@engenty/wizards-runtime 0.11.6 → 0.11.7

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.
Files changed (111) hide show
  1. package/apps/runtime/dist/agents/architect.js +37 -53
  2. package/apps/runtime/dist/agents/company.js +4 -12
  3. package/apps/runtime/dist/agents/studio-assistant.js +57 -70
  4. package/apps/runtime/dist/agents/subscription.js +3 -6
  5. package/apps/runtime/dist/assistant/knows.js +19 -19
  6. package/apps/runtime/dist/auth/account.js +51 -12
  7. package/apps/runtime/dist/authoring/guide.js +20 -447
  8. package/apps/runtime/dist/browser/fast/run.js +18 -12
  9. package/apps/runtime/dist/cli/account.js +127 -10
  10. package/apps/runtime/dist/cli/main.js +4 -2
  11. package/apps/runtime/dist/connectors/mail.js +4 -3
  12. package/apps/runtime/dist/documents/parse.js +5 -14
  13. package/apps/runtime/dist/engine/decide.js +2 -1
  14. package/apps/runtime/dist/engine/runner.js +4 -3
  15. package/apps/runtime/dist/engine/steps.js +82 -91
  16. package/apps/runtime/dist/engine/template.js +2 -3
  17. package/apps/runtime/dist/harness/antigravity.js +2 -2
  18. package/apps/runtime/dist/harness/apple.js +4 -6
  19. package/apps/runtime/dist/harness/codex.js +5 -6
  20. package/apps/runtime/dist/harness/prompt.js +8 -8
  21. package/apps/runtime/dist/mcp/handler.js +5 -7
  22. package/apps/runtime/dist/mcp/tools.js +33 -54
  23. package/apps/runtime/dist/media/conversation.js +18 -23
  24. package/apps/runtime/dist/media/generate.js +18 -3
  25. package/apps/runtime/dist/media/transcribe.js +5 -4
  26. package/apps/runtime/dist/motion-graphics/project.js +19 -53
  27. package/apps/runtime/dist/motion-graphics/sounds.js +2 -1
  28. package/apps/runtime/dist/motion-graphics/step.js +31 -16
  29. package/apps/runtime/dist/prompts/README.md +48 -0
  30. package/apps/runtime/dist/prompts/architect.md +89 -0
  31. package/apps/runtime/dist/prompts/authoring.md +503 -0
  32. package/apps/runtime/dist/prompts/goose.md +229 -0
  33. package/apps/runtime/dist/prompts/mcp.md +156 -0
  34. package/apps/runtime/dist/prompts/safety.md +23 -0
  35. package/apps/runtime/dist/prompts/services.md +151 -0
  36. package/apps/runtime/dist/prompts/step.md +334 -0
  37. package/apps/runtime/dist/prompts/tools.md +330 -0
  38. package/apps/runtime/dist/prompts/voice.md +53 -0
  39. package/apps/runtime/dist/prompts.js +50 -0
  40. package/apps/runtime/dist/routes/studio.js +19 -1
  41. package/apps/runtime/dist/safety.js +45 -0
  42. package/apps/runtime/dist/sandbox/index.js +8 -3
  43. package/apps/runtime/dist/services/assistant-chats.js +5 -8
  44. package/apps/runtime/dist/services/brand.js +2 -7
  45. package/apps/runtime/dist/services/cloud.js +8 -4
  46. package/apps/runtime/dist/services/knowledge-model.js +17 -8
  47. package/apps/runtime/dist/services/knowledge.js +5 -9
  48. package/apps/runtime/dist/services/project-files.js +3 -8
  49. package/apps/runtime/dist/services/relevance.js +4 -3
  50. package/apps/runtime/dist/services/runs.js +6 -7
  51. package/apps/runtime/dist/services/site.js +2 -2
  52. package/apps/runtime/dist/services/translations.js +17 -10
  53. package/apps/runtime/dist/sync/client.js +116 -1
  54. package/apps/runtime/dist/tools/browser.js +36 -33
  55. package/apps/runtime/dist/tools/code.js +20 -6
  56. package/apps/runtime/dist/tools/connector.js +23 -9
  57. package/apps/runtime/dist/tools/index.js +14 -11
  58. package/apps/runtime/dist/tools/mail.js +5 -5
  59. package/apps/runtime/dist/tools/net-guard.js +4 -4
  60. package/apps/runtime/dist/tools/pages.js +3 -2
  61. package/apps/runtime/dist/tools/project.js +7 -8
  62. package/apps/runtime/dist/tools/store.js +14 -10
  63. package/apps/web/dist/assets/{AboutDialog-30Mc1_N_.js → AboutDialog-J9rRhJTJ.js} +1 -1
  64. package/apps/web/dist/assets/{ChangelogDialog-Vjxg6JV8.js → ChangelogDialog-D9bBSuLQ.js} +1 -1
  65. package/apps/web/dist/assets/{CodeEditor-CmMRfVhS.js → CodeEditor-CiRJjYpm.js} +1 -1
  66. package/apps/web/dist/assets/{EditorPage-Di5KB-Ei.js → EditorPage-ChLV09jO.js} +1 -1
  67. package/apps/web/dist/assets/{FlowPreview-BkcO3iCf.js → FlowPreview-QRnLE4JM.js} +1 -1
  68. package/apps/web/dist/assets/{Harness-D_Hr80Fo.js → Harness-dM1CDgnx.js} +1 -1
  69. package/apps/web/dist/assets/Marketplace-8rU-MhWj.js +2 -0
  70. package/apps/web/dist/assets/{NewWizardChannels-BIzOtfc8.js → NewWizardChannels--JqgVT-t.js} +1 -1
  71. package/apps/web/dist/assets/{NewWizardPage-BenzMrPD.js → NewWizardPage-CNv5UuBn.js} +1 -1
  72. package/apps/web/dist/assets/{OnboardingPage-DuckyzQr.js → OnboardingPage-CDuhfBEI.js} +1 -1
  73. package/apps/web/dist/assets/{PreviewPane-D9hmriSm.js → PreviewPane-BsMrHW8b.js} +2 -2
  74. package/apps/web/dist/assets/{ProjectPage-A8Z8cS1E.js → ProjectPage-CoVMEoB1.js} +1 -1
  75. package/apps/web/dist/assets/{PublicRunner-QPvlEAxx.js → PublicRunner-Ckte5NnM.js} +1 -1
  76. package/apps/web/dist/assets/{ReadOnly-DFn32cvo.js → ReadOnly-Ch-ss9Mh.js} +1 -1
  77. package/apps/web/dist/assets/SettingsPage-CGp6G_fp.js +2 -0
  78. package/apps/web/dist/assets/{SetupPage-WNHH74hu.js → SetupPage-DgFT_646.js} +1 -1
  79. package/apps/web/dist/assets/{SharePage-Bw4TRWtv.js → SharePage-CEcFKE3b.js} +1 -1
  80. package/apps/web/dist/assets/changelog-DMhLfQmS.js +1 -0
  81. package/apps/web/dist/assets/{i18n-CLxuuhp_.js → i18n-AXoEWXfv.js} +1 -1
  82. package/apps/web/dist/assets/{index-Bha72INy.css → index-BYZBN0xx.css} +1 -1
  83. package/apps/web/dist/assets/index-Dx7qMiM3.js +34 -0
  84. package/apps/web/dist/assets/{oss-credits-CZT1KRIp.js → oss-credits-Da4KrYmP.js} +1 -1
  85. package/apps/web/dist/assets/{phone-DymZ7rLO.js → phone-De-HF0g7.js} +1 -1
  86. package/apps/web/dist/assets/{runners-UfKeoOe4.js → runners-UIPj9xyX.js} +1 -1
  87. package/apps/web/dist/assets/{session-COf_im0l.js → session-DUxZmhqy.js} +1 -1
  88. package/apps/web/dist/assets/{settings-menu-mtOjI15L.js → settings-menu-Bo1yXMGF.js} +1 -1
  89. package/apps/web/dist/assets/{theme-DWoTWDAG.js → theme-CSuPPxre.js} +1 -1
  90. package/apps/web/dist/assets/ui-CBDsXUoA.js +83 -0
  91. package/apps/web/dist/assets/{upload-BizIzwxa.js → upload-CZgdEF60.js} +1 -1
  92. package/apps/web/dist/assets/{useMutation-BJfRETsQ.js → useMutation-ZHWqRSPd.js} +1 -1
  93. package/apps/web/dist/assets/{volume-2-BGkyA8T9.js → volume-2-c641MxaU.js} +1 -1
  94. package/apps/web/dist/assets/{wrench-Be5zav03.js → wrench-DCEAyYuR.js} +1 -1
  95. package/apps/web/dist/index.html +8 -9
  96. package/apps/web/dist/mcp/flow.html +87 -87
  97. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +5 -0
  98. package/node_modules/@engenty/wizards-shared/dist/run.js +10 -0
  99. package/node_modules/@engenty/wizards-shared/dist/surface.d.ts +0 -2
  100. package/node_modules/@engenty/wizards-shared/dist/surface.js +0 -29
  101. package/node_modules/@engenty/wizards-shared/dist/sync.d.ts +5 -0
  102. package/package.json +2 -2
  103. package/plugin/.claude-plugin/plugin.json +1 -1
  104. package/plugin/plugin.json +1 -1
  105. package/apps/runtime/dist/assistant/primer.js +0 -26
  106. package/apps/web/dist/assets/Marketplace-BxFBMUsi.js +0 -2
  107. package/apps/web/dist/assets/SettingsPage-ByP15ndy.js +0 -2
  108. package/apps/web/dist/assets/changelog-Dr9tAFY9.js +0 -1
  109. package/apps/web/dist/assets/coins-DTH3SKgZ.js +0 -1
  110. package/apps/web/dist/assets/index-HhslPV6N.js +0 -34
  111. package/apps/web/dist/assets/ui-D_0Xdrjh.js +0 -83
@@ -1,34 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AboutDialog-30Mc1_N_.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-D_0Xdrjh.js","assets/preload-helper-DpV6A1kQ.js","assets/i18n-CLxuuhp_.js","assets/logo-CGNoptDg.js","assets/engenty-CNjaZCVM.js","assets/settings-menu-mtOjI15L.js","assets/react-dom-hf6EcyAr.js","assets/media-Cej-H610.js","assets/ChangelogDialog-Vjxg6JV8.js","assets/Marketplace-BxFBMUsi.js","assets/useMutation-BJfRETsQ.js","assets/volume-2-BGkyA8T9.js","assets/coins-DTH3SKgZ.js","assets/session-COf_im0l.js","assets/PublicRunner-QPvlEAxx.js","assets/theme-DWoTWDAG.js","assets/phone-DymZ7rLO.js","assets/theme-CbR9-ayl.css","assets/SharePage-Bw4TRWtv.js","assets/EditorPage-Di5KB-Ei.js","assets/PreviewPane-D9hmriSm.js","assets/upload-BizIzwxa.js","assets/runners-UfKeoOe4.js","assets/wrench-Be5zav03.js","assets/esm-BdxDT9Km.js","assets/NewWizardChannels-BIzOtfc8.js","assets/OnboardingPage-DuckyzQr.js","assets/NewWizardPage-BenzMrPD.js","assets/SettingsPage-ByP15ndy.js","assets/ReadOnly-DFn32cvo.js","assets/Harness-D_Hr80Fo.js","assets/Harness-BrP-ENHg.css","assets/ProjectPage-A8Z8cS1E.js","assets/SetupPage-WNHH74hu.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{n as r,t as i}from"./jsx-runtime-BNakU3Ej.js";import{$ as a,$n as o,An as s,Ar as c,B as l,Bn as u,Cn as d,Cr as f,Dn as p,Dr as m,Er as h,Fn as g,G as _,Gn as v,Gt as y,Hn as b,In as x,It as S,J as C,Jn as ee,Jt as w,K as te,Kt as T,Ln as E,Lt as ne,Mn as re,Mr as ie,Nn as ae,Pn as oe,Pt as se,Q as ce,Qn as le,Rn as ue,Tn as de,Tr as fe,Un as pe,W as D,Wt as O,X as me,Xn as k,Xt as he,Y as ge,Yt as _e,Z as ve,Zn as A,Zt as j,_n as ye,_r as be,_t as xe,a as Se,an as Ce,ar as M,at as we,bn as Te,br as Ee,cn as De,ct as Oe,en as ke,er as Ae,et as je,fn as Me,ft as Ne,gr as Pe,hn as Fe,hr as Ie,i as Le,in as Re,ir as ze,it as Be,jr as Ve,l as He,ln as Ue,lt as We,mn as Ge,nr as Ke,nt as qe,on as N,or as Je,ot as Ye,pn as Xe,q as Ze,qn as Qe,qt as $e,r as et,rn as tt,rr as nt,rt,s as it,sn as at,sr as ot,t as st,tn as ct,tr as P,tt as lt,un as ut,ur as dt,ut as ft,vr as pt,wr as mt,wt as ht,xn as gt,xr as _t,y as vt,yn as yt,yr as bt,yt as xt,zn as St}from"./ui-D_0Xdrjh.js";import{O as Ct,S as wt,T as Tt,_ as Et,i as Dt,k as Ot,n as kt,v as At,x as jt}from"./Marketplace-BxFBMUsi.js";import{n as Mt,t as Nt}from"./useMutation-BJfRETsQ.js";import{t as Pt}from"./react-dom-hf6EcyAr.js";import{t as Ft}from"./preload-helper-DpV6A1kQ.js";import{i as It,n as Lt,r as Rt,t as zt}from"./volume-2-BGkyA8T9.js";import{n as Bt,t as Vt}from"./coins-DTH3SKgZ.js";import{A as Ht,C as Ut,D as Wt,M as Gt,_ as Kt,b as qt,c as Jt,d as F,f as Yt,g as Xt,h as Zt,i as Qt,j as $t,k as en,l as tn,m as nn,n as rn,o as an,r as on,s as sn,x as cn}from"./session-COf_im0l.js";import{n as ln,t as un}from"./logo-CGNoptDg.js";import{D as dn,K as fn,T as pn,V as mn,_t as hn,bt as gn,c as _n,et as vn,g as yn,gt as bn,mt as xn,n as I,pt as Sn,r as Cn,s as L,vt as wn,w as Tn}from"./i18n-CLxuuhp_.js";import{t as En}from"./media-Cej-H610.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 Dn=class extends pt{#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 Mt({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=On(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=On(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=On(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=On(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Pe.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=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){Pe.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Pe.batch(()=>Promise.all(e.map(e=>e.continue().catch(fe))))}};function On(e){return e.options.scope?.id}var kn=class extends pt{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??_t(r,t),a=this.get(i);return a||(a=new dt({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(){Pe.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=>mt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>mt(e,t)):t}notify(e){Pe.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Pe.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Pe.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},An=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new kn,this.#t=e.mutationCache||new Dn,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=be.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ie.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(m(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=bt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Pe.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;Pe.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Pe.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=Pe.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(fe).catch(fe)}invalidateQueries(e,t={}){return Pe.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=Pe.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(fe)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(fe)}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(m(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(m(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(fe).catch(fe)}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(fe).catch(fe)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Ie.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(Ee(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{h(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Ee(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{h(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=_t(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===c&&(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()}},jn=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}}var S=!1,C=-1,ee=5,w=-1;function te(){return g?!0:!(e.unstable_now()-w<ee)}function T(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){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(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(T)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=T,E=function(){re.postMessage(null)}}else E=function(){_(T,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Mn=n(((e,t)=>{t.exports=jn()})),Nn=n((e=>{var t=Mn(),n=r(),i=Pt();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 x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(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 ee(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 w=Object.assign,te=Symbol.for(`react.element`),T=Symbol.for(`react.transitional.element`),E=Symbol.for(`react.portal`),ne=Symbol.for(`react.fragment`),re=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),se=Symbol.for(`react.forward_ref`),ce=Symbol.for(`react.suspense`),le=Symbol.for(`react.suspense_list`),ue=Symbol.for(`react.memo`),de=Symbol.for(`react.lazy`),fe=Symbol.for(`react.activity`),pe=Symbol.for(`react.legacy_hidden`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.for(`react.view_transition`),me=Symbol.for(`react.recoverable`),k=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||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 ne:return`Fragment`;case ie:return`Profiler`;case re:return`StrictMode`;case ce:return`Suspense`;case le:return`SuspenseList`;case fe:return`Activity`;case O:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case E:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case se:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ue:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case de:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ve=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,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function M(e,t){xe++,be[xe]=e.current,e.current=t}var we=Se(null),Te=Se(null),Ee=Se(null),De=Se(null);function Oe(e,t){switch(M(Ee,t),M(Te,e),M(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(we),M(we,e)}function ke(){Ce(we),Ce(Te),Ce(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,M(De,e)),t=we.current;var n=fp(t,e.type);t!==n&&(M(Te,e),M(we,n))}function je(e){Te.current===e&&(Ce(we),Ce(Te)),De.current===e&&(Ce(De),ch._currentValue=ye)}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
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
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(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{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
- Error generating stack: `+e.message+`
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,N=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 P(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(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-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(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 ft(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(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-tt(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&&gt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(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 bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=j.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function St(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Ft(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[wt])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Rt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[jt]=!0}function Bt(e){e[Mt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=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]*$`),Kt={},qt={};function Jt(e){return ze.call(qt,e)?!0:ze.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var F=!1;function Yt(){var e=F;return F=!1,e}function Xt(e,t,n){if(Jt(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 Zt(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 Qt(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 $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(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 nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(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=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(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=``+$t(s):e.removeAttribute(`name`)}function cn(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)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(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),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(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=``+$t(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 dn(e,t,n){if(t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ve(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(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||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(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&&(hn(e,i,r),F=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(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 vn=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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var I=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,L=null;function wn(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(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="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Tt]||null;if(!i)throw Error(a(90));sn(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&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Cn!==null||L!==null)&&(Bd(),Cn&&(t=Cn,e=L,L=Cn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Pn=i.slice(e,1<r?1-r:void 0)}function In(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 Ln(){return!0}function Rn(){return!1}function zn(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)?Ln:Rn,this.isPropagationStopped=Rn,this}return w(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=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=zn(Bn),Hn=w({},Bn,{view:0,detail:0}),Un=zn(Hn),Wn,Gn,Kn,qn=w({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ir,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!==Kn&&(Kn&&e.type===`mousemove`?(Wn=e.screenX-Kn.screenX,Gn=e.screenY-Kn.screenY):Gn=Wn=0,Kn=e),Wn)},movementY:function(e){return`movementY`in e?e.movementY:Gn}}),Jn=zn(qn),Yn=zn(w({},qn,{dataTransfer:0})),Xn=zn(w({},Hn,{relatedTarget:0})),Zn=zn(w({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Qn=zn(w({},Bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),$n=zn(w({},Bn,{data:0})),er={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},tr={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`},nr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function rr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nr[e])?!!t[e]:!1}function ir(){return rr}var ar=zn(w({},Hn,{key:function(e){if(e.key){var t=er[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=In(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?tr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ir,charCode:function(e){return e.type===`keypress`?In(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?In(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),or=zn(w({},qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),sr=zn(w({},Bn,{submitter:0})),cr=zn(w({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ir})),lr=zn(w({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ur=zn(w({},qn,{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})),dr=zn(w({},Bn,{newState:0,oldState:0,source:0})),fr=[9,13,27,32],pr=On&&`CompositionEvent`in window,mr=null;On&&`documentMode`in document&&(mr=document.documentMode);var hr=On&&`TextEvent`in window&&!mr,gr=On&&(!pr||mr&&8<mr&&11>=mr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!pr&&yr(e,t)?(e=Fn(),Pn=Nn=jn=null,xr=!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 gr&&t.locale!==`ko`?null:t.data;default:return null}}var wr={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 Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!wr[e.type]:t===`textarea`}function Er(e,t,n,r){Cn?L?L.push(r):L=[r]:Cn=r,t=Yf(t,`onChange`),0<t.length&&(n=new Vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Or=null;function kr(e){Hf(e,0)}function Ar(e){if(rn(Lt(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(On){var Nr;if(On){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Dr&&(Dr.detachEvent(`onpropertychange`,Lr),Or=Dr=null)}function Lr(e){if(e.propertyName===`value`&&Ar(Or)){var t=[];Er(t,Or,e,Sn(e)),En(kr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Dr=t,Or=n,Dr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(Or)}function Br(e,t){if(e===`click`)return Ar(t)}function Vr(e,t){if(e===`input`||e===`change`)return Ar(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(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)||!Ur(e[i],t[i]))return!1}return!0}function Gr(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 Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(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=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(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=Gr(e.document)}return t}function Xr(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 Zr=On&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(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}),ei&&Wr(ei,r)||(ei=r,r=Yf($r,`onSelect`),0<r.length&&(t=new Vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};On&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`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(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ut(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=xd.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(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 xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Si=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)},Ci=[],wi=0,Ti=0;function Ei(){for(var e=wi,t=Ti=wi=0;t<e;){var n=Ci[t];Ci[t++]=null;var r=Ci[t];Ci[t++]=null;var i=Ci[t];Ci[t++]=null;var a=Ci[t];if(Ci[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&&Ai(n,i,a)}}function Di(e,t,n,r){Ci[wi++]=e,Ci[wi++]=t,Ci[wi++]=n,Ci[wi++]=r,Ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Oi(e,t,n,r){return Di(e,t,n,r),ji(e)}function ki(e,t){return Di(e,null,null,t),ji(e)}function Ai(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-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ji(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 Mi={};function Ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pi(e,t,n,r){return new Ni(e,t,n,r)}function Fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var n=e.alternate;return n===null?(n=Pi(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 Li(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 Ri(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Fi(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case fe:return e=Pi(31,n,t,i),e.elementType=fe,e.lanes=o,e;case ne:return zi(n.children,i,o,t);case re:s=8,i|=24;break;case ie:return e=Pi(12,n,t,i|2),e.elementType=ie,e.lanes=o,e;case ce:return e=Pi(13,n,t,i),e.elementType=ce,e.lanes=o,e;case le:return e=Pi(19,n,t,i),e.elementType=le,e.lanes=o,e;case pe:case O:return e=i|32,e=Pi(30,n,t,e),e.elementType=O,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 se:s=11;break a;case ue:s=14;break a;case de:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Pi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function zi(e,t,n,r){return e=Pi(7,e,r,t),e.lanes=n,e}function Bi(e,t,n){return e=Pi(6,e,null,t),e.lanes=n,e}function Vi(e){var t=Pi(18,null,null,0);return t.stateNode=e,t}function Hi(e,t,n){return t=Pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ui=new WeakMap;function Wi(e,t){if(typeof e==`object`&&e){var n=Ui.get(e);return n===void 0?(t={value:e,source:t,stack:Re(t)},Ui.set(e,t),t):n}return{value:e,source:t,stack:Re(t)}}var Gi=[],Ki=0,R=null,qi=0,Ji=[],Yi=0,z=null,Xi=1,Zi=``;function Qi(e,t){Gi[Ki++]=qi,Gi[Ki++]=R,R=e,qi=t}function $i(e,t,n){Ji[Yi++]=Xi,Ji[Yi++]=Zi,Ji[Yi++]=z,z=e;var r=Xi;e=Zi;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-tt(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===R;)R=Gi[--Ki],Gi[Ki]=null,qi=Gi[--Ki],Gi[Ki]=null;for(;e===z;)z=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null,Xi=Ji[--Yi],Ji[Yi]=null}function na(e,t){Ji[Yi++]=Xi,Ji[Yi++]=Zi,Ji[Yi++]=z,Xi=t.id,Zi=t.overflow,z=e}var ra=null,ia=null,B=!1,aa=null,oa=!1,sa=Error(a(519));function ca(e){throw ma(Wi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),sa}function la(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Z(`cancel`,t),Z(`close`,t);break;case`iframe`:case`object`:case`embed`:Z(`load`,t);break;case`video`:case`audio`:for(n=0;n<Bf.length;n++)Z(Bf[n],t);break;case`source`:Z(`error`,t);break;case`img`:case`image`:case`link`:Z(`error`,t),Z(`load`,t);break;case`details`:Z(`toggle`,t);break;case`input`:Z(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Z(`invalid`,t);break;case`textarea`:Z(`invalid`,t),fn(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||tp(t.textContent,n)?(r.popover!=null&&(Z(`beforetoggle`,t),Z(`toggle`,t)),r.onScroll!=null&&Z(`scroll`,t),r.onScrollEnd!=null&&Z(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||ca(e,!0)}function ua(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:ra=ra.return}}function da(e){if(e!==ra)return!1;if(!B)return ua(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&ia&&ca(e),ua(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ia=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ia=fm(e)}else t===27?(t=ia,Cp(e.type)?(e=dm,dm=null,ia=e):ia=t):ia=ra?um(e.stateNode.nextSibling):null;return!0}function fa(){ia=ra=null,B=!1}function pa(){var e=aa;return e!==null&&(pd===null?pd=e:pd.push.apply(pd,e),aa=null),e}function ma(e){aa===null?aa=[e]:aa.push(e)}var ha=Se(null),ga=null,_a=null;function va(e,t,n){M(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,Ce(ha)}function ba(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 xa(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),ba(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),ba(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),ba(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 Sa(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;Ur(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=[ch]:e.push(ch))}i=i.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(a(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=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()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(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 Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Ff(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=A.S;A.S=function(e,t){if(gd=We(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=xf;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=xf;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=Se(null);function Ka(){var e=Ga.current;return e===null?G.pooledCache:e}function qa(e,t){t===null?M(Ga,Ga.current):M(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(a(460)),Xa=Error(a(474)),Za=Error(a(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=G,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(a(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(a(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===te?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(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=Ii(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=Bi(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===ne?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===de&&to(a)===t.type)?(t=i(t,n.props),co(t,n),t.return=e,t):(t=Ri(n.type,n.key,n.props,null,e.mode,r),co(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=Hi(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=zi(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=Bi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case T:return n=Ri(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case E:return t=Hi(t,e.mode,n),t.return=e,t;case de:return t=to(t),f(e,t,n)}if(ve(t)||he(t))return t=zi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===oe)return f(e,Ea(e,t),n);lo(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 T:return n.key===i?l(e,t,n,r):null;case E:return n.key===i?u(e,t,n,r):null;case de:return n=to(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===oe)return p(e,t,Ea(e,n),r);lo(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 T:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case E:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case de:return r=to(r),m(e,t,n,r,i)}if(ve(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,so(r),i);if(r.$$typeof===oe)return m(e,t,n,Ea(t,r),i);lo(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),B&&Qi(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 B&&Qi(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)}),B&&Qi(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),B&&Qi(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 B&&Qi(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)}),B&&Qi(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ne&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case T:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ne){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===de&&to(l)===r.type){n(e,r.sibling),c=i(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ne?(c=zi(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Ri(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case E: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=Hi(o,e.mode,c),c.return=e,e=c}return s(e);case de:return o=to(o),_(e,r,o,c)}if(ve(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,so(o),c);if(o.$$typeof===oe)return _(e,r,Ea(e,o),c);lo(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=Bi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(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 _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ji(e),Ai(e,null,n),t}return Di(e,r,t,n),ji(e)}function yo(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,_t(e,n)}}function bo(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 xo=!1;function So(){if(xo){var e=Ba;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===za&&(xo=!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=w({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),cd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=Se(null),Do=Se(0);function Oo(e,t){e=od,M(Do,e),M(Eo,t),od=e|t.baseLanes}function ko(){M(Do,od),M(Eo,Eo.current)}function Ao(){od=Do.current,Ce(Eo),Ce(Do)}var jo=Se(null),Mo=null;function No(e){var t=e.alternate;M(Ro,Ro.current&1),M(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){M(Ro,Ro.current),M(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(M(Ro,Ro.current),M(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){M(Ro,Ro.current),M(jo,jo.current)}function Lo(e){Ce(jo),Mo===e&&(Mo=null),Ce(Ro)}var Ro=Se(0);function zo(e,t){M(jo,jo.current),M(Ro,t)}function Bo(e){Ce(Ro),Ce(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(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 Ho=0,V=null,H=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(a(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){A.H=hc;var t=H!==null&&H.next!==null;if(Ho=0,Uo=H=V=null,Wo=!1,Jo=0,Yo=null,t)throw Error(a(300));e===null||Pc||(e=e.dependencies,e!==null&&Ca(e)&&(Pc=!0))}function ts(e,t,n,r){V=e;var i=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=i)throw Error(a(301));if(i+=1,Uo=H=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(Go);return o}function ns(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Ho=0,Uo=H=V=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=Uo===null?V.memoizedState:Uo.next;if(t!==null)Uo=t,H=e;else{if(e===null)throw V.alternate===null?Error(a(467)):Error(a(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=eo(Yo,e,t),t=V,(Uo===null?t.memoizedState:Uo.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===me)return;if(e.$$typeof===oe)return Ta(e)}throw Error(a(438,String(e)))}function ds(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.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(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),H,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?(Ho&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((Ho&p)===p){u=u.next,p===za&&(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,V.lanes|=p,cd|=p;f=u.action,Ko&&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,V.lanes|=f,cd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Pc=!0,d&&(n=Ba,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=ss(),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);Ur(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=V,i=ss(),o=B;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Ur((H||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||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,G===null)throw Error(a(349));o||Ho&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=cs(),V.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!Ur(e,n)}catch{return!0}}function xs(e){var t=ki(e,2);t!==null&&Fd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){et(!0);try{n()}finally{et(!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,H,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(B){var n=G.formState;if(n!==null){a:{var r=V;if(B){if(ia){b:{for(var i=ia,a=oa;i.nodeType!==8;){if(!a){i=null;break b}if(i=um(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=um(i.nextSibling),r=i.data===`F!`;break a}}ca(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,V,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,V,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),H,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===Ya?Za:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.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=ss(),n=H;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();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=V.updateQueue,t===null&&(t=cs(),V.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 ss().memoizedState}function Rs(e,t,n,r){var i=os();V.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&Qo(r,H.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(V.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){V.flags|=4;var t=V.updateQueue;if(t===null)t=cs(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(W&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=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Ho&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nd(),V.lanes|=e,cd|=e,n)}function Qs(e,t,n,r){return Ur(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(q&261930)?(Pc=!0,e.memoizedState=n):(e=Nd(),V.lanes|=e,cd|=e,t):(e=Zs(e,n,r),Ur(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,Ua(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,ye,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:ye},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 Ta(ch)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Md();e=_o(n);var r=vo(t,e,n);r!==null&&(Fd(r,t,n),yo(r,t,n)),t={cache:Ma()},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=Oi(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,Ur(s,o))return Di(e,t,i,0),G===null&&Ei(),!1}catch{}if(n=Oi(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:Ff(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(a(479))}else t=Oi(e,n,r,2),t!==null&&Fd(t,e,2)}function fc(e){var t=e.alternate;return e===V||t!==null&&t===V}function pc(e,t){Go=Wo=!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,_t(e,n)}}var hc={readContext:Ta,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:Ta,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,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=os();t=t===void 0?null:t;var r=e();if(Ko){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){et(!0);try{n(t)}finally{et(!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,V,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,V,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,i=os();if(B){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),G===null)throw Error(a(349));q&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=os(),t=G.identifierPrefix;if(B){var n=Zi,r=Xi;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();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,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,V)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(W&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Ta,use:us,useCallback:Ys,useContext:Ta,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(ss(),H.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().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(ss(),H,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:Ta,use:us,useCallback:Ys,useContext:Ta,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=ss();return H===null?Zs(n,e,t):Qs(n,H.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().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=ss();return H===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,H,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:w({},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=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Fd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Md(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Fd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Md(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(Fd(t,e,n),yo(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?!Wr(n,r)||!Wr(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=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){Si(e)}function Tc(e){console.error(e)}function Ec(e){Si(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=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=_o(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&&Sa(t,n,i,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?qd():n.alternate===null&&sd===0&&(sd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),hf(e,r,i)),!1;case 22:return n.flags|=65536,r===Qa?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)),hf(e,r,i)),!1}throw Error(a(435,n.tag))}return hf(e,r,i),qd(),!1}if(B)return t=jo.current,t===null?(r!==sa&&(t=Error(a(423),{cause:r}),ma(Wi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Wi(r,n),i=kc(e.stateNode,r,i),bo(e,i),sd!==4&&(sd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==sa&&(e=Error(a(422),{cause:r}),ma(Wi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Wi(o,n),fd===null?fd=[o]:fd.push(o),sd!==4&&(sd=2),t===null)return!0;r=Wi(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),bo(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),bo(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?po(t,null,n,r):fo(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 wa(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(B&&s&&ea(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`&&!Fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Ri(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?Wr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Ii(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(Wr(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&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),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=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Sa(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 fo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Lo(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(B){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(Po(t),(e=ia)?(e=om(e,oa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:z===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(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||Sa(e,t,n,!1),i=(n&e.childLanes)!==0,Pc||i){if(Eo.current===null){if(r=G,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ki(e,s),Fd(r,e,s),Nc;qd()}t=Uc(e,t,n)}else e=o.treeContext,ia=um(s.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Ii(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 wa(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(B&&r&&ea(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(B&&r&&ea(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=Mi,o=n.contextType;typeof o==`object`&&o&&(a=Ta(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={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):Mi,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),Co(t,r,a,i),So(),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=Mi,typeof u==`object`&&u&&(o=Ta(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),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=mo||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,go(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Mi,typeof l==`object`&&l&&(c=Ta(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),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=mo||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(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=fo(t,e.child,null,i),t.child=fo(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 fa(),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:Ja()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Y),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:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?No(t):Io(),(e=ia)?(e=om(e,oa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:z===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=Vi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=zi(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)):(No(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?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ii(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=zi(i,a,n,null),i.flags|=2):i=Ii(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=Ja():(s=ja._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)):(No(t),n=e.child,e=n.sibling,n=Ii(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=Pi(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return fo(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?(No(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Io(),o=i.fallback,s=t.mode,i=tl({mode:`visible`,children:i.children},s),o=zi(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,fo(t,e.child,null,c),i=t.child,i.memoizedState=Zc(c),i.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,i)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),cm(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,ma({value:i,source:null,stack:null})),nl(e,t,c)}if(Pc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(Eo.current!==null)return nl(e,t,c);if(r=G,r!==null&&(i=vt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,ki(e,i),Fd(r,e,i),Nc;return sm(o)||qd(),nl(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ia=um(o.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(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),ba(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(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=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=B?qi: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&&Vo(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 va(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),cd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(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=Ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ii(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&&Ca(e)))}function fl(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),fa();break;case 27:case 5:Ae(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(No(t),e=ul(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(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),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:va(t,ja,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,B&&t.flags&1048576&&$i(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Fi(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===se){t.tag=11,t=Ic(null,t,e,r,n);break a}if(i===ue){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,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,ja,r),r!==o.cache&&xa(t,[ja],n,!0),So(),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=Wi(Error(a(424)),t),ma(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(ia=um(e.firstChild),ra=t,B=!0,aa=null,oa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(fa(),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=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=pp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&B&&(r=t.stateNode=gm(t.type,t.pendingProps,Ee.current),ra=t,oa=!0,i=ia,Cp(t.type)?(dm=i,ia=um(r.firstChild)):ia=i),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((i=r=ia)&&(r=im(r,t.type,t.pendingProps,oa),r===null?i=!1:(t.stateNode=r,ra=t,ia=um(r.firstChild),oa=!1,i=!0)),i||ca(t)),Ae(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(i,o)?r=null:s!==null&&mp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=$o(e,t,ns,null,null,n),ch._currentValue=i),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=ia)&&(n=am(n,t.pendingProps,oa),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||ca(t)),null;case 13:return $c(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(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,wa(t),i=Ta(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 wa(t),r=Ta(ja),e===null?(i=Ka(),i===null&&(i=G,o=Ma(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},ho(t),va(t,ja,i)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,va(t,ja,r),r!==i.cache&&xa(t,[ja],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),va(t,ja,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:B&&ea(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?Ym(t,r):Ym(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(Wd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Wd())e.flags|=8192;else throw no=Qa,Xa}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,dd|=t)}function vl(e,t){if(!B)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 yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(da(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),yl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,i,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(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 yl(t),t.subtreeFlags&=-33554433,null}e=we.current,da(t)?la(t,e):(e=gm(i,r,n),t.stateNode=e,ml(t))}return yl(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 yl(t),t.subtreeFlags&=-33554433,null}if(o=we.current,da(t))la(t,o);else{var s=up(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[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(rp(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 yl(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,da(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ra,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||ca(t,!0)}else e=up(e).createTextNode(r),e[wt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=da(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[wt]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(a(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=da(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[wt]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),i=!1}else i=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(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),yl(t),null);case 4:return ke(),e===null&&Gf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return ya(t.type),yl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return yl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)vl(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(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;)Li(n,e),n=n.sibling;return zo(t,Ro.current&1|2),B&&Qi(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=Vo(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&&!B)return yl(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=Ro.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?zo(t,o):(n=o,M(jo,t),M(Ro,n),Mo===null&&(Mo=t)),B&&Qi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(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&&Ce(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(a(156,t.tag))}function xl(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),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(Lo(t),t.alternate===null)throw Error(a(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(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 ya(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&Ce(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function Sl(e,t){switch(ta(t),t.tag){case 3:ya(ja),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ya(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&Ce(Ga);break;case 24:ya(ja)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){X(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){X(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){X(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){X(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){X(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);p(e.child,!1,$p,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){X(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){X(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){X(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)tm(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&tm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&nm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){X(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[Tt]=t}catch(t){X(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Cp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xn)),kl(e,r),F=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),F=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){X(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);Vl=!0,Ep(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=xi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Pd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=xi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Pd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Pd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Pd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=kp(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&&Ep(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Pd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,U=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,cp=gh,e=Yr(e),Xr(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(lp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&eu(e),gu(n))}}Hl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){X(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(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=yi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=xi(i.default,i.update),i!==`none`&&ql(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Cl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){X(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){X(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Lu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){X(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=vf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||U;t=ou,i=U,ou=r,(U=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),ou=t,U=i}break;case 30:Lu(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){X(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,F=!0}catch(t){X(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){X(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:U||Ol(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!U&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:U||Ol(n,t),jl(n);var r=Su,i=Cu;Cp(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:U||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),F=!0}catch(e){X(n,t,e)}else try{Su.removeChild(n.stateNode),F=!0}catch(e){X(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):wp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),U||wl(4,n,t),wu(e,t,n);break;case 1:U||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:U=(r=U)||n.memoizedState!==null,wu(e,t,n),U=r;break;case 30:Ol(n,t),wu(e,t,n);break;case 7:U||Ol(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){X(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){X(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(a(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=yf.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Cp(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(a(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),i&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),i&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=pp(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[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),rp(r,t,n),r[wt]=e,zt(r),t=r;break a;case`link`:if(o=Km(`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),rp(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Km(`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),rp(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[wt]=e,zt(r),t=r}e.stateNode=t}}else ou||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||U||t.parentNode.removeChild(t)):i.count--,n===null?ou||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),i&512&&(U||r===null||Ol(r,r.return)),r!==null&&i&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),i&512&&(U||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),F=!0}catch(t){X(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),i&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,F=!0}catch(t){X(e,e.return,t)}}break;case 3:if(F=!1,Gm=null,o=ju,ju=xm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){X(e,e.return,t)}cu&&(cu=!1,Pu(e)),F=!1;break;case 4:i=su,su=ou,r=Yt(),o=ju,ju=xm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,F&&fu&&(pu=!0),F=r,su=i;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hd=We()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=U,u=su;ou=c||o,su=u||o,U=l||s,Au(t,e,n),U=l,su=u,ou=c,Nu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||U||(t=s||U,n=ou,r=U,ou=o||ou,U=t,Ru(e,2),ou=n,U=r),!o&&su||vu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:i&512&&(U||r===null||Ol(r,r.return)),i=Yt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&xi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&F&&(e.flags|=4),fu=o,F=i;break;case 21:break;case 7:i&512&&(U||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Nl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Ml(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(a(161))}}catch(t){X(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else au(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Gl(),Fu(t,e),!du&&!pu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Wl=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Zl(e,!1));break;case 30:r=du,i=Gl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Pd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Ru(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),Ru(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),Ru(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||U||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Ol(n,n.return),Ru(n,r);break;case 7:Ol(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Cl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){X(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++)wo(l[i],c)}catch(e){X(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||qm(xm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),Dl(a,a.return);break;case 30:zu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){X(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Wu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=ju;ju=xm(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,W=0,G=null,K=null,q=0,J=0,nd=null,rd=!1,id=!1,ad=!1,od=0,sd=0,cd=0,ld=0,ud=0,Y=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 W&2&&q!==0?q&-q:A.T===null?xt():Ff()}function Nd(){if(Y===0){if(!(q&536870912)||B){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),Y=e}else Y=536870912}return e=jo.current,e!==null&&(e.flags|=32),Y}function Pd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(yi(e.memoizedProps,n))),Od===null&&(Od=[]),Od.push(t.bind(null,r))}}function Fd(e,t,n){(e===G&&(J===2||J===9)||e.cancelPendingCommit!==null)&&(Hd(e,0),zd(e,q,Y,!1)),mt(e,n),(!(W&2)||e!==G)&&(e===G&&(!(W&2)&&(ld|=n),sd===4&&zd(e,q,Y,!1)),Df(e))}function Id(e,t,n){if(W&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),i=r?Xd(e,t):Jd(e,t,!0),o=r;do{if(i===0){id&&!r&&zd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Rd(n)){i=Jd(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&&(Hd(c,s).flags|=256),s=Jd(c,s,!1),s!==2&&s!==6){if(ad&&!l){c.errorRecoveryDisabledLanes|=o,ld|=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){Hd(e,0),zd(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:zd(r,t,Y,!rd);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(zd(r,t,Y,!rd),P(r,0,!0)!==0)break a;Cd=t,r.timeoutHandle=_p(Ld.bind(null,r,n,pd,vd,md,t,Y,ld,dd,rd,o,`Throttled`,-0,0),i);break a}Ld(r,n,pd,vd,md,t,Y,ld,dd,rd,o,null,-0,0)}break}while(1);Df(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:xn},Hl=null,Ju(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?hd-We():(a&4194048)===a?gd-We():0,m=th(d,m),m!==null)){Cd=a,e.cancelPendingCommit=m(rf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),zd(e,a,o,!l);return}rf(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(!Ur(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 zd(e,t,n,r){t=ut(e,t),t&=~ud,t&=~ld,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&gt(e,n,t)}function Bd(){return W&6?!0:(Of(0,!1),!1)}function Vd(){if(K!==null){if(J===0)var e=K.return;else e=K,_a=ga=null,as(e),ao=null,oo=0,e=K;for(;e!==null;)Sl(e.alternate,e),e=e.return;K=null}}function Hd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Cd=0,Vd(),G=e,K=n=Ii(e.current,null),q=t,J=0,nd=null,rd=!1,id=lt(e,t),ad=!1,dd=Y=ud=ld=cd=sd=0,pd=fd=null,md=!1,od=ut(e,t),Ei(),n}function Ud(e,t){V=null,A.H=hc,t===Ya||t===Za?(t=ro(),J=3):t===Xa?(t=ro(),J=4):J=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nd=t,K===null&&(sd=1,Dc(e,Wi(t,e.current)))}function Wd(){var e=jo.current;return e===null?!0:(q&4194048)===q?Mo===null:(q&62914560)===q||q&536870912?e===Mo:!1}function Gd(){var e=A.H;return A.H=hc,e===null?hc:e}function Kd(){var e=A.A;return A.A=ed,e}function qd(){sd=4,rd||(q&4194048)!==q&&jo.current!==null||(id=!0),!(cd&134217727)&&!(ld&134217727)||G===null||zd(G,q,Y,!1)}function Jd(e,t,n){var r=W;W|=2;var i=Gd(),a=Kd();(G!==e||q!==t)&&(vd=null,Hd(e,t)),t=!1;var o=sd;a:do try{if(J!==0&&K!==null){var s=K,c=nd;switch(J){case 8:Vd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=J;if(J=0,nd=null,ef(e,s,c,l),n&&id){o=0;break a}break;default:l=J,J=0,nd=null,ef(e,s,c,l)}}Yd(),o=sd;break}catch(t){Ud(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,W=r,A.H=i,A.A=a,K===null&&(G=null,q=0,Ei()),o}function Yd(){for(;K!==null;)Qd(K)}function Xd(e,t){var n=W;W|=2;var r=Gd(),i=Kd();G!==e||q!==t?(vd=null,_d=We()+500,Hd(e,t)):id=lt(e,t);a:do try{if(J!==0&&K!==null){t=K;var o=nd;b:switch(J){case 1:J=0,nd=null,ef(e,t,o,1);break;case 2:case 9:if($a(o)){J=0,nd=null,$d(t);break}t=function(){J!==2&&J!==9||G!==e||(J=7),Df(e)},o.then(t,t);break a;case 3:J=7;break a;case 4:J=5;break a;case 7:$a(o)?(J=0,nd=null,$d(t)):(J=0,nd=null,ef(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Xm(s):c.stateNode.complete){J=0,nd=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,tf(u))}break b}}J=0,nd=null,ef(e,t,o,5);break;case 6:J=0,nd=null,ef(e,t,o,6);break;case 8:Vd(),sd=6;break a;default:throw Error(a(462))}}Zd();break}catch(t){Ud(e,t)}while(1);return _a=ga=null,A.H=r,A.A=i,W=n,K===null?(G=null,q=0,Ei(),sd):0}function Zd(){for(;K!==null&&!He();)Qd(K)}function Qd(e){var t=pl(e.alternate,e,od);e.memoizedProps=e.pendingProps,t===null?tf(e):K=t}function $d(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:as(t);var r=t;r===ra&&(B?(ua(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(ua(r),B=!0));default:Sl(n,t),t=K=Li(t,od),t=pl(n,t,od)}e.memoizedProps=e.pendingProps,t===null?tf(e):K=t}function ef(e,t,n,r){_a=ga=null,as(t),ao=null,oo=0;var i=t.return;try{if(Mc(e,i,t,n,q)){sd=1,Dc(e,Wi(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;sd=1,Dc(e,Wi(n,e.current)),K=null;return}t.flags&32768?(B||r===1?e=!0:id||q&536870912?e=!1:(rd=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),nf(t,e)):tf(t)}function tf(e){var t=e;do{if(t.flags&32768){nf(t,rd);return}e=t.return;var n=bl(t.alternate,t,od);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);sd===0&&(sd=5)}function nf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);sd=6,K=null}function rf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do ff();while(bd!==0);if(W&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===G&&(K=G=null,q=0),Sd=t,xd=e,Cd=n,Td=i,Ed=r,af(e,t,n,s,c,l,f)}}function af(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(wd=s,s|=Ti,ht(e,n,s,r,i,a),Od=null,(n&335544064)===n?(kd=Ia(e),r=10262):(kd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,bf(N,function(){return pf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=W,W|=4;try{hu(e,t,n)}finally{W=a,j.p=i,A.T=r}}bd=1,Vl?Dd=Np(o,e.containerInfo,kd,cf,lf,sf,uf,pf,of,null,null):(cf(),lf(),uf())}function of(e){if(bd!==0){var t=xd.onRecoverableError;t(e,{componentStack:null})}}function sf(){bd===3&&(bd=0,Iu(Sd,xd),bd=4)}function cf(){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=W;W|=4;try{fu=pu=!1,Mu(t,e,n),n=lp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(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 _=qr(s,h),v=qr(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=!!cp,lp=cp=null}finally{W=a,j.p=i,A.T=r}}e.current=t,bd=2}}function lf(){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=W;W|=4;try{_u(e,t.alternate,t)}finally{W=i,j.p=r,A.T=n}}bd=3}}function uf(){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,df(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(yd=null),bt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,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&&ff(),Df(t),a=t.pendingLanes,r&261930&&a&42?t===jd?Ad++:(Ad=0,jd=t):(Ad=0,jd=null),Of(0,!1)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function ff(){return Dd!==null&&(Dd.skipTransition(),Dd=null),cf(),lf(),uf(),pf()}function pf(){if(bd!==5)return!1;var e=xd,t=wd;wd=0;var n=bt(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,W&6)throw Error(a(331));var c=W;if(W|=4,Zu(o.current),Uu(o,o.current,s,n),W=c,Of(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{j.p=i,A.T=r,df(e,t)}}function mf(e,t,n){t=Wi(n,t),t=kc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(mt(e,2),Df(e))}function X(e,t,n){if(e.tag===3)mf(e,e,n);else for(;t!==null;){if(t.tag===3){mf(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=Wi(n,e),n=Ac(2),r=vo(t,n,2),r!==null&&(jc(n,r,t,e),mt(r,2),Df(r));break}}t=t.return}}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=gf.bind(null,e,t,n),t.then(e,e))}function gf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,G===e&&(q&n)===n&&(sd===4||sd===3&&(q&62914560)===q&&300>We()-hd?W&2?ud|=n:Hd(e,0):ud|=n,dd===q&&(dd=0)),Df(e)}function _f(e,t){t===0&&(t=ft()),e=ki(e,t),e!==null&&(mt(e,t),Df(e))}function vf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_f(e,n)}function yf(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),_f(e,n)}function bf(e,t){return Be(e,t)}var xf=null,Sf=null,Cf=!1,wf=!1,Tf=!1,Ef=0;function Df(e){e!==Sf&&e.next===null&&(Sf===null?xf=Sf=e:Sf=Sf.next=e),wf=!0,Cf||(Cf=!0,Pf())}function Of(e,t){if(!Tf&&wf){Tf=!0;do for(var n=!1,r=xf;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=q,a=P(r,r===G?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Nf(r,a))}r=r.next}while(n);Tf=!1}}function kf(){Af()}function Af(){wf=Cf=!1;var e=0;Ef!==0&&gp()&&(e=Ef);for(var t=We(),n=null,r=xf;r!==null;){var i=r.next,a=jf(r,t);a===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&(Sf=n)):(n=r,(e!==0||a&3)&&(wf=!0)),r=i}bd!==0&&bd!==5||Of(e,!1),Ef!==0&&(Ef=0)}function jf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=G,n=q,n=P(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(J===2||J===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),bt(n)){case 2:case 8:n=qe;break;case 32:n=N;break;case 268435456:n=Ye;break;default:n=N}return r=Mf.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 Mf(e,t){if(bd!==0&&bd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ff()&&e.callbackNode!==n)return null;var r=q;return r=P(e,e===G?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Id(e,r,t),jf(e,We()),e.callbackNode!=null&&e.callbackNode===n?Mf.bind(null,e):null)}function Nf(e,t){if(ff())return null;Id(e,t,!0)}function Pf(){xp(function(){W&6?Be(Ke,kf):Af()})}function Ff(){if(Ef===0){var e=za;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Ef=e}return Ef}function If(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Lf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=If((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?If(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ef!==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 Rf=0;Rf<gi.length;Rf++){var zf=gi[Rf];_i(zf.toLowerCase(),`on`+(zf[0].toUpperCase()+zf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Bf=`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(` `),Vf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Bf));function Hf(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){Si(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){Si(e)}i.currentTarget=null,a=c}}}}function Z(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Kf(t,e,2,!1),n.add(r))}function Uf(e,t,n){var r=0;t&&(r|=4),Kf(n,e,r,t)}var Wf=`_reactListening`+Math.random().toString(36).slice(2);function Gf(e){if(!e[Wf]){e[Wf]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(Vf.has(t)||Uf(t,!1,e),Uf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wf]||(t[Wf]=!0,Uf(`selectionchange`,!1,t))}}function Kf(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,!kn||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 qf(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=Ft(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}En(function(){var r=a,i=Sn(n),o=[];a:{var c=hi.get(e);if(c!==void 0){var l=Vn,u=e;switch(e){case`keypress`:if(In(n)===0)break a;case`keydown`:case`keyup`:l=ar;break;case`focusin`:u=`focus`,l=Xn;break;case`focusout`:u=`blur`,l=Xn;break;case`beforeblur`:case`afterblur`:l=Xn;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=Jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=cr;break;case ci:case li:case ui:l=Zn;break;case mi:l=lr;break;case`scroll`:case`scrollend`:l=Un;break;case`wheel`:l=ur;break;case`copy`:case`cut`:case`paste`:l=Qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=or;break;case`submit`:l=sr;break;case`toggle`:case`beforetoggle`:l=dr}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=Dn(m,p),g!=null&&d.push(Jf(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!==I&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Et]))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?Ft(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=Jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=or,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?ee(c,l,Xf):null,c!==null&&Zf(o,u,c,d,!1),l!==null&&f!==null&&Zf(o,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=jr;else if(Tr(c)){if(Mr)_=Vr;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=jr):_=Br;if(_&&=_(e,r)){Er(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Tr(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(o,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(o,n,i)}var y;if(pr)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 xr?yr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(gr&&n.locale!==`ko`&&(xr||b!==`onCompositionStart`?b===`onCompositionEnd`&&xr&&(y=Fn()):(jn=i,Nn=`value`in jn?jn.value:jn.textContent,xr=!0)),v=Yf(r,b),0<v.length&&(b=new $n(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=br(n),y!==null&&(b.data=y)))),(y=hr?Sr(e,n):Cr(e,n))&&(b=Yf(r,`onBeforeInput`),0<b.length&&(v=new $n(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Lf(o,e,r,n,i)}Hf(o,t)})}function Jf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yf(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=Dn(e,n),i!=null&&r.unshift(Jf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Jf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Xf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(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=Dn(n,a),l!=null&&o.unshift(Jf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Jf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,$f=/\u0000|\uFFFD/g;function ep(e){return(typeof e==`string`?e:``+e).replace(Qf,`
10
- `).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function Q(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(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=bn(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`&&Q(e,t,`name`,i.name,i,null),Q(e,t,`formEncType`,i.formEncType,i,null),Q(e,t,`formMethod`,i.formMethod,i,null),Q(e,t,`formTarget`,i.formTarget,i,null)):(Q(e,t,`encType`,i.encType,i,null),Q(e,t,`method`,i.method,i,null),Q(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Z(`scroll`,e);return;case`onScrollEnd`:r!=null&&Z(`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=bn(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`:Z(`beforetoggle`,e),Z(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(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=vn.get(n)||n,Xt(e,n,r);else return}F=!0}function np(e,t,n,r,i,o){switch(n){case`style`:gn(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`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Z(`scroll`,e);return;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.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[Tt]||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 rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Z(`error`,e),Z(`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:Q(e,t,o,s,n,null)}}i&&Q(e,t,`srcSet`,n.srcSet,n,null),r&&Q(e,t,`src`,n.src,n,null);return;case`input`:Z(`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:Q(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Z(`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:Q(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Z(`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:Q(e,t,s,c,n,null)}fn(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:Q(e,t,l,r,n,null)}return;case`dialog`:Z(`beforetoggle`,e),Z(`toggle`,e),Z(`cancel`,e),Z(`close`,e);break;case`iframe`:case`object`:Z(`load`,e);break;case`video`:case`audio`:for(r=0;r<Bf.length;r++)Z(Bf[r],e);break;case`image`:Z(`error`,e),Z(`load`,e);break;case`details`:Z(`toggle`,e);break;case`embed`:case`source`:case`link`:Z(`error`,e),Z(`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:Q(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Q(e,t,c,r,n,null))}var ip={};function ap(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)||Q(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&&Q(e,t,p,m,r,f)}}sn(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)||Q(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&&Q(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(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:Q(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&&Q(e,t,s,i,r,o)}dn(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:Q(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:Q(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)&&Q(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:Q(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Q(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||Q(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[wt]=r,n[Tt]=t,rp(n,e,t),zt(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(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`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Hh(t)}function Tp(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 Ep(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 Dp(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 Op(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 kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(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`&&(jp(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+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.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 Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.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},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.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(Vp(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=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.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,zp(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,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=v(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=up(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(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}Ip.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Up,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||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Ft(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=ee(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=ee(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Qp(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)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Up,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),Qp(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),Qp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=v(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(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,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[jt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(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 hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&Q(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var ym=new Map,bm=new Set;function xm(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 Sm=j.d;j.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=Bd();return e||t}function wm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=w({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Rt(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);zt(c),rp(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Rt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=w({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),zt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Rt(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),zt(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var i=(i=Ee.current)?xm(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=Fm(n.href),t=Rt(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=Fm(n.href);var o=Rt(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.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},ym.set(e,o)),Rm(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=zm(n),t=Rt(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 Fm(e){return`href="`+on(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=Bt.bind(null,t),rp(t,`link`,n),zt(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 zm(e){return`[src="`+on(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,zt(r),r;var i=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),zt(r),rp(r,`style`,i),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Fm(n.href);var o=e.querySelector(Im(i));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=Lm(n),(i=ym.get(i))&&Um(r,i),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(i=e.querySelector(Bm(o)))?(t.instance=i,zt(i),i):(r=n,(i=ym.get(o))&&(r=w({},n),Wm(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),zt(i),rp(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[jt]||a[wt]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:oe,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function lh(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=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(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 uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Pi(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function $(e){return e?(e=Mi,e):Mi}function dh(e,t,n,r,i,a){i=$(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(Fd(n,e,t),yo(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=ki(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=yt(t);var n=ki(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)qf(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=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Df(a),!(W&6)&&(_d=We()+500,Of(0,!1))}}break;case 31:case 13:s=ki(a,2),s!==null&&Fd(s,a,2),Bd(),ph(a,2)}if(a=bh(r),a===null&&qf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else qf(e,t,r,null,n)}}function bh(e){return e=Sn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Ft(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 N:case Je:return 32;case Ye: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=It(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=Ft(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,St(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,St(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);I=r,n.target.dispatchEvent(r),I=null}else return t=It(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=It(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[Tt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||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),Bd(),t[Et]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();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{Qe=Jh.inject(qh),$e=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=uh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[Et]=t.current,Gf(e),new Wh(t)}})),Pn=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=Nn()})),Fn={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`}]]};Fn.node;var In=k(Fn),Ln={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`}]]};Ln.node;var Rn=k(Ln),zn={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};zn.node;var Bn=k(zn),Vn={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`}]]};Vn.node;var Hn=k(Vn),Un={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`}]]};Un.node;var Wn=k(Un),Gn={name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]};Gn.node;var Kn=k(Gn),qn={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`}]]};qn.node;var Jn=k(qn),Yn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Yn.node;var Xn=k(Yn),Zn={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Zn.node;var Qn=k(Zn),$n={name:`cloud-alert`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]};$n.node;var er=k($n),tr={name:`cloud-cog`,size:24,node:[[`path`,{d:`m10.852 19.772-.383.924`,key:`r7sl7d`}],[`path`,{d:`m13.148 14.228.383-.923`,key:`1d5zpm`}],[`path`,{d:`M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1ydik7`}],[`path`,{d:`m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1m1vsf`}],[`path`,{d:`m14.772 15.852.923-.383`,key:`660p6e`}],[`path`,{d:`m14.772 18.148.923.383`,key:`hrcpis`}],[`path`,{d:`M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2`,key:`j2q98n`}],[`path`,{d:`m9.228 15.852-.923-.383`,key:`1p9ong`}],[`path`,{d:`m9.228 18.148-.923.383`,key:`6558rz`}]]};tr.node;var nr=k(tr),rr={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`}]]};rr.node;var ir=k(rr),ar={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`}]]};ar.node;var or=k(ar),sr={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`}]]};sr.node;var cr=k(sr),lr={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};lr.node;var ur=k(lr),dr={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`]};dr.node;var fr=k(dr),pr={name:`folder-up`,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`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]};pr.node;var mr=k(pr),hr={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`}]]};hr.node;var gr=k(hr),_r={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};_r.node;var vr=k(_r),yr={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`}]]};yr.node;var br=k(yr),xr={name:`highlighter`,size:24,node:[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]};xr.node;var Sr=k(xr),Cr={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`]};Cr.node;var wr=k(Cr),Tr={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`}]]};Tr.node;var Er=k(Tr),Dr={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`}]]};Dr.node;var Or=k(Dr),kr={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};kr.node;var Ar=k(kr),jr={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};jr.node;var Mr=k(jr),Nr={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};Nr.node;var Pr=k(Nr),Fr={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Fr.node;var Ir=k(Fr),Lr={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Lr.node;var Rr=k(Lr),zr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};zr.node;var Br=k(zr),Vr={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`}]]};Vr.node;var Hr=k(Vr),Ur={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`}]]};Ur.node;var Wr=k(Ur),Gr={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`}]]};Gr.node;var Kr=k(Gr),qr={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`}]]};qr.node;var Jr=k(qr),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 Xr=k(Yr),Zr={name:`message-square`,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`}]]};Zr.node;var Qr=k(Zr),$r={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`}]]};$r.node;var ei=k($r),ti={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`}]]};ti.node;var ni=k(ti),ri={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`}]]};ri.node;var ii=k(ri),ai={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`}]]};ai.node;var oi=k(ai),si={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};si.node;var ci=k(si),li={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`]};li.node;var ui=k(li),di={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`}]]};di.node;var fi=k(di),pi={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`}]]};pi.node;var mi=k(pi),hi={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`}]]};hi.node;var gi=k(hi),_i={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`}]]};_i.node;var vi=k(_i),yi={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`}]]};yi.node;var bi=k(yi),xi={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};xi.node;var Si=k(xi),Ci={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`]};Ci.node;var wi=k(Ci),Ti={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`]};Ti.node;var Ei=k(Ti),Di={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};Di.node;var Oi=k(Di),ki={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`}]]};ki.node;var Ai=k(ki),ji={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`}]]};ji.node;var Mi=k(ji),Ni={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`]};Ni.node;var Pi=k(Ni),Fi={name:`swatch-book`,size:24,node:[[`path`,{d:`M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z`,key:`1ldrpk`}],[`path`,{d:`M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7`,key:`11i5po`}],[`path`,{d:`M 7 17h.01`,key:`1euzgo`}],[`path`,{d:`m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8`,key:`o2gii7`}]]};Fi.node;var Ii=k(Fi),Li={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};Li.node;var Ri=k(Li),zi={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};zi.node;var Bi=k(zi),Vi={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Vi.node;var Hi=k(Vi),Ui={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`]};Ui.node;var Wi=k(Ui),Gi={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`}]]};Gi.node;var Ki=k(Gi),R=t(r(),1),qi=Pn(),Ji=e({defineStudioPlugin:()=>Yi});function Yi(e){return e}var z=t(i(),1),Xi=Pt(),Zi={account:{kind:`release`,default:!0,label:`Account in a local install`,hint:`Linking, Settings → Account, the offer to sign in.`},twoWaySync:{kind:`release`,default:!0,label:`Two-way sync with the cloud`,hint:`A local install with an account keeps its spaces in step with the organization in the cloud, both ways: wizards, knowledge, data and files.`},liveChanges:{kind:`release`,default:!0,label:`Live changes in the studio`,hint:`An open studio shows what changed elsewhere (another member, a run, the AI, the sync) without a reload.`},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:`Organization plans`,hint:`The organization page in the cloud studio, and plans that carry this switch on the account pages.`},organizationSettings:{kind:`release`,default:!1,label:`Organization settings in the studio`,hint:`Settings › Organisation in the cloud studio: the organization's name, its members and invitations, changed there instead of on the account pages.`},brandSections:{kind:`release`,default:!1,label:`Sections in Brand`,hint:`Sections of logos and of colours, gradients and patterns among them.`},brandRules:{kind:`release`,default:!1,label:`Rules in Brand`,hint:`Rules for how the logos, the colours and the type may be used.`},typography:{kind:`release`,default:!1,label:`Typography in Brand`,hint:`The brand's fonts, their licences and a type scale.`},channelVoice:{kind:`release`,default:!1,label:`Live voice`,hint:`Wizards run as a spoken conversation in the browser: offered when building and sharing.`},channelVideo:{kind:`release`,default:!1,label:`Video call`,hint:`Wizards run as a video call in the browser: offered when building and sharing.`},pages:{kind:`release`,default:!1,label:`Public page`,hint:`A space's page at the organization's address on wizards.page: its part in the space, the share dialog's switch.`},wordpress:{kind:`release`,default:!1,label:`WordPress plugin`,hint:`The plugin for WordPress sites, and a wizard as a package for one: offered in the share dialog and under Settings → Integrate.`},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 organization puts its providers' keys into the cloud studio instead of running on credits.`}};function Qi(e,t){let n=e?.[t];return typeof n==`boolean`?n:Object.hasOwn(Zi,t)?Zi[t].default:!1}function $i(e=Zi){let t={};for(let[n,r]of Object.entries(e))t[n]=r.default;return t}var ea=[`left`,`top`,`right`,`bottom`],ta=`wizards.appbar`,na={position:`left`,labels:!0},ra=e=>ea.includes(e);function ia(){try{let e=JSON.parse(localStorage.getItem(ta)??`null`);return{position:ra(e?.position)?e.position:na.position,labels:typeof e?.labels==`boolean`?e.labels:na.labels}}catch{return na}}var B=ia(),aa=new Set;function oa(e){B={...B,...e};try{localStorage.setItem(ta,JSON.stringify(B))}catch{}for(let e of aa)e()}function sa(){return En(`(max-width: 767px)`)}function ca(){let e=(0,R.useSyncExternalStore)(e=>(aa.add(e),()=>aa.delete(e)),()=>B),t=sa();return(0,R.useMemo)(()=>t?{...e,position:`bottom`,phone:t}:{...e,phone:t},[e,t])}var la=e=>e===`top`||e===`bottom`;function ua(e){let{position:t,labels:n}=ca(),r=En(`(min-width: 1400px)`)&&!la(t)&&!e;return{shown:n&&r,room:r}}function da(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`}}function fa(){return ot({queryKey:[`config`],queryFn:async()=>{let e=await _.get(`/api/config`);return Be(e.publicUrl),e},staleTime:6e4})}function pa(){let e=Xt(),t=fa();return e.data?.features??t.data?.features??$i()}function ma(e){return Qi(pa(),e)}var ha=()=>matchMedia(`(display-mode: standalone)`).matches||matchMedia(`(display-mode: window-controls-overlay)`).matches||navigator.standalone===!0,ga=()=>navigator.userAgent,_a=()=>/iPhone|iPad|iPod/.test(ga())||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,va=()=>!!navigator.userAgentData?.brands?.length||/Chrome|Chromium|Edg/.test(ga()),ya=()=>/Safari/.test(ga())&&!/Chrome|Chromium|Edg|Firefox|FxiOS/.test(ga());function ba(e){return e?`prompt`:/Android/.test(ga())?va()?`android`:`none`:_a()?`ios`:ya()?`mac`:va()?`chromium`:`none`}function xa(){return(0,R.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 Sa(e){try{await e.prompt()}finally{window.wizardInstall=null,window.dispatchEvent(new Event(`wizard-install`))}}function Ca(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}var wa=112,Ta=72,Ea=89,Da=115,Oa;function ka(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Aa(e){let t=-1;Oa||=ka();for(let n=0;n<e.length;n++)t=Oa[(t^e[n])&255]^t>>>8;return t^-1}function ja(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===wa&&e[n-2]===Ta&&e[n-1]===Ea&&e[n]===Da)return n-3;return 0}function Ma(e,t,n=!1){let r=new Uint8Array(13);t*=39.3701,r[0]=wa,r[1]=Ta,r[2]=Ea,r[3]=Da,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=Aa(r),a=new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=ja(e);return e.set(r,t),e.set(a,t+13),e}{let t=new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}var Na=`AAlwSFlz`,Pa=`AAAJcEhZ`,Fa=`AAAACXBI`;function Ia(e){let t=e.indexOf(Na);return t===-1&&(t=e.indexOf(Pa)),t===-1&&(t=e.indexOf(Fa)),t}var La=`[modern-screenshot]`,Ra=typeof window<`u`,za=Ra&&`Worker`in window,Ba=Ra&&`atob`in window,Va=Ra&&`btoa`in window,Ha=Ra?window.navigator?.userAgent:``,Ua=Ha.includes(`Chrome`),Wa=Ha.includes(`AppleWebKit`)&&!Ua,Ga=Ha.includes(`Firefox`),Ka=e=>e&&`__CONTEXT__`in e,qa=e=>e.constructor.name===`CSSFontFaceRule`,Ja=e=>e.constructor.name===`CSSImportRule`,Ya=e=>e.constructor.name===`CSSLayerBlockRule`,Xa=e=>e.nodeType===1,Za=e=>typeof e.className==`object`,Qa=e=>e.tagName===`image`,$a=e=>e.tagName===`use`,eo=e=>Xa(e)&&e.style!==void 0&&!Za(e),to=e=>e.nodeType===8,no=e=>e.nodeType===3,ro=e=>e.tagName===`IMG`,io=e=>e.tagName===`VIDEO`,ao=e=>e.tagName===`CANVAS`,oo=e=>e.tagName===`TEXTAREA`,so=e=>e.tagName===`INPUT`,co=e=>e.tagName===`STYLE`,lo=e=>e.tagName===`SCRIPT`,uo=e=>e.tagName===`SELECT`,fo=e=>e.tagName===`SLOT`,po=e=>e.tagName===`IFRAME`,mo=(...e)=>console.warn(La,...e);function ho(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}var go=e=>e.startsWith(`data:`);function _o(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ra&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Ra)return e;let n=vo().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function vo(e){return(e&&Xa(e)?e?.ownerDocument:e)??window.document}var yo=`http://www.w3.org/2000/svg`;function bo(e,t,n){let r=vo(n).createElementNS(yo,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function xo(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function So(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}var Co=e=>So(e,`dataUrl`);function wo(e,t){let n=vo(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function To(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?wo(e,vo(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),io(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?To(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=Qa(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(ro(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(ro(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function Eo(e,t){eo(e)&&(ro(e)||io(e)?await To(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>To(e,t)))))}var Do=function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function Oo(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}var ko=0;function Ao(e){let t=`${La}[#${ko}]`;return ko++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&mo(...t)}}function jo(e){return{cache:e?`no-cache`:`force-cache`}}async function Mo(e,t){return Ka(e)?e:No(e,{...t,autoDestruct:!0})}async function No(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(Ra?window.document:void 0),c=e.ownerDocument?.defaultView??(Ra?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:jo(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Ao(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:Po(s),svgDefsElement:s?.createElementNS(yo,`defs`),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:za&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[ho(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await Eo(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=Fo(e,u);return u.width=d,u.height=f,u}function Po(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
11
- .______background-clip--text {
12
- background-clip: text;
13
- -webkit-background-clip: text;
14
- }
15
- `);return t.appendChild(n),t}function Fo(e,t){let{width:n,height:r}=t;if(Xa(e)&&(!n||!r)){let t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute(`width`))||0,r=r||t.height||Number(e.getAttribute(`height`))||0}return{width:n,height:r}}async function Io(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:a}=t;n.time(`image to canvas`);let o=await To(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=Lo(e.ownerDocument,t),l=()=>{try{c?.drawImage(o,0,0,s.width,s.height)}catch(e){t.log.warn(`Failed to drawImage`,e)}};if(l(),t.isEnable(`fixSvgXmlDecode`))for(let e=0;e<i;e++)await new Promise(t=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),t()},e+a)});return t.drawImageCount=0,n.timeEnd(`image to canvas`),s}function Lo(e,t){let{width:n,height:r,scale:i,backgroundColor:a,maximumCanvasSize:o}=t,s=e.createElement(`canvas`);s.width=Math.floor(n*i),s.height=Math.floor(r*i),s.style.width=`${n}px`,s.style.height=`${r}px`,o&&(s.width>o||s.height>o)&&(s.width>o&&s.height>o?s.width>s.height?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o):s.width>o?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o));let c=s.getContext(`2d`);return c&&a&&(c.fillStyle=a,c.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:c}}function Ro(e,t){if(e.ownerDocument)try{let t=e.toDataURL();if(t!==`data:,`)return wo(t,e.ownerDocument)}catch(e){t.log.warn(`Failed to clone canvas`,e)}let n=e.cloneNode(!1),r=e.getContext(`2d`),i=n.getContext(`2d`);try{return r&&i&&i.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(e){t.log.warn(`Failed to clone canvas`,e)}return n}function zo(e,t){try{if(e?.contentDocument?.documentElement)return rs(e.contentDocument.documentElement,t)}catch(e){t.log.warn(`Failed to clone iframe`,e)}return e.cloneNode(!1)}function Bo(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`),t}async function Vo(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return wo(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin=`anonymous`,e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let i=!0;if(await To(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?wo(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(e=>{n.addEventListener(`seeked`,e,{once:!0})});let a=r.createElement(`canvas`);a.width=e.offsetWidth,a.height=e.offsetHeight;try{let e=a.getContext(`2d`);e&&e.drawImage(n,0,0,a.width,a.height)}catch(r){return t.log.warn(`Failed to clone video`,r),e.poster?wo(e.poster,e.ownerDocument):n}return Ro(a,t)}return n}function Ho(e,t){return ao(e)?Ro(e,t):po(e)?zo(e,t):ro(e)?Bo(e):io(e)?Vo(e,t):e.cloneNode(!1)}function V(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement(`iframe`),t.id=`__SANDBOX__${Do()}`,t.width=`0`,t.height=`0`,t.style.visibility=`hidden`,t.style.position=`fixed`,n.body.appendChild(t),t.srcdoc=`<!DOCTYPE html><meta charset="UTF-8"><title></title><body>`,e.sandbox=t)}catch(t){e.log.warn(`Failed to getSandBox`,t)}}return t}var H=[`width`,`height`,`-webkit-text-fill-color`],Uo=[`stroke`,`fill`];function Wo(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),a=Za(e)&&i!==`svg`,o=a?Uo.map(t=>[t,e.getAttribute(t)]).filter(([,e])=>e!==null):[],s=[a&&`svg`,i,o.map((e,t)=>`${e}=${t}`).join(`,`),t].filter(Boolean).join(`:`);if(r.has(s))return r.get(s);let c=V(n)?.contentWindow;if(!c)return new Map;let l=c?.document,u,d;a?(u=l.createElementNS(yo,`svg`),d=u.ownerDocument.createElementNS(u.namespaceURI,i),o.forEach(([e,t])=>{d.setAttributeNS(null,e,t)}),u.appendChild(d)):u=d=l.createElement(i),d.textContent=` `,l.body.appendChild(u);let f=c.getComputedStyle(d,t),p=new Map;for(let e=f.length,t=0;t<e;t++){let e=f.item(t);H.includes(e)||p.set(e,f.getPropertyValue(e))}return l.body.removeChild(u),r.set(s,p),p}function Go(e,t,n){let r=new Map,i=[],a=new Map;if(n)for(let e of n)o(e);else for(let t=e.length,n=0;n<t;n++)o(e.item(n));for(let e=i.length,t=0;t<e;t++)a.get(i[t])?.forEach((e,t)=>r.set(t,e));function o(n){let o=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf(`-`),l=c>-1?n.substring(0,c):void 0;if(l){let e=a.get(l);e||(e=new Map,a.set(l,e)),e.set(n,[o,s])}(t.get(n)!==o||s)&&(l?i.push(l):r.set(n,[o,s]))}return r}function Ko(e,t,n,r){let{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:o}=r,s=t.style,c=i.getComputedStyle(e),l=Wo(e,null,r);o?.forEach((e,t)=>{l.delete(t)});let u=Go(c,l,a);u.delete(`transition-property`),u.delete(`all`),u.delete(`d`),u.delete(`content`),n&&(u.delete(`position`),u.delete(`margin-top`),u.delete(`margin-right`),u.delete(`margin-bottom`),u.delete(`margin-left`),u.delete(`margin-block-start`),u.delete(`margin-block-end`),u.delete(`margin-inline-start`),u.delete(`margin-inline-end`),u.set(`box-sizing`,[`border-box`,``])),u.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`),Ua&&(u.has(`font-kerning`)||u.set(`font-kerning`,[`normal`,``]),(u.get(`overflow-x`)?.[0]===`hidden`||u.get(`overflow-y`)?.[0]===`hidden`)&&u.get(`text-overflow`)?.[0]===`ellipsis`&&e.scrollWidth===e.clientWidth&&u.set(`text-overflow`,[`clip`,``]));for(let e=s.length,t=0;t<e;t++)s.removeProperty(s.item(t));return u.forEach(([e,t],n)=>{s.setProperty(n,e,t)}),u}function qo(e,t){(oo(e)||so(e)||uo(e))&&t.setAttribute(`value`,e.value)}var Jo=[`::before`,`::after`],Yo=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`];function Xo(e,t,n,r,i){let{ownerWindow:a,svgStyleElement:o,svgStyles:s,currentNodeStyle:c}=r;if(!o||!a)return;function l(n){let o=a.getComputedStyle(e,n),l=o.getPropertyValue(`content`);if(!l||l===`none`)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,``);let u=[Do()],d=Wo(e,n,r);c?.forEach((e,t)=>{d.delete(t)});let f=Go(o,d,r.includeStyleProperties);f.delete(`content`),f.delete(`-webkit-locale`),f.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`);let p=[`content: '${l}';`];if(f.forEach(([e,t],n)=>{p.push(`${n}: ${e}${t?` !important`:``};`)}),p.length===1)return;try{t.className=[t.className,...u].join(` `)}catch(e){r.log.warn(`Failed to copyPseudoClass`,e);return}let m=p.join(`
16
- `),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}Jo.forEach(l),n&&Yo.forEach(l)}var Zo=new Set([`symbol`]);async function Qo(e,t,n,r,i){if(Xa(n)&&(co(n)||lo(n))||r.filter&&!r.filter(n))return;r.currentParentNodeStyle=Zo.has(t.nodeName)||Zo.has(n.nodeName)?void 0:r.currentNodeStyle;let a=await rs(n,r,!1,i);r.isEnable(`restoreScrollPosition`)&&es(e,a),t.appendChild(a)}async function $o(e,t,n,r){let i=e.firstChild;Xa(e)&&e.shadowRoot&&(i=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=i;a;a=a.nextSibling)if(!to(a)){if(Xa(a)&&fo(a)&&typeof a.assignedNodes==`function`){let i=a.assignedNodes();for(let a=0;a<i.length;a++)await Qo(e,t,i[a],n,r)}else await Qo(e,t,a,n,r)}}function es(e,t){if(!eo(e)||!eo(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:i}=t.style,a=new DOMMatrix(i),{a:o,b:s,c,d:l}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-r,-n),a.a=o,a.b=s,a.c=c,a.d=l,t.style.transform=a.toString()}function ts(e,t){let{backgroundColor:n,width:r,height:i,style:a}=t,o=e.style;if(n&&o.setProperty(`background-color`,n,`important`),r&&o.setProperty(`width`,`${r}px`,`important`),i&&o.setProperty(`height`,`${i}px`,`important`),a)for(let e in a)o[e]=a[e]}var ns=/^[\w-:]+$/;async function rs(e,t,n=!1,r){let{ownerDocument:i,ownerWindow:a,fontFamilies:o,onCloneEachNode:s}=t;if(i&&no(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&a&&Xa(e)&&(eo(e)||Za(e))){let r=await Ho(e,t);if(t.isEnable(`removeAbnormalAttributes`)){let e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){let t=e[n];ns.test(t)||r.removeAttribute(t)}}let i=t.currentNodeStyle=Ko(e,r,n,t);n&&ts(r,t);let a=!1;if(t.isEnable(`copyScrollbar`)){let t=[i.get(`overflow-x`)?.[0],i.get(`overflow-y`)?.[0]];a=t.includes(`scroll`)||(t.includes(`auto`)||t.includes(`overlay`))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let c=i.get(`text-transform`)?.[0],l=Oo(i.get(`font-family`)?.[0]),u=l?e=>{c===`uppercase`?e=e.toUpperCase():c===`lowercase`?e=e.toLowerCase():c===`capitalize`&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach(t=>{let n=o.get(t);n||o.set(t,n=new Set),e.split(``).forEach(e=>n.add(e))})}:void 0;return Xo(e,r,a,t,u),qo(e,r),io(e)||await $o(e,r,t,u),await s?.(r),r}let c=e.cloneNode(!1);return await $o(e,c,t),await s?.(c),c}function is(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn(`Failed to destroyContext`,t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function as(e){let{url:t,timeout:n,responseType:r,...i}=e,a=new AbortController,o=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...i}).then(e=>{if(!e.ok)throw Error(`Failed fetch, not 2xx response`,{cause:e});switch(r){case`arrayBuffer`:return e.arrayBuffer();case`dataUrl`:return e.blob().then(Co);default:return e.text()}}).finally(()=>clearTimeout(o))}function os(e,t){let{url:n,requestType:r=`text`,responseType:i=`text`,imageDom:a}=t,o=n,{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:f,placeholderImage:p},font:m,workers:h,fontFamilies:g}=e;r===`image`&&(Wa||Ga)&&e.drawImageCount++;let _=l.get(n);if(!_){f&&f instanceof RegExp&&f.test(o)&&(o+=(/\?/.test(o)?`&`:`?`)+new Date().getTime());let t=r.startsWith(`font`)&&m&&m.minify,v=new Set;t&&r.split(`;`)[1].split(`,`).forEach(e=>{g.has(e)&&g.get(e).forEach(e=>v.add(e))});let y=t&&v.size,b={url:o,timeout:s,responseType:y?`arrayBuffer`:i,headers:r===`image`?{accept:c}:void 0,...d};_={type:r,resolve:void 0,reject:void 0,response:null},_.response=(async()=>{if(u&&r===`image`){let e=await u(n);if(e)return e}return!Wa&&n.startsWith(`http`)&&h.length?new Promise((e,t)=>{h[l.size&h.length-1].postMessage({rawUrl:n,...b}),_.resolve=e,_.reject=t}):as(b)})().catch(t=>{if(l.delete(n),r===`image`&&p)return e.log.warn(`Failed to fetch image base64, trying to use placeholder image`,o),typeof p==`string`?p:p(a);throw t}),l.set(n,_)}return _.response}async function ss(e,t,n,r){if(!cs(e))return e;for(let[i,a]of us(e,t))try{let t=await os(n,{url:a,requestType:r?`image`:`text`,responseType:`dataUrl`});e=e.replace(ds(i),`$1${t}$3`)}catch(e){n.log.warn(`Failed to fetch css data url`,i,e)}return e}function cs(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}var ls=/url\((['"]?)([^'"]+?)\1\)/g;function us(e,t){let n=[];return e.replace(ls,(e,r,i)=>(n.push([i,_o(i,t)]),e)),n.filter(([e])=>!go(e))}function ds(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}var fs=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`];function ps(e,t){return fs.map(n=>{let r=e.getPropertyValue(n);return!r||r===`none`?null:((Wa||Ga)&&t.drawImageCount++,ss(r,null,t,!0).then(t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))}).filter(Boolean)}function ms(e,t){if(ro(e)){let n=e.currentSrc||e.src;if(!go(n))return[os(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.srcset=``,e.dataset.originalSrc=n,e.src=t||``)})];(Wa||Ga)&&t.drawImageCount++}else if(Za(e)&&!go(e.href.baseVal)){let n=e.href.baseVal;return[os(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||``)})]}return[]}function hs(e,t){let{ownerDocument:n,svgDefsElement:r}=t,i=e.getAttribute(`href`)??e.getAttribute(`xlink:href`);if(!i)return[];let[a,o]=i.split(`#`);if(o){let i=`#${o}`,s=t.shadowRoots.reduce((e,t)=>e??t.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(a&&e.setAttribute(`href`,i),r?.querySelector(i))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(a)return[os(t,{url:a,responseType:`text`}).then(e=>{r?.insertAdjacentHTML(`beforeend`,e)})]}return[]}function gs(e,t){let{tasks:n}=t;Xa(e)&&((ro(e)||Qa(e))&&n.push(...ms(e,t)),$a(e)&&n.push(...hs(e,t))),eo(e)&&n.push(...ps(e.style,t)),e.childNodes.forEach(e=>{gs(e,t)})}async function _s(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:i,fontCssTexts:a,tasks:o,font:s}=t;if(n&&r&&i.size){if(s&&s.cssText){let e=Cs(s.cssText,t);r.appendChild(n.createTextNode(`${e}
17
- `))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(Ja(e)){let n=e.href,r=``;try{r=await os(t,{url:n,requestType:`text`,responseType:`text`})}catch(e){t.log.warn(`Error fetch remote css import from ${n}`,e)}let i=r.replace(ls,(e,t,r)=>e.replace(r,_o(r,n)));for(let e of bs(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn(`Error inserting rule from remote css import`,{rule:e,error:n})}}}))),l.cssRules.length&&e.push(l);let u=[];e.forEach(e=>{ws(e.cssRules,u)}),u.filter(e=>qa(e)&&cs(e.style.getPropertyValue(`src`))&&Oo(e.style.getPropertyValue(`font-family`))?.some(e=>i.has(e))).forEach(e=>{let i=e,s=a.get(i.cssText);s?r.appendChild(n.createTextNode(`${s}
18
- `)):o.push(ss(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,t).then(e=>{e=Cs(e,t),a.set(i.cssText,e),r.appendChild(n.createTextNode(`${e}
19
- `))}))})}}}var vs=/(\/\*[\s\S]*?\*\/)/g,ys=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function bs(e){if(e==null)return[];let t=[],n=e.replace(vs,``);for(;;){let e=ys.exec(n);if(!e)break;t.push(e[0])}n=n.replace(ys,``);let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=r.exec(n);if(e)i.lastIndex=r.lastIndex;else if(e=i.exec(n),e)r.lastIndex=i.lastIndex;else break;t.push(e[0])}return t}var xs=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ss=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Cs(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Ss,e=>{for(;;){let[t,,n]=xs.exec(e)||[];if(!n)return``;if(n===r)return`src: ${t};`}}):e}function ws(e,t=[]){for(let n of Array.from(e))Ya(n)?t.push(...ws(n.cssRules)):`cssRules`in n?ws(n.cssRules,t):t.push(n);return t}var Ts=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function Es(e){return Ts.test(e.innerHTML)}async function Ds(e,t){let n=await Mo(e,t);if(Xa(n.node)&&Za(n.node)&&!Es(n.node))return n.node;let{ownerDocument:r,log:i,tasks:a,svgStyleElement:o,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:f,onEmbedNode:p,onCreateForeignObjectSvg:m}=n;i.time(`clone node`);let h=await rs(n.node,n,!0);if(o&&r){let e=``;c.forEach((t,n)=>{e+=`${t.join(`,
20
- `)} {
21
- ${n}
22
- }
23
- `}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&Xa(h)&&(i.time(`embed web font`),await _s(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),gs(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=Os(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&is(n),await m?.(y),y}function Os(e,t){let{width:n,height:r}=t,i=bo(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function ks(e,t){let n=await Mo(e,t),r=await Ds(n),i=xo(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=Po(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(yo,`defs`),n.svgStyles.clear()),await Io(wo(i,r.ownerDocument),n)}async function As(e,t){let n=await Mo(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await ks(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&Ba&&Va){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=Ia(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?Ma(u,o,r):Ca(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function js(e,t){return As(await Mo(e,{...t,type:`image/png`}))}var Ms=null,Ns=!1,Ps=0,Fs=new Set,Is=()=>{for(let e of Fs)e()};async function Ls(e){if(Ns)return;Ns=!0,Is();let t=await Us();Ns=!1,Ps+=1,Ms={context:e,shot:t,n:Ps},Is()}var Rs=()=>{Ms=null,Is()},zs=e=>(Fs.add(e),()=>{Fs.delete(e)}),Bs=()=>(0,R.useSyncExternalStore)(zs,()=>Ms),Vs=()=>(0,R.useSyncExternalStore)(zs,()=>Ns);function Hs(e){if(e instanceof HTMLInputElement){if(![`button`,`submit`,`checkbox`,`radio`,`range`,`color`,`hidden`].includes(e.type)){let t=e.value?`•`.repeat(Math.min(12,e.value.length)):``;e.setAttribute(`value`,t),e.value=t}}else if(e instanceof HTMLTextAreaElement){let t=e.value?`•`.repeat(Math.min(24,e.value.length)):``;e.textContent=t,e.value=t}else e instanceof HTMLElement&&(e.isContentEditable||e.dataset.private!==void 0)&&(e.style.filter=`blur(6px)`)}async function Us(){try{return await js(document.body,{scale:Math.min(2,window.devicePixelRatio||1),width:window.innerWidth,height:window.innerHeight,style:{transform:`translateY(-${window.scrollY}px)`},backgroundColor:getComputedStyle(document.body).backgroundColor||`#fff`,onCloneEachNode:Hs,filter:e=>!(e instanceof HTMLElement&&e.dataset.reportSkip!==void 0)})}catch(e){return console.warn(`[report] no screenshot:`,e.message),null}}function Ws(e,t,n){if(!e||!t)return;let r=e.getContext(`2d`);if(r){r.drawImage(t,0,0,e.width,e.height);for(let t of n)if(t.tool===`pen`){r.strokeStyle=`#e11d48`,r.lineWidth=Math.max(3,e.width/300),r.lineCap=`round`,r.lineJoin=`round`,r.beginPath();for(let[e,[n,i]]of t.points.entries())e?r.lineTo(n,i):r.moveTo(n,i);r.stroke()}else{r.fillStyle=`#000`;let[e,n]=t.from,[i,a]=t.to;r.fillRect(Math.min(e,i),Math.min(n,a),Math.abs(i-e),Math.abs(a-n))}}}function Gs({src:e,onChange:t}){let n=(0,R.useRef)(null),r=(0,R.useRef)(null),[i,a]=(0,R.useState)(`pen`),[o,s]=(0,R.useState)([]),c=(0,R.useRef)(null),l=e=>Ws(n.current,r.current,e);(0,R.useEffect)(()=>{let t=new Image;t.onload=()=>{r.current=t;let e=n.current;e&&(e.width=t.naturalWidth,e.height=t.naturalHeight,Ws(e,t,[]))},t.src=e},[e]);let u=e=>{let t=n.current,r=t.getBoundingClientRect();return[(e.clientX-r.left)/r.width*t.width,(e.clientY-r.top)/r.height*t.height]},d=e=>{s(e),l(e),t(n.current.toDataURL(`image/png`))};return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:[(0,z.jsxs)(O,{size:`sm`,variant:i===`pen`?`quiet`:`ghost`,onClick:()=>a(`pen`),children:[(0,z.jsx)(Sr,{className:`size-4`}),` `,L(`report.pen`)]}),(0,z.jsxs)(O,{size:`sm`,variant:i===`cover`?`quiet`:`ghost`,onClick:()=>a(`cover`),children:[(0,z.jsx)(Me,{className:`size-4 fill-current`}),` `,L(`report.cover`)]}),(0,z.jsxs)(O,{size:`sm`,variant:`ghost`,disabled:!o.length,onClick:()=>d(o.slice(0,-1)),children:[(0,z.jsx)(Hi,{className:`size-4`}),` `,L(`report.undo`)]}),o.length?(0,z.jsx)(O,{size:`sm`,variant:`ghost`,onClick:()=>d([]),"aria-label":`Clear`,children:(0,z.jsx)(oe,{className:`size-4`})}):null]}),(0,z.jsx)(`canvas`,{ref:n,className:`w-full cursor-crosshair touch-none rounded-lg border border-border`,onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId);let t=u(e);c.current=i===`pen`?{tool:i,points:[t]}:{tool:i,from:t,to:t}},onPointerMove:e=>{let t=c.current;if(!t)return;let n=u(e);t.tool===`pen`?t.points.push(n):t.to=n,l([...o,t])},onPointerUp:()=>{let e=c.current;c.current=null,e&&d([...o,e])}})]})}function Ks(){let e=Bs();return Vs()?(0,z.jsx)(`div`,{"data-report-skip":!0,className:`pointer-events-none fixed inset-x-0 bottom-6 z-50 flex justify-center`,children:(0,z.jsxs)(`span`,{className:`flex items-center gap-2 rounded-full bg-ink px-4 py-2 text-paper text-sm`,children:[(0,z.jsx)(ct,{className:`size-4`}),` `,L(`report.capturing`)]})}):e?(0,z.jsx)(qs,{context:e.context,shot:e.shot},e.n):null}function qs({context:e,shot:t}){let[n,r]=(0,R.useState)(null),[i,a]=(0,R.useState)(!!t),[o,s]=(0,R.useState)(!0),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(`idle`),m=me().map(ve),h=ve(window.location.href),g=async()=>{p(`sending`);try{let r=await fetch(Ye(`/api/bug-reports`),{method:`POST`,headers:{"content-type":`application/json`},credentials:`include`,body:JSON.stringify({where:e.where,url:window.location.href.split(`?`)[0],runId:e.runId??null,comment:c.trim()||null,error:e.error?{message:ve(e.error.message),stack:e.error.stack?ve(e.error.stack):void 0}:null,logs:o?m:[],screenshot:i?n??t:null,contact:u.trim()||null})});p(r.ok?`sent`:`failed`)}catch{p(`failed`)}};return(0,z.jsx)($e,{open:!0,onClose:Rs,title:L(`report.title`),wide:!0,height:`tall`,children:(0,z.jsx)(`div`,{className:`grid gap-5`,"data-report-skip":!0,children:f===`sent`?(0,z.jsxs)(`div`,{className:`py-10 text-center`,children:[(0,z.jsx)(`p`,{className:`font-display font-semibold text-lg`,children:L(`report.sent`)}),(0,z.jsx)(O,{className:`mt-6`,onClick:Rs,children:`OK`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-ink-3 text-sm`,children:L(`report.lead`)}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{hint:L(`report.whatHint`),children:L(`report.what`)}),(0,z.jsx)(Ce,{"data-autofocus":!0,value:c,onChange:e=>l(e.target.value),rows:3})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,z.jsx)(j,{hint:L(`report.screenshotHint`),children:L(`report.screenshot`)}),(0,z.jsx)(tt,{checked:i,disabled:!t,onChange:a,label:L(`report.screenshot`)})]}),t?i?(0,z.jsx)(Gs,{src:t,onChange:r}):null:(0,z.jsx)(`p`,{className:`text-ink-3 text-sm`,children:L(`report.noShot`)})]}),e.error?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`report.error`)}),(0,z.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-lg bg-paper-2 p-3 text-xs`,children:ve(e.error.message)})]}):null,(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,z.jsx)(j,{hint:L(`report.logsHint`),children:L(`report.logs`,{count:m.length})}),(0,z.jsx)(tt,{checked:o,disabled:!m.length,onChange:s,label:L(`report.logs`,{count:m.length})})]}),o&&m.length?(0,z.jsx)(`pre`,{className:`max-h-40 overflow-auto rounded-lg bg-paper-2 p-3 text-xs`,children:m.join(`
24
- `)}):null]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`report.page`)}),(0,z.jsxs)(`p`,{className:`break-all font-mono text-ink-3 text-xs`,children:[h,(0,z.jsx)(`br`,{}),navigator.userAgent]})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`report.contact`)}),(0,z.jsx)(he,{type:`email`,value:u,onChange:e=>d(e.target.value)})]}),f===`failed`?(0,z.jsx)(`p`,{className:`text-rose text-sm`,children:L(`report.failed`)}):null,(0,z.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,z.jsx)(O,{variant:`ghost`,onClick:Rs,children:L(`report.cancel`)}),(0,z.jsx)(O,{onClick:()=>void g(),busy:f===`sending`,children:L(f===`sending`?`report.sending`:`report.send`)})]})]})})})}var Js=(0,R.lazy)(()=>Ft(()=>import(`./AboutDialog-30Mc1_N_.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Ys=`0.11.6`;function Xs({me:e}){let[t,n]=(0,R.useState)(!1);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`button`,{type:`button`,className:`tabular-nums transition hover:text-ink-2`,onClick:()=>n(!0),children:L(`about.version`,{v:Ys})}),t?(0,z.jsx)(R.Suspense,{fallback:null,children:(0,z.jsx)(Js,{open:!0,me:e,onClose:()=>n(!1)})}):null]})}var Zs=[`update`],Qs=36e5;function $s(e=!0){let t=ie(),[n,r]=(0,R.useState)(null),i=ot({queryKey:Zs,queryFn:()=>_.get(`/api/studio/update`),staleTime:Qs,refetchInterval:Qs,retry:!1,enabled:e}),a=Nt({mutationFn:()=>_.get(`/api/studio/update?fresh=1`),onSuccess:e=>t.setQueryData(Zs,e)}),o=Nt({mutationFn:()=>_.post(`/api/studio/update`),onSuccess:e=>t.setQueryData(Zs,e)}),s=i.data,c=s?.latest??null,l=s?.restarts&&(s.applying===`running`||s.applying===`done`),u=s?.current;return(0,R.useEffect)(()=>{if(!(l||s?.applying===`running`)||!c)return;let e=setInterval(async()=>{try{let e=await _.get(`/api/studio/update`);if(e.current!==u){window.location.reload();return}t.setQueryData(Zs,e),e.applying===`done`&&e.restarts&&r(c)}catch{r(c)}},2e3);return()=>clearInterval(e)},[l,s?.applying,c,u,t]),{status:i,data:s,latest:c,check:a,apply:o,busy:s?.applying===`running`||n!==null,progress:!s||!c?null:n===null?s.applying===`running`?L(`about.update.installing`,{v:c}):s.applying===`done`?L(`about.update.done`,{v:c}):s.applying===`failed`?L(`about.update.failed`):null:L(`about.update.restarting`,{v:c})}}var ec=`wizards.install-banner`,tc=`wizards.first-day`,nc=()=>window.matchMedia(`(pointer: coarse)`).matches;function rc({open:e,onClose:t}){let n=xa(),r=ba(n),i=L(r===`prompt`?`install.app.offer`:r===`none`?`install.app.browser`:`install.app.how.${r}`);return(0,z.jsxs)($e,{open:e,onClose:t,title:L(`install.app.action`),children:[(0,z.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2 leading-relaxed`,children:i}),(0,z.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,z.jsx)(O,{variant:`ghost`,onClick:t,children:L(`install.app.close`)}),n?(0,z.jsx)(O,{onClick:()=>{Sa(n),t()},children:L(`install.app.action`)}):null]})]})}function ic(){try{return localStorage.getItem(ec)===`1`}catch{return!1}}var ac=()=>new Date().toLocaleDateString(`sv`);function oc(){try{let e=localStorage.getItem(tc);return e?e!==ac():(localStorage.setItem(tc,ac()),!1)}catch{return!1}}function sc({me:e}){let t=xa(),[n,r]=(0,R.useState)(ic),[i]=(0,R.useState)(oc);return!(t&&e.hasWizards&&i)||n||ha()||nc()?null:(0,z.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,z.jsx)(Ot,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`p`,{className:`min-w-0 flex-1`,children:L(`install.app.offer`)}),(0,z.jsx)(O,{size:`sm`,onClick:()=>void Sa(t),children:L(`install.app.action`)}),(0,z.jsx)(_e,{label:L(`install.app.close`),onClick:()=>{try{localStorage.setItem(ec,`1`)}catch{}r(!0)},className:`size-8`,children:(0,z.jsx)(at,{className:`size-4`})})]})}function cc(e){return e.mode===`managed`&&(e.organizations.length>1||e.mayCreateOrganization)}function lc(e){if(e.slug){window.location.href=`${a}/${e.slug}/`;return}let t=new URLSearchParams({organization:e.id,return:`${a}/`});window.location.href=Ye(`/api/auth/login?${t}`)}function uc(e){return e.organizations.find(t=>t.id===e.tenant.id)??(e.tenant.name?{id:e.tenant.id,name:e.tenant.name,slug:null,role:e.tenant.role,personal:!1,plan:e.tenant.plan}:null)}function dc({org:e,size:t=`sm`}){return(0,z.jsx)(`span`,{"aria-hidden":`true`,className:N(`grid shrink-0 place-items-center font-semibold tracking-wide`,t===`md`?`size-10 text-[0.8125rem]`:t===`sm`?`size-9 text-[0.75rem]`:`size-7 text-[0.625rem]`,e.personal?`rounded-full bg-ember-tint text-ember-strong ring-1 ring-border-soft`:`rounded-lg bg-card text-ink-2 ring-1 ring-border`),children:rn(e.name)})}function fc(e){let t=ze();return()=>{Qi(e.features,`teamPlans`)?t(`/settings/organization`):e.manageUrl&&window.open(`${e.manageUrl}/account`,`_blank`,`noreferrer`)}}function pc({me:e,roomy:t,onDone:n}){let r=fc(e),[i,a]=(0,R.useState)(null),o=N(`flex w-full items-center gap-3 rounded-lg px-3 text-left text-ink-2 transition hover:bg-accent hover:text-ink`,t?`py-3 text-[0.9375rem]`:`py-2 text-[0.875rem]`);return(0,z.jsxs)(z.Fragment,{children:[e.organizations.map(r=>{let o=r.id===e.tenant.id;return(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,disabled:i!==null,"aria-current":o?`true`:void 0,className:N(`flex w-full items-center gap-3 rounded-lg px-2 text-left transition hover:bg-accent disabled:cursor-default`,t?`py-2.5`:`py-1.5`),onClick:()=>{if(o){n();return}a(r.id),lc(r)},children:[(0,z.jsx)(dc,{org:r,size:t?`md`:`sm`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,z.jsx)(`span`,{className:N(`truncate`,t?`text-[0.9375rem]`:`text-[0.875rem]`,o?`font-semibold text-ink`:`font-medium text-ink-2`),children:r.name}),(0,z.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:i===r.id?L(`organizations.switching`,{name:r.name}):r.personal?L(`organizations.own`):L(`organization.role.${r.role}`)})]}),r.plan?(0,z.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded-full px-2 py-0.5 font-medium text-[0.6875rem] text-ink-3 ring-1 ring-border`,children:r.plan.name}):null,(0,z.jsx)(`span`,{className:`grid w-4 shrink-0 place-items-center`,children:i===r.id?(0,z.jsx)(Br,{className:`size-4 animate-spin text-ink-3`}):o?(0,z.jsx)(pe,{className:`size-4 text-ember-strong`}):null})]},r.id)}),(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:o,onClick:()=>{n(),r()},children:[(0,z.jsx)(Ai,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`truncate`,children:L(`organizations.manage`)})]}),e.mayCreateOrganization&&e.manageUrl?(0,z.jsxs)(`a`,{role:`menuitem`,className:o,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,onClick:n,children:[(0,z.jsx)(yt,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`flex-1 truncate`,children:L(`organizations.create`)}),(0,z.jsx)(Bn,{className:`size-3.5 shrink-0 text-ink-4`})]}):null]})}function mc({me:e,className:t}){let[n,r]=(0,R.useState)(!1),[i,a]=(0,R.useState)({top:0,left:0}),o=(0,R.useRef)(null);Vm(o,n,()=>r(!1));let s=uc(e);return s?cc(e)?(0,z.jsxs)(`div`,{ref:o,className:N(`relative min-w-0 shrink`,t),children:[(0,z.jsxs)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":n,title:L(`organizations.switch`),onClick:e=>{let t=e.currentTarget.getBoundingClientRect();a({top:t.bottom+6,left:t.left}),r(e=>!e)},className:N(`-ml-2 flex max-w-[13rem] items-center gap-1 rounded-md py-0.5 pr-1.5 pl-2 text-[0.9375rem] text-ink-2 transition hover:bg-accent hover:text-ink`,n&&`bg-accent text-ink`),children:[(0,z.jsx)(`span`,{className:`truncate`,children:s.name}),(0,z.jsx)(Qn,{className:`size-3.5 shrink-0 text-ink-4`})]}),n?(0,z.jsxs)(`div`,{role:`menu`,style:{position:`fixed`,...i},className:`z-50 w-80 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[(0,z.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:L(`organizations.mine`)}),(0,z.jsx)(pc,{me:e,onDone:()=>r(!1)})]}):null]}):(0,z.jsx)(`span`,{className:N(`max-w-[12rem] truncate text-[0.9375rem] text-ink-3`,t),title:s.name,children:s.name}):null}function hc({me:e,open:t,onClose:n}){let r=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=r.current;t&&e&&!e.open?e.showModal():!t&&e?.open&&e.close()},[t]),(0,z.jsx)(`dialog`,{ref:r,onClose:n,onClick:e=>{e.target===r.current&&n()},"aria-label":L(`organizations.switch`),className:N(`max-h-[85dvh] overflow-y-auto overscroll-contain bg-card p-0 text-ink shadow-overlay backdrop:bg-[oklch(20%_0.01_60/0.28)]`,`max-sm:mx-0 max-sm:mt-auto max-sm:mb-0 max-sm:w-full max-sm:max-w-none max-sm:rounded-t-3xl`,`sm:m-auto sm:w-[calc(100%-32px)] sm:max-w-sm sm:rounded-2xl`),children:t?(0,z.jsxs)(`div`,{className:`px-3 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))] sm:pt-3`,children:[(0,z.jsx)(`div`,{className:`mx-auto mb-2 h-1.5 w-9 rounded-full bg-border sm:hidden`}),(0,z.jsx)(gc,{onClose:n,children:L(`organizations.switch`)}),(0,z.jsx)(pc,{me:e,roomy:!0,onDone:n})]}):null})}function gc({children:e,onClose:t}){return(0,z.jsxs)(`div`,{className:`flex items-center justify-between px-2 pt-1 pb-2.5`,children:[(0,z.jsx)(`h2`,{className:`font-semibold text-[1.0625rem]`,children:e}),(0,z.jsx)(`button`,{type:`button`,onClick:t,"aria-label":L(`common.close`),className:`grid size-8 place-items-center rounded-full bg-paper-2 text-ink-3 transition hover:text-ink`,children:(0,z.jsx)(at,{className:`size-4`})})]})}var _c=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function vc({me:e,position:t,horizontal:n,labels:r}){let i=ze(),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),[l,d]=(0,R.useState)(!1),f=e.mode===`managed`?uc(e):null,p=cc(e),m=fc(e),h=xa(),g=(0,R.useRef)(null);Vm(g,a,()=>o(!1)),(0,R.useEffect)(()=>{a||d(!1)},[a]);let _=e.mode===`local`,{data:v,check:y}=$s(_);(0,R.useEffect)(()=>{let e=e=>{e.key===`,`&&(_c?e.metaKey:e.ctrlKey)&&!e.altKey&&!e.shiftKey&&(e.preventDefault(),i(`/settings`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let b=e=>{o(!1),i(e)},x=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 transition hover:bg-accent hover:text-ink`,S=`ml-auto shrink-0 text-[0.75rem] text-ink-4`,C=(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),ee=y.isPending?{text:L(`about.update.checking`),tone:S}:v?.newer&&v.latest?{text:v.latest,tone:`ml-auto shrink-0 text-[0.75rem] font-medium text-ember-strong`}:v?{text:L(`about.update.upToDateShort`),tone:`ml-auto shrink-0 text-[0.75rem] text-moss`}:null;return(0,z.jsxs)(`div`,{ref:g,className:N(`relative shrink-0`,r&&`w-full`),children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,"aria-haspopup":`menu`,title:L(`about.title`),"aria-label":L(`about.title`),className:N(`shrink-0 rounded-lg transition hover:bg-ink/10`,a&&`bg-ink/10`,r?`flex h-12 w-full items-center gap-2 px-1.5`:N(`grid place-items-center`,n?`size-11`:`h-12 w-11`)),children:[(0,z.jsx)(un,{size:32}),r?(0,z.jsxs)(`span`,{className:`truncate font-display font-semibold text-[1rem] tracking-tight`,children:[`engenty`,(0,z.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,z.jsx)(`span`,{className:`ml-1 font-normal text-ink-3`,children:`wizards`})]}):null]}),a?(0,z.jsxs)(`div`,{role:`menu`,className:N(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,da(t,`start`)),children:[(0,z.jsxs)(`div`,{className:`flex items-baseline gap-2 px-3 pt-2 pb-2.5`,children:[(0,z.jsxs)(`span`,{className:`font-display font-semibold text-[1rem] tracking-tight`,children:[`engenty`,(0,z.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,z.jsx)(`span`,{className:`ml-1 font-normal text-ink-3`,children:`wizards`})]}),(0,z.jsx)(`span`,{className:N(S,`tabular-nums`),children:Ys})]}),f?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-haspopup":p?`menu`:void 0,"aria-expanded":p?l:void 0,className:N(`flex w-full items-center gap-3 rounded-lg px-2.5 py-1.5 text-left transition hover:bg-accent`,l&&`bg-accent`),onClick:()=>{p?d(e=>!e):(o(!1),m())},children:[(0,z.jsx)(dc,{org:f,size:`xs`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,z.jsx)(`span`,{className:`truncate font-medium text-[0.875rem] text-ink`,children:f.name}),(0,z.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:f.plan?`${L(`organization.title`)} · ${f.plan.name}`:L(`organization.title`)})]}),p?(0,z.jsx)(u,{className:`size-4 shrink-0 text-ink-4`}):null]}),l?(0,z.jsxs)(`div`,{role:`menu`,className:N(`absolute top-12 z-50 w-80 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`right`?`right-full mr-1.5`:`left-full ml-1.5`),children:[(0,z.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:L(`organizations.switch`)}),(0,z.jsx)(pc,{me:e,onDone:()=>o(!1)})]}):null,C]}):null,(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>b(`/settings/about`),children:L(`about.title`)}),_?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>v?.newer?b(`/settings/about`):y.mutate(),children:[L(`about.update.check`),ee?(0,z.jsx)(`span`,{className:ee.tone,children:ee.text}):null]}):null,(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>b(`/settings/about?tab=new`),children:L(`about.tab.new`)}),C,(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>b(`/settings`),children:[L(`nav.settings`),` …`,(0,z.jsx)(`span`,{className:S,children:_c?`⌘ ,`:`Ctrl ,`})]}),ha()?null:(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>{o(!1),h?Sa(h):c(!0)},children:L(`install.app.action`)}),C,(0,z.jsx)(`button`,{type:`button`,role:`menuitem`,className:x,onClick:()=>b(`/settings/about?tab=credits`),children:L(`about.creditsMenu`)})]}):null,(0,z.jsx)(rc,{open:s,onClose:()=>c(!1)})]})}var yc=[],bc=0,xc=new Set;function Sc(){for(let e of xc)e()}function Cc(e){let t=(0,R.useRef)(e);t.current=e;let n=e!==null,r=e?.icon,i=e?.label;(0,R.useEffect)(()=>{if(!n||!r||i===void 0)return;let e=++bc;return yc=[...yc,{id:e,action:{icon:r,label:i,run:()=>t.current?.run()}}],Sc(),()=>{yc=yc.filter(t=>t.id!==e),Sc()}},[n,r,i])}function wc(){return(0,R.useSyncExternalStore)(e=>(xc.add(e),()=>xc.delete(e)),()=>yc.at(-1)?.action??null,()=>null)}var Tc=(0,R.lazy)(()=>Ft(()=>import(`./AboutDialog-30Mc1_N_.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));function Ec(e,t=!1){return N(`shrink-0 rounded-lg transition`,t?`flex h-10 w-full items-center gap-3 px-2.5 font-medium text-[0.875rem]`:`grid size-10 place-items-center`,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 Dc({children:e}){return(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e})}function Oc({me:e,labels:t}){let{project:n}=F(),r=Gm(e),i=r?e.tenant.name??void 0:void 0;return(0,z.jsxs)(Km,{me:e,placement:`bar-start`,label:n?.name??L(`nav.space`),className:e=>t?N(`flex w-full items-center gap-3 rounded-lg p-0.5 pr-2 text-left transition hover:bg-ink/10`,e&&`bg-ink/10`):N(`block rounded-lg transition`,e?`ring-2 ring-ink/80 ring-offset-2 ring-offset-sidebar`:`hover:shadow-soft`),children:[(0,z.jsx)(Wm,{project:n,name:i}),t?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-semibold text-[0.875rem] text-ink`,children:i??n?.name??L(`nav.space`)}),r?null:(0,z.jsx)(Qn,{className:`size-4 shrink-0 text-ink-4`})]}):null]})}var kc={left:ui,top:mi,right:fi,bottom:oi},Ac=[{pick:`light`,icon:$t,label:`appbar.light`},{pick:`dark`,icon:Gt,label:`appbar.dark`},{pick:null,icon:ni,label:`appbar.system`}];function jc({at:e,room:t,onClose:n}){let{position:r,labels:i}=ca(),a=Ht(),o=ea,s=(0,R.useRef)(null);Vm(s,!0,n);let[c,l]=(0,R.useState)({x:0,y:0});(0,R.useLayoutEffect)(()=>{let e=s.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 disabled:pointer-events-none disabled:opacity-50`,d=`px-3 pt-2 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`;return(0,z.jsxs)(`div`,{ref:s,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+c.x),top:Math.max(8,e.y+c.y)},onContextMenu:e=>e.preventDefault(),children:[(0,z.jsx)(`div`,{className:d,children:L(`appbar.position`)}),o.map(e=>{let t=kc[e];return(0,z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===r,className:N(u,e===r&&`text-ink`),onClick:()=>{oa({position:e}),n()},children:[(0,z.jsx)(t,{className:`size-4`}),(0,z.jsx)(`span`,{className:`flex-1`,children:L(`appbar.${e}`)}),e===r?(0,z.jsx)(pe,{className:`size-4 text-ember-strong`}):null]},e)}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":i,disabled:!(i||t),className:N(u,i&&`text-ink`),onClick:()=>{oa({labels:!i}),n()},children:[(0,z.jsx)(ci,{className:`size-4`}),(0,z.jsx)(`span`,{className:`flex-1`,children:L(`appbar.labels`)}),i?(0,z.jsx)(pe,{className:`size-4 text-ember-strong`}):null]}),(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsx)(`div`,{className:d,children:L(`appbar.theme`)}),Ac.map(({pick:e,icon:t,label:r})=>(0,z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===a,className:N(u,e===a&&`text-ink`),onClick:()=>{Ut(e),n()},children:[(0,z.jsx)(t,{className:`size-4`}),(0,z.jsx)(`span`,{className:`flex-1`,children:L(r)}),e===a?(0,z.jsx)(pe,{className:`size-4 text-ember-strong`}):null]},r))]})}function Mc(){let{pathname:e}=nt();return e===`/new`?`new`:e===`/`||e.startsWith(`/edit/`)?`home`:e===`/space/results`||e.startsWith(`/space/results/`)?`results`:e===`/settings`||e.startsWith(`/settings/`)?`settings`:e===`/space`||e.startsWith(`/space/`)?`space`:null}function Nc({me:e,labels:t,room:n}){let r=ph(),{position:i}=ca(),a=la(i),s=Mc(),[c,l]=(0,R.useState)(null),u=e=>{e.preventDefault(),l({x:e.clientX,y:e.clientY})},d=(0,R.useRef)(null),f=(0,R.useRef)(!1),p=()=>{d.current&&=(window.clearTimeout(d.current.timer),null)};return(0,z.jsxs)(`aside`,{"aria-label":qt.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),l({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:N(`flex shrink-0 select-none bg-sidebar [-webkit-touch-callout:none]`,a?`w-full flex-row items-center gap-1.5 px-2`:N(`h-full flex-col pt-2 pb-3 transition-[width] duration-200 ease-out`,t?`w-56 items-stretch px-2.5`:`w-16 items-center`),i===`bottom`&&`pt-1.5 pb-[calc(0.375rem+env(safe-area-inset-bottom))]`,i===`top`&&`pt-[calc(0.375rem+env(safe-area-inset-top))] pb-1.5`),children:[(0,z.jsx)(vc,{me:e,position:i,horizontal:a,labels:t}),(0,z.jsx)(`div`,{className:a?`ml-1`:`mt-2`,children:(0,z.jsx)(Oc,{me:e,labels:t})}),(0,z.jsxs)(le,{to:`/`,title:L(`nav.home`),"aria-label":L(`nav.home`),"aria-current":s===`home`||s===`new`?`page`:void 0,className:N(Ec(s===`home`||s===`new`,t),a?`ml-1.5`:`mt-2`),children:[(0,z.jsx)(wr,{className:`size-5 shrink-0`}),t?(0,z.jsx)(Dc,{children:L(`nav.home`)}):null]}),(0,z.jsxs)(le,{to:`/space`,title:L(`nav.sources`),"aria-label":L(`nav.sources`),"aria-current":s===`space`?`page`:void 0,className:N(Ec(s===`space`,t),a?`ml-1.5`:`mt-2`),children:[(0,z.jsx)(Ir,{className:`size-5 shrink-0`}),t?(0,z.jsx)(Dc,{children:L(`nav.sources`)}):null]}),(0,z.jsxs)(le,{to:`/space/results`,title:L(`space.results`),"aria-label":L(`space.results`),"aria-current":s===`results`?`page`:void 0,className:N(Ec(s===`results`,t),a?`ml-1.5`:`mt-2`),children:[(0,z.jsx)(Or,{className:`size-5 shrink-0`}),t?(0,z.jsx)(Dc,{children:L(`space.results`)}):null]}),r.nav.length?(0,z.jsx)(`div`,{className:N(`shrink-0 bg-border`,a?`mx-2 h-7 w-px`:N(`my-3 h-px`,t?`mx-2.5`:`w-7`))}):null,(0,z.jsx)(`nav`,{className:N(`flex min-h-0 min-w-0 flex-1 gap-1.5`,t?`items-stretch`:`items-center`,a?`flex-row overflow-x-auto`:`flex-col overflow-y-auto`),children:r.nav.map(e=>(0,z.jsx)(Lh,{of:e,children:(0,z.jsxs)(o,{to:e.to,title:e.label(),"aria-label":e.label(),className:({isActive:e})=>Ec(e,t),children:[(0,z.jsx)(e.icon,{className:`size-5 shrink-0`}),t?(0,z.jsx)(Dc,{children:e.label()}):null]})},e.serial))}),(0,z.jsxs)(`div`,{className:N(`flex shrink-0 gap-2`,a?`flex-row pl-3`:`flex-col pt-3`,t?`items-stretch`:`items-center`),children:[(0,z.jsxs)(o,{to:`/settings`,title:L(`nav.settings`),"aria-label":L(`nav.settings`),className:({isActive:e})=>Ec(e,t),children:[(0,z.jsx)(Ai,{className:`size-5 shrink-0`}),t?(0,z.jsx)(Dc,{children:L(`nav.settings`)}):null]}),(0,z.jsx)(Xm,{me:e,placement:`bar-end`,named:t})]}),c?(0,z.jsx)(jc,{at:c,room:n,onClose:()=>l(null)}):null]})}function Pc(e){return N(`glass-press relative grid h-12 w-16 place-items-center rounded-full transition-colors`,e?`text-ink`:`text-ink-3`)}var Fc=68;function Ic({index:e}){let t=(0,R.useRef)(null),n=(0,R.useRef)(e);return(0,R.useEffect)(()=>{let r=n.current;n.current=e;let i=t.current;if(!i||r===null||e===null||r===e||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let a=r*Fc,o=e*Fc;i.animate([{transform:`translateX(${a}px)`},{transform:`translateX(${(a+o)/2}px) scaleX(1.35) scaleY(0.92)`,offset:.45},{transform:`translateX(${o}px)`}],{duration:420,easing:`cubic-bezier(0.34, 1.3, 0.64, 1)`})},[e]),(0,z.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:`pointer-events-none absolute top-1 left-1 h-12 w-16 rounded-full bg-ink/12 transition-opacity`,style:{transform:`translateX(${(e??0)*Fc}px)`,opacity:e===null?0:1}})}function Lc({me:e}){let t=ph(),n=Mc(),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(!1),s=ze(),c=(0,R.useRef)(null),l=wc(),u=Zt(),{project:d}=F(),f=l??(u&&!d?.readOnly&&n!==`new`?{icon:yt,label:L(`home.new`),run:()=>s(`/new`)}:null);Vm(c,r,()=>i(!1));let{pathname:p}=nt();(0,R.useEffect)(()=>i(!1),[p]);let m=e=>!r&&n===e,h=r?2:n===`home`||n===`new`?0:n===`space`?1:n===`results`||n===`settings`?2:null,g=e=>{i(!1),s(e)},_=e=>N(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-[0.9375rem] transition`,e?`bg-accent text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`);return(0,z.jsxs)(`div`,{className:`fixed inset-x-0 bottom-[calc(0.5rem+env(safe-area-inset-bottom))] z-40 flex select-none justify-center gap-2.5 [-webkit-touch-callout:none]`,children:[(0,z.jsxs)(`nav`,{ref:c,"aria-label":qt.name,className:`liquid-glass relative flex gap-1 rounded-full p-1`,children:[(0,z.jsx)(Ic,{index:h}),(0,z.jsx)(le,{to:`/`,"aria-label":L(`nav.home`),"aria-current":n===`home`?`page`:void 0,onClick:()=>i(!1),className:Pc(m(`home`)),children:(0,z.jsx)(wr,{className:`size-[1.375rem]`})}),(0,z.jsx)(le,{to:`/space`,"aria-label":L(`nav.sources`),"aria-current":n===`space`?`page`:void 0,onClick:()=>i(!1),className:Pc(m(`space`)),children:(0,z.jsx)(Ir,{className:`size-[1.375rem]`})}),(0,z.jsx)(`button`,{type:`button`,"aria-label":L(`nav.more`),"aria-expanded":r,"aria-haspopup":`menu`,onClick:()=>i(e=>!e),className:Pc(r||n===`results`||n===`settings`),children:(0,z.jsx)(ur,{className:`size-[1.375rem]`})}),r?(0,z.jsxs)(`div`,{role:`menu`,className:`absolute right-0 bottom-full mb-3 flex w-60 animate-rise flex-col rounded-2xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:_(n===`results`),onClick:()=>g(`/space/results`),children:[(0,z.jsx)(Or,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:L(`space.results`)})]}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:_(n===`settings`),onClick:()=>g(`/settings`),children:[(0,z.jsx)(Ai,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:L(`nav.settings`)})]}),t.nav.map(e=>(0,z.jsx)(Lh,{of:e,children:(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:_(!1),onClick:()=>g(e.to),children:[(0,z.jsx)(e.icon,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label()})]})},e.serial)),(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:_(!1),onClick:()=>{i(!1),o(!0)},children:[(0,z.jsx)(Ar,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:L(`about.nav`)})]})]}):null,a?(0,z.jsx)(R.Suspense,{fallback:null,children:(0,z.jsx)(Tc,{open:!0,me:e,onClose:()=>o(!1)})}):null]}),f?(0,z.jsx)(`button`,{type:`button`,"aria-label":f.label,title:f.label,onClick:f.run,className:`liquid-glass glass-press relative grid size-14 shrink-0 place-items-center rounded-full text-ink`,children:(0,z.jsx)(f.icon,{className:`size-6`})}):null]})}var Rc=bn({route:wn().max(400),title:wn().max(200).optional(),view:wn().max(200).optional(),open:bn({kind:wn().max(60),id:wn().max(120).optional(),label:wn().max(200)}).optional(),selection:Sn(wn().max(120)).max(100).optional(),summary:wn().max(2e3).optional(),fields:Sn(bn({id:wn().max(120),label:wn().max(200),value:gn()})).max(60).optional(),plugin:wn().max(60).optional()}),zc=bn({name:wn().regex(/^[a-z][a-z0-9_]{1,62}$/),description:wn().max(2e3),parameters:hn(wn(),gn())});bn({message:wn().min(1).max(8e3),projectId:wn().max(80).optional(),page:Rc.optional(),tools:Sn(zc).max(40).default([]),debug:xn().optional(),extra:xn().optional()}),bn({ref:wn().min(1).max(40),message:wn().min(1).max(8e3)});var Bc={initial:400,min:320,max:720},Vc=`wz.readAloud`,Hc=typeof window<`u`&&`speechSynthesis`in window&&`SpeechSynthesisUtterance`in window;function Uc(){try{return localStorage.getItem(Vc)===`1`}catch{return!1}}function Wc(e){try{localStorage.setItem(Vc,e?`1`:`0`)}catch{}}function Gc(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 Kc(e,t=I,n=!1){if(!Hc||!e.trim())return;let r=window.speechSynthesis;n&&r.cancel();let i=vn(t),a=new SpeechSynthesisUtterance(e.trim().slice(0,2e3));a.lang=i;let o=Gc(i);o&&(a.voice=o),r.speak(a)}function qc(e,t=I){if(!Hc||!e.trim())return Promise.resolve();let n=window.speechSynthesis;n.cancel();let r=vn(t),i=new SpeechSynthesisUtterance(e.trim().slice(0,4e3));i.lang=r;let a=Gc(r);return a&&(i.voice=a),new Promise(e=>{i.onend=()=>e(),i.onerror=()=>e(),n.speak(i)})}function Jc(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 Yc(){Hc&&window.speechSynthesis.cancel()}function Xc(){let[e,t]=(0,R.useState)(()=>Hc&&Uc()),n=(0,R.useCallback)(e=>{t(e),Wc(e),e||Yc()},[]);return(0,R.useEffect)(()=>{Hc&&window.speechSynthesis.getVoices()},[]),(0,R.useEffect)(()=>()=>Yc(),[]),[e,n]}function Zc(e,t,n,r){let i=(0,R.useRef)(null);(0,R.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&&Kc(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`)&&Yc();for(let e of o)if(e.who===`bot`&&e.spoken!==!1){let n=r(e.key);n&&Kc(n,t)}},[e,t,n,r])}var Qc=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function $c(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 el(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 tl({names:e,previews:t,fileUrl:n}){let r=e.filter(e=>t?.[e]||n&&Qc.test(e)),i=e.filter(e=>!r.includes(e));return(0,z.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5`,children:[r.map(e=>{let r=t?.[e]??n?.(e)??``;return(0,z.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,title:e,children:(0,z.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,z.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:i.map(e=>(0,z.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,z.jsx)(d,{className:`size-3 shrink-0 text-ink-4`}),(0,z.jsx)(`span`,{className:`truncate`,children:e})]},e))}):null]})}function nl(e,t){let n=ie(),[r,i]=(0,R.useState)([]),[a,o]=(0,R.useState)(`idle`),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(null),[h,g]=(0,R.useState)(!0),_=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(e){if(_.current!==e.id){_.current=e.id,i(e.messages);return}a===`idle`&&i(t=>e.messages.length>=t.length?e.messages:t)}},[e,a]),{messages:r,phase:a,activity:l,thought:d,startedAt:p,error:s,send:async(r,s=[])=>{if(!e||!(r.trim()||s.length)||a!==`idle`)return!1;if(c(null),m(Date.now()),f(null),s.length){o(`thinking`);try{for(let t of s){let n=await fetch(Ye(`/api/studio/wizards/${e.id}/files/${encodeURIComponent(t.name)}`),{method:`PUT`,credentials:`include`,headers:{"content-type":t.type||`application/octet-stream`,"accept-language":I},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??n.statusText)}}}catch(t){return c(t.message),o(`idle`),m(null),await n.invalidateQueries({queryKey:D.wizard(e.id)}),!1}let t=`${L(`editor.attached`)}: ${s.map(e=>e.name).join(`, `)}`;r=r.trim()?`${r}\n\n${t}`:t}let l=`p-${Date.now()}`;i(e=>[...e,{id:`u-${Date.now()}`,role:`user`,content:r,previews:$c(s)},{id:l,role:`assistant`,content:``,pending:!0}]),o(`thinking`),u(null);let d=!1;try{await te(`/api/studio/wizards/${e.id}/chat`,{message:r,extra:h},(e,n)=>{if(e===`text`){let e=JSON.parse(n);i(t=>t.map(t=>t.id===l?{...t,content:t.content+e}:t))}else if(e===`activity`)u(JSON.parse(n));else if(e===`thought`)f(JSON.parse(n));else if(e===`building`)o(`building`);else if(e===`done`){d=!0;let e=JSON.parse(n);i(t=>t.map(t=>t.id===l?{...t,content:e.reply,changed:e.changed,pending:!1}:t)),e.changed&&t(e.draft,e.revision)}else e===`error`&&(d=!0,c(JSON.parse(n).message))}),d||c(L(`editor.chatBroken`))}catch(e){c(e.message)}finally{u(null),f(null),m(null),i(e=>e.filter(e=>!(e.id===l&&!e.content)).map(e=>({...e,pending:!1}))),o(`idle`),await n.invalidateQueries({queryKey:D.wizard(e.id)}),await n.invalidateQueries({queryKey:[`me`]})}return!0},fileUrl:t=>Ye(`/api/studio/wizards/${e?.id}/files/${encodeURIComponent(t)}`),extra:h,setExtra:g}}function rl(e){let[t,n]=(0,R.useState)(()=>Date.now());return(0,R.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 il(e){return e<60?`${e} s`:`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)} min`}function al({chat:e,thought:t,className:n,spinner:r=`size-3.5`}){let i=rl(e.startedAt);return(0,z.jsxs)(`div`,{className:N(`min-w-0`,n),children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(ct,{className:N(`shrink-0`,r)}),(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.activity??(e.phase===`building`?L(`editor.building`):L(`editor.thinking`))}),i===null?null:(0,z.jsx)(`span`,{className:`shrink-0 text-ink-4 tabular-nums`,children:il(i)})]}),t&&e.thought?(0,z.jsx)(`p`,{className:`mt-0.5 truncate pl-5.5 text-[0.75rem] text-ink-4`,children:e.thought}):null]})}function ol({message:e,fileUrl:t}){let{text:n,names:r}=el(e.content);return(0,z.jsxs)(`div`,{className:`ml-8 flex flex-col items-end gap-1.5 self-end`,children:[e.signal?(0,z.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4`,children:L(`assistant.signalled`)}):null,r.length?(0,z.jsx)(tl,{names:r,previews:e.previews,fileUrl:t}):null,n?(0,z.jsx)(`div`,{className:`rounded-xl rounded-br-md bg-paper-2 px-4 py-2.5 text-[0.875rem] leading-relaxed`,children:(0,z.jsx)(`span`,{className:`whitespace-pre-wrap`,children:n})}):null]})}function sl({chat:e,avatar:t,costume:n,changedLabel:r,card:i,calls:a,foot:o}){return(0,z.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.messages.map(s=>s.role===`user`?(0,z.jsx)(ol,{message:s,fileUrl:e.fileUrl},s.id):(0,z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,z.jsx)(`div`,{className:`shrink-0`,children:(0,z.jsx)(cn,{kind:t,costume:n,size:28,interactive:!1})}),(0,z.jsxs)(`div`,{className:`min-w-0 pt-0.5 text-[0.875rem]`,children:[s.source===`mcp`?(0,z.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1.5 text-[0.75rem] text-ink-3`,children:[(0,z.jsx)(Lt,{className:`size-3`}),` `,L(`editor.viaClient`,{client:s.client??`MCP`})]}):null,a?a(s):null,s.content?(0,z.jsx)(xt,{text:s.content,className:`text-[0.875rem]`}):null,i&&s.cards?.length?(0,z.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:s.cards.map(e=>(0,z.jsx)(R.Fragment,{children:i(e)},e.id))}):null,s.pending?(0,z.jsx)(al,{chat:e,thought:!0,className:`mt-1 text-[0.8125rem] text-ink-3`}):null,s.changed?(0,z.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,z.jsx)(Xe,{className:`size-3`}),` `,r]}):null,o?o(s):null]})]},s.id))})}var cl=`wizards.editorThread.height`,ll=320,ul=120,dl=()=>Math.max(ul,window.innerHeight-260);function fl(){let[e,t]=(0,R.useState)(()=>{try{let e=Number(localStorage.getItem(cl));return e?Math.min(Math.max(e,ul),dl()):ll}catch{return ll}});return{height:e,set:e=>{let n=Math.round(Math.min(Math.max(e,ul),dl()));t(n);try{localStorage.setItem(cl,String(n))}catch{}}}}function pl({open:e,height:t,onHeight:n,onToggle:r}){let i=(0,R.useRef)(null);return(0,z.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-orientation":`horizontal`,"aria-valuenow":t,"aria-valuemin":ul,"aria-label":L(`editor.threadGrip`),title:L(`editor.threadGrip`),onPointerDown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget.setPointerCapture(n.pointerId),i.current={y:n.clientY,height:e?t:0,moved:!1})},onPointerMove:t=>{let a=i.current;!a||!a.moved&&Math.abs(t.clientY-a.y)<4||!(e||a.moved)&&t.clientY>a.y||(e||a.moved||r(!0),a.moved=!0,n(a.height+(a.y-t.clientY)))},onPointerUp:()=>{let t=i.current&&!i.current.moved;i.current=null,t&&r(!e)},onPointerCancel:()=>{i.current=null},onKeyDown:i=>{if(i.key===`ArrowUp`||i.key===`ArrowDown`){if(i.preventDefault(),!e){i.key===`ArrowUp`&&r(!0);return}n(t+(i.key===`ArrowUp`?32:-32))}else(i.key===`Enter`||i.key===` `)&&(i.preventDefault(),r(!e))},className:`group flex h-3.5 shrink-0 cursor-row-resize touch-none items-center justify-center outline-none`,children:(0,z.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 ml({chat:e,avatar:t,costume:n,hello:r=L(`editor.chatHello`),placeholder:i=L(`editor.composer`),changedLabel:a=L(`editor.flowChanged`),compact:o,intro:s,closed:c,card:l,foldOn:u}){let[f,p]=(0,R.useState)(!1);(0,R.useEffect)(()=>{u&&p(!1)},[u]);let m=fl(),h=(0,R.useRef)(null),g=(0,R.useRef)(null);(0,R.useEffect)(()=>{h.current?.scrollTo({top:h.current.scrollHeight,behavior:`smooth`})},[e.messages,e.phase]);let _=!o||f,v=e.messages.at(-1),[y,x]=(0,R.useState)(!1),S=(0,R.useRef)(0),C=e=>!c&&e.dataTransfer.types.includes(`Files`);return(0,z.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,onDragEnter:e=>{C(e)&&(e.preventDefault(),S.current+=1,x(!0))},onDragOver:e=>{C(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)},onDragLeave:()=>{S.current=Math.max(0,S.current-1),S.current===0&&x(!1)},onDrop:e=>{C(e)&&(e.preventDefault(),S.current=0,x(!1),g.current?.add(Array.from(e.dataTransfer.files).map(it)),g.current?.focus())},children:[y?(0,z.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,z.jsx)(d,{className:`size-6`}),L(`editor.dropToAttach`)]}):null,(0,z.jsxs)(`div`,{className:o?N(`mb-2 flex min-h-0 flex-col overflow-hidden rounded-2xl bg-card shadow-overlay ring-1 ring-border`,!(v||e.error)&&`hidden`):`contents`,children:[o&&(v||e.error)?(0,z.jsx)(pl,{open:f,height:m.height,onHeight:m.set,onToggle:p}):null,o&&(v||e.error)?(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":f,"aria-label":L(`editor.thread`),onClick:()=>p(e=>!e),className:`flex items-center gap-2 px-4 pb-0.5 text-left text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[!(e.error||f)&&v?.pending?(0,z.jsx)(al,{chat:e,className:`flex-1`}):(0,z.jsx)(`span`,{className:N(`min-w-0 flex-1 truncate`,e.error&&`text-rose`),children:e.error??(f?L(`editor.thread`):v?.content)}),f?(0,z.jsx)(b,{className:`size-4 shrink-0`}):(0,z.jsx)(Xn,{className:`size-4 shrink-0`})]}):null,(0,z.jsxs)(`div`,{ref:h,className:N(`min-h-0 flex-1 overflow-y-auto px-5 py-5`,!_&&`hidden`),style:o?{height:m.height,flex:`none`}:void 0,children:[e.messages.length===0&&!c?s??(0,z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,z.jsx)(cn,{kind:t,costume:n,size:32,interactive:!1}),(0,z.jsx)(`p`,{className:`pt-1 text-[0.875rem] text-ink-2 leading-relaxed`,children:r})]}):null,(0,z.jsx)(sl,{chat:e,avatar:t,costume:n,changedLabel:a,card:l}),e.error?(0,z.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-3 py-2 text-[0.8125rem] text-rose`,children:e.error}):null]})]}),c?(0,z.jsx)(`p`,{className:`m-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:c}):(0,z.jsx)(et,{ref:g,floating:o,className:o?void 0:`p-3`,placeholder:i,disabled:e.phase!==`idle`,onSend:(t,n)=>e.send(t,n),effort:e.setExtra?{on:!!e.extra,onChange:e.setExtra}:void 0})]})}var hl=D.cloudSync();function gl(e){return e?.mode===`local`&&!!e.account&&Qi(e.features,`twoWaySync`)}function _l(){let e=Xt(),t=gl(e.data),n=Qi(e.data?.features??{},`liveChanges`);return ot({queryKey:hl,queryFn:()=>_.get(`/api/studio/sync`),enabled:t,refetchInterval:t?n?12e4:2e4:!1})}function vl(e){let t=ie(),n=Qi(Xt().data?.features??{},`liveChanges`);return Nt({mutationFn:e,onSuccess:e=>{e&&typeof e==`object`&&`spaces`in e?t.setQueryData(hl,e):t.invalidateQueries({queryKey:hl}),!n&&(t.invalidateQueries({queryKey:[`wizard`]}),t.invalidateQueries({queryKey:[`space-page`]}),t.invalidateQueries({queryKey:[`space-table`]}))}})}var yl=e=>new Date(e).toLocaleString(I===`de`?`de-AT`:`en-GB`,{day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`}),bl={update_here:`cloudSync.error.updateHere`,update_cloud:`cloudSync.error.updateCloud`,unreachable:`cloudSync.error.unreachable`,signed_out:`cloudSync.error.signedOut`,refused:`cloudSync.error.refused`};function xl(e){let t=e.reason?bl[e.reason]:void 0;return t?L(t):e.message}var Sl={space:`cloudSync.kind.space`,wizard:`cloudSync.kind.wizard`,translation:`cloudSync.kind.translation`,message:`cloudSync.kind.message`,page:`cloudSync.kind.page`,table:`cloudSync.kind.table`,row:`cloudSync.kind.row`,category:`cloudSync.kind.category`,file:`cloudSync.kind.file`,connector:`cloudSync.kind.connector`},Cl={title:`cloudSync.word.title`,markdown:`cloudSync.word.text`,description:`cloudSync.word.description`,steps:`cloudSync.word.steps`,fields:`cloudSync.word.fields`,instructions:`cloudSync.word.instructions`,prompt:`cloudSync.word.prompt`,label:`cloudSync.word.label`,cells:`cloudSync.word.cells`,columns:`cloudSync.word.columns`,name:`cloudSync.word.name`,brand:`cloudSync.word.brand`,facts:`cloudSync.word.facts`,themes:`cloudSync.word.themes`,files:`cloudSync.word.files`,options:`cloudSync.word.options`,categories:`cloudSync.word.categories`,values:`cloudSync.word.values`,texts:`cloudSync.word.texts`,page:`cloudSync.word.page`};function wl(e){return e.split(` › `).map(e=>e.startsWith(`“`)||!Cl[e]?e:L(Cl[e])).join(` › `)}var Tl=new Map,El=new Set;function Dl(e){(0,R.useEffect)(()=>{if(e){Tl.set(e,(Tl.get(e)??0)+1);for(let e of El)e();return()=>{Tl.set(e,(Tl.get(e)??1)-1),Tl.get(e)||Tl.delete(e);for(let e of El)e()}}},[e])}function Ol(){let[,e]=(0,R.useState)(0);return(0,R.useEffect)(()=>{let t=()=>e(e=>e+1);return El.add(t),()=>{El.delete(t)}},[]),[...Tl.keys()]}function kl(){let e=_l(),t=vl(()=>_.post(`/api/studio/sync/now`,{})),n=vl(e=>_.put(`/api/studio/sync/spaces/${e.id}`,{on:e.on})),r=e.data;return r?(0,z.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,z.jsx)(vt,{title:L(`cloudSync.title`),hint:L(`cloudSync.hint`),action:(0,z.jsxs)(O,{variant:`secondary`,size:`sm`,busy:t.isPending,onClick:()=>t.mutate(void 0),children:[(0,z.jsx)(ye,{className:`size-3.5`}),` `,L(`cloudSync.now`)]}),children:(0,z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:r.spaces.map(e=>(0,z.jsxs)(`li`,{className:`flex items-start gap-4 py-3 first:pt-0 last:pb-0`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{className:`font-medium text-[0.9375rem]`,children:e.name}),(0,z.jsx)(Al,{space:e,refusals:r.refusals[e.spaceId]})]}),(0,z.jsx)(tt,{checked:e.on,label:L(`cloudSync.spaceOn`),disabled:n.isPending,onChange:t=>n.mutate({id:e.spaceId,on:t})})]},e.spaceId))})}),r.conflicts.length?(0,z.jsx)(jl,{view:r}):null,r.merges.length?(0,z.jsx)(Pl,{merges:r.merges}):null]}):e.isLoading?(0,z.jsx)(ct,{className:`size-5`}):null}function Al({space:e,refusals:t}){return e.on?(0,z.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[e.error?(0,z.jsxs)(`p`,{className:`text-[0.8125rem] text-rose`,children:[xl(e.error),e.error.reason===`refused`&&t?.length?` ${t.join(` · `)}`:``]}):e.waiting?(0,z.jsx)(T,{tone:`warn`,children:L(`cloudSync.state.waiting`,{count:e.waiting})}):e.conflicts?null:(0,z.jsx)(T,{tone:`live`,children:L(`cloudSync.state.ok`)}),e.conflicts?(0,z.jsx)(T,{tone:`ember`,children:L(`cloudSync.state.conflicts`,{count:e.conflicts})}):null,e.syncedAt?(0,z.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:L(`cloudSync.state.at`,{when:yl(e.syncedAt)})}):null]}):(0,z.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:L(e.here?`cloudSync.state.hereOnly`:`cloudSync.state.cloudOnly`)})}function jl({view:e}){let t=vl(e=>_.post(`/api/studio/sync/spaces/${e}/keep-cloud`,{})),n=[...new Set(e.conflicts.map(e=>e.spaceId))];return(0,z.jsx)(vt,{title:L(`cloudSync.conflicts`),hint:L(`cloudSync.conflictsHint`),action:e.conflicts.length>1&&n.length===1?(0,z.jsx)(O,{variant:`secondary`,size:`sm`,busy:t.isPending,onClick:()=>t.mutate(n[0]),children:L(`cloudSync.keepCloudAll`)}):null,children:(0,z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:e.conflicts.map(e=>(0,z.jsx)(`li`,{className:`py-4 first:pt-0 last:pb-0`,children:(0,z.jsx)(Nl,{conflict:e})},e.id))})})}var Ml=e=>e===void 0?L(`cloudSync.removed`):typeof e==`string`?e:JSON.stringify(e,null,1);function Nl({conflict:e}){let[t,n]=(0,R.useState)(!1),[r,i]=(0,R.useState)(()=>e.conflicts.map(()=>`local`)),[a,o]=(0,R.useState)(null),s=vl(t=>_.post(`/api/studio/sync/conflicts/${e.id}/resolve`,t)),c=Nt({mutationFn:()=>_.post(`/api/studio/sync/conflicts/${e.id}/propose`,{}),onSuccess:e=>o(e.record)}),l=e.deleted===`remote`?L(`cloudSync.conflict.deletedRemote`):e.deleted===`local`?L(`cloudSync.conflict.deletedLocal`):L(`cloudSync.conflict.both`);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`p`,{className:`font-medium text-[0.9375rem]`,children:[(0,z.jsxs)(`span`,{className:`text-ink-3`,children:[L(Sl[e.kind]),` · `]}),e.title]}),(0,z.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:l})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(O,{size:`sm`,variant:`secondary`,busy:s.isPending,onClick:()=>s.mutate({take:`remote`}),children:L(`cloudSync.keepCloud`)}),(0,z.jsx)(O,{size:`sm`,variant:`secondary`,busy:s.isPending,onClick:()=>s.mutate({take:`local`}),children:L(`cloudSync.keepLocal`)}),e.conflicts.length?(0,z.jsx)(O,{size:`sm`,variant:`ghost`,onClick:()=>n(e=>!e),children:L(`cloudSync.pick`)}):null,e.deleted?null:(0,z.jsx)(O,{size:`sm`,variant:`ghost`,busy:c.isPending,onClick:()=>c.mutate(),children:L(`cloudSync.ai`)})]}),t?(0,z.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg bg-paper-2 p-3`,children:[e.conflicts.map((e,t)=>(0,z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,z.jsx)(`p`,{className:`font-medium text-[0.8125rem]`,children:wl(e.label)}),[`local`,`remote`].map(n=>(0,z.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-[0.8125rem]`,children:[(0,z.jsx)(`input`,{type:`radio`,className:`mt-1`,checked:r[t]===n,onChange:()=>i(e=>e.map((e,r)=>r===t?n:e))}),(0,z.jsxs)(`span`,{className:`min-w-0`,children:[(0,z.jsxs)(`span`,{className:`text-ink-3`,children:[L(n===`local`?`cloudSync.here`:`cloudSync.cloud`),`:`,` `]}),(0,z.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:Ml(e[n])})]})]},n))]},e.label)),(0,z.jsx)(`div`,{children:(0,z.jsx)(O,{size:`sm`,busy:s.isPending,onClick:()=>s.mutate({choices:r.map(e=>({take:e}))}),children:L(`cloudSync.apply`)})})]}):null,c.isError?(0,z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:L(`cloudSync.aiFailed`,{error:c.error.message})}):null,a?(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-paper-2 p-3`,children:[(0,z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2`,children:L(`cloudSync.aiProposal`)}),(0,z.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-[0.75rem] text-ink-2`,children:JSON.stringify(a,null,2)}),(0,z.jsx)(`div`,{children:(0,z.jsx)(O,{size:`sm`,busy:s.isPending,onClick:()=>s.mutate({record:a}),children:L(`cloudSync.aiTake`)})})]}):null,s.isError?(0,z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:s.error.message}):null]})}function Pl({merges:e}){return(0,z.jsx)(vt,{title:L(`cloudSync.merges`),hint:L(`cloudSync.mergesHint`),children:(0,z.jsx)(`ul`,{className:`flex flex-col divide-y divide-border-soft`,children:e.map(e=>(0,z.jsx)(`li`,{className:`py-4 first:pt-0 last:pb-0`,children:(0,z.jsx)(Fl,{merge:e})},e.id))})})}function Fl({merge:e,compact:t}){let n=vl(()=>_.post(`/api/studio/sync/merges/seen`,{ids:[e.id]})),r=vl(t=>_.post(`/api/studio/sync/merges/${e.id}/undo`,{take:t}));return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsxs)(`div`,{className:`text-[0.8125rem]`,children:[(0,z.jsx)(`p`,{className:`font-medium text-[0.9375rem]`,children:t?L(`cloudSync.merged`):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`text-ink-3`,children:[L(Sl[e.kind]),` · `]}),e.title]})}),e.local.length?(0,z.jsx)(`p`,{className:`mt-0.5 text-ink-3`,children:L(`cloudSync.mergedHere`,{places:e.local.map(wl).join(`, `)})}):null,e.remote.length?(0,z.jsx)(`p`,{className:`mt-0.5 text-ink-3`,children:L(`cloudSync.mergedThere`,{places:e.remote.map(wl).join(`, `)})}):null]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(O,{size:`sm`,variant:`secondary`,busy:n.isPending,onClick:()=>n.mutate(void 0),children:L(`cloudSync.ok`)}),(0,z.jsx)(O,{size:`sm`,variant:`ghost`,busy:r.isPending,onClick:()=>r.mutate(`local`),children:L(`cloudSync.undoLocal`)}),(0,z.jsx)(O,{size:`sm`,variant:`ghost`,busy:r.isPending,onClick:()=>r.mutate(`remote`),children:L(`cloudSync.undoRemote`)})]})]})}function Il({kind:e,item:t}){let n=_l(),r=n.data?.conflicts.find(n=>n.kind===e&&n.item===t),i=n.data?.merges.find(n=>n.kind===e&&n.item===t);return Dl(r?r.id:null),r?(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-border-soft border-b bg-amber-tint px-4 py-2 text-[0.8125rem] text-ink-2 sm:px-6`,children:[(0,z.jsx)(er,{className:`size-4 shrink-0 text-amber`}),(0,z.jsx)(`p`,{className:`min-w-0 flex-1`,children:L(`cloudSync.conflict.both`)}),(0,z.jsx)(le,{to:`/settings/cloud`,className:`shrink-0 underline transition hover:text-ink`,children:L(`cloudSync.settle`)})]}):i?(0,z.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 border-border-soft border-b bg-moss-tint px-4 py-2 sm:px-6`,children:[(0,z.jsx)(vr,{className:`mt-1 size-4 shrink-0 text-moss`}),(0,z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,z.jsx)(Fl,{merge:i,compact:!0})})]}):null}function Ll({me:e}){let t=_l(),n=Ol(),r=(t.data?.conflicts??[]).filter(e=>!n.includes(e.id)).length;return!gl(e)||!r?null:(0,z.jsxs)(`div`,{className:`flex items-center gap-3 border-border-soft border-b bg-amber-tint px-4 py-2 text-[0.8125rem] text-ink-2 sm:px-6`,children:[(0,z.jsx)(er,{className:`size-4 shrink-0 text-amber`}),(0,z.jsx)(`p`,{className:`min-w-0 flex-1`,children:L(`cloudSync.bar`,{count:r})}),(0,z.jsx)(le,{to:`/settings/cloud`,className:`shrink-0 underline transition hover:text-ink`,children:L(`cloudSync.settle`)})]})}function Rl(e,t){let n=e?.mode===`managed`&&Qi(e.features,`organizationSettings`),r=L(`settings.groupOrganization`),i=n?L(`settings.groupStudio`):void 0,a=e=>i?{...e,group:i}:e;return[...n?[]:[{id:`account`,label:L(`account.title`),icon:Wi,menu:!0}],...n?[{id:`general`,label:L(`orgSettings.general`),icon:Kn,menu:!1,group:r},{id:`members`,label:L(`orgSettings.members`),icon:Ki,menu:!0,group:r},{id:`credits`,label:L(`credits.title`),icon:Vt,menu:!1,group:r},{id:`usage`,label:L(`credits.usage`),icon:Ct,menu:!1,group:r},{id:`invoices`,label:L(`credits.invoices`),icon:Si,menu:!1,group:r},{id:`keys`,label:L(`orgSettings.keys`),icon:Mr,menu:!1,group:r}]:e?.mode===`managed`&&Qi(e.features,`teamPlans`)?[{id:`organization`,label:L(`organization.title`),icon:Ki,menu:!0}]:[],...gl(e)?[a({id:`cloud`,label:L(`cloudSync.title`),icon:nr,menu:!1})]:[],a({id:`connectors`,label:L(`connectors.title`),icon:Lt,menu:!0}),a({id:`models`,label:L(`local.title`),icon:or,menu:!0}),a({id:`integrate`,label:L(`integrate.nav`),icon:Jn,menu:!0}),...t.sections.map(e=>a({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?[a({id:`plugins`,label:L(`plugins.title`),icon:Hn,menu:!1})]:[],{id:`about`,label:L(`about.nav`),icon:Ar,menu:!1}]}function zl(){return[{id:`profile`,label:L(`konto.profile`),icon:Wi,menu:!0},{id:`orgs`,label:L(`konto.organizations`),icon:Kn,menu:!1},{id:`apps`,label:L(`konto.apps`),icon:Lt,menu:!1}]}var Bl=`wizards.assistant`,Vl={place:`center`,height:null,dev:!1};function Hl(){try{let e=JSON.parse(localStorage.getItem(Bl)??`null`);return{place:e?.place===`right`?`right`:`center`,height:typeof e?.height==`number`?e.height:null,dev:e?.dev===!0}}catch{return Vl}}var Ul=Hl(),Wl=new Set,Gl=()=>{for(let e of Wl)e()},Kl=e=>(Wl.add(e),()=>Wl.delete(e));function ql(e){Ul={...Ul,...e};try{localStorage.setItem(Bl,JSON.stringify(Ul))}catch{}Gl()}function Jl(){return(0,R.useSyncExternalStore)(Kl,()=>Ul)}var Yl=64,Xl=12,Zl=null,Ql=new Set;function $l(e){Zl=e;for(let e of Ql)e()}function eu(){return(0,R.useSyncExternalStore)(e=>(Ql.add(e),()=>Ql.delete(e)),()=>Zl)}var tu=e=>Math.min(600,e-24);function nu(e,t,n){let r=tu(e.width),i=e.height-Xl-t;return{center:{left:(e.width-r)/2,top:i,width:r,height:t},right:e.width>=r+24+240?{left:e.width-Xl-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 ru=e=>e>=tu(e)+24+240;function iu(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=tu(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=nu(s,u,t.sidebar),m=s.height-(f+u)<Yl,h=s.width-(d+l)<Yl||window.innerWidth-r.clientX<Yl,g;if(p.sidebar&&h&&(!m||window.innerWidth-r.clientX<Yl))g=`sidebar`;else{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:p[g]??o?.spot??null},$l(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($l(null),!a){t.onClick?.();return}r?.zone&&t.onDrop(r.zone)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)}var au=null,ou=new Set;function U(e){au=e;for(let e of ou)e()}function su(){return(0,R.useSyncExternalStore)(e=>(ou.add(e),()=>ou.delete(e)),()=>au)}var cu=null,lu=new Set;function uu(e){cu=e;for(let e of lu)e()}function du(){return(0,R.useSyncExternalStore)(e=>(lu.add(e),()=>lu.delete(e)),()=>cu)}var fu=1300,pu=3e3;function mu(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}var hu=typeof window<`u`&&(!!mu()||!!navigator.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`);function gu(e){return e.toLowerCase().split(/[\s\-–—/]+/).map(e=>e.replace(/[^\p{L}\p{N}]/gu,``)).filter(Boolean)}function _u(e,t){let n=new Set(gu(t)),r=gu(e);return r.length<2||r.filter(e=>n.has(e)).length/r.length>=.75}function vu(e){let[t,n]=(0,R.useState)(`off`),[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(0),[d,f]=(0,R.useState)(``),[p,m]=(0,R.useState)(null),h=(0,R.useRef)(`off`),g=(0,R.useRef)(!1),v=(0,R.useRef)(null),y=(0,R.useRef)(null),b=(0,R.useRef)(null),x=(0,R.useRef)(``),S=(0,R.useRef)({text:``,until:0}),C=(0,R.useRef)(``),ee=(0,R.useRef)(null),w=(0,R.useRef)(null),te=(0,R.useRef)(e);te.current=e;let T=(0,R.useRef)(p);T.current=p;let E=(0,R.useCallback)(e=>{h.current=e,n(e)},[]),ne=(0,R.useCallback)(()=>{Yc(),b.current&&=(b.current.pause(),null),x.current=``},[]),re=(0,R.useCallback)(()=>{ee.current&&=(clearTimeout(ee.current),null);let e=C.current.trim();C.current=``,f(``),e&&h.current!==`off`&&(E(`thinking`),w.current=te.current.messages.at(-1)?.id??null,te.current.send(e).then(e=>{!e&&h.current===`thinking`&&E(`listening`)}))},[E]),ie=(0,R.useCallback)((e,t)=>{if(!(g.current||h.current===`off`||h.current===`thinking`)){if(h.current===`speaking`){if(_u(e,x.current))return;ne(),E(`listening`)}else if(Date.now()<S.current.until&&_u(e,S.current.text))return;f(e),t&&(C.current=`${C.current} ${e}`.trim(),f(C.current)),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(re,fu)}},[re,ne,E]),ae=(0,R.useCallback)(()=>{let e=mu();if(!e||v.current)return;let t=new e;t.continuous=!0,t.interimResults=!0,t.lang=dn[I],t.onresult=e=>{let t=``;for(let n=e.resultIndex;n<e.results.length;n++){let r=e.results[n];r.isFinal?ie(r[0].transcript,!0):t+=r[0].transcript}t.trim()&&ie(`${C.current} ${t}`.trim(),!1)},t.onerror=e=>{(e.error===`not-allowed`||e.error===`service-not-allowed`)&&c(`denied`)},t.onend=()=>{v.current=null,h.current!==`off`&&!g.current&&setTimeout(ae,200)},v.current=t;try{t.start()}catch{v.current=null}},[ie]),oe=(0,R.useCallback)((e,t)=>{let n=null,r=[],i=0,a=new Uint8Array(t.fftSize),o=()=>{if(h.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&&!g.current&&h.current===`listening`){if(i=Date.now(),!n){let t=Date.now()<S.current.until?S.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&&h.current!==`off`){E(`thinking`);try{let{text:n}=await _.upload(`/api/studio/transcribe`,e);if(t&&_u(n,t)){E(`listening`);return}C.current=n,re()}catch(e){c(e.message),E(`listening`)}}},n.start()}}else n&&Date.now()-i>fu&&n.stop();setTimeout(o,100)};o()},[re,E]),se=(0,R.useCallback)(async()=>{if(h.current!==`off`)return;c(null);let e;try{e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch{c(`denied`);return}y.current=e,w.current=te.current.messages.at(-1)?.id??null,E(`listening`),o(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(h.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);u(g.current?0:Math.min(1,e*3)),setTimeout(i,90)};i(),mu()?ae():oe(e,n),T.current||_.get(`/api/studio/assistant/voice`).then(({way:e})=>m({way:e,natural:e===`key`||e===`local`})).catch(()=>m({way:`none`,natural:!1}))},[ae,oe,E]),ce=(0,R.useCallback)(()=>{E(`off`),o(null),f(``),u(0),C.current=``,ee.current&&clearTimeout(ee.current),v.current?.abort(),v.current=null,ne();for(let e of y.current?.getTracks()??[])e.stop();y.current=null},[ne,E]),le=(0,R.useCallback)(()=>{let e=!g.current;g.current=e,i(e);for(let t of y.current?.getAudioTracks()??[])t.enabled=!e;e?(v.current?.abort(),v.current=null):h.current!==`off`&&ae()},[ae]),ue=(0,R.useCallback)(async e=>{let t=Jc(e);if(!t){E(`listening`);return}E(`speaking`),x.current=t;let n=T.current?.natural&&T.current.way!==`none`,r=!1;if(n)try{let e=await fetch(Ye(`/api/studio/assistant/speak`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({text:t.slice(0,4e3)})});if(e.ok&&h.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&&h.current===`speaking`&&await qc(t,I),b.current=null,x.current=``,h.current===`speaking`&&(S.current={text:t,until:Date.now()+pu},C.current=``,f(``),v.current?.abort(),E(`listening`))},[E]);return(0,R.useEffect)(()=>{if(t!==`thinking`||e.phase!==`idle`)return;let n=e.messages.at(-1);n?.role===`assistant`&&n.id!==w.current&&!n.pending?(w.current=n.id,ue(n.content)):e.error&&E(`listening`)},[t,e.phase,e.messages,e.error,ue,E]),(0,R.useEffect)(()=>()=>ce(),[ce]),{state:t,muted:r,since:a,error:s,level:l,heard:d,voice:p,setNatural:e=>m(t=>t&&{...t,natural:e}),start:se,end:ce,toggleMute:le}}var yu=new Map,bu={},xu=new Set;function Su(){bu=Object.assign({},...yu.values());for(let e of xu)e()}function Cu(){return(0,R.useSyncExternalStore)(e=>(xu.add(e),()=>xu.delete(e)),()=>bu)}function wu(){for(let e of yu.values())e.onChanged?.()}function Tu(e){let t=(0,R.useId)(),n=(0,R.useRef)(e);n.current=e;let{onChanged:r,...i}=e,a=JSON.stringify(i);(0,R.useEffect)(()=>{yu.set(t,{...JSON.parse(a),onChanged:()=>n.current.onChanged?.()}),Su()},[t,a]),(0,R.useEffect)(()=>()=>{yu.delete(t),Su()},[t])}function Eu(){let e=document.getElementById(Qm);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 Du(){let{title:e,hello:t,about:n,placeholder:r,suggestions:i,compact:a,onChanged:o,...s}=bu,c=Pm().map(e=>e.label),l=window.location.pathname,u=l.startsWith(lt)?l.slice(lt.length)||`/`:l,d=Eu(),f=(e,t)=>e&&e.length>t?`${e.slice(0,t-1)}…`:e;return{route:`${u}${window.location.search}`.slice(0,400),...c.length?{title:f(c.join(` / `),200)}:{},...d?{view:f(d,200)}:{},...s.open?{open:{kind:s.open.kind.slice(0,60),...s.open.id?{id:s.open.id.slice(0,120)}:{},label:f(s.open.label,200)??``}}:{},...s.selection?{selection:s.selection.slice(0,100).map(e=>e.slice(0,120))}:{},...s.summary?{summary:f(s.summary,2e3)}:{},...s.fields?{fields:s.fields.slice(0,60).map(e=>({id:e.id.slice(0,120),label:f(e.label,200)??``,value:e.value}))}:{},...s.plugin?{plugin:s.plugin}:{}}}var Ou=()=>document.getElementById(`studio-scroll`)??document.body,ku=`[data-assist],h1,h2,h3,h4,button,a[href],input,textarea,select,[role=switch],[role=checkbox],[role=tab],[contenteditable=true]`,Au=150,ju=0;function Mu(e){return e.dataset.assist?e.dataset.assist:(e.dataset.assistRef||(ju+=1,e.dataset.assistRef=`e${ju}`),e.dataset.assistRef)}var Nu=(e,t=120)=>(e??``).replace(/\s+/g,` `).trim().slice(0,t);function Pu(e){if(e.dataset.assistLabel)return Nu(e.dataset.assistLabel);let t=e.getAttribute(`aria-label`);if(t)return Nu(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 Nu(t.getAttribute(`data-assist-section`)||t.textContent)}if(e.id){let t=document.querySelector(`label[for="${CSS.escape(e.id)}"]`);if(t)return Nu(t.textContent)}let n=e.closest(`label`);if(n&&n!==e)return Nu(n.textContent);let r=e.parentElement?.querySelector(`label`);return r&&(e.matches(`input,textarea,select`)||e.getAttribute(`role`)===`switch`)?Nu(r.textContent):Nu(e.textContent||e.placeholder||e.getAttribute(`title`)||``)}function Fu(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 Nu(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 Nu(e.textContent,600)}function Iu(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 Lu(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 Ru(e){let t=e.getBoundingClientRect();return t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth}function zu(e,t){let n=[];for(let r of e.querySelectorAll(ku)){if(n.length>=Au)break;if(!Lu(r)||t&&!Ru(r))continue;let e=Iu(r),i=Pu(r);if(!i&&e!==`field`)continue;let a=e===`field`?Fu(r):void 0,o=r.disabled||r.getAttribute(`aria-disabled`)===`true`;n.push({ref:Mu(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 Bu(e){let t=Ou(),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(ku)){if(!Lu(e))continue;let t=Pu(e).toLowerCase();if(t===i)return e;!a&&t.includes(i)&&(a=e)}return a}var Vu=e=>({error:`Nothing on the page is "${e}". look_at_page lists what is there.`}),Hu=null,Uu=0,Wu=new Set;function Gu(e){Hu=e;for(let e of Wu)e()}function Ku(){return(0,R.useSyncExternalStore)(e=>(Wu.add(e),()=>Wu.delete(e)),()=>Hu)}var qu=null,Ju=()=>[];function Yu(e,t){qu=e,Ju=t}function Xu(e){let t=e.split(/[?#]/)[0]||`/`;return Ju().some(e=>RegExp(`^${e.split(`/`).map(e=>e.startsWith(`:`)?e.endsWith(`?`)?`(?:[^/]+)?`:`[^/]+`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`)}/?$`).test(t))}var Zu=()=>new Promise(e=>setTimeout(e,450));function Qu(e){return!e.startsWith(`/`)||e.startsWith(`//`)||/^\/(api|w|s)\//.test(e)||!(qu&&Xu(e))?!1:(qu(e),!0)}var $u={type:`string`,description:`A ref or area from look_at_page, or the label`},ed=new Map;function td(){return[...ed.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}var W=[{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(`/`)&&Xu(t)?(qu?.(t),await Zu(),{opened:t,pageTools:td()}):{error:`The studio has no page "${t}".`,pages:Ju()}}},{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:$u,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=Bu(String(e??``));return a?(a.scrollIntoView({behavior:`smooth`,block:`center`}),await Zu(),Uu+=1,Gu({id:Uu,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:Pu(a)}):Vu(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(Ou().scrollTop),items:zu(Ou(),!0),pageTools:td()})},{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:$u},required:[`target`]},run:({target:e})=>{let t=Bu(String(e??``));return t?{area:Pu(t),items:zu(t,!1),text:Nu(t.innerText,4e3)}:Vu(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:$u,value:{type:[`string`,`number`,`boolean`]}},required:[`target`,`value`]},run:async({target:e,value:t})=>{let n=Bu(String(e??``));if(!n)return Vu(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)||Nu(e.textContent).toLowerCase()===String(t).toLowerCase());if(!e)return{error:`No such choice.`,choices:[...n.options].map(e=>Nu(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:Pu(n),value:Fu(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=ed.get(String(e??``));return n?n.run(t??{}):{error:`The page offers no tool "${String(e)}".`,pageTools:td()}}},{name:`scroll_to`,description:`Scroll an element of the page into view.`,parameters:{type:`object`,properties:{target:$u},required:[`target`]},run:async({target:e})=>{let t=Bu(String(e??``));return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),await Zu(),{at:Pu(t)}):Vu(String(e))}}];function G(e,t,n){let r=(0,R.useRef)(n);r.current=n;let i=JSON.stringify(t);(0,R.useEffect)(()=>{if(W.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 ed.set(e,{name:e,description:t,parameters:n??{type:`object`,properties:{}},run:e=>r.current(e)}),()=>{ed.delete(e)}},[e,i])}function K(){return[...W,...ed.values()].map(({name:e,description:t,parameters:n})=>({name:e,description:t,parameters:n}))}async function q(e,t){let n=W.find(t=>t.name===e)??ed.get(e);if(!n)return null;try{return{result:await n.run(t??{})}}catch(e){return{result:{error:e.message}}}}var J=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 nd(e){return e.type.startsWith(`image/`)&&/logo/i.test(e.name)?`logo`:/^(image|video|audio)\//.test(e.type)?`asset`:`document`}var rd=0,id=e=>`${e}-${Date.now()}-${++rd}`,ad=(0,R.createContext)(null);function od(){return(0,R.useContext)(ad)}function sd(){let e=ph(),t=Xt(),n=(0,R.useRef)([]);return n.current=[`/`,`/new`,`/edit/:id`,`/space`,`/space/:group`,`/settings`,...Rl(t.data,e).map(e=>`/settings/${e.id}`),...e.pages.map(e=>e.path)],(0,R.useCallback)(()=>n.current,[])}function cd({children:e}){let t=ie(),n=Xt(),r=!!n.data,{project:i}=F(),a=ze(),o=sd();(0,R.useEffect)(()=>{Yu(e=>a(e),o)},[a,o]);let s=ot({queryKey:[`assistant-chat`],queryFn:()=>_.get(`/api/studio/assistant/chat`),enabled:r,staleTime:1/0}),c=ot({queryKey:[`assistant-layout`],queryFn:()=>_.get(`/api/studio/assistant/layout`),enabled:r,staleTime:1/0}),[l,u]=(0,R.useState)([]),[d,f]=(0,R.useState)(`idle`),[p,m]=(0,R.useState)(null),[h,g]=(0,R.useState)(null),[v,y]=(0,R.useState)(null),[b,x]=(0,R.useState)(!1),[S,C]=(0,R.useState)(!1),[ee,w]=(0,R.useState)({kind:`chat`}),[T,E]=(0,R.useState)(null),[ne,re]=(0,R.useState)(void 0),[ae,oe]=(0,R.useState)([]),[se,ce]=(0,R.useState)([]),le=(0,R.useRef)(null),ue=Jl(),de=!!n.data?.assistantDev,fe=de&&ue.dev,pe=(0,R.useRef)(fe);pe.current=fe;let[O,me]=(0,R.useState)(!1),k=(0,R.useRef)(O);k.current=O,(0,R.useEffect)(()=>{s.data&&le.current!==s.data.id&&(le.current=s.data.id,u(s.data.messages.map(J)))},[s.data]);let he=(0,R.useCallback)(e=>{E(e),t.setQueryData([`assistant-layout`],t=>({...t,layout:e})),_.put(`/api/studio/assistant/layout`,{layout:e}).catch(()=>null)},[t]),ge=(0,R.useCallback)((e,n=!0)=>{re(e),n&&(t.setQueryData([`assistant-layout`],t=>({...t,width:e})),_.put(`/api/studio/assistant/layout`,{width:e}).catch(()=>null))},[t]),_e=(0,R.useRef)(null),ve=(0,R.useCallback)(()=>(_e.current??=(async()=>{await Promise.all([t.invalidateQueries({queryKey:D.spaces()}),i?t.invalidateQueries({queryKey:D.files(i.id)}):null,i?t.invalidateQueries({queryKey:D.knowledge(i.id)}):null]),wu(),_e.current=null})(),_e.current),[t,i]),A=(0,R.useRef)([]),j=(0,R.useCallback)(e=>{A.current=e(A.current),oe(A.current)},[]),ye=(0,R.useRef)(!1),be=(0,R.useRef)(null),xe=(0,R.useRef)(null),Se=(0,R.useRef)(()=>void 0),Ce=(0,R.useRef)(new Set),M=(0,R.useCallback)(()=>{let e=be.current?.runId;if(e)for(let t of A.current)t.way!==`signal`||Ce.current.has(t.id)||(Ce.current.add(t.id),_.post(`/api/studio/assistant/run/${e}/signal`,{ref:t.id,message:t.text}).catch(()=>{}))},[]),we=(0,R.useCallback)(async(e,t)=>{if(!t.length)return e;if(!i||i.readOnly)return m(L(`assistant.filesNeedSpace`)),null;try{for(let e of t)await _.upload(`/api/studio/projects/${i.id}/files?kind=${nd(e)}`,e)}catch(e){return m(e.message),await ve(),null}await ve();let n=`${L(`editor.attached`)}: ${t.map(e=>e.name).join(`, `)}`;return e.trim()?`${e}\n\n${n}`:n},[i,ve]),Te=(0,R.useCallback)(async(e,n)=>{ye.current=!0,m(null),f(`thinking`),y(Date.now()),Gu(null),w({kind:`chat`});let r=id(`p`),a=id(`u`);u(t=>[...t,{id:a,role:`user`,content:e,previews:n},{id:r,role:`assistant`,content:``,pending:!0}]),g(null);let o=e=>{let t=r;u(n=>n.map(n=>n.id===t?e(n):n))},s=pe.current?{id:id(`t`),message:e,startedAt:Date.now(),endedAt:null,prompt:null,events:[]}:null;s&&ce(e=>[...e,s]);let c=(e,t)=>{s&&(s.events.push({at:Date.now(),event:e,data:t}),e===`prompt`&&(s.prompt=t),ce(e=>e.map(e=>e.id===s.id?{...s}:e)))},l=new AbortController,d={runId:null,abort:l,stopped:!1};be.current=d;let p=!1;try{await te(`/api/studio/assistant/turn`,{message:e,projectId:i?.id,page:Du(),tools:K(),lang:I,...pe.current?{debug:!0}:{},...k.current?{extra:!0}:{}},(e,t)=>{let n=JSON.parse(t);switch(c(e,n),e){case`run_started`:{let e=n;d.runId=e.runId,u(t=>t.map(t=>t.id===a?{...t,id:e.messageId}:t)),M();break}case`text`:o(e=>({...e,content:e.content+n.delta}));break;case`activity`:g(n.label);break;case`tool_call`:{let e=n;o(t=>({...t,toolCalls:[...t.toolCalls??[],e]})),q(e.toolCallName,e.args).then(t=>{t&&_.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`:ve();break;case`step`:o(e=>({...e,steps:[...e.steps??[],n]}));break;case`signal`:{let e=n,t=r;r=id(`p`),j(t=>t.filter(t=>t.id!==e.ref)),u(n=>[...n.flatMap(n=>n.id===t?n.content||n.toolCalls?.length||n.cards?.length||n.steps?.length?[{...n,id:e.answerId??n.id,pending:!1}]:[]:[n]),{id:e.messageId,role:`user`,content:e.content,signal:!0},{id:r,role:`assistant`,content:``,pending:!0}]);break}case`done`:{p=!0;let e=n;o(t=>({...t,id:e.messageId,content:e.reply,changed:e.changed,pending:!1}));break}case`error`:p=!0,m(n.message)}},l.signal),p||m(L(`editor.chatBroken`))}catch(e){d.stopped||m(e.message)}finally{s&&(s.endedAt=Date.now(),ce(e=>e.map(e=>e.id===s.id?{...s}:e))),be.current=null,g(null),y(null),u(e=>e.filter(e=>!(e.pending&&!e.content&&!e.cards?.length&&!e.toolCalls?.length&&!e.steps?.length)).map(e=>({...e,pending:!1}))),f(`idle`),ye.current=!1,await _e.current,t.invalidateQueries({queryKey:[`me`]})}let h=xe.current;if(xe.current=null,!(h||d.stopped)){let e=A.current.filter(e=>e.way===`signal`),t=e.length?e:A.current.filter(e=>e.way===`queue`).slice(0,1);t.length&&(j(e=>e.filter(e=>!t.includes(e))),h=t.map(e=>e.text).join(`
25
-
26
- `))}h&&Se.current(h)},[i,ve,t,M,j]);Se.current=e=>void Te(e);let Ee=(0,R.useCallback)(async(e,t=[],n=`signal`)=>{if(!(e.trim()||t.length))return!1;if(C(!0),!ye.current){ye.current=!0,f(`thinking`);let n=await we(e,t);return n===null?(ye.current=!1,f(`idle`),!1):(Te(n,$c(t)),!0)}let r=await we(e,t);return r!==null&&(j(e=>[...e,{id:id(`s`),text:r,way:n}]),M(),!0)},[we,Te,M,j]),De=(0,R.useCallback)(()=>{let e=be.current;e&&(e.stopped=!0,e.abort.abort())},[]),Oe=(0,R.useCallback)(e=>{let t=A.current.find(t=>t.id===e);t&&(j(e=>e.filter(e=>e!==t)),be.current?(xe.current=t.text,De()):ye.current||Te(t.text))},[Te,De,j]),ke=(0,R.useCallback)(e=>{let t=A.current.find(t=>t.id===e);return j(e=>e.filter(e=>e!==t)),t},[j]),Ae=(0,R.useCallback)(async()=>{De(),j(()=>[]),u([]),ce([]),m(null),w({kind:`chat`}),x(!0);try{let e=await _.post(`/api/studio/assistant/chat/new`);le.current=e.id,t.setQueryData([`assistant-chat`],e),await t.invalidateQueries({queryKey:[`assistant-chats`]})}catch(e){m(e.message)}finally{x(!1)}},[t,De,j]),je=(0,R.useCallback)((e,t)=>Ee(e,t),[Ee]),Me=(0,R.useMemo)(()=>({messages:l,phase:d,activity:h,startedAt:v,error:p,send:je}),[l,d,h,v,p,je]),Ne=vu(Me),Pe=(0,R.useCallback)(e=>ql({dev:e}),[]),Fe=(0,R.useMemo)(()=>({chat:Me,ready:!!s.data,renewing:b,newChat:Ae,send:Ee,pending:ae,sendNow:Oe,takeBack:ke,stop:De,extra:O,setExtra:me,layout:T??c.data?.layout??`bottom`,setLayout:he,width:ne===void 0?c.data?.width??null:ne,setWidth:ge,open:S,setOpen:C,view:ee,setView:w,live:Ne,dev:{offered:de,on:fe,set:Pe,turns:se}}),[Me,s.data,b,Ae,Ee,ae,Oe,ke,De,O,T,c.data,he,ne,ge,S,ee,Ne,de,fe,Pe,se]);return(0,z.jsx)(ad.Provider,{value:Fe,children:e})}function ld(e){return ot({queryKey:[`assistant-chats`],queryFn:()=>_.get(`/api/studio/assistant/chats`),enabled:e,refetchInterval:e=>e.state.data?.chats.some(e=>e.summarising)?2e3:!1})}function ud(e){return ot({queryKey:[`assistant-chat`,e],queryFn:async()=>{let t=await _.get(`/api/studio/assistant/chats/${e}`);return{...t,messages:t.messages.map(J)}},enabled:!!e})}var Y=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),dd=e=>e<1e3?`${e} ms`:`${(e/1e3).toFixed(1)} s`,fd=e=>e?`$${e<.01?e.toFixed(4):e.toFixed(3)}`:`$0`,pd=e=>Math.round(e/4),md=(e,t)=>L(`assistant.tokens`,{input:Y(e),output:Y(t),total:Y(e+t)});function hd({steps:e}){return e?.length?(0,z.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-0.5`,children:e.map(e=>(0,z.jsxs)(`details`,{className:`group text-[0.75rem] text-ink-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer list-none truncate hover:text-ink-3`,children:[L(`assistant.step`,{n:e.step}),e.model,md(e.inputTokens,e.outputTokens),dd(e.ms),e.costUsd?fd(e.costUsd):null].filter(Boolean).join(` · `)}),(0,z.jsxs)(`div`,{className:`mt-1 rounded-lg bg-paper-2 px-3 py-2 font-mono text-[0.6875rem] text-ink-3`,children:[L(`assistant.stepTools`),`: `,e.tools.length?e.tools.join(`, `):`–`,e.cachedInputTokens?` · cache ${Y(e.cachedInputTokens)}`:``]})]},e.step))}):null}function gd(e){if(typeof e!=`string`)return JSON.stringify(e,null,2)??``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function _d({calls:e}){return e?.length?(0,z.jsx)(`div`,{className:`mb-1.5 flex flex-col gap-1`,children:e.map(e=>(0,z.jsxs)(`details`,{className:`rounded-lg bg-paper-2 text-[0.75rem]`,children:[(0,z.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,z.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 pb-2`,children:[(0,z.jsx)(`span`,{className:`text-ink-4`,children:L(`assistant.args`)}),(0,z.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[0.6875rem] text-ink-2`,children:gd(e.args)}),e.result===void 0?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`text-ink-4`,children:L(`assistant.result`)}),(0,z.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-[0.6875rem] text-ink-2`,children:gd(e.result)})]})]})]},e.toolCallId))}):null}function vd(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 yd({ratio:e}){let t=2*Math.PI*7;return(0,z.jsxs)(`svg`,{viewBox:`0 0 18 18`,className:`size-[18px] -rotate-90`,"aria-hidden":`true`,children:[(0,z.jsx)(`circle`,{cx:`9`,cy:`9`,r:7,fill:`none`,strokeWidth:`2.5`,className:`stroke-paper-3`}),(0,z.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 bd({messages:e,narrow:t}){let[n,r]=(0,R.useState)(!1),i=(0,R.useRef)(null);Vm(i,n,()=>r(!1));let a=vd(e);if(!a.lastStep)return null;let o=a.window?a.context/a.window:0,s=(e,t)=>(0,z.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,z.jsx)(`span`,{className:`text-ink-3`,children:e}),(0,z.jsx)(`span`,{className:`font-mono tabular-nums`,children:t})]});return(0,z.jsxs)(`div`,{className:`relative`,ref:i,children:[(0,z.jsxs)(`button`,{type:`button`,"aria-expanded":n,title:L(`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,z.jsxs)(`span`,{className:`whitespace-nowrap max-sm:hidden`,children:[Y(a.last.input+a.last.output),` / `,Y(a.thread.input+a.thread.output)]}),(0,z.jsx)(yd,{ratio:o})]}),n?(0,z.jsxs)(`div`,{role:`dialog`,"aria-label":L(`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,z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`font-medium`,children:L(`assistant.window`)}),(0,z.jsxs)(`span`,{className:`font-mono text-[0.75rem] text-ink-3`,children:[Y(a.context),` /`,` `,a.window?`${Y(a.window)} (${Math.round(o*100)}%)`:`?`]})]}),(0,z.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-paper-2`,children:(0,z.jsx)(`span`,{className:N(`block h-full rounded-full`,o>.8?`bg-rose`:`bg-ember`),style:{width:`${Math.min(100,o*100)}%`}})}),(0,z.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:a.lastStep.model}),(0,z.jsx)(`span`,{className:`mt-1 font-medium text-[0.75rem] text-ink-3`,children:L(`assistant.lastTurn`)}),s(L(`assistant.promptTokens`),Y(a.last.input)),s(L(`assistant.answerTokens`),Y(a.last.output)),s(L(`assistant.duration`),dd(a.last.ms)),s(L(`assistant.cost`),fd(a.last.cost)),(0,z.jsx)(`span`,{className:`mt-1 font-medium text-[0.75rem] text-ink-3`,children:L(`assistant.wholeChat`)}),s(L(`assistant.promptTokens`),Y(a.thread.input)),s(L(`assistant.answerTokens`),Y(a.thread.output)),s(L(`assistant.steps`),String(a.thread.steps)),s(L(`assistant.cost`),fd(a.thread.cost))]}):null]})}function xd(e,t){return JSON.stringify({messages:e.map(({previews:e,...t})=>t),turns:t},null,2)}function Sd({messages:e,turns:t}){let[n,r]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,z.jsx)(_e,{label:L(n?`assistant.copied`:`assistant.copyThread`),onClick:()=>void navigator.clipboard.writeText(xd(e,t)).then(()=>r(!0)),className:`size-8`,children:n?(0,z.jsx)(pe,{className:`size-4`}):(0,z.jsx)(ue,{className:`size-4`})})}function Cd({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:L(`assistant.system`),chars:e.system.length},{label:L(`assistant.context`),chars:e.context.length},{label:L(`assistant.history`,{n:e.history.length}),chars:t},{label:L(`assistant.tools`,{n:e.tools.length}),chars:n}],i=r.reduce((e,t)=>e+t.chars,0)||1,a=(e,t)=>(0,z.jsxs)(`details`,{className:`rounded-lg bg-paper-2`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 font-medium text-[0.8125rem]`,children:e}),(0,z.jsx)(`div`,{className:`px-3 pb-3`,children:t})]});return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3 text-[0.8125rem]`,children:[(0,z.jsxs)(`div`,{className:`flex justify-between text-ink-3`,children:[(0,z.jsx)(`span`,{className:`font-mono`,children:e.model}),(0,z.jsx)(`span`,{children:L(`assistant.estimate`,{tokens:Y(pd(i))})})]}),(0,z.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-paper-2`,children:r.map((e,t)=>(0,z.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,z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:r.map(e=>(0,z.jsxs)(`li`,{className:`flex justify-between gap-4`,children:[(0,z.jsx)(`span`,{children:e.label}),(0,z.jsxs)(`span`,{className:`font-mono text-ink-3 tabular-nums`,children:[Y(pd(e.chars)),` · `,Math.round(e.chars/i*100),`%`]})]},e.label))}),a(L(`assistant.system`),(0,z.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap font-mono text-[0.6875rem] text-ink-2`,children:e.system})),a(L(`assistant.context`),(0,z.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap font-mono text-[0.6875rem] text-ink-2`,children:e.context})),a(L(`assistant.tools`,{n:e.tools.length}),(0,z.jsx)(`ul`,{className:`flex flex-col gap-0.5 font-mono text-[0.6875rem]`,children:e.tools.map(e=>(0,z.jsxs)(`li`,{className:`flex justify-between gap-4`,children:[(0,z.jsx)(`span`,{children:e.name}),(0,z.jsx)(`span`,{className:`text-ink-3`,children:Y(pd(e.chars))})]},e.name))}))]})}function wd({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:`${L(`assistant.step`,{n:e.step})} · ${md(e.inputTokens,e.outputTokens)}`,from:t.at-e.ms,to:t.at,kind:`step`})}return r.sort((e,t)=>e.from-t.from),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`div`,{className:`flex justify-between gap-3 text-[0.8125rem]`,children:[(0,z.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.message}),(0,z.jsx)(`span`,{className:`shrink-0 text-ink-3 tabular-nums`,children:dd(n)})]}),r.map((t,r)=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.75rem]`,children:[(0,z.jsx)(`span`,{className:`w-40 shrink-0 truncate font-mono text-ink-3`,children:t.label}),(0,z.jsx)(`span`,{className:`relative h-3 flex-1 rounded bg-paper-2`,children:(0,z.jsx)(`span`,{className:N(`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,z.jsx)(`span`,{className:`w-14 shrink-0 text-right text-ink-4 tabular-nums`,children:dd(t.to-t.from)})]},`${t.label}-${r}`))]})}function Td({open:e,onClose:t,turns:n,messages:r}){let[i,a]=(0,R.useState)(`timeline`),o=n.at(-1);return(0,z.jsx)($e,{open:e,onClose:t,title:L(`assistant.turns`),wide:!0,height:`tall`,children:(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,z.jsx)(Re,{value:i,onChange:a,options:[{id:`timeline`,label:L(`assistant.turnsTimeline`)},{id:`prompt`,label:L(`assistant.turnsPrompt`)},{id:`events`,label:L(`assistant.turnsEvents`)}]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(Sd,{messages:r,turns:n}),(0,z.jsx)(_e,{label:L(`assistant.download`),onClick:()=>{let e=n.flatMap(e=>e.events.map(t=>JSON.stringify({turn:e.id,...t}))),t=new Blob([`${e.join(`
27
- `)}\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,z.jsx)(x,{className:`size-4`})})]})]}),n.length?i===`timeline`?(0,z.jsx)(`div`,{className:`flex flex-col gap-5`,children:n.map(e=>(0,z.jsx)(wd,{turn:e},e.id))}):i===`prompt`?o?.prompt?(0,z.jsx)(Cd,{prompt:o.prompt}):(0,z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:L(`assistant.noTurns`)}):(0,z.jsx)(`div`,{className:`flex flex-col gap-1 font-mono text-[0.6875rem]`,children:n.flatMap(e=>e.events.map((t,n)=>(0,z.jsxs)(`details`,{className:`rounded bg-paper-2`,children:[(0,z.jsxs)(`summary`,{className:`cursor-pointer px-2 py-1 text-ink-3`,children:[(0,z.jsxs)(`span`,{className:`tabular-nums`,children:[`+`,dd(t.at-e.startedAt)]}),` `,(0,z.jsx)(`span`,{className:`text-ink`,children:t.event})]}),(0,z.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,z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:L(`assistant.noTurns`)})]})})}var Ed=(0,R.lazy)(()=>Ft(()=>import(`./Marketplace-BxFBMUsi.js`).then(e=>e.a).then(e=>({default:e.MarketplaceCards})),__vite__mapDeps([12,1,2,3,4,5,13,14,15,16,7,6]))),Dd=1520,Od=768,kd={min:120,max:900};function Ad(){return(0,R.useSyncExternalStore)(e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)),()=>window.innerWidth)}function jd(e){let t=Ad(),n=Cu(),r=t>=Dd,i=t<Od,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 Md=new Set([`scroll_to`]);function Nd(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 L(`assistant.tool.navigate`,{where:String(t.to??``)});case`highlight`:return L(`assistant.tool.highlight`,{what:i});case`look_at_page`:return L(`assistant.tool.look`);case`read_section`:return L(`assistant.tool.read`,{what:i});case`fill_field`:return L(`assistant.tool.fill`,{what:i});case`docs_search`:case`docs_read`:case`authoring_guide`:return L(`assistant.tool.docs`);case`gallery_search`:case`gallery_detail`:case`show_templates`:return L(`assistant.tool.gallery`);case`plans`:case`account`:case`usage`:return L(`assistant.tool.account`);case`chats_search`:case`chat_read`:return L(`assistant.tool.chats`);case`wizards`:case`runs`:return L(`assistant.tool.space`);case`models`:return L(`assistant.tool.models`);default:return null}}function Pd({calls:e}){let t=[...new Set((e??[]).filter(e=>!Md.has(e.toolCallName)).map(Nd).filter(e=>!!e))];return t.length?(0,z.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1.5`,children:t.map(e=>(0,z.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,z.jsx)(`span`,{className:`truncate`,children:e})},e))}):null}function Fd({card:e,send:t}){if(!e.plugin&&e.tool===`extraEffort`)return(0,z.jsx)(Id,{reason:String(e.data.reason??``)});if(!e.plugin&&e.tool===`templates`){let{entries:t}=e.data;return(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(ct,{className:`m-2 size-4`}),children:(0,z.jsx)(Ed,{entries:t})})}return(0,z.jsx)(Ld,{card:e,send:t})}function Id({reason:e}){let t=od(),[n,r]=(0,R.useState)(!1);return!t||n?null:(0,z.jsxs)(`div`,{className:`my-2 flex flex-col gap-2 rounded-xl bg-amber/10 p-3 text-[0.8125rem] ring-1 ring-amber/30`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`b`,{className:`font-medium`,children:L(`assistant.extraTitle`)}),` `,(0,z.jsx)(`span`,{className:`text-ink-2`,children:e})]}),t.extra?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-ink-2`,children:[(0,z.jsx)(pe,{className:`size-3.5 text-moss`,strokeWidth:3}),` `,L(`assistant.extraOn`)]}):(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>t.setExtra(!0),className:`inline-flex h-8 items-center rounded-full bg-primary px-3 font-medium text-primary-foreground text-[0.8125rem]`,children:L(`assistant.extraOnButton`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`inline-flex h-8 items-center rounded-full px-3 text-ink-2 ring-1 ring-border hover:bg-paper-2`,children:L(`assistant.extraNo`)})]})]})}function Ld({card:e,send:t}){let n=ph().cards.find(t=>t.plugin===e.plugin&&t.tool===e.tool);return n?(0,z.jsx)(Lh,{of:n,children:(0,z.jsx)(n.component,{data:e.data,send:t})}):null}function Rd(){return[{label:L(`assistant.suggest.what`)},{label:L(`assistant.suggest.models`)},{label:L(`assistant.suggest.credits`)}]}function zd({state:e,composer:t,top:n}){let r=Cu(),i=(r.suggestions?.length?r.suggestions:Rd()).slice(0,3);return(0,z.jsxs)(`div`,{className:N(`flex flex-col`,n?`gap-5`:`gap-4`),children:[(0,z.jsxs)(`div`,{className:N(`flex items-start`,n?`gap-4`:`gap-3`),children:[(0,z.jsx)(`div`,{className:`shrink-0`,children:(0,z.jsx)(cn,{kind:`round`,size:n?64:44,helmet:!0,interactive:!1})}),(0,z.jsxs)(`div`,{className:`min-w-0 pt-0.5`,children:[(0,z.jsx)(`h2`,{className:N(`font-display font-semibold leading-tight tracking-tight`,n?`text-[1.25rem]`:`text-[1.0625rem]`),children:r.title??L(`assistant.helloTitle`)}),(0,z.jsx)(`p`,{className:N(`mt-1 text-ink-2 leading-relaxed`,n?`max-w-2xl text-[0.9375rem]`:`text-[0.875rem]`),children:r.hello??L(`assistant.hello`)}),n&&r.about?(0,z.jsx)(`p`,{className:`mt-2 max-w-2xl text-[0.875rem] text-ink-3 leading-relaxed`,children:r.about}):null]})]}),(0,z.jsx)(`div`,{className:N(`flex gap-1.5`,n?`flex-wrap sm:pl-20`:`flex-col`),children:i.map(r=>(0,z.jsxs)(`button`,{type:`button`,disabled:e.chat.phase!==`idle`,onClick:()=>{let n=r.message??r.label;r.fill?t.current?.fill(n):e.chat.send(n)},className:N(`flex items-center gap-2 bg-paper-2 text-left text-[0.875rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink disabled:opacity-60`,n?`rounded-full px-3.5 py-2`:`rounded-xl px-3.5 py-2.5`),children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1`,children:r.label}),r.fill?(0,z.jsx)(Pi,{className:`size-3.5 shrink-0 text-ink-4`}):null]},r.label))})]})}function Bd({state:e}){let t=ld(!0);if(t.isLoading)return(0,z.jsx)(ct,{className:`m-4 size-4`});let n=t.data?.chats??[];return n.length?(0,z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(t=>(0,z.jsx)(`li`,{children:(0,z.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,z.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem]`,children:t.title||L(`assistant.untitled`)}),(0,z.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-4 tabular-nums`,children:new Date(t.closedAt).toLocaleDateString(I)})]}),(0,z.jsx)(`span`,{className:`line-clamp-1 text-[0.8125rem] text-ink-3`,children:t.summarising?L(`assistant.summarising`):t.summary.split(`
28
- `)[0]})]})},t.id))}):(0,z.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:L(`assistant.noEarlier`)})}function Vd({id:e}){let t=ud(e);return t.data?(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{className:`rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:[(0,z.jsx)(`div`,{className:`font-medium text-ink`,children:t.data.title||L(`assistant.untitled`)}),(0,z.jsx)(`p`,{className:`mt-1 whitespace-pre-line`,children:t.data.summary})]}),(0,z.jsx)(sl,{chat:{messages:t.data.messages,phase:`idle`,activity:null,startedAt:null,error:null,send:async()=>!1},avatar:`round`,changedLabel:L(`project.assistantChanged`),card:e=>(0,z.jsx)(Fd,{card:e,send:()=>void 0}),calls:e=>(0,z.jsx)(Pd,{calls:e.toolCalls})})]}):(0,z.jsx)(ct,{className:`m-4 size-4`})}function Hd({state:e,composer:t,top:n}){let r=(0,R.useRef)(null),{chat:i,view:a}=e;return(0,R.useEffect)(()=>{let e=r.current,t=e=>{let t=e.target.closest(`a`)?.getAttribute(`href`);!t||e.metaKey||e.ctrlKey||e.shiftKey||(Qu(t)?e.preventDefault():/^https?:\/\//.test(t)&&(e.preventDefault(),window.open(t,`_blank`,`noopener,noreferrer`)))};return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,R.useEffect)(()=>{r.current?.scrollTo({top:r.current.scrollHeight,behavior:`smooth`})},[i.messages,i.phase,a]),(0,z.jsxs)(`div`,{ref:r,"data-assistant-thread":!0,className:N(`min-h-0 flex-1 overflow-y-auto px-4 py-4`,n?`sm:px-6 sm:py-5`:`sm:px-5`),children:[a.kind===`earlier`?(0,z.jsx)(Bd,{state:e}):a.kind===`read`?(0,z.jsx)(Vd,{id:a.id}):i.messages.length?(0,z.jsx)(sl,{chat:i,avatar:`round`,changedLabel:L(`project.assistantChanged`),card:e=>(0,z.jsx)(Fd,{card:e,send:e=>void i.send(e)}),calls:t=>e.dev.on?(0,z.jsx)(_d,{calls:t.toolCalls}):(0,z.jsx)(Pd,{calls:t.toolCalls}),foot:t=>e.dev.on?(0,z.jsx)(hd,{steps:t.steps}):null}):(0,z.jsx)(zd,{state:e,composer:t,top:n}),i.error&&a.kind===`chat`?(0,z.jsx)(`div`,{className:`mt-4 rounded-lg bg-rose-tint px-3 py-2 text-[0.8125rem] text-rose`,children:i.error}):null]})}function Ud({state:e}){let[t,n]=(0,R.useState)(!1),r=!!ld(!0).data?.chats.length,i=(0,R.useRef)(null);Vm(i,t,()=>n(!1));let a=`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,z.jsxs)(`div`,{className:`relative shrink-0`,ref:i,children:[(0,z.jsxs)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":t,"aria-label":L(`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:[L(`assistant.name`),(0,z.jsx)(b,{className:`size-3.5 text-ink-4`})]}),t?(0,z.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,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:a,disabled:e.renewing,onClick:()=>{n(!1),e.newChat()},children:[(0,z.jsx)(Pi,{className:`size-4`}),` `,L(`assistant.newChat`)]}),r?(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:a,onClick:()=>{n(!1),e.setView({kind:`earlier`})},children:[(0,z.jsx)(wi,{className:`size-4`}),` `,L(`assistant.earlier`)]}):null]}):null]})}function Wd({state:e}){let t=e.dev.on;return(0,z.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"aria-label":L(`assistant.dev`),title:L(t?`assistant.devOn`:`assistant.devOff`),onClick:()=>e.dev.set(!t),className:N(`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,z.jsx)(`span`,{className:`size-4 rounded-full bg-white shadow-sm`})]})}function Gd({state:e,where:t,wide:n,phone:r,compact:i,grip:a}){let o=e.live,[s,c]=(0,R.useState)(!1),l=Fm().map(e=>e.label).join(` · `),u=e.dev.on&&e.view.kind===`chat`,d=t===`sidebar`,f=e.chat.messages;return(0,z.jsxs)(`div`,{className:N(`flex items-center border-border-soft border-b py-1`,d?`px-3`:`px-3 sm:px-4`),children:[a,e.view.kind===`chat`?t===`sidebar`?(0,z.jsx)(cn,{kind:`round`,size:26,helmet:!0,interactive:!1}):null:(0,z.jsx)(_e,{label:L(`assistant.back`),onClick:()=>e.setView({kind:e.view.kind===`read`?`earlier`:`chat`}),className:`size-8`,children:(0,z.jsx)(ee,{className:`size-4`})}),(0,z.jsx)(`div`,{className:`mr-1 ml-1.5 min-w-[8.5rem] flex-1`,children:(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.view.kind===`chat`?(0,z.jsx)(Ud,{state:e}):(0,z.jsx)(`span`,{className:`font-display font-semibold text-[0.9375rem]`,children:L(`assistant.earlier`)}),e.dev.offered&&e.view.kind===`chat`?(0,z.jsx)(Wd,{state:e}):null,o.state===`off`?l?(0,z.jsx)(`span`,{className:`min-w-0 truncate text-[0.75rem] text-ink-4`,children:L(`assistant.sees`,{page:l})}):null:(0,z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[0.75rem] text-ember-strong`,children:[(0,z.jsx)(`span`,{className:`size-1.5 animate-pulse-dot rounded-full bg-ember`}),L(`assistant.live`),` · `,(0,z.jsx)(Kd,{since:o.since})]})]})}),u?(0,z.jsx)(bd,{messages:f,narrow:d}):null,u?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(_e,{label:L(`assistant.inspect`),onClick:()=>c(!0),className:`size-8 max-sm:hidden`,children:(0,z.jsx)(Rn,{className:`size-4`})}),f.length&&!d?(0,z.jsx)(`span`,{className:`max-sm:hidden`,children:(0,z.jsx)(Sd,{messages:f,turns:e.dev.turns})}):null,(0,z.jsx)(Td,{open:s,onClose:()=>c(!1),turns:e.dev.turns,messages:f})]}):null,e.view.kind===`chat`&&f.length?(0,z.jsx)(_e,{label:L(`assistant.newChat`),disabled:e.renewing,onClick:()=>void e.newChat(),className:`size-8`,children:(0,z.jsx)(Pi,{className:`size-4`})}):null,t!==`sidebar`&&n?(0,z.jsx)(_e,{label:L(`assistant.layoutSidebar`),onClick:()=>e.setLayout(`sidebar`),className:`size-8`,children:(0,z.jsx)(fi,{className:`size-4`})}):null,t===`sidebar`||t===`avatar`&&!r&&!i?(0,z.jsx)(_e,{label:L(`assistant.layoutBottom`),onClick:()=>{e.setLayout(`bottom`),e.setOpen(!0)},className:`size-8`,children:(0,z.jsx)(oi,{className:`size-4`})}):null,(0,z.jsx)(_e,{label:L(`assistant.close`),onClick:()=>{t!==`avatar`&&e.setLayout(`avatar`),e.setOpen(!1)},className:`size-8`,children:(0,z.jsx)(at,{className:`size-4`})})]})}function Kd({since:e}){let[t,n]=(0,R.useState)(()=>Date.now());(0,R.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,z.jsxs)(`span`,{className:`tabular-nums`,children:[String(Math.floor(r/60)).padStart(2,`0`),`:`,String(r%60).padStart(2,`0`)]})}function qd({state:e}){let t=e.live,n=t.state===`thinking`?L(`assistant.liveThinking`):t.state===`speaking`?L(`assistant.liveSpeaking`):t.muted?L(`assistant.liveMuted`):L(`assistant.liveListening`);return(0,z.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,z.jsx)(`span`,{className:`size-2 shrink-0 animate-pulse-dot rounded-full bg-ember`}),(0,z.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,z.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,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] text-ink-2`,children:t.heard?(0,z.jsx)(`span`,{className:`text-ink`,children:t.heard}):t.state===`thinking`?(0,z.jsx)(al,{chat:e.chat,className:`text-ink-3`}):(0,z.jsxs)(z.Fragment,{children:[n,` · `,(0,z.jsx)(Kd,{since:t.since})]})}),t.voice&&t.voice.way!==`none`?(0,z.jsx)(_e,{label:L(`assistant.naturalVoice`),"aria-pressed":t.voice.natural,onClick:()=>t.setNatural(!t.voice?.natural),className:N(t.voice.natural&&`bg-ember-tint text-ember-strong`),children:(0,z.jsx)(zt,{className:`size-4`})}):null,(0,z.jsx)(_e,{label:t.muted?L(`assistant.unmute`):L(`assistant.mute`),"aria-pressed":t.muted,onClick:t.toggleMute,children:t.muted?(0,z.jsx)(ei,{className:`size-4`}):(0,z.jsx)(de,{className:`size-4`})}),(0,z.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,z.jsx)(vi,{className:`size-4`}),` `,L(`assistant.end`)]})]})}function Jd({state:e,composer:t}){return e.pending.length?(0,z.jsx)(`ul`,{"aria-label":L(`assistant.pending`),className:`mb-2 flex flex-col gap-1`,children:e.pending.map(n=>(0,z.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,z.jsx)(`span`,{title:n.way===`queue`?L(`assistant.pendingQueueHint`):L(`assistant.pendingSignalHint`),className:N(`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`?L(`assistant.pendingQueue`):L(`assistant.pendingSignal`)}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.text}),(0,z.jsx)(`button`,{type:`button`,title:L(`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:L(`assistant.sendNow`)}),(0,z.jsx)(_e,{label:L(`assistant.edit`),onClick:()=>{let r=e.takeBack(n.id);r&&t.current?.fill(r.text)},className:`size-7`,children:(0,z.jsx)(Te,{className:`size-3.5`})}),(0,z.jsx)(_e,{label:L(`assistant.remove`),onClick:()=>e.takeBack(n.id),className:`size-7`,children:(0,z.jsx)(at,{className:`size-3.5`})})]},n.id))}):null}function Yd({state:e,composer:t,floating:n,bare:r}){let i=Cu(),a=e.live;if(e.view.kind===`earlier`)return null;if(e.view.kind===`read`)return(0,z.jsx)(`p`,{className:`m-3 rounded-xl bg-paper-2 px-4 py-3 text-[0.8125rem] text-ink-2 leading-relaxed`,children:L(`assistant.readOnly`)});let o=e.chat.phase!==`idle`;return(0,z.jsxs)(`div`,{className:n?void 0:`p-3`,children:[a.state===`off`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Jd,{state:e,composer:t}),(0,z.jsx)(et,{ref:t,floating:n,bare:r,placeholder:o?L(`assistant.busyComposer`,{keys:Se}):i.placeholder??L(`assistant.composer`),busy:o,onStop:e.stop,effort:{on:e.extra,onChange:e.setExtra},onSend:(t,n,r)=>e.send(t,n,r?`queue`:`signal`),onTalk:hu?()=>{e.setOpen(!0),a.start()}:void 0})]}):(0,z.jsx)(qd,{state:e}),a.error?(0,z.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:a.error===`denied`?L(`editor.micDenied`):a.error}):null]})}function Xd({composer:e,children:t,className:n,style:r}){return(0,z.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 Zd(e){let[t,n]=(0,R.useState)({width:0,height:0});return(0,R.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 Qd(e){return t=>{if(t===`sidebar`){e.setLayout(`sidebar`);return}ql({place:t})}}function $d({state:e,column:t,frame:n,wide:r,from:i}){let a=Jl(),o=Qd(e);return(0,z.jsx)(`button`,{type:`button`,title:L(`assistant.move`),"aria-label":L(`assistant.move`),onPointerDown:a=>iu(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=ru(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,z.jsx)(s,{className:`size-4`})})}function ef(){let e=eu();return e?.spot?(0,z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute rounded-2xl border-2 border-ember border-dashed bg-ember-veil transition-all duration-200`,style:e.spot}):null}function tf({place:e,width:t,column:n,frame:r,children:i}){let a=eu(),o;return o=a?{left:a.left,top:a.top,width:t}:{left:e===`right`?n.width-t-12:(n.width-t)/2,bottom:0,width:t},(0,z.jsx)(`div`,{ref:r,className:N(`pointer-events-none absolute flex flex-col`,a?`opacity-90`:`transition-[left,bottom] duration-300 ease-out`),style:o,children:i})}function nf({thread:e,max:t,folded:n,onFold:r,onOpen:i}){let a=Jl(),o=(0,R.useRef)(null),s=e=>Math.round(Math.min(Math.max(e,kd.min),t)),c=a.height??e.current?.offsetHeight??kd.min;return(0,z.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-orientation":`horizontal`,"aria-valuenow":c,"aria-valuemin":kd.min,"aria-valuemax":t,"aria-label":L(n?`assistant.open`:`assistant.flap`),title:L(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,ql({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}ql({height:s(c+(e.key===`ArrowUp`?32:-32))})}else(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),(n?i:r)())},className:`group absolute top-0 left-1/2 z-10 flex h-3 w-16 -translate-x-1/2 cursor-row-resize touch-none items-center justify-center outline-none`,children:(0,z.jsx)(`span`,{className:`h-1 w-10 rounded-full bg-ink-4/40 transition group-hover:bg-ink-4 group-focus-visible:bg-ember`})})}var rf=48,af=32,of=240;function sf(){return(0,z.jsx)(`div`,{ref:U,className:`hidden`})}function cf(e,t){let[n,r]=(0,R.useState)(!1);return(0,R.useLayoutEffect)(()=>{if(!e){r(!1);return}let n=0,i=()=>{n=0;let i=$m().getBoundingClientRect(),a=e.getBoundingClientRect();if(!e.offsetParent){r(!0);return}let o=a.top+Math.max(a.height,t.current||of);r(o<i.top+rf||a.top>i.bottom)},a=()=>{n||=requestAnimationFrame(i)};i();let o=new ResizeObserver(a);return o.observe(e),window.addEventListener(`scroll`,a,{passive:!0,capture:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(n),o.disconnect(),window.removeEventListener(`scroll`,a,{capture:!0}),window.removeEventListener(`resize`,a)}},[e,t]),n}function lf({column:e}){let t=od(),n=!!Ku(),r=(0,R.useRef)(null),i=(0,R.useRef)(null),a=(0,R.useRef)(null),o=(0,R.useRef)(null),s=(0,R.useRef)(null),c=df(t),l=Jl(),u=Zd(e),d=t&&c,f=c?.where===`sidebar`,p=du(),m=tu(u.width),h=c?.phone||!ru(u.width)?`center`:l.place,g=su(),_=g&&d&&c.where===`bottom`?g:null,y=(0,R.useRef)(0);(0,R.useLayoutEffect)(()=>{g&&(g.style.display=_?`block`:``)},[g,_]);let b=cf(_,y),x=!!_&&!b,S=c?.where===`avatar`,C=!!t?.open,[ee,w]=(0,R.useState)(!1),te=ee||C||t?.chat.phase!==`idle`||(t?.live.state??`off`)!==`off`,T=!(x||f),E=!!c?.phone,ne=!!d&&!(S&&!C),[re]=(0,R.useState)(()=>{let e=document.createElement(`div`);return e.className=`flex min-h-0 flex-col`,e}),[ie,ae]=(0,R.useState)(null),[oe,se]=(0,R.useState)(!1);(0,R.useLayoutEffect)(()=>{let e=f?p:x?_:ie;if(re.className=N(`flex min-h-0 flex-col`,f&&`flex-1`),!e||re.parentElement===e)return;let t=re.contains(document.activeElement)?document.activeElement:null;e.appendChild(re),t instanceof HTMLElement&&t.focus({preventScroll:!0});for(let e of re.querySelectorAll(`[data-assistant-thread]`))e.scrollTop=e.scrollHeight;se(!0)},[f,p,x,_,ie,re]),(0,R.useLayoutEffect)(()=>{if(!g||(g.style.minHeight=_&&b?`${y.current}px`:``,!(_&&x)))return;let e=new ResizeObserver(()=>{y.current=re.offsetHeight});return e.observe(re),()=>e.disconnect()},[g,_,b,x,re]),(0,R.useEffect)(()=>()=>{re.remove()},[re]),(0,R.useLayoutEffect)(()=>{let t=S&&!C?i.current:o.current,n=e.current;if(!(t&&n&&d&&T)){n?.style.setProperty(`--assistant-dock`,`0px`);return}let r=new ResizeObserver(()=>{let e=t===o.current&&!E?af:0,r=n.getBoundingClientRect().bottom-t.getBoundingClientRect().top;n.style.setProperty(`--assistant-dock`,`${Math.max(0,Math.ceil(r))+e+8}px`)});return r.observe(t),r.observe(n),()=>{r.disconnect(),n.style.setProperty(`--assistant-dock`,`0px`)}},[e,d,T,S,C,oe,E]);let ce=(0,R.useRef)(x);if((0,R.useEffect)(()=>{ce.current&&!x&&_&&t?.open&&t.setOpen(!1),ce.current=x},[x,_,t]),(0,R.useEffect)(()=>{if(!t?.open)return;let e=e=>{e.key===`Escape`&&!document.querySelector(`[role=dialog], dialog[open]`)&&t.setOpen(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),!(t&&c&&d))return null;let le=Math.max(kd.min,Math.min(kd.max,u.height-220)),ue=l.height===null?null:Math.min(l.height,le),de=c.phone||x?void 0:(0,z.jsx)($d,{state:t,column:e,frame:()=>f?null:o.current,wide:c.wide,from:f?`sidebar`:`bottom`}),fe=C||x||f,pe=ne&&oe?(0,Xi.createPortal)((0,z.jsx)(Xd,{composer:r,className:N(`flex min-h-0 flex-col`,f&&`flex-1`),children:(0,z.jsxs)(`div`,{className:N(`pointer-events-auto relative flex min-h-0 flex-col overflow-hidden`,f?`flex-1`:x?`rounded-xl bg-card bg-linear-to-br from-ember-tint via-card to-card shadow-soft ring-1 ring-ember-veil focus-within:ring-ember`:`rounded-[1.375rem] bg-card shadow-overlay ring-1 ring-border focus-within:ring-focus`),children:[x||f?null:(0,z.jsx)(nf,{thread:s,max:le,folded:!C,onFold:()=>t.setOpen(!1),onOpen:()=>t.setOpen(!0)}),(0,z.jsx)(`div`,{className:N(`relative flex min-h-0 flex-col`,f&&`flex-1`),children:(0,z.jsxs)(`div`,{className:N(`flex min-h-0 flex-col`,f&&`flex-1`),style:fe&&!(x||f)?{maxHeight:le+60}:void 0,children:[(0,z.jsx)(Gd,{state:t,where:f?`sidebar`:S?`avatar`:`bottom`,wide:c.wide,phone:c.phone,compact:c.compact,grip:de}),fe?(0,z.jsx)(`div`,{ref:s,className:N(`flex min-h-0 flex-col border-border-soft border-b`,f?`flex-1`:!x&&`animate-rise`),style:f?void 0:x?{maxHeight:Math.min(480,le)}:ue===null?{maxHeight:Math.min(le,Math.round(u.height*.45))}:{height:ue},children:(0,z.jsx)(Hd,{state:t,composer:r,top:x})}):t.chat.messages.length||t.chat.error?(0,z.jsx)(uf,{state:t}):null]})}),(0,z.jsx)(`div`,{ref:i,onFocusCapture:()=>w(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||w(!1)},className:`relative w-full`,children:(0,z.jsx)(Yd,{state:t,composer:r,floating:!0,bare:!0})})]})}),re):null,D=(0,z.jsx)(`button`,{type:`button`,"aria-label":L(`assistant.open`),title:`${L(`assistant.open`)} · ${L(`assistant.move`)}`,tabIndex:-1,onPointerDown:n=>iu(n,{column:()=>e.current,frame:()=>o.current,sidebar:c.wide,onClick:()=>t.setOpen(!0),onDrop:Qd(t)}),onClick:e=>{e.detail===0&&t.setOpen(!0)},className:N(`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`,te?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-3 scale-75 opacity-0`),children:(0,z.jsx)(cn,{kind:`round`,size:44,helmet:!0,interactive:te})}),O=(0,z.jsx)(Xd,{composer:r,className:N(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:(0,z.jsx)(`div`,{ref:i,className:N(`pointer-events-auto absolute right-3 sm:right-4`,E?`bottom-[calc(4.75rem+env(safe-area-inset-bottom))]`:`bottom-3 sm:bottom-4`),children:(0,z.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,z.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,z.jsxs)(`span`,{className:`relative`,children:[(0,z.jsx)(cn,{kind:`round`,size:36,helmet:!0,interactive:!1}),t.chat.phase!==`idle`||t.live.state!==`off`?(0,z.jsx)(`span`,{className:`absolute top-0 right-0 size-2.5 animate-pulse-dot rounded-full bg-ember ring-2 ring-card`}):null]}),(0,z.jsx)(`span`,{className:`max-sm:hidden`,children:L(`assistant.ask`)})]}),hu?(0,z.jsx)(_e,{label:L(`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,z.jsx)(v,{className:`size-4`})}):null]})})});return(0,z.jsxs)(z.Fragment,{children:[pe,x||f?null:S&&!C?O:(0,z.jsxs)(Xd,{composer:r,className:N(`pointer-events-none absolute inset-0`,n?`z-[61]`:`z-30`),children:[(0,z.jsx)(ef,{}),(0,z.jsxs)(tf,{place:h,width:m,column:u,frame:o,children:[D,(0,z.jsx)(`div`,{ref:ae,className:`flex min-h-0 flex-col`}),(0,z.jsx)(`div`,{ref:a,className:N(`shrink-0`,E?`h-[calc(4.75rem+env(safe-area-inset-bottom))]`:`h-[max(0.75rem,env(safe-area-inset-bottom))]`)})]})]})]})}function uf({state:e}){let t=e.chat.messages.at(-1);return(0,z.jsx)(`button`,{type:`button`,onClick:()=>e.setOpen(!0),className:`flex w-full items-center gap-2 border-border-soft border-b px-4 py-2.5 text-left text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:t?.pending?(0,z.jsx)(al,{chat:e.chat,className:`flex-1`}):(0,z.jsx)(`span`,{className:N(`min-w-0 flex-1 truncate`,e.chat.error&&`text-rose`),children:e.chat.error??Jc(t?.content??``)})})}function df(e){let t=jd(e??ff);return e?t:null}var ff={layout:`bottom`,open:!1,chat:{messages:[]}},pf=e=>Math.max(Bc.min,Math.min(Bc.max,e-1120));function mf({state:e,width:t,max:n}){let r=e=>Math.round(Math.min(Math.max(e,Bc.min),n));return(0,z.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":L(`editor.resize`),"aria-valuenow":t,"aria-valuemin":Bc.min,"aria-valuemax":n,tabIndex:0,title:L(`editor.resize`),onPointerDown:n=>{if(n.button!==0)return;n.preventDefault();let i=n.clientX,a=t,o=n=>{a=r(t-(n.clientX-i)),e.setWidth(a,!1)},s=()=>{window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),e.setWidth(a===Bc.initial?null:a)};document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},onKeyDown:n=>{if(n.key===`ArrowLeft`||n.key===`ArrowRight`){n.preventDefault();let i=n.shiftKey?64:16;e.setWidth(r(t+(n.key===`ArrowLeft`?i:-i)))}},onDoubleClick:()=>e.setWidth(null),className:`group -left-2 absolute inset-y-0 z-10 w-2 cursor-col-resize outline-none`,children:(0,z.jsx)(`span`,{className:`-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 h-8 w-1 rounded-full bg-ink-4/20 transition group-hover:bg-ember/60 group-focus-visible:bg-ember group-active:h-12 group-active:bg-ember`})})}function X(){return df(od())?.where===`sidebar`}function hf(){let e=od(),t=!!Ku(),n=df(e),r=pf(Ad());if(!(e&&n&&n.where===`sidebar`))return null;let i=Math.min(Math.max(e.width??Bc.initial,Bc.min),r);return(0,z.jsxs)(`div`,{className:N(`relative flex shrink-0`,t&&`z-[61]`),style:{width:i},children:[(0,z.jsx)(mf,{state:e,width:i,max:r}),(0,z.jsx)(`aside`,{"aria-label":L(`assistant.name`),className:`flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl bg-background shadow-elevated dark:ring-1 dark:ring-border-soft`,children:(0,z.jsx)(`div`,{ref:uu,className:`flex min-h-0 flex-1 flex-col`})})]})}function gf(){let e=Ku(),t=od(),[n,r]=(0,R.useState)(null);if((0,R.useEffect)(()=>{if(!e){r(null);return}let t=0,n=()=>{if(!e.el.isConnected){Gu(null);return}r(e.el.getBoundingClientRect()),t=requestAnimationFrame(n)};n();let i=e=>{e.key===`Escape`&&Gu(null)};return document.addEventListener(`keydown`,i),()=>{cancelAnimationFrame(t),document.removeEventListener(`keydown`,i)}},[e]),!(e&&n))return null;let i={left:n.left-6,top:n.top-6,width:n.width+12,height:n.height+12},a=i.top+i.height+220<window.innerHeight,o=a?i.top+i.height+10:Math.max(10,i.top-10),s=Math.min(Math.max(10,i.left),window.innerWidth-330),c=e=>{Gu(null),t?.chat.send(e)};return(0,Xi.createPortal)((0,z.jsxs)(`div`,{"data-assistant-ui":!0,className:`pointer-events-none fixed inset-0 z-[60]`,children:[e.mode===`spotlight`?(0,z.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:()=>Gu(null),onKeyDown:void 0,role:`presentation`}):null,(0,z.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,z.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,z.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,z.jsx)(cn,{kind:`round`,size:28,helmet:!0,interactive:!1}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.title?(0,z.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:e.title}):null,e.text?(0,z.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-2 leading-relaxed`,children:e.text}):null]})]}),(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-1.5`,children:[e.buttons.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`rounded-full bg-paper-2 px-3 py-1.5 text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink`,children:e},e)),(0,z.jsx)(`button`,{type:`button`,onClick:()=>Gu(null),className:`rounded-full bg-primary px-3 py-1.5 font-medium text-[0.8125rem] text-primary-foreground`,children:L(`assistant.gotIt`)})]})]}):null]}),document.body)}function _f({enabled:e=!0,align:t=`center`}){let{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:c}=$s(e),l=r?.checkedAt?new Date(r.checkedAt).toLocaleTimeString(I,{hour:`2-digit`,minute:`2-digit`}):null,u=t===`center`;return(0,z.jsxs)(`div`,{className:N(`flex flex-col gap-3 text-[0.875rem] text-ink-2`,u?`items-center text-center`:`items-start`),children:[n.isPending||a.isPending?(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,z.jsx)(ct,{className:`size-4 text-ember-strong`}),L(`about.update.checking`)]}):c?(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[s?(0,z.jsx)(ct,{className:`size-4 text-ember-strong`}):null,c]}):r?.newer&&i?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2.5 font-medium text-ink`,children:[(0,z.jsx)(x,{className:`size-4 shrink-0 text-ember-strong`}),L(`about.update.available`,{v:i})]}),r.canApply?null:(0,z.jsx)(`p`,{className:`text-ink-3`,children:L(`about.update.manual`)})]}):r?.enabled?r.latest===null?(0,z.jsx)(`p`,{children:L(`about.update.unknown`)}):(0,z.jsxs)(`p`,{children:[L(`about.update.upToDate`),l?(0,z.jsxs)(`span`,{className:`text-ink-4`,children:[` `,`· `,L(`about.update.checkedAt`,{when:l})]}):null]}):(0,z.jsx)(`p`,{children:L(`about.update.off`)}),s||n.isPending?null:(0,z.jsxs)(`div`,{className:N(`flex flex-wrap gap-2`,u&&`justify-center`),children:[r?.newer&&r.canApply&&r.applying!==`running`?(0,z.jsxs)(O,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,z.jsx)(x,{className:`size-4`}),` `,L(`about.update.install`)]}):null,r?.enabled===!1?null:(0,z.jsxs)(O,{size:`sm`,variant:`secondary`,disabled:a.isPending,onClick:()=>a.mutate(),children:[(0,z.jsx)(ye,{className:N(`size-4`,a.isPending&&`animate-spin`)}),` `,L(`about.update.check`)]})]})]})}function vf({me:e}){let t=e.mode===`local`,{status:n,data:r,latest:i,check:a,apply:o,busy:s,progress:c}=$s(t),l=n.isPending||a.isPending;return(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-2 text-[0.8125rem] text-ink-3`,children:[(0,z.jsx)(Xs,{me:e}),(0,z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),t?l?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,z.jsx)(ct,{className:`size-3.5 text-ember-strong`}),` `,L(`about.update.checking`)]}):c?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[s?(0,z.jsx)(ct,{className:`size-3.5 text-ember-strong`}):null,c]}):r?.newer&&i?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-ink`,children:[(0,z.jsx)(x,{className:`size-3.5 shrink-0 text-ember-strong`}),L(`about.update.available`,{v:i})]}):r?.enabled?r.latest===null?(0,z.jsx)(`span`,{children:L(`about.update.unknown`)}):(0,z.jsx)(`span`,{children:L(`about.update.upToDate`)}):(0,z.jsx)(`span`,{children:L(`about.update.off`)}):(0,z.jsx)(`span`,{children:L(`about.kind.cloud`)}),!t||l||s?null:r?.newer&&r.canApply?(0,z.jsxs)(O,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:[(0,z.jsx)(x,{className:`size-4`}),` `,L(`about.update.install`)]}):r?.enabled?(0,z.jsx)(_e,{label:L(`about.update.check`),className:`size-7 coarse:size-9`,onClick:()=>a.mutate(),children:(0,z.jsx)(ye,{className:`size-3.5`})}):null]})}var yf=`cubic-bezier(0.3, 0.7, 0.2, 1)`,bf=`(max-width: 639px)`;function xf({tone:e=`ground`,ink:t}){let n=_n(),r=Kt(),i=Cn();return i?(0,z.jsx)(Sf,{langs:[`en`,i],value:n,onPick:e=>{mn(e)&&r(e)},tone:e,ink:t}):null}function Sf({langs:e,value:t,onPick:n,tone:r=`ground`,ink:i,label:a}){let o=En(bf),s=(0,R.useRef)({}),[c,l]=(0,R.useState)(null),u=e=>a?a(e):fn(e),d=e.join(`|`);(0,R.useLayoutEffect)(()=>{let e=()=>{let e={};for(let[t,n]of Object.entries(s.current))e[t]=n?Math.ceil(n.getBoundingClientRect().width):0;l(e)};e(),document.fonts?.ready.then(e)},[d]);let f=e=>c?(c[e===t&&!o?`${e}-full`:`${e}-short`]??0)+24:void 0,p=c?e.slice(0,e.indexOf(t)).reduce((e,t)=>e+(f(t)??0),0):0,m=`300ms ${yf}`,h=r===`ground`;return(0,z.jsxs)(`fieldset`,{className:N(`relative inline-flex items-center rounded-full border-0 p-0.5 ring-1`,h?`bg-white/10 ring-white/15`:`bg-paper-2 ring-border-soft`),children:[(0,z.jsx)(`legend`,{className:`sr-only`,children:L(`nav.language`)}),c?(0,z.jsx)(`span`,{"aria-hidden":`true`,className:N(`absolute top-0.5 bottom-0.5 left-0.5 rounded-full shadow-sm motion-reduce:transition-none`,h?`bg-white`:`bg-card`),style:{width:f(t),transform:`translateX(${p}px)`,transition:`transform ${m}, width ${m}`}}):null,e.map(e=>{let r=e===t;return(0,z.jsxs)(`button`,{"aria-pressed":r,className:N(`relative h-7 cursor-pointer overflow-hidden whitespace-nowrap rounded-full font-medium text-[0.75rem] motion-reduce:transition-none`,h?r?`text-[oklch(32%_0.15_262)]`:`text-white/70`:r?`text-ink`:`text-ink-3`),lang:e,onClick:()=>{r||n(e)},style:{width:f(e),transition:`width ${m}, color ${m}`,...h&&r&&i?{color:i}:{}},title:u(e),type:`button`,children:[[u(e),e.toUpperCase()].map((e,t)=>{let n=r&&!o?t===0:t===1;return(0,z.jsx)(`span`,{"aria-hidden":!n,className:`absolute inset-0 grid place-items-center motion-reduce:transition-none`,style:{opacity:+!!n,transition:`opacity 220ms ${yf}`},children:e},`${t}:${e}`)}),(0,z.jsx)(`span`,{ref:t=>{s.current[`${e}-full`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:u(e)}),(0,z.jsx)(`span`,{ref:t=>{s.current[`${e}-short`]=t},"aria-hidden":`true`,className:`invisible absolute`,children:e.toUpperCase()}),(0,z.jsx)(`span`,{className:`invisible px-3`,children:r?u(e):e.toUpperCase()})]},e)})]})}function Cf(){let e=_n(),t=Kt();return(0,z.jsx)(ke,{className:`w-44`,value:e,onChange:e=>{mn(e)&&t(e)},options:Tn.map(e=>({value:e,label:pn[e]}))})}var wf=[`text`,`image`,`video`,`speech`,`listening`],Tf={text:[`classifier`,`low`,`standard`,`high`],image:[`image`],video:[`video`],speech:[`speech`],listening:[`audio`]},Ef={classifier:{needs:[`json`],context:32e3,blocks:[]},low:{needs:[`tools`,`json`,`vision`],context:64e3,blocks:[]},standard:{needs:[`tools`,`json`,`vision`],context:128e3,blocks:[`tools`]},high:{needs:[`tools`,`json`,`vision`,`reasoning`],context:2e5,blocks:[`tools`]}},Df=`credits`,Of=`${Df}:`;function kf(e){return e===`credits`||!!e?.startsWith(Of)}function Af(e){return e?.startsWith(Of)&&e.slice(Of.length)||null}function jf(e){return e?`${Of}${e}`:Df}function Mf(e){return e===`transcription`?`listening`:e}var Nf=[`openai`,`anthropic`,`google`,`fal`,`elevenlabs`,`replicate`,`gateway`],Pf={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.`}},Ff=(e,t)=>yn(Pf,e,t),If=[{id:`openai`,name:`OpenAI`,about:`about.openai`,keyUrl:`https://platform.openai.com/api-keys`,keyPlaceholder:`sk-…`,text:{classifier:`openai:gpt-5.4-mini`,low:`openai:gpt-5.4-mini`,standard:`openai:gpt-5.5`,high:`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`,low:`anthropic:claude-haiku-4-5`,standard:`anthropic:claude-sonnet-5-5`,high:`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`,low:`google:gemini-flash-latest`,standard:`google:gemini-pro-latest`,high:`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:`deepseek/deepseek-v4.1-flash`,low:`deepseek/deepseek-v4.1-flash`,standard:`deepseek/deepseek-v4.1-flash`,high:`moonshotai/kimi-k3`},models:{text:[{ref:`deepseek/deepseek-v4.1-flash`,label:`DeepSeek V4.1 Flash`,note:`fastLowCost`},{ref:`moonshotai/kimi-k3`,label:`Kimi K3`},{ref:`zai/glm-5.3`,label:`GLM 5.3`},{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 Lf(e){return If.find(t=>t.id===e)??null}function Rf(e){if(kf(e))return null;let t=/^([a-z]+):/.exec(e)?.[1];return t?Nf.includes(t)?t:null:e?.includes(`/`)?`gateway`:null}function zf(e){for(let t of If)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 Bf(e){let t=window.engentyDesktop;t?t.open(e):window.open(e,`_blank`,`noopener`)}var Vf=If.filter(e=>e.text);function Hf({models:e}){return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`local.keys`)}),(0,z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:L(`local.keysHint`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col`,children:[Vf.map(t=>(0,z.jsx)(Uf,{provider:t,stored:!!e.keys[t.id]},t.id)),(0,z.jsx)(Wf,{url:e.ollamaUrl})]}),(0,z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:L(`local.modelsLater`)})]})}function Z(e){let t=ie();return Nt({mutationFn:t=>_.post(e,t),onSuccess:()=>t.invalidateQueries({queryKey:[`me`]})})}function Uf({provider:e,stored:t}){let n=ie(),[r,i]=(0,R.useState)(``),a=Z(`/api/studio/local/keys/${e.id}`),o=()=>a.mutate(r.trim()?{key:r.trim()}:{},{onSuccess:e=>e.ok?i(``):void 0}),s=Nt({mutationFn:()=>_.put(`/api/studio/local/models`,{keys:{[e.id]:``}}),onSuccess:async()=>{a.reset(),await n.invalidateQueries({queryKey:[`me`]})}});return(0,z.jsx)(Kf,{label:e.name,sub:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>Bf(e.keyUrl),className:`inline-flex items-center gap-1 text-left hover:text-ink-2 hover:underline`,children:[L(`local.keyGet`),` `,(0,z.jsx)(ae,{className:`size-3`})]}),input:(0,z.jsx)(he,{type:`password`,autoComplete:`off`,className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,placeholder:t?L(`local.keySet`):e.keyPlaceholder,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&r.trim()&&o()}}),actions:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(O,{variant:`secondary`,busy:a.isPending,disabled:!t&&!r.trim(),onClick:o,children:L(`local.test`)}),t?(0,z.jsx)(O,{variant:`ghost`,size:`sm`,busy:s.isPending,onClick:()=>s.mutate(),children:L(`local.keyRemove`)}):null]}),said:Gf(a,t=>Rf(t)===e.id)})}function Wf({url:e}){let[t,n]=(0,R.useState)(e),r=Z(`/api/studio/local/ollama`);return(0,z.jsx)(Kf,{label:`Ollama`,sub:L(`local.ollamaWhere`),input:(0,z.jsx)(he,{className:`min-w-0 flex-1 font-mono text-[0.8125rem]`,value:t,onChange:e=>n(e.target.value)}),actions:(0,z.jsx)(O,{variant:`secondary`,busy:r.isPending,disabled:!t.trim(),onClick:()=>r.mutate({url:t.trim()}),children:L(`local.test`)}),said:Gf(r,e=>e.startsWith(`ollama:`))})}function Gf(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??L(`models.keyBad`)};if(!n.text)return{ok:!0,text:L(`local.keyWorksPlain`)};let r=zf(n.text);return{ok:!0,text:L(t(n.text)?`local.keyWorks`:`local.keyWorksOther`,{model:r})}}function Kf({label:e,sub:t,input:n,actions:r,said:i}){return(0,z.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,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`text-[0.875rem] text-ink-2`,children:e}),(0,z.jsx)(`div`,{className:`text-[0.75rem] text-ink-4`,children:t})]}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n,r]}),i?(0,z.jsxs)(`p`,{className:N(`flex items-start gap-1.5 text-[0.8125rem]`,i.ok?`text-moss`:`text-rose`),children:[i.ok?(0,z.jsx)(pe,{className:`mt-0.5 size-3.5 shrink-0`,strokeWidth:3}):null,i.text]}):null]})]})}var qf=[{theme:`light`,icon:$t,label:`theme.light`},{theme:`dark`,icon:Gt,label:`theme.dark`}],Jf=`cubic-bezier(0.3, 0.7, 0.2, 1)`;function Yf({tone:e=`surface`}){let t=en(),n=Wt(),r=e===`ground`,i=r?n:t,a=qf.findIndex(e=>e.theme===i);return(0,z.jsxs)(`fieldset`,{className:N(`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,z.jsx)(`legend`,{className:`sr-only`,children:L(`nav.theme`)}),(0,z.jsx)(`span`,{"aria-hidden":`true`,className:N(`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 ${Jf}`}}),qf.map(({theme:e,icon:t,label:n})=>(0,z.jsx)(`button`,{"aria-label":L(n),"aria-pressed":e===i,className:N(`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:()=>Ut(e),title:L(n),type:`button`,children:(0,z.jsx)(t,{className:`size-3.5`})},e))]})}function Xf(e){try{return new URL(e).host}catch{return e}}var Zf=e=>`${rt()}/w/${e.shareToken}`;function Qf(e,t,n){if(!e.published)return{kind:`draft`};if(t.mode===`managed`)return{kind:`live`,url:Zf(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:L(`cloud.notSent`)}:!r.runnable||!o||a===null?{kind:`missing`,url:o,runs:a,why:`${L(`cloud.notRunnable`,{v:r.version})} ${a===null?L(`cloud.nothingRuns`):L(`cloud.keepsRunning`,{v:a})}`}:{kind:`live`,url:o,runs:a,notes:r.problems.filter(e=>!e.blocking).length,cloud:!0}}function $f(e){return e.kind===`live`||e.kind===`sending`||e.kind===`missing`?e.url:null}function ep({where:e,me:t,version:n}){let r=Xf(t.account?.cloudUrl??``),i=`size-3.5`;switch(e.kind){case`draft`:return null;case`unknown`:return(0,z.jsx)(T,{tone:`live`,children:L(`home.live`)});case`here`:return(0,z.jsx)(T,{icon:(0,z.jsx)(Pr,{className:i}),title:L(`where.hereHint`),children:n?L(`where.hereVersion`,{v:n}):L(`where.here`)});case`live`:{let t=n?L(`editor.published`,{v:e.runs}):L(`home.live`),a=e.notes===1?L(`where.note`):e.notes>1?L(`where.notes`,{n:e.notes}):null;return(0,z.jsx)(T,{tone:`live`,icon:e.cloud?(0,z.jsx)(ir,{className:i}):void 0,title:e.cloud?L(`where.liveHint`,{host:r}):void 0,children:a?`${t} · ${a}`:t})}case`sending`:return(0,z.jsx)(T,{tone:`warn`,icon:(0,z.jsx)(St,{className:i}),title:L(`cloud.again`,{when:new Intl.DateTimeFormat(I,{timeStyle:`short`}).format(new Date(e.again))}),children:L(`where.sending`)});case`missing`:return(0,z.jsx)(T,{tone:`warn`,icon:(0,z.jsx)(Bt,{className:i}),title:e.why,children:e.runs===null?L(`where.missing`):L(`editor.published`,{v:e.runs})})}}var tp=`mt-1.5 text-[0.8125rem] text-ink-3`;function Q(e){let t=ie(),[n,r]=(0,R.useState)(!1),i=Nt({mutationFn:e=>_.post(`/api/studio/account/link`,e),onSuccess:({url:e})=>{Bf(e),r(!0)}});return(0,R.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,R.useEffect)(()=>{e&&r(!1)},[e]),{link:i,waiting:n}}function np({link:e,waiting:t}){return e.isError?(0,z.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:L(`local.accountFailed`)}):t?(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,z.jsx)(ct,{className:`size-3.5`}),` `,L(`local.accountWaiting`)]}):null}function rp({me:e}){let t=ma(`account`),n=Q(!1),{link:r}=n,[i,a]=(0,R.useState)(``);return(0,z.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,z.jsxs)(`div`,{className:`flex items-start gap-4 py-5 first:pt-0 last:pb-0`,children:[(0,z.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2`,children:(0,z.jsx)(br,{className:`size-5`})}),(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:L(`account.local`)}),(0,z.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:L(`account.localText`)}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(vf,{me:e})})]})]}),t?(0,z.jsxs)(`div`,{className:`flex flex-col gap-4 py-5 last:pb-0`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:L(`account.with`)}),(0,z.jsxs)(`ul`,{className:`mt-2 flex flex-col gap-2 text-[0.875rem] text-ink-2 leading-snug`,children:[(0,z.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,z.jsx)(Vt,{className:`mt-0.5 size-4 shrink-0 text-amber`}),L(`account.withCredits`)]}),(0,z.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,z.jsx)(ir,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),L(`account.withCloud`)]})]})]}),(0,z.jsx)(`div`,{children:(0,z.jsx)(O,{busy:r.isPending&&!r.variables?.signup,onClick:()=>r.mutate({}),children:L(`account.signIn`)})})]}):null,t?(0,z.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,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`font-medium text-[0.9375rem]`,children:L(`account.new`)}),(0,z.jsx)(`p`,{className:`mt-1 text-[0.875rem] text-ink-3 leading-relaxed`,children:L(`account.newHint`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(he,{value:i,maxLength:64,autoComplete:`off`,spellCheck:!1,placeholder:L(`account.code`),"aria-label":L(`account.code`),onChange:e=>a(e.target.value),className:`w-56 font-mono text-[0.875rem]`}),(0,z.jsx)(O,{type:`submit`,variant:`secondary`,className:`h-11`,busy:r.isPending&&!!r.variables?.signup,children:L(`account.create`)})]}),(0,z.jsx)(np,{...n})]}):null]})}var ip={start:`account.kind.start`,monthly:`account.kind.monthly`,gift:`account.kind.gift`};function ap({account:e,me:t}){let n=ie(),r=Q(e.signedIn),i=Nt({mutationFn:()=>_.del(`/api/studio/account`),onSuccess:()=>n.invalidateQueries({queryKey:[`me`]})}),a=new Intl.DateTimeFormat(I,{dateStyle:`medium`});return(0,z.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3 py-5 first:pt-0`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.name||e.email}),e.signedIn?(0,z.jsx)(T,{tone:`live`,children:L(`account.linked`)}):null]}),(0,z.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.email}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(vf,{me:t})})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(O,{variant:`secondary`,onClick:()=>Bf(e.url),children:[L(`setup.openAccount`),` `,(0,z.jsx)(ae,{className:`size-4`})]}),(0,z.jsxs)(O,{variant:`ghost`,busy:i.isPending,onClick:()=>i.mutate(),children:[(0,z.jsx)(Hr,{className:`size-4`}),` `,L(`nav.logout`)]})]})]}),e.signedIn?null:(0,z.jsxs)(`div`,{className:`flex flex-col gap-3 py-5`,children:[(0,z.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:L(`local.accountExpired`)}),(0,z.jsx)(`div`,{children:(0,z.jsx)(O,{busy:r.link.isPending,onClick:()=>r.link.mutate({}),children:L(`account.signInAgain`)})}),(0,z.jsx)(np,{...r})]}),e.credits===null?null:(0,z.jsxs)(`div`,{className:`py-5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:L(`account.credits`)}),(0,z.jsx)(`div`,{className:`font-display font-semibold text-[1.375rem] tabular-nums leading-tight`,children:L(`nav.credits`,{n:Math.floor(e.credits).toLocaleString(I)})})]}),(0,z.jsxs)(O,{variant:`secondary`,onClick:()=>Bf(`${e.url}/billing`),children:[L(`account.topUp`),` `,(0,z.jsx)(ae,{className:`size-4`})]})]}),e.expiring.length?(0,z.jsx)(`ul`,{className:`mt-3 flex flex-col gap-1 text-[0.8125rem] text-ink-3 tabular-nums`,children:e.expiring.map(e=>(0,z.jsxs)(`li`,{children:[L(`account.expires`,{n:Math.floor(e.credits).toLocaleString(I),date:a.format(new Date(e.expiresAt))}),ip[e.kind]?(0,z.jsxs)(`span`,{className:`text-ink-4`,children:[` · `,L(ip[e.kind])]}):null]},`${e.kind}:${e.expiresAt}`))}):null]}),(0,z.jsxs)(`div`,{className:`flex items-start gap-2.5 py-5 text-[0.875rem] text-ink-2 leading-snug last:pb-0`,children:[(0,z.jsx)(ir,{className:`mt-0.5 size-4 shrink-0 text-cobalt`}),(0,z.jsx)(`p`,{children:L(`account.cloud`,{host:Xf(e.cloudUrl)})})]})]})}function op({me:e,fromAccount:t}){let n=ie(),[r,i]=(0,R.useState)(e.profile),a=e=>i(t=>({...t,...e})),o=l(r,async e=>{await _.put(`/api/studio/profile`,e),await n.invalidateQueries({queryKey:[`me`]})});return(0,z.jsx)(vt,{title:L(`account.profile`),hint:L(`account.hint`),save:o,children:(0,z.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 sm:w-32`,children:[(0,z.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,z.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full object-cover`}):rn(r.name)||`?`}),(0,z.jsx)(`p`,{className:`text-center text-[0.75rem] text-ink-3 leading-snug`,children:L(`account.initials`)})]}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`account.name`)}),(0,z.jsx)(he,{value:r.name,maxLength:80,disabled:t,onChange:e=>a({name:e.target.value})}),(0,z.jsx)(`p`,{className:tp,children:L(t?`account.fromAccount`:`account.nameHint`)})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`account.about`)}),(0,z.jsx)(Ce,{minRows:3,maxLength:2e3,value:r.about,onChange:e=>a({about:e.target.value})}),(0,z.jsx)(`p`,{className:tp,children:L(`account.aboutHint`)})]}),(0,z.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`account.email`)}),(0,z.jsx)(he,{type:`email`,value:r.email,maxLength:200,disabled:t,onChange:e=>a({email:e.target.value})})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`account.phone`)}),(0,z.jsx)(he,{type:`tel`,value:r.phone,maxLength:40,onChange:e=>a({phone:e.target.value})})]})]})]})]})})}function sp({me:e}){let t=e.mode===`managed`,n=t||!!e.account;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-9`,children:[(0,z.jsx)(vt,{title:L(`account.connection`),hint:L(`account.connectionHint`),children:t?(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.user.name}),(0,z.jsx)(T,{tone:`live`,children:L(`account.linked`)})]}),(0,z.jsx)(`div`,{className:`truncate text-[0.875rem] text-ink-3`,children:e.user.email}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(vf,{me:e})})]}),e.manageUrl?(0,z.jsxs)(O,{variant:`secondary`,onClick:()=>Bf(`${e.manageUrl}/account`),children:[L(`setup.openAccount`),` `,(0,z.jsx)(ae,{className:`size-4`})]}):null]}):e.account?(0,z.jsx)(ap,{account:e.account,me:e}):(0,z.jsx)(rp,{me:e})}),(0,z.jsx)(op,{me:e,fromAccount:n},n?`account`:`own`),(0,z.jsx)(vt,{title:L(`account.look`),hint:L(`account.lookHint`),children:(0,z.jsxs)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pb-4`,children:[(0,z.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:L(`nav.language`)}),(0,z.jsx)(Cf,{})]}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-4`,children:[(0,z.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:L(`nav.theme`)}),(0,z.jsx)(Yf,{})]})]})})]})}var cp={steps:Ei,chat:Jr,talk:de,whatsapp:Kr,sms:Xr,call:gi,video:De},lp=e=>cp[e]??jt,up=[`steps`,`chat`];function dp(){return ot({queryKey:[`runners`],queryFn:()=>_.get(`/api/studio/runners`),staleTime:6e4})}function fp(e,t){let n=new Set(t.map(e=>e.id)),r=(e.runners?.enabled??up).filter(e=>n.has(e)),i=e.runners?.default??`steps`;return[...r].sort((e,t)=>e===i?-1:+(t===i))}function pp({w:e,runners:t}){let n=fp(e,t),r=e.runners?.default??`steps`;return(0,z.jsx)(`span`,{className:`inline-flex items-center gap-1.5`,children:n.map(e=>{let n=lp(e),i=t.find(t=>t.id===e)?.label[I]??e;return(0,z.jsx)(n,{"aria-label":i,className:N(`size-3.5`,e===r?`text-ink-2`:`text-ink-4`),children:(0,z.jsx)(`title`,{children:i})},e)})})}async function mp(e,t){let n=e.isFetching({queryKey:t.queryKey,exact:!0})>0;await e.cancelQueries({queryKey:t.queryKey,exact:!0});let r=e.getQueryData(t.queryKey),i=t.update(r);i!==r&&e.setQueryData(t.queryKey,i);let a=e.getQueryData(t.queryKey),o=()=>e.invalidateQueries({queryKey:t.queryKey,exact:!0});return{invalidate:o,wasFetching:n,rollback:()=>{if(e.getQueryData(t.queryKey)!==a)return o(),`invalidated`;if(r===void 0){if(a===void 0)return`unchanged`;e.removeQueries({queryKey:t.queryKey,exact:!0})}else e.setQueryData(t.queryKey,r);return`restored`}}}function hp(e,t=150){let n=new Map;return r=>{let i=JSON.stringify(r),a=n.get(i);a&&clearTimeout(a),n.set(i,setTimeout(()=>{n.delete(i),e.invalidateQueries({queryKey:r,refetchType:`active`})},t))}}var gp=[];function _p(e){for(let t of e)gp.some(e=>e.id===t.id)||gp.push(t)}var vp=new Map;function yp(e,t,n){let r=`${e}|${t}`;return vp.set(r,n),()=>{vp.get(r)===n&&vp.delete(r)}}var bp=(e,t)=>vp.get(`${e}|${t}`);function xp(e,t){return e?typeof t.revision==`number`&&typeof e.revision==`number`?t.revision>e.revision:t.updatedAt&&e.updatedAt?Date.parse(t.updatedAt)>Date.parse(e.updatedAt):!0:!0}async function Sp(e,t,n){if(!e.getQueryCache().find({queryKey:t,exact:!0}))return!1;let r=!1,i=await mp(e,{queryKey:t,update:e=>{let t=n(e);return t===void 0||t===e?e:(r=!0,t)}});return i.wasFetching&&i.invalidate(),r}function Cp(e,t,n){e.setQueriesData({queryKey:t},e=>Array.isArray(e)?n(e)??e:e)}function wp(e,t,n){let r=e.findIndex(e=>e.id===t.id);if(r<0)return n===`none`?void 0:n===`first`?[t,...e]:[...e,t];if(!xp(e[r],t))return;let i=e.slice();return i[r]=t,i}var Tp=(e,t)=>e.some(e=>e.id===t)?e.filter(e=>e.id!==t):void 0,Ep=1500,Dp=new Map,Op=new Map,kp=e=>{for(let t of Op.get(e)??[])t()};function Ap(e){Dp.set(e,{at:Date.now(),n:(Dp.get(e)?.n??0)+1}),kp(e),setTimeout(()=>{let t=Dp.get(e);t&&Date.now()-t.at>=Ep&&(Dp.delete(e),kp(e))},1550)}function jp(e){let t=Dp.get(e);return!t||Date.now()-t.at>=Ep?``:t.n%2?`live-flash-a`:`live-flash-b`}function Mp(e,t){let n=Op.get(e)??new Set;return n.add(t),Op.set(e,n),()=>{n.delete(t),n.size||Op.delete(e)}}function Np(e){let t=hp(e,150),n={qc:e,invalidate:t,flash:Ap};return async function(e){let r=[];Pe.batch(()=>{for(let i of e)for(let e of gp){if(!e.kinds.includes(i.kind))continue;let a=()=>{for(let n of e.fallback(i))t(n)};if(i.op===`put`&&i.view===void 0){a();continue}try{let t=e.patch(i,n);t&&r.push(t.catch(t=>{console.warn(`[live] ${e.id} could not patch ${i.kind}:`,t),a()}))}catch(t){console.warn(`[live] ${e.id} could not patch ${i.kind}:`,t),a()}}}),await Promise.all(r)}}function Pp(e){e.invalidateQueries({refetchType:`active`})}var Fp=(e,t)=>(e.getQueryCache().find({queryKey:t,exact:!0})?.getObserversCount()??0)>0,Ip=[{id:`wizards`,kinds:[`wizard`],patch:async(e,{qc:t,flash:n})=>{let r=[D.wizards(e.projectId??void 0),D.projectWizards(e.projectId??``)];if(e.op===`del`){for(let n of r)Cp(t,n,t=>Tp(t,e.item));return}let i=e.view;for(let n of r)Cp(t,n,t=>wp(t,{...t.find(t=>t.id===e.item),...i.summary},`first`));n(e.item);let a=bp(`wizard`,e.item);a?a(e):Fp(t,D.wizard(e.item))||await Sp(t,D.wizard(e.item),e=>xp(e,i.detail)?i.detail:e)},fallback:e=>[D.wizards(e.projectId??void 0),D.projectWizards(e.projectId??``)]},{id:`translations`,kinds:[`translation`],patch:(e,{qc:t})=>{e.parent&&e.view&&t.setQueryData(D.translations(e.parent),e.view)},fallback:e=>e.parent?[D.translations(e.parent)]:[]},{id:`messages`,kinds:[`message`],patch:()=>void 0,fallback:()=>[]}],Lp=[{id:`pages`,kinds:[`page`],patch:async(e,{qc:t,invalidate:n,flash:r})=>{let i=D.page(e.item),a=t.getQueryData(i);if(e.op===`del`)t.removeQueries({queryKey:i,exact:!0});else{let n=e.view,r=bp(`page`,e.item);if(r?r(e):await Sp(t,i,e=>xp(e,n)?n:e),a&&a.title===n.title)return}r(e.item),n(D.knowledge(e.projectId??void 0)),n(D.spaceData(e.projectId??void 0))},fallback:e=>[D.page(e.item),D.knowledge(e.projectId??void 0),D.spaceData(e.projectId??void 0)]},{id:`tables`,kinds:[`table`],patch:async(e,{qc:t,invalidate:n})=>{let r=D.table(e.item),i=t.getQueryData(r);if(e.op===`del`)t.removeQueries({queryKey:r,exact:!0});else{let n=e.view;if(await Sp(t,r,e=>e&&{...n,rows:e.rows}),i&&i.title===n.title)return}n(D.knowledge(e.projectId??void 0)),n(D.spaceData(e.projectId??void 0))},fallback:e=>[D.table(e.item),D.knowledge(e.projectId??void 0),D.spaceData(e.projectId??void 0)]},{id:`rows`,kinds:[`row`],patch:async(e,{qc:t,invalidate:n,flash:r})=>{if(!e.parent)return;let i=D.table(e.parent),a=e.view;await Sp(t,i,t=>{if(!t)return t;if(e.op===`del`||!a){let n=Tp(t.rows,e.item);return n?{...t,rows:n}:t}let{tableId:n,...r}=a,i=wp(t.rows,r,`last`);return i?{...t,rows:i}:t}),e.op===`put`&&r(e.item),n(D.spaceData(e.projectId??void 0))},fallback:e=>[...e.parent?[D.table(e.parent)]:[],D.spaceData(e.projectId??void 0)]},{id:`categories`,kinds:[`category`],patch:(e,{invalidate:t})=>{t(D.knowledge(e.projectId??void 0)),t(D.knowledgeValues())},fallback:e=>[D.knowledge(e.projectId??void 0),D.knowledgeValues()]},{id:`files`,kinds:[`file`],patch:(e,{qc:t,invalidate:n,flash:r})=>{if(!e.projectId)return;let i=D.files(e.projectId),a=t.getQueryData(i);if(a){let n=e.op===`del`?Tp(a.files,e.item):wp(a.files,e.view,`first`);n&&t.setQueryData(i,{...a,files:n})}e.op===`put`&&r(e.item),n(D.fileText(e.item)),n(D.knowledge(e.projectId))},fallback:e=>[...e.projectId?[D.files(e.projectId),D.knowledge(e.projectId)]:[],D.fileText(e.item)]}],Rp=Math.random().toString(36).slice(2,10),zp=[{id:`presence`,kinds:[`presence`],patch:(e,{qc:t})=>{if(!e.parent)return;let n=e.item.slice(e.parent.length+1),r=e.view??[];t.setQueryData(D.presence(e.parent,n),r),t.setQueryData(D.presentItems(e.parent),e=>{if(!e)return e;let t={...e};return r.length?t[n]=r:delete t[n],t})},fallback:e=>e.parent?[D.presence(e.parent,e.item.slice(e.parent.length+1)),D.presentItems(e.parent)]:[]}];function Bp(e,t,n){let r=ma(`liveChanges`);return(ot({queryKey:D.presence(e,t??``),queryFn:()=>_.get(`/api/studio/presence/${e}/${t}`),enabled:r&&!!t,refetchInterval:6e4}).data??[]).filter(e=>e.who!==n)}function Vp(e){let t=ma(`liveChanges`);return ot({queryKey:D.presentItems(e),queryFn:()=>_.get(`/api/studio/presence/${e}`),enabled:t,refetchInterval:6e4}).data}var Hp=2e4;function Up(e,t,n){let r=ma(`liveChanges`),i=(0,R.useRef)(n);i.current=n;let a=`${n.state}|${n.place??``}`;(0,R.useEffect)(()=>{if(!r||!t)return;let n=()=>_.put(`/api/studio/presence`,{kind:e,item:t,tab:Rp,...i.current}).catch(()=>void 0);n();let a=setInterval(()=>void n(),Hp),o=()=>navigator.sendBeacon?.(Ye(`/api/studio/presence/leave`),new Blob([JSON.stringify({kind:e,item:t,tab:Rp})],{type:`text/plain`}));return window.addEventListener(`pagehide`,o),()=>{clearInterval(a),window.removeEventListener(`pagehide`,o),_.post(`/api/studio/presence/leave`,{kind:e,item:t,tab:Rp}).catch(()=>void 0)}},[r,e,t]),(0,R.useEffect)(()=>{if(!r||!t)return;let n=setTimeout(()=>void _.put(`/api/studio/presence`,{kind:e,item:t,tab:Rp,...i.current}).catch(()=>void 0),1e3);return()=>clearTimeout(n)},[r,e,t,a])}var Wp=[{id:`spaces`,kinds:[`space`],patch:(e,{qc:t,invalidate:n})=>{let r=t.getQueryData(D.spaces());if(r){let n=e.op===`del`?Tp(r,e.item):wp(r,e.view,`last`);n&&t.setQueryData(D.spaces(),n)}n(D.themes(e.item))},fallback:e=>[D.spaces(),D.themes(e.item)]},{id:`connectors`,kinds:[`connector`],patch:(e,{qc:t})=>{if(!e.projectId)return;let n=D.connectors(e.projectId),r=t.getQueryData(n);if(!r)return;let i=e.item.slice(e.projectId.length+1),a=e.op===`del`?Tp(r,i):wp(r,e.view,`last`);a&&t.setQueryData(n,a)},fallback:e=>e.projectId?[D.connectors(e.projectId)]:[]}],Gp=100,Kp=45e3,qp=3e4;function Jp(e){let t=ma(`liveChanges`),n=ie();(0,R.useEffect)(()=>{if(!t){console.info(`[live] off: the liveChanges switch is off`);return}return Yp(n,e)},[t,n,e])}function Yp(e,t){let n=`wz-live:${t}`,r=new AbortController,i=typeof BroadcastChannel==`function`?new BroadcastChannel(n):null,a=Np(e),o=null,s=new Map,c=null,l=()=>{c=null;let e=[...s.values()];s=new Map,a(e)},u=t=>{if(`seq`in t&&(o=t.seq),t.event===`changes`){for(let e of t.items){let t=`${e.kind}|${e.item}`;s.delete(t),s.set(t,e)}c??=setTimeout(l,Gp)}else t.event===`reset`?(s.clear(),Pp(e)):t.event===`sync`&&e.invalidateQueries({queryKey:D.cloudSync()})};i&&(i.onmessage=e=>u(e.data));let d=async()=>{await Xp(()=>o,e=>{u(e),i?.postMessage(e)},r.signal)};return typeof navigator<`u`&&navigator.locks?navigator.locks.request(n,{signal:r.signal},d).catch(e=>{r.signal.aborted||console.warn(`[live]`,e)}):d(),()=>{r.abort(),i?.close(),c&&clearTimeout(c)}}async function Xp(e,t,n){let r=1e3;for(;!n.aborted;){let i=new AbortController,a=()=>i.abort();n.addEventListener(`abort`,a,{once:!0});let o=null,s=()=>{o&&clearTimeout(o),o=setTimeout(()=>i.abort(),Kp)};try{let a=e(),o=await fetch(Ye(`/api/studio/live`),{credentials:`include`,headers:{accept:`text/event-stream`,"x-wizards-client":`web`,...a===null?{}:{"last-event-id":String(a)}},signal:i.signal});if(o.status===404){console.info(`[live] off: this runtime has no live stream`);return}if(o.status===429){console.info(`[live] waiting: too many studio windows are open`),await Zp(qp,n);continue}if(!o.ok||!o.body)throw Error(`live stream answered ${o.status}`);r=1e3,s(),await Qp(o.body,e=>{s(),t(e)})}catch(e){if(n.aborted)return;i.signal.aborted||console.info(`[live] dropped, reconnecting:`,e.message)}finally{o&&clearTimeout(o),n.removeEventListener(`abort`,a)}await Zp(r,n),r=Math.min(r*2,3e4)}}function Zp(e,t){return new Promise(n=>{let r=()=>{clearTimeout(a),document.removeEventListener(`visibilitychange`,i),window.removeEventListener(`online`,r),t.removeEventListener(`abort`,r),n()},i=()=>{document.visibilityState===`visible`&&r()},a=setTimeout(r,e);document.addEventListener(`visibilitychange`,i),window.addEventListener(`online`,r),t.addEventListener(`abort`,r)})}async function Qp(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return;i+=r.decode(a,{stream:!0});let o=i.indexOf(`
29
-
30
- `);for(;o>=0;){let e=i.slice(0,o);i=i.slice(o+2);let n=`message`,r=``;for(let t of e.split(`
31
- `))t.startsWith(`event:`)?n=t.slice(6).trim():t.startsWith(`data:`)&&(r+=t.slice(5).replace(/^ /,``));t({event:n,...r?JSON.parse(r):{}}),o=i.indexOf(`
32
-
33
- `)}}}_p([...Wp,...Ip,...Lp,...zp]);function $p(e){let[,t]=(0,R.useReducer)(e=>e+1,0);return(0,R.useEffect)(()=>Mp(e,t),[e]),jp(e)}function em(e){let t=0;for(let n of e)t=(t*31+n.charCodeAt(0))%360;return`oklch(72% 0.13 ${t})`}var tm=e=>e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)||`?`;function nm(e){let t=Math.max(0,Math.round((Date.parse(e)-Date.now())/1e3));return new Intl.RelativeTimeFormat(I,{numeric:`auto`}).format(Math.abs(t)<60?-Math.abs(t):-Math.round(Math.abs(t)/60),Math.abs(t)<60?`second`:`minute`)}function rm(e){let t=e.whoKind===`assistant`?L(`presence.assistant`,{person:e.client??L(`presence.someone`)}):e.whoKind===`agent`?e.client?L(`presence.agentFor`,{name:e.name,person:e.client,ago:nm(e.seenAt)}):L(`presence.agent`,{name:e.name,ago:nm(e.seenAt)}):L(e.state===`editing`?`presence.editing`:`presence.viewing`,{name:e.name});return e.placeLabel?L(`presence.at`,{who:t,place:e.placeLabel}):t}function im({kind:e,item:t,me:n,className:r}){let i=Bp(e,t,n),a=new Map;for(let e of i){let t=a.get(e.who);(!t||e.state===`editing`&&t.state!==`editing`)&&a.set(e.who,e)}let o=[...a.values()];return o.length?(0,z.jsxs)(`ul`,{"aria-label":L(`presence.here`),className:N(`flex shrink-0 items-center -space-x-1.5`,r),children:[o.slice(0,4).map(e=>(0,z.jsx)(`li`,{title:rm(e),"aria-label":rm(e),className:N(`relative grid size-7 place-items-center rounded-full font-semibold text-[0.6875rem] ring-2 ring-background`,e.state===`editing`&&`outline-2 outline-offset-1`),style:{background:em(e.who),outlineColor:em(e.who),color:`oklch(24% 0.03 260)`},children:e.whoKind===`person`?tm(e.name):(0,z.jsx)(It,{className:`size-3.5`})},e.who)),o.length>4?(0,z.jsxs)(`li`,{className:`grid size-7 place-items-center rounded-full bg-paper-2 text-[0.6875rem] text-ink-3 ring-2 ring-background`,children:[`+`,o.length-4]}):null]}):null}function am(e,t,n,r){let i=Bp(e,t,n);return r?i.find(e=>e.place===r&&e.state===`editing`&&e.whoKind===`person`)??null:null}function om(e,t,n){return Bp(e,t,n).filter(e=>e.state===`editing`)}function sm({wizard:e,className:t,onDeleted:n}){let r=ie(),i=ze(),a=Yt(),[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(!1),u=(0,R.useRef)(null);Vm(u,o,()=>s(!1));let d=Nt({mutationFn:()=>_.post(`/api/studio/wizards/${e.id}/duplicate`),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`wizards`]}),i(`/edit/${e}`)}}),f=Nt({mutationFn:()=>_.del(`/api/studio/wizards/${e.id}`),onSuccess:async()=>{l(!1),await r.invalidateQueries({queryKey:[`wizards`]}),await r.invalidateQueries({queryKey:D.spaces()}),n?.()}}),p=`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,z.jsxs)(`div`,{ref:u,className:N(`relative`,t),onClick:e=>e.stopPropagation(),children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":L(`wizardMenu.label`),title:L(`wizardMenu.label`),"aria-haspopup":`menu`,"aria-expanded":o,onClick:()=>s(e=>!e),className:N(`grid size-8 place-items-center rounded-full text-ink-3 transition hover:bg-accent hover:text-ink`,o&&`bg-accent text-ink`),children:(0,z.jsx)(g,{className:`size-4`})}),o?(0,z.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,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:p,disabled:d.isPending,onClick:()=>{s(!1),d.mutate()},children:[(0,z.jsx)(ue,{className:`size-4 shrink-0`}),` `,L(`wizardMenu.duplicate`)]}),(0,z.jsxs)(`a`,{role:`menuitem`,href:Ye(`/api/studio/wizards/${e.id}/export`),download:!0,className:p,onClick:()=>s(!1),children:[(0,z.jsx)(x,{className:`size-4 shrink-0`}),` `,L(`editor.export`)]}),a?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:N(p,`text-rose hover:bg-rose-tint hover:text-rose`),onClick:()=>{s(!1),l(!0)},children:[(0,z.jsx)(ut,{className:`size-4 shrink-0`}),` `,L(`wizardMenu.delete`)]})]}):null]}):null,(0,z.jsxs)($e,{open:c,onClose:()=>l(!1),title:L(`wizardMenu.deleteTitle`,{title:e.title}),children:[(0,z.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:e.published?L(`wizardMenu.deletePublished`):L(`wizardMenu.deleteDraft`)}),f.error?(0,z.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-rose`,children:f.error.message}):null,(0,z.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,z.jsx)(O,{variant:`ghost`,onClick:()=>l(!1),children:L(`common.cancel`)}),(0,z.jsxs)(O,{variant:`danger`,busy:f.isPending,onClick:()=>f.mutate(),children:[(0,z.jsx)(ut,{className:`size-4`}),` `,L(`wizardMenu.delete`)]})]})]})]})}var cm=e({HomePage:()=>Tm,NewSpaceDialog:()=>um,ProjectSwitcher:()=>dm}),lm=[{icon:Et,name:()=>L(`nav.wizards`),what:`space.holds.wizards`},{icon:fr,name:()=>L(`space.info`),what:`space.holds.info`},{icon:Wn,name:()=>`${L(`space.knowledge`)} & ${L(`space.data`)}`,what:`space.holds.knowledge`},{icon:Lt,name:()=>L(`connectors.title`),what:`space.holds.connectors`},{icon:Or,name:()=>L(`space.results`),what:`space.holds.results`}];function um({open:e,onClose:t}){let{select:n}=F(),r=ie(),[i,a]=(0,R.useState)(``),o=Nt({mutationFn:()=>_.post(`/api/studio/projects`,{name:i}),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:D.spaces()}),n(e),a(``),t()}});return(0,z.jsxs)($e,{open:e,onClose:t,title:L(`home.newProject`),children:[(0,z.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:L(`space.holds.intro`)}),(0,z.jsx)(`dl`,{className:`mt-4 flex flex-col gap-2.5 text-[0.8125rem]`,children:lm.map(e=>(0,z.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,z.jsx)(e.icon,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`dt`,{className:`w-28 shrink-0 font-medium text-ink`,children:e.name()}),(0,z.jsx)(`dd`,{className:`min-w-0 text-ink-3`,children:L(e.what)})]},e.what))}),(0,z.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-ink-4`,children:L(`space.holds.shared`)}),(0,z.jsxs)(`form`,{className:`mt-5`,onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,z.jsx)(he,{autoFocus:!0,placeholder:L(`home.projectName`),value:i,onChange:e=>a(e.target.value)}),(0,z.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,z.jsx)(O,{variant:`ghost`,onClick:t,children:L(`common.cancel`)}),(0,z.jsx)(O,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:L(`home.newProject`)})]})]})]})}function dm(){let{project:e,projects:t,select:n}=F(),r=Xt().data?.limits.projects??1,i=Zt(),[a,o]=(0,R.useState)(!1);return!e||r!==null&&r<=1?null:(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(ke,{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:`+ ${L(`home.newProject`)}`}:{value:`__new`,label:L(`home.projectLimit`,{n:r}),disabled:!0}]:[]]}),(0,z.jsx)(um,{open:a,onClose:()=>o(!1)})]})}function fm({url:e}){let[t,n]=(0,R.useState)(!1);return(0,z.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,z.jsx)(pe,{className:`size-3.5`}):(0,z.jsx)(ue,{className:`size-3.5`}),L(t?`share.copied`:`share.link`)]})}function pm(){let e=ze(),t=Q(!1),[n,r]=(0,R.useState)(!1),i=(0,R.useRef)(null);return(0,R.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,z.jsxs)(`div`,{className:`relative`,ref:i,onClick:e=>e.stopPropagation(),children:[(0,z.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,z.jsx)(ue,{className:`size-3.5`}),` `,L(`share.link`)]}),n?(0,z.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,z.jsx)(`p`,{className:`text-[0.8125rem] text-ink-2 leading-relaxed`,children:L(`teaser.link`)}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(O,{size:`sm`,busy:t.link.isPending,onClick:()=>t.link.mutate({}),children:L(`account.signIn`)}),(0,z.jsx)(O,{size:`sm`,variant:`secondary`,onClick:()=>e(`/settings/account`),children:L(`account.create`)})]}),(0,z.jsx)(np,{...t})]}):null]})}function mm({w:e,me:t,runners:n,present:r}){let i=ma(`account`),a=ze(),o=Qf(e,t,e.cloud),s=$f(o),c=s??(e.published?Zf(e):null),l=$p(e.id);return(0,z.jsxs)(`div`,{className:`group/card relative pt-6`,children:[(0,z.jsx)(`div`,{className:`pointer-events-none absolute top-0 left-4 z-10`,children:(0,z.jsx)(cn,{kind:e.avatar,costume:e.costume,size:52})}),(0,z.jsxs)(y,{className:N(`relative flex h-full cursor-pointer flex-col px-5 pt-10 pb-3 transition hover:shadow-elevated`,l),onClick:()=>a(`/edit/${e.id}`),children:[(0,z.jsx)(`div`,{className:`absolute top-3 right-3`,children:e.published?(0,z.jsx)(ep,{where:o,me:t}):(0,z.jsx)(T,{children:L(`home.draft`)})}),(0,z.jsx)(`h3`,{className:`font-display font-semibold text-[1.0625rem] leading-snug`,children:e.title}),(0,z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[0.875rem] text-ink-3`,children:e.description}),(0,z.jsxs)(`div`,{className:`mt-auto flex min-h-8 items-center justify-between pt-3`,children:[(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2.5 text-[0.75rem] text-ink-4`,children:[L(`home.steps`,{n:e.stepCount}),(0,z.jsx)(pp,{w:e,runners:n}),r?.length?(0,z.jsx)(`span`,{role:`img`,className:`inline-flex items-center gap-1`,title:r.map(rm).join(`
34
- `),"aria-label":r.map(rm).join(`, `),children:r.slice(0,3).map(e=>(0,z.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:em(e.who)}},`${e.who}|${e.tab}`))}):null]}),(0,z.jsxs)(`div`,{className:`flex items-center`,children:[(0,z.jsx)(sm,{wizard:e,className:`opacity-0 transition group-hover/card:opacity-100 has-[[aria-expanded=true]]:opacity-100 focus-within:opacity-100 coarse:opacity-100`}),s?(0,z.jsx)(fm,{url:s}):o.kind===`here`&&i?(0,z.jsx)(pm,{}):null,c?(0,z.jsx)(_e,{label:L(s?`share.open`:`share.openHere`),className:`ml-1 size-8`,onClick:e=>{e.stopPropagation(),Bf(c)},children:(0,z.jsx)(Bn,{className:`size-4`})}):null]})]})]})]})}var hm=[`draft`,`here`,`live`,`missing`],gm={draft:gt,here:Pr,live:bi,missing:Bt},_m=e=>L(e===`draft`?`home.draft`:e===`here`?`where.here`:e===`live`?`home.live`:`where.missing`);function vm(e,t){let{kind:n}=Qf(e,t,e.cloud);return n===`draft`||n===`here`?n:n===`live`||n===`unknown`?`live`:`missing`}function ym({wizards:e,me:t,value:n,onChange:r}){let i=new Map;for(let n of e){let e=vm(n,t);i.set(e,(i.get(e)??0)+1)}if(i.size<2)return null;let a=e=>N(`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,z.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-1`,children:[(0,z.jsxs)(`button`,{type:`button`,className:a(n===null),onClick:()=>r(null),children:[L(`home.all`),(0,z.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:e.length})]}),hm.filter(e=>i.has(e)).map(e=>{let t=gm[e];return(0,z.jsxs)(`button`,{type:`button`,"aria-pressed":n===e,className:a(n===e),onClick:()=>r(n===e?null:e),children:[(0,z.jsx)(t,{className:`size-3.5`}),_m(e),(0,z.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:i.get(e)})]},e)})]})}var bm=12,xm=3;function Sm({value:e,onChange:t}){return(0,z.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,z.jsx)(Fe,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:L(`home.search`),"aria-label":L(`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,z.jsx)(`button`,{type:`button`,"aria-label":L(`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,z.jsx)(at,{className:`size-4`})}):null]})}var Cm=`curl -fsSL https://engenty.ai/install.sh | bash`;function wm(){let[e,t]=(0,R.useState)(!1),n=[L(`home.local.install`),L(`home.local.signIn`),L(`home.local.publish`)];return(0,z.jsxs)(`div`,{className:`mx-auto flex max-w-xl animate-rise flex-col items-center pt-4 text-center`,children:[(0,z.jsx)(cn,{kind:`round`,size:120}),(0,z.jsx)(`h1`,{className:`mt-2 font-display font-semibold text-[1.75rem] leading-tight tracking-tight`,children:L(`home.local.title`)}),(0,z.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:L(`home.local.text`)}),(0,z.jsx)(`ol`,{className:`mt-8 flex w-full flex-col gap-4 text-left`,children:n.map((n,r)=>(0,z.jsxs)(`li`,{className:`flex gap-3`,children:[(0,z.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,z.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,z.jsx)(`p`,{className:`text-[0.9375rem] leading-snug`,children:n}),r===0?(0,z.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,z.jsx)(`code`,{className:`min-w-0 flex-1 select-all overflow-x-auto whitespace-nowrap font-mono text-[0.8125rem] text-ink-2`,children:Cm}),(0,z.jsxs)(O,{variant:`secondary`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(Cm),t(!0),setTimeout(()=>t(!1),1500)},children:[e?(0,z.jsx)(pe,{className:`size-3.5`}):(0,z.jsx)(ue,{className:`size-3.5`}),L(e?`share.copied`:`share.copy`)]})]}):null]})]},n))})]})}function Tm(){let e=ze(),t=ie(),{project:n,projects:r,loading:i}=F(),a=Xt().data,o=nn(),s=Zt(),c=ot({queryKey:[`wizards`,n?.id,!!a?.account],queryFn:()=>_.get(`/api/studio/projects/${n.id}/wizards`),enabled:!!n}),l=dp().data??[],u=Vp(`wizard`),[d,f]=(0,R.useState)(null),[p,m]=(0,R.useState)(``),h=(c.data?.length??0)>bm,g=h?p.trim().toLowerCase():``,v=(c.data??[]).filter(e=>(!d||!a||vm(e,a)===d)&&(!g||`${e.title} ${e.description}`.toLowerCase().includes(g))),y=!!g&&v.length<xm,b=Nt({mutationFn:e=>_.post(`/api/studio/wizards`,{projectId:n.id,starterId:e,lang:I}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:D.spaces()}),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,z.jsx)(Ae,{to:`/new`,replace:!0}):!i&&!o&&r.length===0?(0,z.jsx)(wm,{}):(0,z.jsxs)(`div`,{className:`animate-rise`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[h?(0,z.jsx)(Sm,{value:p,onChange:m}):(0,z.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] tracking-tight`,children:L(`home.title`,{space:n?.name??``})}),S?(0,z.jsxs)(O,{onClick:()=>e(`/new`),children:[(0,z.jsx)(yt,{className:`size-4`}),` `,L(`home.new`)]}):null]}),n?.origin===`local`?(0,z.jsxs)(`p`,{className:`mt-2 text-[0.875rem] text-ink-3`,children:[L(`home.fromLocal`),` `,n.syncedAt?L(`home.syncedAt`,{when:new Intl.DateTimeFormat(I,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.syncedAt))}):null]}):null,c.data&&c.data.length===0?(0,z.jsxs)(w,{children:[(0,z.jsx)(`p`,{children:L(`home.empty`)}),S?(0,z.jsxs)(O,{className:`mt-5`,onClick:()=>e(`/new`),children:[(0,z.jsx)(yt,{className:`size-4`}),` `,L(`home.new`)]}):null]}):null,c.data?.length&&a?(0,z.jsx)(ym,{wizards:c.data,me:a,value:d,onChange:f}):null,g&&v.length===0?(0,z.jsx)(`p`,{className:`mt-6 text-[0.875rem] text-ink-3`,children:L(`home.noMatch`)}):null,(0,z.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:a?v.map(e=>(0,z.jsx)(mm,{w:e,me:a,runners:l,present:u?.[e.id]?.filter(e=>e.who!==a.user.id)},e.id)):null}),y?(0,z.jsxs)(z.Fragment,{children:[S?(0,z.jsx)(Dt,{query:p,busy:b.isPending,onUse:e=>n&&!b.isPending&&b.mutate(e.id)}):(0,z.jsx)(Dt,{query:p}),S?(0,z.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,z.jsxs)(O,{variant:`secondary`,onClick:()=>e(`/new?wish=${encodeURIComponent(p.trim())}`),children:[(0,z.jsx)(Xe,{className:`size-4`}),` `,L(`home.newFromSearch`,{q:p.trim()})]})}):null]}):null]})}var Em=(0,R.lazy)(()=>Ft(()=>import(`./ChangelogDialog-Vjxg6JV8.js`).then(e=>({default:e.ChangelogDialog})),__vite__mapDeps([11,1,2,3,4,5]))),Dm=`wizards.update-banner`;function Om(){try{return localStorage.getItem(Dm)}catch{return null}}function km(){let[e,t]=(0,R.useState)(Om),[n,r]=(0,R.useState)(!1),{data:i,latest:a,apply:o,busy:s,progress:c}=$s(),l=i&&!i.newer?i.updated?.to??null:null,u=l??(i?.newer?a:null);if(!(i&&u)||e===u&&i.applying===`idle`)return null;let d=()=>{try{localStorage.setItem(Dm,u)}catch{}t(u)},f=c??(l?L(`about.update.updated`,{v:u}):i.pending?.version===u?L(`about.update.ready`,{v:u}):L(`about.update.available`,{v:u}));return(0,z.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,z.jsx)(ct,{className:`size-4 shrink-0 text-ember-strong`}):(0,z.jsx)(x,{className:`size-4 shrink-0 text-ember-strong`}),(0,z.jsx)(`p`,{className:`min-w-0 flex-1`,children:f}),s?null:(0,z.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`shrink-0 underline transition hover:text-ink`,children:L(`about.update.notes`)}),n?(0,z.jsx)(R.Suspense,{fallback:null,children:(0,z.jsx)(Em,{open:!0,version:u,onClose:()=>r(!1)})}):null,i.canApply&&!l&&(i.applying===`idle`||i.applying===`failed`)?(0,z.jsx)(O,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:L(`about.update.install`)}):null,s?null:(0,z.jsx)(_e,{label:L(`install.app.close`),onClick:d,className:`size-8`,children:(0,z.jsx)(at,{className:`size-4`})})]})}var Am=[],jm=new Set;function Mm(e){Am=e;for(let e of jm)e()}function Nm(e){let t=JSON.stringify(e);(0,R.useEffect)(()=>(Mm(JSON.parse(t)),()=>Mm([])),[t])}function Pm(){return Am}function Fm(){return(0,R.useSyncExternalStore)(e=>(jm.add(e),()=>jm.delete(e)),()=>Am)}function Im({alone:e=!1}){let t=Fm();return t.length?(0,z.jsx)(`nav`,{"aria-label":L(`nav.breadcrumb`),className:`flex min-w-0 items-center text-[0.9375rem] max-sm:hidden`,children:t.map((n,r)=>(0,z.jsxs)(R.Fragment,{children:[e&&r===0?null:(0,z.jsx)(`span`,{className:N(`mr-2 text-ink-4`,r===0?`-ml-1 sm:-ml-2`:`ml-2`),children:`/`}),n.to&&r<t.length-1?(0,z.jsx)(le,{to:n.to,className:`truncate text-ink-3 transition hover:text-ink`,children:n.label}):(0,z.jsx)(`span`,{"aria-current":`page`,className:`truncate font-medium text-ink`,children:n.label})]},`${r}:${n.label}`))}):null}var Lm=e=>e.manageUrl??e.account?.url??null;function Rm(e){let t=Lm(e);return t?`${t}/billing`:null}function zm({me:e}){let t=Jt(e),n=Rm(e);return t===null||!n?null:(0,z.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:N(`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:L(`nav.credits`,{n:Math.floor(t).toLocaleString(I)})})}function Bm(e,t){return e.mode===`local`?e.account?e.account.signedIn?`linked`:`expired`:t?`alone`:null:null}function Vm(e,t,n){let r=(0,R.useRef)(n);r.current=n,(0,R.useEffect)(()=>{if(!t)return;let n=t=>{e.current?.contains(t.target)||r.current()},i=e=>{e.key===`Escape`&&r.current()};return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,i)}},[e,t])}function Hm(e,t,n){return e===`below`?n:da(t,e===`bar-start`?`start`:`end`)}var Um=e=>`oklch(from ${e} calc(0.16 + 0.83 * clamp(0, (0.65 - l) * 1000, 1)) 0.01 h)`;function Wm({project:e,name:t,size:n=`md`}){let r=e?.brand.colors?.[0]?.value,i=rn(t??e?.name??``),a=(0,z.jsx)(`span`,{className:N(`grid shrink-0 place-items-center font-semibold tracking-wide`,n===`md`?`size-10 rounded-lg text-[0.8125rem]`:n===`sm`?`size-9 rounded-lg text-[0.75rem]`:`size-6 rounded-md text-[0.5625rem]`,r?null:`bg-paper-3 text-ink ring-1 ring-border`),style:r?{background:r,color:Um(r)}:void 0,children:i||(0,z.jsx)(gr,{className:`size-4`})});return e?.origin===`local`?(0,z.jsxs)(`span`,{className:`relative shrink-0`,title:L(`readonly.project`),children:[a,(0,z.jsx)(`span`,{className:`-right-1 -bottom-1 absolute grid size-4 place-items-center rounded-full bg-amber ring-2 ring-paper`,children:(0,z.jsx)(Pr,{className:`size-2.5 text-paper`})})]}):a}function Gm(e){let{projects:t}=F();return e.mode===`managed`&&!!e.tenant.name&&e.limits.projects===1&&t.length<=1}function Km({me:e,placement:t,label:n,className:r,children:i}){let a=ze(),{position:o,phone:s}=ca(),{project:c,projects:l,select:d}=F(),f=Gm(e),p=fc(e),m=Zt(),[h,g]=(0,R.useState)(!1),[_,v]=(0,R.useState)(!1),[y,b]=(0,R.useState)(!1),[x,S]=(0,R.useState)(!1),C=uc(e),[ee,w]=(0,R.useState)({top:0,left:0}),te=(0,R.useRef)(null);Vm(te,h,()=>g(!1));let T=e.limits.projects,E=T!==null&&l.length>=T,ne=`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,z.jsx)(`div`,{className:`shrink-0`,ref:te,children:(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();w({top:t.bottom+6,left:t.left}),g(e=>!e)},"aria-expanded":h,"aria-haspopup":`menu`,"aria-label":n,title:f?void 0:L(`nav.switchSpace`),className:typeof r==`function`?r(h):r,children:i}),h?(0,z.jsxs)(`div`,{role:`menu`,style:t===`below`?{position:`fixed`,...ee}:void 0,className:N(`z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`below`?null:N(`absolute`,Hm(t,o,`top-10 left-0`))),children:[f&&cc(e)&&!s?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:L(`organizations.mine`)}),(0,z.jsx)(pc,{me:e,onDone:()=>g(!1)}),(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`})]}):null,f&&!(cc(e)&&s)?null:C&&cc(e)?(0,z.jsxs)(z.Fragment,{children:[(0,z.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:()=>{g(!1),S(!0)},children:[(0,z.jsx)(dc,{org:C,size:`xs`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,z.jsx)(`span`,{className:`truncate font-semibold text-[0.875rem] text-ink`,children:C.name}),C.plan?(0,z.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:C.plan.name}):null]}),(0,z.jsx)(`span`,{className:`shrink-0 text-[0.8125rem] text-ink-3`,children:L(`organizations.switchShort`)}),(0,z.jsx)(u,{className:`size-4 shrink-0 text-ink-4`})]}),(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`})]}):e.tenant.name?(0,z.jsx)(`div`,{className:`truncate px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:e.tenant.name}):null,(f?[]:l).map(e=>{let t=e.id===c?.id;return(0,z.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:()=>{g(!1),t?a(`/`):d(e.id)},children:[(0,z.jsx)(Wm,{project:e,size:`sm`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,z.jsx)(`span`,{className:N(`truncate text-[0.875rem]`,t?`font-semibold text-ink`:`font-medium text-ink-2`),children:e.name}),(0,z.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:L(`nav.wizardCount`,{n:e.wizardCount})})]}),t?(0,z.jsx)(pe,{className:`size-4 shrink-0 text-ember-strong`}):null]},e.id)}),f?null:(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),[{to:`/`,icon:Et,label:L(f?`nav.allWizards`:`nav.wizardsInSpace`),show:!0},{to:`/new`,icon:yt,label:L(`nav.addWizard`),show:m}].filter(e=>e.show).map(e=>(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ne,onClick:()=>{g(!1),a(e.to)},children:[(0,z.jsx)(e.icon,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)),f&&!cc(e)?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ne,onClick:()=>{g(!1),p()},children:[(0,z.jsx)(Ai,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`truncate`,children:L(`organizations.manage`)})]})]}):null,c&&!c.readOnly&&!f?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ne,onClick:()=>{g(!1),b(!0)},children:[(0,z.jsx)(Te,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`truncate`,children:L(`nav.renameSpace`)})]})]}):null,m&&!E?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,z.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ne,onClick:()=>{g(!1),v(!0)},children:[(0,z.jsx)(yt,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:(0,z.jsx)(`span`,{className:`truncate`,children:L(`nav.addSpace`)})})]})]}):null]}):null,(0,z.jsx)(um,{open:_,onClose:()=>v(!1)}),cc(e)?(0,z.jsx)(hc,{me:e,open:x,onClose:()=>S(!1)}):null,c?(0,z.jsx)(qm,{project:c,open:y,onClose:()=>b(!1)}):null]})})}function qm({project:e,open:t,onClose:n}){let r=ie(),[i,a]=(0,R.useState)(e.name);(0,R.useEffect)(()=>{t&&a(e.name)},[t,e.name]);let o=Nt({mutationFn:()=>_.patch(`/api/studio/projects/${e.id}`,{name:i.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:D.spaces()}),n()}});return(0,z.jsx)($e,{open:t,onClose:n,title:L(`nav.renameSpace`),children:(0,z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&o.mutate()},children:[(0,z.jsx)(he,{autoFocus:!0,maxLength:80,"aria-label":L(`nav.renameSpace`),value:i,onChange:e=>a(e.target.value)}),(0,z.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,z.jsx)(O,{variant:`ghost`,onClick:n,children:L(`common.cancel`)}),(0,z.jsx)(O,{type:`submit`,busy:o.isPending,disabled:!i.trim(),children:L(`settings.save`)})]})]})})}function Jm({me:e,project:t}){let n=e.mode===`local`||t.origin===`local`,r=n?Pr:ir,i=L(n?`nav.spaceLocal`:`nav.spaceCloud`);return(0,z.jsx)(`span`,{title:i,className:`grid size-6 shrink-0 place-items-center text-ink-4`,children:(0,z.jsx)(r,{className:`size-3.5`,"aria-label":i})})}function Ym({me:e}){let{project:t}=F(),{phone:n}=ca(),r=Gm(e);return t?r&&e.tenant.name?(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,z.jsxs)(Km,{me:e,placement:`below`,label:e.tenant.name,className:e=>N(n?`-ml-1 flex max-w-[16rem] items-center gap-2.5 rounded-xl py-1 pr-2 pl-1`:`-mx-1 flex max-w-[16rem] items-center gap-1 rounded-md px-2 py-0.5`,`text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,e&&`bg-accent`),children:[n?(0,z.jsx)(Wm,{project:t,name:e.tenant.name,size:`sm`}):null,(0,z.jsx)(`span`,{className:`truncate`,children:e.tenant.name}),(0,z.jsx)(Qn,{className:`size-3.5 shrink-0 text-ink-4`})]}),(0,z.jsx)(Jm,{me:e,project:t})]}):(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[e.tenant.name&&!n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(mc,{me:e,className:`max-lg:hidden`}),(0,z.jsx)(`span`,{className:`text-ink-4 max-lg:hidden`,"aria-hidden":`true`,children:`/`})]}):null,(0,z.jsx)(Km,{me:e,placement:`below`,label:t.name,className:e=>N(n?`-ml-1 flex max-w-[16rem] items-center gap-2.5 rounded-xl py-1 pr-2 pl-1 text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`:`-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:n?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Wm,{project:t,size:`sm`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-col leading-tight`,children:[e.tenant.name?(0,z.jsx)(`span`,{className:`truncate font-normal text-[0.75rem] text-ink-3`,children:e.tenant.name}):null,(0,z.jsx)(`span`,{className:`truncate`,children:t.name})]})]}):t.name}),(0,z.jsx)(Jm,{me:e,project:t})]}):null}function Xm({me:e,placement:t=`below`,named:n}){let[r,i]=(0,R.useState)(!1),a=(0,R.useRef)(null),o=ze(),{position:s,phone:c}=ca();Vm(a,r,()=>i(!1));let l=xa(),[u,d]=(0,R.useState)(!1),f=rn(e.user.name),p=Bm(e,ma(`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,z.jsxs)(`div`,{className:N(`relative`,n&&`w-full`),ref:a,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:n?N(`flex w-full items-center gap-3 rounded-lg p-0.5 pr-2 text-left transition hover:bg-ink/10`,r&&`bg-ink/10`):`block shrink-0 rounded-full`,"aria-label":e.user.name||`Menu`,children:[(0,z.jsxs)(`span`,{className:N(`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`),children:[e.user.image?(0,z.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full rounded-full object-cover`}):f,p===`linked`||p===`expired`?(0,z.jsx)(`span`,{title:p===`linked`?L(`nav.connected`,{host:Xf(e.account?.cloudUrl??``)}):L(`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,z.jsx)(ir,{className:`size-2.5 text-moss`}):(0,z.jsx)(Bt,{className:`size-2.5 text-amber`})}):null]}),n?(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem] text-ink-2`,children:e.user.name}):null]}),r?(0,z.jsxs)(`div`,{className:N(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,Hm(t,s,`top-11 right-0`)),children:[(0,z.jsxs)(`div`,{className:`px-3 pt-2 pb-2.5`,children:[(0,z.jsxs)(`div`,{className:`truncate font-medium text-[0.875rem]`,children:[e.user.name,p===`alone`?(0,z.jsxs)(`span`,{className:`font-normal text-ink-4`,children:[` (`,L(`nav.local`),`)`]}):null]}),(0,z.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.user.email}),e.tenant.name?(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 text-[0.75rem] text-ink-2`,children:[(0,z.jsx)(Kn,{className:`size-3.5 shrink-0 text-ink-4`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`truncate`,children:e.tenant.name})]}):null]}),p?(0,z.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:()=>{i(!1),o(`/settings/account`)},children:[p===`linked`?(0,z.jsx)(ir,{className:`mt-0.5 size-4 shrink-0 text-moss`}):p===`expired`?(0,z.jsx)(Bt,{className:`mt-0.5 size-4 shrink-0 text-amber`}):(0,z.jsx)(Pr,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-snug`,children:[(0,z.jsx)(`span`,{className:`break-words`,children:p===`linked`?L(`nav.connected`,{host:Xf(e.account?.cloudUrl??``)}):L(p===`expired`?`nav.expired`:`nav.onlyHere`)}),(0,z.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:p===`linked`?e.account?.credits!==null&&e.account?.credits!==void 0?L(`nav.credits`,{n:Math.floor(e.account.credits).toLocaleString(I)}):null:L(p===`expired`?`account.signInAgain`:`account.signIn`)})]})]}):null,e.mode===`managed`&&Qi(e.features,`organizationSettings`)?(0,z.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{i(!1),o(`/account`)},children:[(0,z.jsx)(Wi,{className:`size-4`}),` `,L(`konto.title`)]}):e.manageUrl?(0,z.jsxs)(`a`,{className:m,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,children:[(0,z.jsx)(cr,{className:`size-4`}),` `,L(`nav.account`)]}):null,c&&!ha()?(0,z.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{i(!1),l?Sa(l):d(!0)},children:[(0,z.jsx)(Ot,{className:`size-4`}),` `,L(`install.app.action`)]}):null,(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[L(`nav.theme`),(0,z.jsx)(Yf,{})]}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[L(`nav.language`),(0,z.jsx)(xf,{tone:`surface`})]}),e.mode===`managed`?(0,z.jsxs)(`button`,{type:`button`,className:m,onClick:()=>{i(!1),Ls({where:`studio`})},children:[(0,z.jsx)(Tt,{className:`size-4`}),` `,L(`report.open`)]}):null,e.mode===`managed`?(0,z.jsxs)(`button`,{type:`button`,className:m,onClick:()=>void sn(),children:[(0,z.jsx)(Hr,{className:`size-4`}),` `,L(`nav.logout`)]}):null]}):null,(0,z.jsx)(rc,{open:u,onClose:()=>d(!1)})]})}function Zm({me:e,children:t}){let{phone:n}=ca(),r=nt().pathname.startsWith(`/account`);return(0,z.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:[r?null:(0,z.jsx)(Ym,{me:e}),(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,z.jsx)(Im,{alone:r}),t]}),r?null:(0,z.jsx)(zm,{me:e}),n?(0,z.jsx)(Xm,{me:e}):null]})}var Qm=`studio-scroll`;function $m(){return document.getElementById(`studio-scroll`)??document.documentElement}var eh={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`},th={left:`flex-row`,right:`flex-row-reverse`,top:`flex-col`,bottom:`flex-col-reverse`};function nh({me:e,wide:t,full:n,children:r}){let{position:i,phone:a}=ca(),o=(0,R.useRef)(null),s=a&&!n?`calc(4.75rem + env(safe-area-inset-bottom))`:`0px`,c=ma(`goose`),l=X()&&c&&!n,u=ua(!!n||l);return Jp(e.tenant.id),(0,z.jsxs)(`div`,{className:N(`flex h-dvh overflow-hidden bg-sidebar`,th[i]),children:[a?n?null:(0,z.jsx)(Lc,{me:e}):(0,z.jsx)(Nc,{me:e,labels:u.shown,room:u.room}),(0,z.jsxs)(`div`,{className:N(`flex min-h-0 min-w-0 flex-1 md:gap-2`,eh[i]),children:[(0,z.jsxs)(`div`,{className:`flex min-h-0 min-w-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,z.jsx)(km,{}),(0,z.jsx)(sc,{me:e}),(0,z.jsx)(Ll,{me:e}),n?(0,z.jsx)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:r}):(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,z.jsx)(Zm,{me:e}),(0,z.jsxs)(`div`,{ref:o,className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,z.jsx)(`main`,{id:Qm,className:`relative min-h-0 flex-1 overflow-y-auto`,style:{paddingBottom:`max(var(--assistant-dock, 0px), ${s})`},children:(0,z.jsx)(`div`,{className:N(`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})}),c&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(lf,{column:o}),(0,z.jsx)(gf,{})]})]})]})]}),c&&!n?(0,z.jsx)(hf,{}):null]})]})}function rh(){return[{id:`info`,label:L(`space.info`),icon:fr},{id:`brand`,label:L(`space.brand`),icon:Ii},{id:`knowledge`,label:L(`space.knowledge`),icon:Wn},{id:`data`,label:L(`space.data`),icon:E},{id:`page`,label:L(`space.page`),icon:Rt}]}function ih(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 ah(e){return e===`info`||e===`brand`||e===`knowledge`||e===`data`||e===`page`||e===`results`}var oh=[{id:`base`,group:`info`,label:`project.base`,icon:At},{id:`facts`,group:`info`,label:`project.facts`,icon:wt},{id:`logos`,group:`brand`,label:`project.logos`,icon:Mi},{id:`colors`,group:`brand`,label:`project.colors`,icon:ii},{id:`typography`,group:`brand`,label:`project.typography`,icon:In},{id:`assets`,group:`brand`,label:`project.assets`,icon:Er},{id:`documents`,group:`knowledge`,label:`project.documents`,icon:re},{id:`page`,group:`page`,label:`page.sectionPage`,icon:Rt},{id:`page-words`,group:`page`,label:`page.sectionWords`,icon:At},{id:`page-wizards`,group:`page`,label:`page.sectionWizards`,icon:Rr}],sh=oh.map(e=>e.id);function ch(e,t){let n=t.spaceSections.find(t=>t.id===e);return oh.find(t=>t.id===e)?.group??(n?n.group??`knowledge`:null)}function lh(e,t,n=[]){let r=oh.filter(t=>t.group===e&&!n.includes(t.id)).map(e=>({id:e.id,label:L(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}))]}globalThis.__WIZARDS_STUDIO__={react:R,jsx:z,reactDom:{createPortal:Xi.createPortal,flushSync:Xi.flushSync},router:{Link:le,Navigate:Ae,NavLink:o,useLocation:nt,useNavigate:ze,useParams:M,useSearchParams:Je},query:{useMutation:Nt,useQuery:ot,useQueryClient:ie},ui:st,sdk:Ji};var uh=0,$={status:`idle`,plugins:[],canReload:!1,problems:[],failed:{},pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],spaceMenus:{},shareSections:[],shareSetups:[],cards:[]},dh=new Set;function fh(e){$={...$,...e};for(let e of dh)e()}function ph(){return(0,R.useSyncExternalStore)(e=>(dh.add(e),()=>dh.delete(e)),()=>$)}var mh=new Set([`account`,`project`,`connectors`,`models`,`build`,`plugins`]),hh=new Set([`info`,`brand`,`knowledge`,`data`,`page`,`results`]),gh=new Map,_h=null,vh=e=>`${e.script}|${e.styles}`,yh=e=>`__wizardsPlugin_${e.replaceAll(`-`,`_`)}`;function bh(){let{project:e}=F(),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,R.useMemo)(()=>t?{id:t,name:n,readOnly:r,brand:JSON.parse(i)}:null,[t,n,r,i])}var xh=(0,R.createContext)(null);function Sh({part:e,children:t}){return(0,z.jsx)(xh.Provider,{value:e,children:t})}function Ch(e){let t=(0,R.useContext)(xh),n=JSON.stringify(e.map(e=>[e.id,e.label]));(0,R.useEffect)(()=>{if(t)return fh({spaceMenus:{...$.spaceMenus,[t]:e}}),()=>{let{[t]:e,...n}=$.spaceMenus;fh({spaceMenus:n})}},[t,n])}function wh({plugin:e,...t}){return Tu({...t,plugin:e}),null}function Th(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(`/`)||je.has(r))throw Error(`"${e.path}" is an address of the studio itself.`);if([...i($.pages),...t.pages].some(t=>t.path===e.path))throw Error(`"${e.path}" is registered already.`);t.pages.push({...e,plugin:n,serial:++uh})},registerNav(e){t.nav.push({...e,plugin:n,serial:++uh})},registerSettingsSection(e){let r=[...i($.sections),...t.sections].some(t=>t.id===e.id);if(mh.has(e.id)||r)throw Error(`The settings have a section "${e.id}" already.`);t.sections.push({...e,plugin:n,serial:++uh})},registerSpaceSection(e){let r=[...i($.spaceSections),...t.spaceSections].some(t=>t.id===e.id);if(sh.includes(e.id)||r)throw Error(`The space page has a section "${e.id}" already.`);t.spaceSections.push({...e,plugin:n,serial:++uh})},registerSpacePart(e){let r=[...i($.spaceParts),...t.spaceParts].some(t=>t.id===e.id);if(!/^[a-z][a-z0-9-]{0,39}$/.test(e.id)||hh.has(e.id)||r)throw Error(`The space page has a part "${e.id}" already.`);t.spaceParts.push({...e,plugin:n,serial:++uh})},registerShareSection(e){if([...i($.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:++uh})},registerShareSetup(e){if([...i($.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:++uh})},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:++uh})},useSpace:bh,useSpaceMenu:Ch,useCrumbs:Nm,Assistant:e=>(0,z.jsx)(wh,{plugin:n,...e}),useAssistantPage:e=>Tu({...e,plugin:n}),useAssistantTool:(e,t,r)=>G(`${n.replaceAll(`-`,`_`)}_${e}`,t,r),i18n:{register:e=>(t,n)=>{let r=e[I]?.[t]??e.de[t]??t;for(let[e,t]of Object.entries(n??{}))r=r.replace(`{${e}}`,String(t));return r},lang:()=>I},api:{get:e=>_.get(r(e)),post:(e,t)=>_.post(r(e),t),put:(e,t)=>_.put(r(e),t),patch:(e,t)=>_.patch(r(e),t),del:e=>_.del(r(e))},me:()=>({user:{id:_h.user.id,name:_h.user.name,email:_h.user.email},tenant:_h.tenant,mode:_h.mode}),onUnload(e){t.disposers.push(e)}}}function Eh(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 Dh(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 Oh(e,t,n){for(let n of t)try{n()}catch(t){console.error(`[plugin ${e}]`,t)}n?.remove()}function kh(e){let t=gh.get(e);gh.delete(e),Oh(e,t?.disposers??[],t?.link??null);let{[e]:n,...r}=$.failed;fh({failed:r,pages:$.pages.filter(t=>t.plugin!==e),nav:$.nav.filter(t=>t.plugin!==e),sections:$.sections.filter(t=>t.plugin!==e),spaceSections:$.spaceSections.filter(t=>t.plugin!==e),spaceParts:$.spaceParts.filter(t=>t.plugin!==e),shareSections:$.shareSections.filter(t=>t.plugin!==e),shareSetups:$.shareSetups.filter(t=>t.plugin!==e),cards:$.cards.filter(t=>t.plugin!==e)})}async function Ah(e){let{id:t}=e,n={pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],shareSections:[],shareSetups:[],cards:[],disposers:[]},r=null;try{e.styles&&(r=await Dh(t,Ye(e.styles))),await Eh(Ye(e.script));let i=globalThis,a=yh(t),o=i[a];i[a]=void 0;let s=typeof o==`function`?o:o?.default;if(typeof s!=`function`)throw Error(`The plugin's script has no default export.`);s(Th(e,n))}catch(i){console.error(`[plugin ${t}]`,i),Oh(t,n.disposers,r),kh(t),gh.set(t,{key:vh(e),disposers:[],link:null}),fh({failed:{...$.failed,[t]:i.message}});return}let i=gh.get(t);gh.set(t,{key:vh(e),disposers:n.disposers,link:r});let{[t]:a,...o}=$.failed;fh({failed:o,pages:[...$.pages.filter(e=>e.plugin!==t),...n.pages],nav:[...$.nav.filter(e=>e.plugin!==t),...n.nav],sections:[...$.sections.filter(e=>e.plugin!==t),...n.sections],spaceSections:[...$.spaceSections.filter(e=>e.plugin!==t),...n.spaceSections],spaceParts:[...$.spaceParts.filter(e=>e.plugin!==t),...n.spaceParts],shareSections:[...$.shareSections.filter(e=>e.plugin!==t),...n.shareSections],shareSetups:[...$.shareSetups.filter(e=>e.plugin!==t),...n.shareSetups],cards:[...$.cards.filter(e=>e.plugin!==t),...n.cards]}),Oh(t,i?.disposers??[],i?.link??null)}var jh=Promise.resolve();function Mh(){return jh=jh.catch(()=>void 0).then(async()=>{let e=await _.get(`/api/studio/plugins`);for(let t of[...gh.keys()])e.plugins.some(e=>e.id===t&&e.script)||kh(t);fh(e);for(let t of e.plugins)t.script&&gh.get(t.id)?.key!==vh(t)&&await Ah(t)}).catch(e=>console.error(`[plugins]`,e)).finally(()=>fh({status:`ready`})),jh}var Nh=null;function Ph(e){_h=e,$.status===`idle`&&(fh({status:`loading`}),Mh().then(()=>{$.canReload&&!Nh&&(Nh=new EventSource(Ye(`/api/studio/plugins/-/events`),{withCredentials:!0}),Nh.addEventListener(`change`,()=>void Mh()))}))}async function Fh(e){await _.post(e?`/api/studio/plugins/-/reload/${e}`:`/api/studio/plugins/-/reload`),await Mh()}var Ih=class extends R.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin]`,e)}render(){return this.state.failed?(0,z.jsx)(w,{children:L(`plugins.crashed`)}):this.props.children}};function Lh({of:e,children:t}){return(0,z.jsx)(`div`,{"data-plugin":e.plugin,className:`contents`,children:(0,z.jsx)(Ih,{children:t},e.serial)})}function Rh({end:e,className:t}){return(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-4 ${t??``}`,children:[(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,z.jsx)(un,{size:28}),(0,z.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight ${e?`max-sm:sr-only`:``}`,children:[`engenty`,(0,z.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-ember-strong`,children:`.`}),(0,z.jsx)(`span`,{className:`font-normal text-ink-2`,children:`wizards`})]})]}),(0,z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:e?`flex max-sm:hidden`:`flex`,children:(0,z.jsx)(Yf,{tone:`surface`})}),(0,z.jsx)(xf,{tone:`surface`}),e]})]})}var zh={de:{imprint:`/de/impressum`,privacy:`/de/datenschutz`,terms:`/de/nutzungsbedingungen`},en:{imprint:`/imprint`,privacy:`/privacy`,terms:`/terms`}};function Bh({failed:e}){let t=_n(),[n,r]=(0,R.useState)(()=>Qt()??``),[i,o]=(0,R.useState)(!1),s=He(n,r,{endpoint:null}),c=()=>{let e=n.trim();e&&!i&&(s.listening&&s.stop(),o(!0),on(e),an(`${a}/new`,e))};return(0,z.jsxs)(`div`,{className:`min-h-dvh px-6 pb-16 sm:px-10`,children:[(0,z.jsx)(Rh,{className:`pt-6 sm:pt-8`,end:(0,z.jsx)(O,{variant:`secondary`,size:`sm`,onClick:()=>an(`${a}/`),children:L(`guest.signIn`)})}),(0,z.jsxs)(`div`,{className:`mx-auto max-w-2xl animate-rise pt-8 md:pt-12`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,z.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,z.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,z.jsx)(cn,{kind:`sprout`,size:150,fluffy:!0})})}),(0,z.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:L(`new.title`)})]}),(0,z.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,z.jsx)(Ce,{autoFocus:!0,minRows:4,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&c()},placeholder:s.listening?L(`editor.listening`):L(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pb-1`,children:[s.supported?(0,z.jsx)(Le,{speech:s,labelled:!0}):null,(0,z.jsx)(`span`,{className:`flex-1`}),(0,z.jsxs)(O,{size:`md`,onClick:c,busy:i,disabled:!n.trim(),children:[L(`new.build`),` `,(0,z.jsx)(Qe,{className:`size-4`})]})]})]}),s.error?(0,z.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:s.error===`denied`?L(`editor.micDenied`):s.error}):null,e?(0,z.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:L(`auth.failed`)}):null,(0,z.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:L(`guest.hint`)})]}),(0,z.jsxs)(`section`,{className:`mx-auto max-w-5xl`,children:[(0,z.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:L(`new.orStarter`)}),(0,z.jsx)(kt,{onGuestOpen:e=>an(`${a}/new?starter=${encodeURIComponent(e.id)}`)})]}),(0,z.jsxs)(`footer`,{className:`mt-16 flex flex-wrap justify-center gap-x-5 gap-y-1 text-[0.75rem] text-ink-3`,children:[(0,z.jsx)(`span`,{children:`engenty.wizards`}),[`imprint`,`privacy`,`terms`].map(e=>(0,z.jsx)(`a`,{href:zh[t][e],className:`transition hover:text-ink-2`,children:L(`legal.${e}`)},e))]})]})}var Vh=/(?:^|;\s*)engenty_signed_in=1(?:;|$)/;function Hh(){return!!window.engentyDesktop}function Uh({text:e}){return e.split(/(?<=[.!?])\s+/).map(e=>(0,z.jsx)(`span`,{className:`block`,children:e},e))}function Wh({title:e,children:t,className:n=`mt-8`}){return(0,z.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,z.jsx)(`div`,{className:`mb-1.5 font-medium text-ink`,children:e}),t]})}function Gh({text:e}){let[t,n]=(0,R.useState)(!1);return(0,z.jsxs)(`div`,{className:`mt-2 flex items-center gap-3 rounded-xl bg-[oklch(22%_0.02_262)] py-2.5 pr-2.5 pl-4 font-mono text-[0.9375rem] text-white shadow-soft`,children:[(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`select-none text-white/40`,children:`$`}),(0,z.jsx)(`code`,{className:`min-w-0 flex-1 select-all break-all`,children:e}),(0,z.jsx)(`button`,{type:`button`,"aria-label":L(t?`settings.copied`:`settings.copy`),title:L(t?`settings.copied`:`settings.copy`),className:`flex size-8 shrink-0 items-center justify-center rounded-lg text-white/60 transition hover:bg-white/10 hover:text-white focus-visible:outline-2 focus-visible:outline-white/60`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?(0,z.jsx)(pe,{className:`size-4`}):(0,z.jsx)(ue,{className:`size-4`})})]})}function Kh(){let e=ot({queryKey:[`config`],queryFn:()=>_.get(`/api/config`),refetchInterval:e=>e.state.status===`error`&&!(e.state.error instanceof ne&&e.state.error.body?.code===`host`)&&2e3,retry:!1}),t=ie(),[n,r]=(0,R.useState)(!1),[i,a]=(0,R.useState)(!1),o=new URLSearchParams(window.location.search).get(`signin`)===`failed`,s=e.data?.mode===`local`&&e.data.devLogin,[c,l]=(0,R.useState)(!1),u=e.data?.mode===`managed`&&!o&&!Hh()&&Vh.test(document.cookie);if((0,R.useEffect)(()=>{u&&an()},[u]),(0,R.useEffect)(()=>{if(!s||c)return;let e=!0;return _.post(`/api/dev/login`).then(()=>t.invalidateQueries()).catch(()=>{e&&l(!0)}),()=>{e=!1}},[s,c,t]),e.isLoading||u||s&&!c)return(0,z.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,z.jsx)(cn,{kind:`round`,size:56})});if(e.data?.mode===`managed`&&!e.data.devLogin&&!Hh())return(0,z.jsx)(Bh,{failed:o});let d=e.data?.mode===`local`&&!e.data.devLogin,f=e.error instanceof ne&&e.error.body?.code===`host`?e.error:null,p=f?String(f.body.appUrl??``):null,m=d&&!f&&!e.isError;return(0,z.jsxs)(`div`,{className:`relative flex min-h-dvh flex-col items-center justify-center px-6 py-16`,children:[(0,z.jsx)(Rh,{className:`absolute inset-x-6 top-6 sm:inset-x-10 sm:top-8`}),(0,z.jsxs)(`div`,{className:`flex w-full max-w-md animate-rise flex-col items-center text-center`,children:[(0,z.jsx)(cn,{kind:`round`,size:d||e.isError?140:200,fluffy:!0}),(0,z.jsxs)(`span`,{className:`mt-2 font-display font-semibold text-[0.9375rem] text-ink-3 tracking-tight`,children:[(0,z.jsx)(ln,{}),(0,z.jsx)(`span`,{className:`font-normal`,children:`wizards`})]}),(0,z.jsx)(`h1`,{className:`mt-3 text-balance font-display font-semibold text-[2.125rem] leading-[1.1] tracking-tight`,children:m?L(`auth.localTitle`):(0,z.jsx)(Uh,{text:L(`brand.tagline`)})}),m?null:(0,z.jsx)(`p`,{className:`mt-4 text-balance text-[1rem] text-ink-2 leading-relaxed`,children:(0,z.jsx)(Uh,{text:L(`brand.sub`)})}),p?(0,z.jsxs)(Wh,{title:L(`auth.wrongHost`),children:[(0,z.jsx)(`p`,{children:L(`auth.wrongHostWhy`)}),(0,z.jsx)(`a`,{href:`${p}${window.location.pathname}`,className:`mt-1.5 block break-all font-medium text-ember-strong underline-offset-2 hover:underline`,children:p})]}):e.isError?(0,z.jsx)(Wh,{title:L(`auth.unreachable`),children:L(`auth.unreachableWhy`,{address:window.location.host})}):null,(0,z.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-3`,children:[o?(0,z.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:L(`auth.failed`)}):null,e.data?.mode===`managed`?(0,z.jsx)(O,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0);let e=window.engentyDesktop;if(!e){an();return}let{url:t}=await _.post(`/api/auth/desktop/start`);e.open(t),a(!0),r(!1)},children:L(i?`local.accountWaiting`:`auth.signIn`)}):null,e.data?.devLogin?(0,z.jsx)(O,{size:`lg`,busy:n,className:`w-full`,onClick:async()=>{r(!0),await _.post(`/api/dev/login`),await t.invalidateQueries(),r(!1)},children:L(`auth.dev`)}):null,m?(0,z.jsxs)(`div`,{className:`-mt-6 text-left text-[0.9375rem] text-ink-2 leading-relaxed`,children:[(0,z.jsx)(`p`,{children:L(`auth.localWhy`)}),(0,z.jsx)(Gh,{text:`wizards open`}),(0,z.jsx)(`p`,{className:`mt-6 text-[0.875rem] text-ink-3`,children:L(`auth.localStartLink`)}),(0,z.jsx)(Gh,{text:`wizards open --print`}),(0,z.jsx)(`p`,{className:`mt-6 text-center text-[0.875rem] text-ink-3`,children:L(`auth.localNoAccount`)})]}):null]}),e.data?.mode===`managed`?(0,z.jsx)(`p`,{className:`mt-6 text-[0.8125rem] text-ink-3`,children:L(`auth.legal`)}):null]}),(0,z.jsxs)(`footer`,{className:`absolute inset-x-0 bottom-6 text-center text-[0.75rem] text-ink-3 sm:bottom-8`,children:[`© engenty · `,L(`about.version`,{v:Ys})]})]})}var qh=(0,R.lazy)(()=>Ft(()=>import(`./PublicRunner-QPvlEAxx.js`).then(e=>({default:e.PublicRunner})),__vite__mapDeps([17,1,2,3,4,5,18,9,14,16,7,6,19,20]))),Jh=(0,R.lazy)(()=>Ft(()=>import(`./SharePage-Bw4TRWtv.js`).then(e=>({default:e.SharePage})),__vite__mapDeps([21,1,2,3,4,5,18,9,14,16,7,6,19,20,17]))),Yh=(0,R.lazy)(()=>Ft(()=>import(`./EditorPage-Di5KB-Ei.js`).then(e=>({default:e.EditorPage})),__vite__mapDeps([22,1,2,3,4,5,12,13,14,15,16,7,6,9,23,18,19,20,24,25,26,10,27,28]))),Xh=(0,R.lazy)(()=>Ft(()=>Promise.resolve().then(()=>cm).then(e=>({default:e.HomePage})),void 0)),Zh=(0,R.lazy)(()=>Ft(()=>import(`./OnboardingPage-DuckyzQr.js`).then(e=>({default:e.OnboardingPage})),__vite__mapDeps([29,1,2,3,4,5,13,16,7,6,24]))),Qh=(0,R.lazy)(()=>Ft(()=>import(`./NewWizardPage-BenzMrPD.js`).then(e=>({default:e.NewWizardPage})),__vite__mapDeps([30,1,2,3,4,5,12,13,14,15,16,7,6,24,28,19,25]))),$h=(0,R.lazy)(()=>Ft(()=>import(`./SettingsPage-ByP15ndy.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([31,1,2,3,4,5,12,13,14,15,16,7,6,26,32,8,9,10,33,34]))),eg=(0,R.lazy)(()=>Ft(()=>import(`./ProjectPage-A8Z8cS1E.js`).then(e=>({default:e.ProjectPage})),__vite__mapDeps([35,1,2,3,4,5,12,13,14,15,16,7,6,23,18,9,19,20,24,25,32,8,10]))),tg=(0,R.lazy)(()=>Ft(()=>import(`./SetupPage-WNHH74hu.js`).then(e=>({default:e.SetupPage})),__vite__mapDeps([36,1,2,3,4,5,13,16,7,6,33,34]))),ng=null;function rg(){return(0,z.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center`,children:(0,z.jsx)(cn,{kind:`round`,size:56})})}function ig({children:e,bare:t,wide:n,full:r}){let i=Xt(),a=nt();return tn(i.data),(0,R.useEffect)(()=>{i.data&&Ph(i.data)},[i.data]),i.isLoading?(0,z.jsx)(rg,{}):i.data?i.data.mode===`local`&&!i.data.setupDone&&a.pathname!==`/setup`?(0,z.jsx)(Ae,{to:`/setup`,replace:!0}):i.data.onboarding&&a.pathname!==`/start`?(0,z.jsx)(Ae,{to:`/start`,replace:!0}):t?e:(0,z.jsx)(nh,{me:i.data,wide:n,full:r,children:e}):(0,z.jsx)(Kh,{})}function ag(){return _n(),(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(rg,{}),children:(0,z.jsxs)(Ke,{children:[ng,(0,z.jsx)(P,{path:`/w/:token`,element:(0,z.jsx)(qh,{})}),(0,z.jsx)(P,{path:`/w/:token/steps`,element:(0,z.jsx)(qh,{steps:!0})}),(0,z.jsx)(P,{path:`/w/:token/steps/:runId`,element:(0,z.jsx)(qh,{steps:!0})}),(0,z.jsx)(P,{path:`/w/:token/chat`,element:(0,z.jsx)(qh,{chat:!0})}),(0,z.jsx)(P,{path:`/w/:token/chat/:runId`,element:(0,z.jsx)(qh,{chat:!0})}),(0,z.jsx)(P,{path:`/w/:token/talk`,element:(0,z.jsx)(qh,{chat:!0,talk:!0})}),(0,z.jsx)(P,{path:`/w/:token/talk/:runId`,element:(0,z.jsx)(qh,{chat:!0,talk:!0})}),(0,z.jsx)(P,{path:`/w/:token/video`,element:(0,z.jsx)(qh,{chat:!0,video:!0})}),(0,z.jsx)(P,{path:`/w/:token/video/:runId`,element:(0,z.jsx)(qh,{chat:!0,video:!0})}),(0,z.jsx)(P,{path:`/w/:token/:runId`,element:(0,z.jsx)(qh,{})}),(0,z.jsx)(P,{path:`/s/:token`,element:(0,z.jsx)(Jh,{})}),(0,z.jsx)(P,{path:`*`,element:(0,z.jsx)(og,{})})]})})}function og(){return(0,R.useEffect)(()=>{window.location.replace(`${a}/`)},[]),(0,z.jsx)(rg,{})}function sg(){return ph().status===`ready`?(0,z.jsx)(Ae,{to:`/`,replace:!0}):(0,z.jsx)(rg,{})}function cg(){_n(),(0,R.useEffect)(()=>(document.documentElement.dataset.studio=``,()=>{delete document.documentElement.dataset.studio}),[]);let e=ph();return(0,z.jsx)(cd,{children:(0,z.jsx)(R.Suspense,{fallback:(0,z.jsx)(rg,{}),children:(0,z.jsxs)(Ke,{children:[(0,z.jsx)(P,{path:`/`,element:(0,z.jsx)(ig,{children:(0,z.jsx)(Xh,{})})}),(0,z.jsx)(P,{path:`/sign-in`,element:(0,z.jsx)(ig,{children:(0,z.jsx)(Ae,{to:`/`,replace:!0})})}),(0,z.jsx)(P,{path:`/new`,element:(0,z.jsx)(ig,{children:(0,z.jsx)(Qh,{})})}),(0,z.jsx)(P,{path:`/edit/:id`,element:(0,z.jsx)(ig,{full:!0,children:(0,z.jsx)(Yh,{})})}),(0,z.jsx)(P,{path:`/space/:group?`,element:(0,z.jsx)(ig,{wide:!0,children:(0,z.jsx)(eg,{})})}),(0,z.jsx)(P,{path:`/settings/:section?`,element:(0,z.jsx)(ig,{wide:!0,children:(0,z.jsx)($h,{})})}),(0,z.jsx)(P,{path:`/account/:section?`,element:(0,z.jsx)(ig,{wide:!0,children:(0,z.jsx)($h,{scope:`account`})})}),(0,z.jsx)(P,{path:`/setup`,element:(0,z.jsx)(ig,{bare:!0,children:(0,z.jsx)(tg,{})})}),(0,z.jsx)(P,{path:`/start`,element:(0,z.jsx)(ig,{bare:!0,children:(0,z.jsx)(Zh,{})})}),e.pages.map(e=>(0,z.jsx)(P,{path:e.path,element:(0,z.jsx)(ig,{wide:e.wide,children:(0,z.jsx)(Lh,{of:e,children:(0,z.jsx)(e.component,{})})})},e.serial)),(0,z.jsx)(P,{path:`*`,element:(0,z.jsx)(ig,{bare:!0,children:(0,z.jsx)(sg,{})})})]})})})}var lg=class extends R.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){Ze(`error`,e.message,e.stack)}render(){let{error:e}=this.state;return e?(0,z.jsxs)(`div`,{className:`flex min-h-dvh flex-col items-center justify-center p-6 text-center`,children:[(0,z.jsx)(`h1`,{className:`font-display font-semibold text-[1.375rem]`,children:L(`report.crashed`)}),(0,z.jsx)(`p`,{className:`mt-2 max-w-md text-[0.9375rem] text-ink-3`,children:L(`report.crashedNote`)}),(0,z.jsxs)(`div`,{className:`mt-6 flex gap-3`,children:[(0,z.jsx)(O,{variant:`secondary`,onClick:()=>window.location.reload(),children:L(`report.reload`)}),(0,z.jsx)(O,{onClick:()=>Ls({where:this.props.where,error:{message:e.message,stack:e.stack}}),children:L(`report.open`)})]}),(0,z.jsx)(Ks,{})]}):this.props.children}},ug=`wizards.organizationHint`,dg=30;function fg(e){try{let t=JSON.parse(sessionStorage.getItem(ug)??`null`);return t?.slug===e&&Date.now()-t.at<dg*1e3}catch{return!1}}function pg(e){try{sessionStorage.setItem(ug,JSON.stringify({slug:e,at:Date.now()}))}catch{}}function mg(e,t){let n=e.slice(a.length),r=n.split(`/`)[1]??``;if(!t)return{kind:`here`,root:je.has(r)?a:`${a}/${r}`};let i=t.mode===`managed`?t.tenant.slug:null;if(!i)return{kind:`here`,root:a};let o=`${a}/${i}`;return r===i?{kind:`here`,root:o}:t.organizations.some(e=>e.slug===r)&&!fg(r)?{kind:`switch`,slug:r}:je.has(r)?{kind:`move`,root:o,to:`${o}${n||`/`}`}:{kind:`foreign`,address:r,home:`${o}${n.slice(r.length+1)||`/`}`,me:t}}function hg({children:e}){let t=Xt(),n=(0,R.useRef)(null);if(t.isLoading)return(0,z.jsx)(rg,{});n.current||={place:mg(window.location.pathname,t.data),tenant:t.data?.tenant.id??null};let{place:r}=n.current,{pathname:i,search:o,hash:s}=window.location;if(r.kind===`switch`){pg(r.slug);let e=new URLSearchParams({organization:r.slug,return:`${i}${o}`});return window.location.replace(Ye(`/api/auth/login?${e}`)),(0,z.jsx)(rg,{})}if(r.kind===`foreign`)return(0,z.jsx)(gg,{address:r.address,home:r.home,me:r.me});r.kind===`move`&&(window.history.replaceState(window.history.state,``,`${r.to}${o}${s}`),n.current.place={kind:`here`,root:r.root});let c=r.root,l=t.data?.mode===`managed`?t.data.tenant.slug:null,u=l?`${a}/${l}`:c;if(c!==a&&u!==c&&t.data?.tenant.id===n.current.tenant){let e=i.startsWith(c)?i.slice(c.length):`/`;window.history.replaceState(window.history.state,``,`${u}${e}${o}${s}`),n.current.place={kind:`here`,root:u},c=u}return we(c),(0,z.jsx)(A,{basename:c,children:e},c)}function gg({address:e,home:t,me:n}){return(0,z.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center px-6`,children:(0,z.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-5 text-center`,children:[(0,z.jsx)(cn,{kind:`round`,size:56}),(0,z.jsxs)(`div`,{className:`rounded-md bg-paper-2 px-2.5 py-1 font-mono text-[0.8125rem] text-ink-2`,children:[`/studio/`,e]}),(0,z.jsx)(`h1`,{className:`text-balance font-display font-semibold text-2xl`,children:L(`address.foreign.title`)}),(0,z.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2`,children:L(`address.foreign.text`,{email:n.user.email})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[(0,z.jsxs)(O,{onClick:()=>window.location.assign(t),children:[L(`address.foreign.continue`,{name:n.tenant.name??``}),(0,z.jsx)(Qe,{className:`size-4`})]}),(0,z.jsxs)(O,{variant:`secondary`,onClick:()=>void sn(),children:[(0,z.jsx)(Hr,{className:`size-4`}),L(`address.foreign.switchAccount`)]})]})]})})}function _g({view:e,failed:t}){let n=fa(),[r,i]=(0,R.useState)(null),[a,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(!1);if(!n.data?.reports)return null;let l=(0,z.jsxs)(O,{variant:`ghost`,size:`sm`,onClick:()=>Ls({where:`run`,runId:e.id,error:t&&e.error?{message:e.error}:null}),children:[(0,z.jsx)(Tt,{className:`size-4`}),` `,L(`report.open`)]});if(t)return(0,z.jsx)(`div`,{className:`mt-4 flex justify-center`,children:l});let u=async(t,n)=>{i(t),await fetch(Ye(`/api/runs/${e.id}/feedback`),{method:`POST`,headers:{"content-type":`application/json`},credentials:`include`,body:JSON.stringify({good:t,...n?{comment:n}:{}})}).catch(()=>void 0),n!==void 0&&c(!0)};return(0,z.jsx)(`div`,{className:`mt-8 rounded-2xl border border-border bg-card p-4 sm:p-5`,children:s?(0,z.jsx)(`p`,{className:`text-ink-2 text-sm`,children:L(`feedback.thanks`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`mr-2 font-medium text-[0.9375rem]`,children:L(`feedback.ask`)}),(0,z.jsxs)(O,{size:`sm`,variant:r===!0?`quiet`:`secondary`,onClick:()=>void u(!0),children:[(0,z.jsx)(Bi,{className:`size-4`}),` `,L(`feedback.good`)]}),(0,z.jsxs)(O,{size:`sm`,variant:r===!1?`quiet`:`secondary`,onClick:()=>void u(!1),children:[(0,z.jsx)(Ri,{className:`size-4`}),` `,L(`feedback.bad`)]}),(0,z.jsx)(`span`,{className:`ml-auto`,children:l})]}),r===null?null:(0,z.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-end`,children:[(0,z.jsx)(Ce,{rows:2,value:a,placeholder:L(`feedback.more`),onChange:e=>o(e.target.value),className:`flex-1`}),(0,z.jsx)(O,{size:`sm`,onClick:()=>void u(r,a.trim()),children:L(`feedback.send`)})]})]})})}var vg={mail:Wr,folder:mr,chat:Qr,plug:Lt,globe:Rt};function yg({runId:e,job:t,onAgain:n,onHome:r}){let[i,a]=(0,R.useState)(!1);if(t.status===`running`&&t.ask)return(0,z.jsx)(se,{runId:e,ask:t.ask},t.ask.id);if(t.status===`running`){let n=t.events.slice(-5);return(0,z.jsxs)(`div`,{className:`animate-rise`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center py-6 text-center`,children:[(0,z.jsx)(ct,{className:`size-7 text-ember`}),(0,z.jsx)(`h3`,{className:`mt-4 font-display font-semibold text-[1.125rem]`,children:L(`shareRun.working`)}),(0,z.jsx)(`div`,{className:`mt-4 flex min-h-[5.5rem] w-full max-w-sm flex-col gap-1.5`,children:n.map((e,t)=>(0,z.jsxs)(`div`,{className:N(`flex items-center justify-center gap-2 text-[0.8125rem]`,t===n.length-1?`text-ink-2`:`text-ink-4`),children:[t===n.length-1?(0,z.jsx)(Xe,{className:`size-3.5 shrink-0 animate-breathe text-ember`}):null,(0,z.jsx)(`span`,{className:`truncate`,children:e.message})]},e.at+e.message))})]}),(0,z.jsx)(`div`,{className:`flex justify-center`,children:(0,z.jsx)(O,{variant:`ghost`,busy:i,onClick:()=>{a(!0),_.post(`/api/runs/${e}/share/jobs/${t.id}/cancel`).catch(()=>void 0)},children:L(`common.cancel`)})})]})}let o=t.status===`done`;return(0,z.jsxs)(`div`,{className:`animate-rise`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center py-4 text-center`,children:[(0,z.jsx)(`div`,{className:N(`flex size-12 items-center justify-center rounded-full`,o?`bg-moss-tint text-moss`:`bg-rose-tint text-rose`),children:o?(0,z.jsx)(pe,{className:`size-6`}):(0,z.jsx)(Ue,{className:`size-6`})}),(0,z.jsx)(`h3`,{className:`mt-4 font-display font-semibold text-[1.125rem]`,children:L(o?`shareRun.done`:t.status===`cancelled`?`shareRun.cancelled`:`shareRun.failed`)}),o&&t.result?(0,z.jsx)(xt,{text:t.result.summary,className:`mt-2 max-w-md text-[0.875rem] text-ink-2`}):t.error?(0,z.jsx)(`p`,{className:`mt-2 max-w-md text-[0.875rem] text-ink-2 leading-relaxed`,children:t.error}):null,o&&t.result?.url?(0,z.jsxs)(`a`,{href:t.result.url,target:`_blank`,rel:`noreferrer`,className:`mt-4 inline-flex h-10 items-center gap-2 rounded-full bg-paper-2 px-4 font-medium text-[0.875rem] text-ink hover:bg-paper-3 coarse:h-11`,children:[(0,z.jsx)(ae,{className:`size-4`}),` `,L(`share.open`)]}):null]}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[n?(0,z.jsx)(O,{variant:`ghost`,onClick:n,children:L(o?`shareRun.again`:`shareRun.backToForm`)}):(0,z.jsx)(`span`,{}),(0,z.jsx)(O,{onClick:r,children:L(`shareRun.elsewhere`)})]})]})}function bg({steps:e,now:t}){return(0,z.jsx)(`ol`,{className:`mb-6 flex gap-2`,children:e.map((e,n)=>(0,z.jsxs)(`li`,{className:`min-w-0 flex-1`,"aria-current":n===t?`step`:void 0,children:[(0,z.jsx)(`div`,{className:N(`h-1 rounded-full`,n<t?`bg-moss`:n===t?`bg-ember`:`bg-paper-3`)}),(0,z.jsxs)(`div`,{className:N(`mt-1.5 truncate font-medium text-[0.75rem]`,n<t?`text-moss`:n===t?`text-ember-strong`:`text-ink-4`),children:[n+1,` · `,e]})]},e))})}function xg(e){return[...e.shown.filter(e=>e.output&&e.formats.length).map(e=>({from:e.step.id,label:e.label??e.step.title,formats:e.formats})),...e.lists.filter(e=>e.formats.length).map(e=>({from:`lists.${e.def.id}`,label:e.label??e.def.title,formats:e.formats}))]}function Sg({deliverables:e,picked:t,onPick:n,error:r}){return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{children:L(`shareRun.files`)}),(0,z.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-input`,children:e.map(e=>{let r=!!t[e.from];return(0,z.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-border-soft border-b bg-card px-3 py-2.5 last:border-0`,children:[(0,z.jsxs)(`label`,{className:`flex min-w-0 flex-1 basis-40 cursor-pointer items-center gap-2.5 text-[0.875rem] coarse:min-h-11`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:r,onChange:t=>n(e.from,t.target.checked?e.formats[0]:null),className:`size-4 shrink-0 accent-[var(--ember)] coarse:size-5`}),(0,z.jsx)(`span`,{className:N(`truncate`,!r&&`text-ink-3`),children:e.label})]}),r?(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.formats.map(r=>(0,z.jsx)(`button`,{type:`button`,"aria-pressed":t[e.from]===r,onClick:()=>n(e.from,r),className:N(`h-7 rounded-full px-2.5 font-medium text-[0.75rem] ring-1 transition coarse:h-9 coarse:px-3`,t[e.from]===r?`bg-ember-tint text-ink ring-ember`:`bg-card text-ink-3 ring-input hover:text-ink`),children:xe[r]},r))}):null]},e.from)})}),r?(0,z.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:r}):null]})}function Cg({field:e,value:t,choices:n,error:r,onChange:i}){let a=e.fromAccount?n:e.options;return(0,z.jsxs)(`div`,{children:[(0,z.jsx)(j,{required:e.required,hint:e.help,children:e.label}),e.kind===`textarea`?(0,z.jsx)(Ce,{minRows:3,maxRows:12,value:t,placeholder:e.placeholder,onChange:e=>i(e.target.value)}):e.kind===`select`&&a?.length?(0,z.jsx)(ke,{value:t,onChange:i,options:a,placeholder:``}):(0,z.jsx)(he,{type:e.kind===`url`?`url`:`text`,inputMode:e.kind===`emails`?`email`:void 0,autoCapitalize:e.kind===`text`?void 0:`off`,autoComplete:`off`,spellCheck:e.kind===`text`,value:t,disabled:e.fromAccount&&n===void 0,placeholder:e.fromAccount&&n===void 0?L(`common.loading`):e.placeholder,onChange:e=>i(e.target.value)}),e.fromAccount&&n===null?(0,z.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-ink-3`,children:L(`shareRun.choicesFailed`)}):null,r?(0,z.jsx)(`p`,{className:`mt-1.5 text-[0.8125rem] text-rose`,children:r}):null]})}function wg({view:e,target:t,draft:n,onStarted:r}){let i=e.id,a=!!t.connection,o=!t.connection||!!t.connection.account,[s,c]=(0,R.useState)(!o);(0,R.useEffect)(()=>{o||c(!0)},[o]);let l=(0,R.useMemo)(()=>xg(e),[e]),[u,d]=(0,R.useState)(()=>n?.picked??Object.fromEntries(l.map(e=>[e.from,e.formats[0]]))),[f,p]=(0,R.useState)(()=>n?.values??Object.fromEntries(t.fields.map(e=>[e.id,e.value??``]))),[m,h]=(0,R.useState)({}),[g,v]=(0,R.useState)({}),[y,b]=(0,R.useState)(null),[x,S]=(0,R.useState)(!1),C=t.fields.filter(e=>e.fromAccount).map(e=>e.id);(0,R.useEffect)(()=>{if(!o)return;let e=!0;for(let n of C)_.get(`/api/runs/${i}/share/targets/${encodeURIComponent(t.key)}/choices/${n}?lang=${I}`).then(t=>e&&h(e=>({...e,[n]:t.choices.length?t.choices:null})),()=>e&&h(e=>({...e,[n]:null})));return()=>{e=!1}},[o,i,t.key]);let ee=[...a?[L(`shareRun.stepAccount`)]:[],L(`shareRun.stepForm`),L(`shareRun.stepSend`)],w=async()=>{S(!0),v({}),b(null);let e=t.takes===`files`?l.flatMap(e=>u[e.from]?[{from:e.from,format:u[e.from]}]:[]):[];try{r(await _.post(`/api/runs/${i}/share/jobs`,{target:t.key,items:e,values:f,lang:I}),{values:f,picked:u})}catch(e){let t=e instanceof ne&&e.status===422?e.body?.fields:null;t?(v(t),t._account&&c(!0)):b(e.message)}finally{S(!1)}};return a&&s?(0,z.jsxs)(`div`,{className:`animate-rise`,children:[(0,z.jsx)(bg,{steps:ee,now:0}),(0,z.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-2 leading-relaxed`,children:L(`shareRun.accountHint`)}),(0,z.jsx)(ht,{runId:i,connection:t.connection??void 0}),g._account?(0,z.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:g._account}):null,(0,z.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,z.jsxs)(O,{disabled:!o,onClick:()=>c(!1),children:[L(`run.next`),` `,(0,z.jsx)(Qe,{className:`size-4`})]})})]}):(0,z.jsxs)(`form`,{className:`animate-rise`,onSubmit:e=>{e.preventDefault(),w()},children:[(0,z.jsx)(bg,{steps:ee,now:+!!a}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[a&&t.connection?.account?(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-paper-2 px-3 py-2 text-[0.8125rem]`,children:[(0,z.jsx)(`span`,{className:`min-w-0 truncate text-ink-2`,children:L(`shareRun.as`,{account:t.connection.account.label})}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>c(!0),className:`shrink-0 text-ink-3 hover:text-ink coarse:min-h-11`,children:L(`shareRun.changeAccount`)})]}):null,t.agent?(0,z.jsxs)(`p`,{className:`flex items-start gap-2.5 rounded-lg bg-ember-tint px-3 py-2.5 text-[0.8125rem] text-ink-2 leading-relaxed`,children:[(0,z.jsx)(It,{className:`mt-0.5 size-4 shrink-0 text-ember-strong`}),` `,L(`shareRun.agentHint`)]}):null,t.presets.length?(0,z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.presets.map(e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>p(t=>({...t,...e.values})),className:`h-9 rounded-full bg-card px-3.5 font-medium text-[0.8125rem] text-ink-2 ring-1 ring-input transition hover:text-ink hover:ring-ember coarse:h-11`,children:e.label},e.label))}):null,t.fields.map(e=>(0,z.jsx)(Cg,{field:e,value:f[e.id]??``,choices:m[e.id],error:g[e.id],onChange:t=>p(n=>({...n,[e.id]:t}))},e.id)),t.takes===`files`&&l.length?(0,z.jsx)(Sg,{deliverables:l,picked:u,error:g._files,onPick:(e,t)=>d(n=>({...n,[e]:t}))}):null,y?(0,z.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:y}):null]}),(0,z.jsx)(`div`,{className:`action-bar mt-6 flex justify-end`,children:(0,z.jsxs)(O,{type:`submit`,busy:x,children:[(0,z.jsx)(Oi,{className:`size-4`}),` `,L(t.agent?`shareRun.start`:`shareRun.send`)]})})]})}function Tg(e,t){let n=encodeURIComponent(e),r=encodeURIComponent(t);return[{id:`mail`,label:L(`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 Eg={x:`𝕏`,linkedin:`in`,whatsapp:`WA`,facebook:`f`};function Dg({view:e,title:t}){let n=e.id,[r,i]=(0,R.useState)(!1),[a,o]=(0,R.useState)({at:`home`}),[s,c]=(0,R.useState)(null),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)({}),p=e.shareJob?.status===`running`?e.shareJob:null,m=(0,R.useCallback)(async()=>{try{c(await _.get(`/api/runs/${n}/share/targets?lang=${I}`)),u(null)}catch(e){u(e.message)}},[n]),h=()=>{i(!0),o(p?{at:`job`,id:p.id,key:null}:{at:`home`}),m()};(0,R.useEffect)(()=>{r&&a.at===`target`&&m()},[r,a.at,e,m]);let g=e.shareJob?.status;(0,R.useEffect)(()=>{r&&g&&g!==`running`&&m()},[r,g,m]);let v=a.at===`target`||a.at===`job`?s?.targets.find(e=>e.key===a.key):void 0,y=a.at===`job`?e.shareJob?.id===a.id?e.shareJob:s?.jobs.find(e=>e.id===a.id):void 0,b=a.at===`home`||a.at===`job`&&y?.status===`running`?null:()=>o({at:`home`});return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(O,{variant:`secondary`,onClick:h,children:[p?(0,z.jsx)(ct,{className:`size-4`}):(0,z.jsx)(Ge,{className:`size-4`}),` `,L(`shareRun.button`)]}),(0,z.jsx)($e,{open:r,onClose:()=>i(!1),wide:!0,title:(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[b?(0,z.jsx)(_e,{label:L(`run.back`),onClick:b,className:`-my-1.5 -ml-2`,children:(0,z.jsx)(ee,{className:`size-4`})}):null,a.at===`link`?L(`shareRun.linkTitle`):v?.name??y?.name??L(`shareRun.title`)]}),children:a.at===`link`?(0,z.jsx)(Mg,{view:e,title:t,onWithdrawn:()=>o({at:`home`})}):a.at===`target`&&v?(0,z.jsx)(wg,{view:e,target:v,draft:d[v.key],onStarted:(e,t)=>{f(e=>({...e,[v.key]:t})),o({at:`job`,id:e.id,key:v.key})}},v.key):a.at===`job`&&y?(0,z.jsx)(yg,{runId:n,job:y,onAgain:a.key?()=>o({at:`target`,key:a.key}):null,onHome:()=>o({at:`home`})}):l?(0,z.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:l}):s?(0,z.jsx)(Ag,{overview:s,onLink:()=>o({at:`link`}),onTarget:e=>o({at:`target`,key:e}),onJob:e=>o({at:`job`,id:e,key:null})}):(0,z.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,z.jsx)(ct,{})})})]})}function Og({icon:e,name:t,description:n,onClick:r,selected:i}){let a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:N(`flex size-11 shrink-0 items-center justify-center rounded-full bg-paper-2 text-ink-2 transition`,r&&`group-hover:bg-ember-tint group-hover:text-ember-strong`,i&&`bg-ember-tint text-ember-strong`),children:(0,z.jsx)(e,{className:`size-5`})}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate font-medium text-[0.9375rem]`,children:t}),(0,z.jsx)(`span`,{className:`block text-[0.8125rem] text-ink-3 leading-snug`,children:n})]}),r?(0,z.jsx)(u,{className:`size-4 shrink-0 text-ink-4 transition group-hover:text-ember-strong`}):null]}),o=N(`group flex items-center gap-3 rounded-xl bg-card p-3 text-left ring-1 ring-input transition`,r&&`hover:ring-ember`,i&&`ring-2 ring-ember`);return r?(0,z.jsx)(`button`,{type:`button`,onClick:r,className:o,children:a}):(0,z.jsx)(`div`,{className:o,children:a})}function kg(e){return new Intl.DateTimeFormat(I,{dateStyle:`short`,timeStyle:`short`}).format(new Date(e))}function Ag({overview:e,onLink:t,onTarget:n,onJob:r}){let i=e.jobs.filter(e=>e.status!==`cancelled`);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,z.jsxs)(`div`,{className:`grid gap-2.5 sm:grid-cols-2`,children:[(0,z.jsx)(Og,{icon:p,name:L(`share.link`),description:L(`shareRun.linkHint`),onClick:t}),e.targets.map(e=>(0,z.jsx)(Og,{icon:vg[e.icon],name:e.name,description:e.description,onClick:()=>n(e.key)},e.key))]}),i.length?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`div`,{className:`mb-2 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]`,children:L(`shareRun.recent`)}),(0,z.jsx)(`ul`,{className:`overflow-hidden rounded-lg ring-1 ring-border-soft`,children:i.slice(0,5).map(e=>(0,z.jsx)(`li`,{className:`border-border-soft border-b last:border-0`,children:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex w-full items-center gap-2.5 px-3 py-2 text-left text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11`,children:[(0,z.jsx)(jg,{job:e}),(0,z.jsx)(`span`,{className:`shrink-0 font-medium`,children:e.name}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink-3`,children:e.result?.summary??e.error??L(`shareRun.working`)}),(0,z.jsx)(`span`,{className:`shrink-0 text-ink-4 tabular-nums`,children:kg(e.createdAt)})]})},e.id))})]}):null]})}function jg({job:e}){return e.status===`running`?(0,z.jsx)(ct,{className:`size-3.5 shrink-0 text-ember`}):(0,z.jsx)(`span`,{className:N(`size-2 shrink-0 rounded-full`,e.status===`done`?`bg-moss`:e.status===`failed`?`bg-rose`:`bg-ink-4`)})}function Mg({view:e,title:t,onWithdrawn:n}){let r=e.id,[i,a]=(0,R.useState)(e.shareUrl?{url:e.shareUrl,expiresAt:e.expiresAt}:null),[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(null);(0,R.useEffect)(()=>{if(i)return;let e=!0;return _.post(`/api/runs/${r}/share`).then(t=>e&&a(t)).catch(t=>e&&l(t.message)),()=>{e=!1}},[r,i]);let u=async()=>{await _.del(`/api/runs/${r}/share`),n()},d=()=>{i&&(navigator.clipboard.writeText(i.url),s(!0),setTimeout(()=>s(!1),1500))},f=We(`share`)||typeof navigator<`u`&&`share`in navigator,m=i?.expiresAt?new Intl.DateTimeFormat(I,{dateStyle:`long`}).format(new Date(i.expiresAt)):null;return c?(0,z.jsx)(`p`,{className:`rounded-lg bg-rose-tint px-3 py-2 text-[0.875rem] text-rose`,children:c}):i?(0,z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-paper-2 p-1.5 pl-3`,children:[(0,z.jsx)(p,{className:`size-4 shrink-0 text-ink-3`}),(0,z.jsx)(`input`,{readOnly:!0,value:i.url,onFocus:e=>e.target.select(),"aria-label":L(`share.link`),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] outline-none coarse:h-11`}),(0,z.jsxs)(O,{size:`sm`,onClick:d,children:[o?(0,z.jsx)(pe,{className:`size-3.5`}):(0,z.jsx)(ue,{className:`size-3.5`}),L(o?`share.copied`:`share.copy`)]})]}),(0,z.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 sm:grid-cols-6`,children:[Tg(i.url,t).map(e=>(0,z.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,z.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,z.jsx)(Wr,{className:`size-5`}):Eg[e.id]}),e.label]},e.id)),f?(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void(We(`share`)?Oe(`share`,{link:i.url,title:t}):navigator.share({title:t,url:i.url})).catch(()=>void 0),className:`flex flex-col items-center gap-1.5 text-[0.75rem] text-ink-2 hover:text-ink`,children:[(0,z.jsx)(`span`,{className:`inline-flex size-12 items-center justify-center rounded-full bg-paper-2 transition hover:bg-paper-3`,children:(0,z.jsx)(Ge,{className:`size-5`})}),L(`shareRun.more`)]}):null]}),(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[0.8125rem] text-ink-3`,children:[(0,z.jsx)(`span`,{children:m?L(`shareRun.until`,{date:m}):L(`shareRun.kept`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void u(),className:`shrink-0 hover:text-rose coarse:min-h-11`,children:L(`shareRun.withdraw`)})]})]}):(0,z.jsx)(`div`,{className:`flex justify-center py-8 text-ink-4`,children:(0,z.jsx)(ct,{})})}S({lang:I,runBase:e=>`/api/runs/${e}`,withBase:Ye,asset:qe,serviceWorker:`${ce}/sw.js`,app:{can:We,call:Oe,tell:Ne,download:ft},Mascot:cn,ShareResultButton:Dg,RunEnd:_g,onServerError:e=>Ze(`error`,e)}),C(),ge();var Ng=`wizards.reloadedForBuild`;window.addEventListener(`vite:preloadError`,e=>{let t=0;try{if(t=Number(sessionStorage.getItem(Ng))||0,Date.now()-t<6e4)return;sessionStorage.setItem(Ng,String(Date.now()))}catch{return}e.preventDefault(),window.location.reload()}),`engentyDesktop`in window&&(document.documentElement.dataset.desktop=``);var Pg=window.location.pathname,Fg=Pg===a||Pg.startsWith(`${a}/`);Fg&&`serviceWorker`in navigator&&navigator.serviceWorker.register(`${ce}/sw.js`).catch(()=>void 0);var Ig=new An({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});(0,qi.createRoot)(document.getElementById(`root`)).render((0,z.jsx)(R.StrictMode,{children:(0,z.jsx)(Ve,{client:Ig,children:Fg?(0,z.jsx)(hg,{children:(0,z.jsxs)(lg,{where:`studio`,children:[(0,z.jsx)(cg,{}),(0,z.jsx)(Ks,{})]})}):(0,z.jsx)(A,{basename:ce,children:(0,z.jsxs)(lg,{where:`run`,children:[(0,z.jsx)(ag,{}),(0,z.jsx)(Ks,{})]})})})}));export{Cf as $,yp as A,ni as At,Tf as B,Ar as Bt,em as C,Wi as Ct,$p as D,wi as Dt,om as E,Ei as Et,$f as F,Wr as Ft,Mf as G,Xn as Gt,Df as H,vr as Ht,Qf as I,Rr as It,kf as J,Af as K,Bn as Kt,Yf as L,Ir as Lt,np as M,Qr as Mt,Q as N,Xr as Nt,Bp as O,vi as Ot,ep as P,Jr as Pt,Ff as Q,Hf as R,Pr as Rt,im as S,Ki as St,am as T,Ai as Tt,wf as U,cr as Ut,Ef as V,Or as Vt,If as W,ir as Wt,Lf as X,zf as Y,Rf as Z,Rm as _,$s as _t,bg as a,zl as at,dm as b,ma as bt,Sh as c,Il as ct,ch as d,nl as dt,Sf as et,ah as f,Hc as ft,zm as g,lc as gt,ih as h,Cc as ht,Sg as i,Tu as it,sp as j,ei as jt,Up as k,ii as kt,Fh as l,ml as lt,rh as m,Zc as mt,Og as n,_f as nt,vg as o,Rl as ot,lh as p,Xc as pt,jf as q,Cg as r,sf as rt,Lh as s,kl as st,Dg as t,xf as tt,ph as u,al as ut,$m as v,Ys as vt,rm as w,Hi as wt,sm as x,Qi as xt,Nm as y,fa as yt,Bf as z,Mr as zt};