@engenty/wizards-runtime 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/apps/runtime/dist/agents/architect.js +6 -7
  2. package/apps/runtime/dist/agents/chat-clients.js +3 -0
  3. package/apps/runtime/dist/agents/studio-assistant.js +26 -7
  4. package/apps/runtime/dist/agents/subscription.js +24 -11
  5. package/apps/runtime/dist/assistant/knows.js +1 -1
  6. package/apps/runtime/dist/auth/index.js +15 -2
  7. package/apps/runtime/dist/authoring/guide.js +2 -8
  8. package/apps/runtime/dist/credits/estimate.js +1 -1
  9. package/apps/runtime/dist/data/chat-models.json +116 -0
  10. package/apps/runtime/dist/db/migrations/tenant/0025_drop_mcp_servers.sql +1 -0
  11. package/apps/runtime/dist/db/migrations/tenant/meta/0025_snapshot.json +3959 -0
  12. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  13. package/apps/runtime/dist/db/schema.js +0 -4
  14. package/apps/runtime/dist/docs/dev/plugins/events.md +2 -2
  15. package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +1 -2
  16. package/apps/runtime/dist/docs/dev/wizard-format/wizard-file.md +6 -8
  17. package/apps/runtime/dist/docs/user-guide/cloud-sync.md +2 -2
  18. package/apps/runtime/dist/docs/user-guide/connectors.md +1 -10
  19. package/apps/runtime/dist/docs/user-guide/models.md +15 -5
  20. package/apps/runtime/dist/docs/user-guide/steps.md +2 -3
  21. package/apps/runtime/dist/engine/steps.js +126 -131
  22. package/apps/runtime/dist/env.js +5 -0
  23. package/apps/runtime/dist/live/views.js +1 -3
  24. package/apps/runtime/dist/mcp/tools.js +1 -1
  25. package/apps/runtime/dist/models.js +8 -9
  26. package/apps/runtime/dist/routes/studio.js +39 -6
  27. package/apps/runtime/dist/services/architect.js +5 -5
  28. package/apps/runtime/dist/services/chat-models.js +58 -0
  29. package/apps/runtime/dist/services/package-file.js +0 -1
  30. package/apps/runtime/dist/services/package.js +0 -10
  31. package/apps/runtime/dist/services/projects.js +1 -31
  32. package/apps/runtime/dist/services/spaces.js +5 -23
  33. package/apps/runtime/dist/services/wizards.js +8 -0
  34. package/apps/runtime/dist/sync/records.js +0 -9
  35. package/apps/runtime/dist/tools/index.js +0 -28
  36. package/apps/web/dist/assets/{AboutDialog-B7ThTqw4.js → AboutDialog-30Mc1_N_.js} +1 -1
  37. package/apps/web/dist/assets/{ChangelogDialog-DBpXTjxr.js → ChangelogDialog-Vjxg6JV8.js} +1 -1
  38. package/apps/web/dist/assets/{CodeEditor-BTcAUlGY.js → CodeEditor-CmMRfVhS.js} +1 -1
  39. package/apps/web/dist/assets/EditorPage-Di5KB-Ei.js +3 -0
  40. package/apps/web/dist/assets/{FlowPreview-Sjnlj0OO.js → FlowPreview-BkcO3iCf.js} +1 -1
  41. package/apps/web/dist/assets/{Harness-BKl73EG5.js → Harness-D_Hr80Fo.js} +1 -1
  42. package/apps/web/dist/assets/Marketplace-BxFBMUsi.js +2 -0
  43. package/apps/web/dist/assets/{NewWizardChannels-DarxdQRt.js → NewWizardChannels-BIzOtfc8.js} +1 -1
  44. package/apps/web/dist/assets/{NewWizardPage-BCoPZjp5.js → NewWizardPage-BenzMrPD.js} +1 -1
  45. package/apps/web/dist/assets/{OnboardingPage-qV_YA_mZ.js → OnboardingPage-DuckyzQr.js} +1 -1
  46. package/apps/web/dist/assets/{PreviewPane-B5_GY6Cv.js → PreviewPane-D9hmriSm.js} +2 -2
  47. package/apps/web/dist/assets/{ProjectPage-Bcc81_KO.js → ProjectPage-A8Z8cS1E.js} +1 -1
  48. package/apps/web/dist/assets/{PublicRunner-hlxaESAv.js → PublicRunner-QPvlEAxx.js} +1 -1
  49. package/apps/web/dist/assets/{ReadOnly-BUnTzhA3.js → ReadOnly-DFn32cvo.js} +1 -1
  50. package/apps/web/dist/assets/SettingsPage-ByP15ndy.js +2 -0
  51. package/apps/web/dist/assets/{SetupPage-DAgnVxDA.js → SetupPage-WNHH74hu.js} +1 -1
  52. package/apps/web/dist/assets/{SharePage-aKBNZDby.js → SharePage-Bw4TRWtv.js} +1 -1
  53. package/apps/web/dist/assets/changelog-Dr9tAFY9.js +1 -0
  54. package/apps/web/dist/assets/{coins-C8RAtYAu.js → coins-DTH3SKgZ.js} +1 -1
  55. package/apps/web/dist/assets/i18n-CLxuuhp_.js +55 -0
  56. package/apps/web/dist/assets/index-Bha72INy.css +1 -0
  57. package/apps/web/dist/assets/index-HhslPV6N.js +34 -0
  58. package/apps/web/dist/assets/oss-credits-CZT1KRIp.js +1 -0
  59. package/apps/web/dist/assets/{phone-DTuPPVhC.js → phone-DymZ7rLO.js} +1 -1
  60. package/apps/web/dist/assets/{runners-BcK_yEKU.js → runners-UfKeoOe4.js} +1 -1
  61. package/apps/web/dist/assets/{session-C7ciCzbV.js → session-COf_im0l.js} +1 -1
  62. package/apps/web/dist/assets/{settings-menu-b7am2SP5.js → settings-menu-mtOjI15L.js} +1 -1
  63. package/apps/web/dist/assets/{theme-BOAjs_xb.js → theme-DWoTWDAG.js} +1 -1
  64. package/apps/web/dist/assets/{ui-DKK_O65k.js → ui-D_0Xdrjh.js} +2 -2
  65. package/apps/web/dist/assets/{upload-Cbcw8l_0.js → upload-BizIzwxa.js} +1 -1
  66. package/apps/web/dist/assets/{useMutation-D8Bpwvs1.js → useMutation-BJfRETsQ.js} +1 -1
  67. package/apps/web/dist/assets/{volume-2-CgRP_A7r.js → volume-2-BGkyA8T9.js} +1 -1
  68. package/apps/web/dist/assets/{wrench-me5bf7bd.js → wrench-Be5zav03.js} +1 -1
  69. package/apps/web/dist/index.html +9 -9
  70. package/apps/web/dist/mcp/flow.html +3 -3
  71. package/node_modules/@engenty/wizards-shared/dist/assistant.d.ts +1 -0
  72. package/node_modules/@engenty/wizards-shared/dist/assistant.js +2 -0
  73. package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +0 -4
  74. package/node_modules/@engenty/wizards-shared/dist/definition.js +0 -3
  75. package/node_modules/@engenty/wizards-shared/dist/fit.d.ts +1 -1
  76. package/node_modules/@engenty/wizards-shared/dist/fit.js +0 -4
  77. package/node_modules/@engenty/wizards-shared/dist/marketplace.js +2 -2
  78. package/node_modules/@engenty/wizards-shared/dist/run.d.ts +1 -2
  79. package/node_modules/@engenty/wizards-shared/dist/run.js +2 -4
  80. package/node_modules/@engenty/wizards-shared/dist/wizard-package.d.ts +0 -4
  81. package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +0 -5
  82. package/package.json +1 -2
  83. package/plugin/.claude-plugin/plugin.json +1 -1
  84. package/plugin/plugin.json +1 -1
  85. package/apps/web/dist/assets/EditorPage-B_cFXR-B.js +0 -3
  86. package/apps/web/dist/assets/Marketplace-BNu-Hjzu.js +0 -2
  87. package/apps/web/dist/assets/SettingsPage-BoA-ykQU.js +0 -2
  88. package/apps/web/dist/assets/changelog-DwJOKc4z.js +0 -1
  89. package/apps/web/dist/assets/i18n-Bq6dt_qv.js +0 -55
  90. package/apps/web/dist/assets/index-BdwA-8jc.js +0 -34
  91. package/apps/web/dist/assets/index-DQc1EITf.css +0 -1
  92. package/apps/web/dist/assets/oss-credits-C6bPkfSE.js +0 -1
@@ -0,0 +1 @@
1
+ var e={shared:[{name:`@fontsource/bricolage-grotesque`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/bricolage-grotesque`},{name:`@fontsource/caveat`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/caveat`},{name:`@fontsource/creepster`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/creepster`},{name:`@fontsource/dm-sans`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/dm-sans`},{name:`@fontsource/figtree`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/figtree`},{name:`@fontsource/fraunces`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/fraunces`},{name:`@fontsource/fredoka`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/fredoka`},{name:`@fontsource/inter`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/inter`},{name:`@fontsource/lora`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/lora`},{name:`@fontsource/nosifer`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/nosifer`},{name:`@fontsource/nunito`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/nunito`},{name:`@fontsource/playfair-display`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/playfair-display`},{name:`@fontsource/young-serif`,version:`5.3.0`,license:`OFL-1.1`,homepage:`https://fontsource.org/fonts/young-serif`},{name:`@modelcontextprotocol/client`,version:`2.3.0`,license:`Apache-2.0`,homepage:`https://modelcontextprotocol.io`},{name:`@modelcontextprotocol/ext-apps`,version:`2.0.3`,license:`MIT`,homepage:`https://github.com/modelcontextprotocol/ext-apps`},{name:`dompurify`,version:`3.4.16`,license:`(MPL-2.0 OR Apache-2.0)`,homepage:`https://github.com/cure53/DOMPurify`},{name:`fflate`,version:`0.8.3`,license:`MIT`,homepage:`https://101arrowz.github.io/fflate`},{name:`lucide-react`,version:`1.49.0`,license:`ISC`,homepage:`https://lucide.dev`},{name:`marked`,version:`18.0.14`,license:`MIT`,homepage:`https://marked.js.org`},{name:`pdfmake`,version:`0.3.11`,license:`MIT`,homepage:`http://pdfmake.org`},{name:`qr-scanner`,version:`1.4.2`,license:`MIT`,homepage:`https://github.com/nimiq/qr-scanner#readme`},{name:`zod`,version:`4.6.5`,license:`MIT`,homepage:`https://zod.dev`}],groups:[{id:`apps/runtime`,kind:`app`,label:`runtime`,packages:[{name:`@ai-sdk/anthropic`,version:`4.0.54`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@ai-sdk/elevenlabs`,version:`3.0.42`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@ai-sdk/fal`,version:`3.0.42`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@ai-sdk/gateway`,version:`4.0.82`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@ai-sdk/google`,version:`4.0.72`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@ai-sdk/openai`,version:`4.0.67`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@ai-sdk/replicate`,version:`3.0.42`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`@clack/prompts`,version:`1.8.1`,license:`MIT`,homepage:`https://github.com/bombshell-dev/clack/tree/main/packages/prompts#readme`},{name:`@executor-js/plugin-openapi`,version:`1.6.10`,license:`MIT`,homepage:`https://github.com/UsefulSoftwareCo/executor/tree/main/packages/plugins/openapi`},{name:`@hono/node-server`,version:`2.1.3`,license:`MIT`,homepage:`https://github.com/honojs/node-server`},{name:`@libsql/client`,version:`0.18.0`,license:`MIT`,homepage:`https://github.com/tursodatabase/libsql-client-ts#readme`},{name:`@lydell/node-pty`,version:`1.1.0`,license:`MIT`,homepage:`https://github.com/lydell/node-pty#readme`},{name:`@mastra/core`,version:`1.77.0`,license:`Apache-2.0`,homepage:`https://mastra.ai`},{name:`@mastra/docker`,version:`0.8.0`,license:`Apache-2.0`,homepage:`https://mastra.ai`},{name:`@mastra/quickjs`,version:`0.1.3`,license:`Apache-2.0`,homepage:`https://mastra.ai`},{name:`@modelcontextprotocol/server`,version:`2.3.0`,license:`Apache-2.0`,homepage:`https://modelcontextprotocol.io`},{name:`@napi-rs/canvas`,version:`0.1.80`,license:`MIT`,homepage:`https://github.com/Brooooooklyn/canvas#readme`},{name:`@turbodocx/html-to-docx`,version:`1.23.1`,license:`MIT`,homepage:`https://github.com/TurboDocx/html-to-docx#readme`},{name:`ai`,version:`7.0.102`,license:`Apache-2.0`,homepage:`https://ai-sdk.dev/docs`},{name:`aws4fetch`,version:`1.0.20`,license:`MIT`,homepage:`https://github.com/mhart/aws4fetch#readme`},{name:`cross-spawn`,version:`7.0.6`,license:`MIT`,homepage:`https://github.com/moxystudio/node-cross-spawn`},{name:`drizzle-orm`,version:`0.45.3`,license:`Apache-2.0`,homepage:`https://orm.drizzle.team`},{name:`effect`,version:`4.0.0-beta.59`,license:`MIT`,homepage:`https://effect.website`},{name:`exceljs`,version:`4.4.0`,license:`MIT`,homepage:`https://github.com/exceljs/exceljs#readme`},{name:`fast-xml-parser`,version:`5.11.2`,license:`MIT`,homepage:`https://github.com/NaturalIntelligence/fast-xml-parser#readme`},{name:`hono`,version:`4.13.12`,license:`MIT`,homepage:`https://hono.dev`},{name:`imapflow`,version:`2.2.1`,license:`MIT`,homepage:`https://imapflow.com/`},{name:`jiti`,version:`2.7.0`,license:`MIT`,homepage:`https://github.com/unjs/jiti#readme`},{name:`jose`,version:`6.2.12`,license:`MIT`,homepage:`https://github.com/panva/jose`},{name:`mammoth`,version:`1.13.0`,license:`BSD-2-Clause`,homepage:`https://github.com/mwilliamson/mammoth.js#readme`},{name:`nanoid`,version:`5.1.16`,license:`MIT`,homepage:`https://github.com/ai/nanoid#readme`},{name:`nodemailer`,version:`10.0.9`,license:`MIT-0`,homepage:`https://nodemailer.com/`},{name:`pdf-parse`,version:`2.4.5`,license:`Apache-2.0`,homepage:`https://mehmet-kozan.github.io/pdf-parse/`},{name:`playwright-core`,version:`1.63.0`,license:`Apache-2.0`,homepage:`https://playwright.dev`},{name:`postal-mime`,version:`4.0.2`,license:`MIT-0`,homepage:`https://postal-mime.postalsys.com`},{name:`rfc6902`,version:`5.3.0`,license:`MIT`,homepage:`https://github.com/chbrown/rfc6902`},{name:`turndown`,version:`7.2.4`,license:`MIT`,homepage:`https://github.com/mixmark-io/turndown#readme`},{name:`undici`,version:`8.12.2`,license:`MIT`,homepage:`https://undici.nodejs.org`}]},{id:`apps/web`,kind:`app`,label:`studio`,packages:[{name:`@codemirror/autocomplete`,version:`6.20.3`,license:`MIT`},{name:`@codemirror/commands`,version:`6.11.1`,license:`MIT`},{name:`@codemirror/lang-json`,version:`6.0.2`,license:`MIT`,homepage:`https://github.com/codemirror/lang-json#readme`},{name:`@codemirror/lang-markdown`,version:`6.5.2`,license:`MIT`},{name:`@codemirror/language`,version:`6.13.1`,license:`MIT`},{name:`@codemirror/lint`,version:`6.9.7`,license:`MIT`},{name:`@codemirror/search`,version:`6.7.2`,license:`MIT`},{name:`@codemirror/state`,version:`6.7.6`,license:`MIT`},{name:`@codemirror/view`,version:`6.43.14`,license:`MIT`},{name:`@dagrejs/dagre`,version:`3.1.1`,license:`MIT`,homepage:`https://github.com/dagrejs/dagre#readme`},{name:`@lezer/highlight`,version:`1.2.5`,license:`MIT`},{name:`@tanstack/react-query`,version:`5.104.0`,license:`MIT`,homepage:`https://tanstack.com/query`},{name:`@xterm/addon-fit`,version:`0.11.0`,license:`MIT`,homepage:`https://github.com/xtermjs/xterm.js/tree/master#readme`},{name:`@xterm/addon-web-links`,version:`0.12.0`,license:`MIT`,homepage:`https://github.com/xtermjs/xterm.js/tree/master#readme`},{name:`@xterm/xterm`,version:`6.0.0`,license:`MIT`,homepage:`https://github.com/xtermjs/xterm.js#readme`},{name:`@xyflow/react`,version:`12.12.0`,license:`MIT`,homepage:`https://reactflow.dev`},{name:`modern-screenshot`,version:`4.7.0`,license:`MIT`,homepage:`https://github.com/qq15725/modern-screenshot`},{name:`react`,version:`19.3.0`,license:`MIT`,homepage:`https://react.dev/`},{name:`react-dom`,version:`19.3.0`,license:`MIT`,homepage:`https://react.dev/`},{name:`react-router`,version:`7.18.4`,license:`MIT`,homepage:`https://github.com/remix-run/react-router#readme`},{name:`uqr`,version:`0.1.3`,license:`MIT`,homepage:`https://github.com/unjs/uqr#readme`}]}]};export{e as default};
@@ -1 +1 @@
1
- import{Xn as e}from"./ui-DKK_O65k.js";var t={name:`phone`,size:24,node:[[`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`}]]};t.node;var n=e(t);export{n as t};
1
+ import{Xn as e}from"./ui-D_0Xdrjh.js";var t={name:`phone`,size:24,node:[[`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`}]]};t.node;var n=e(t);export{n as t};
@@ -1 +1 @@
1
- import{S as e}from"./i18n-Bq6dt_qv.js";var t=[`text`,`data`,`image`,`video`,`voice`,`document`,`dashboard`,`widget`,`motion-graphics`,`surface`];[...e],[...t];var n={default:`steps`,enabled:[`steps`,`chat`]};export{n as t};
1
+ import{S as e}from"./i18n-CLxuuhp_.js";var t=[`text`,`data`,`image`,`video`,`voice`,`document`,`dashboard`,`widget`,`motion-graphics`,`surface`];[...e],[...t];var n={default:`steps`,enabled:[`steps`,`chat`]};export{n as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fluffy-engenty-o_lu9icd.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/engenty-CNjaZCVM.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,G as i,Lt as a,Mr as o,W as s,Xn as c,Yt as l,ot as u,sr as d,tt as f}from"./ui-DKK_O65k.js";import{t as ee}from"./preload-helper-DpV6A1kQ.js";import{c as te,s as ne,t as p}from"./engenty-CNjaZCVM.js";import"./logo-CGNoptDg.js";import{O as re,i as m,o as ie,s as h}from"./i18n-Bq6dt_qv.js";var g={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};g.node;var _=c(g),v={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};v.node;var y=c(v),b=e(t(),1),x=`wizards.theme`,S=new Set,C=window.matchMedia(`(prefers-color-scheme: dark)`),w=`engenty_theme`;function T(){let e=document.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`${w}=`))?.slice(14);return e===`light`||e===`dark`||e===`system`?e:null}function E(e){let t=window.location.hostname,n=t.split(`.`),r=n.length>1&&!/^\d+$/.test(n[n.length-1])?n.length>2?n.slice(1).join(`.`):t:``,i=window.location.protocol===`https:`?`; Secure`:``;document.cookie=`${w}=${e}; Path=/; Max-Age=31536000; SameSite=Lax${r?`; Domain=${r}`:``}${i}`}function D(){try{let e=T()??localStorage.getItem(x);return e===`system`?null:e===`light`?`light`:`dark`}catch{return`dark`}}var O=0,k=null,A=null;function j(){try{return T()!==null||localStorage.getItem(x)!==null}catch{return!1}}function M(){return O>0?`dark`:k||(A&&!j()?A:D()??(C.matches?`dark`:`light`))}function N(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function P(){let e=M()===`dark`;document.documentElement.classList.toggle(`dark`,e),N();for(let e of S)e()}C.addEventListener(`change`,P),T()||E(D()??`system`),P();function F(e){E(e??`system`);try{localStorage.setItem(x,e??`system`)}catch{document.documentElement.classList.toggle(`dark`,(e??M())===`dark`);return}P()}function ae(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),D)}function oe(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>D()??(C.matches?`dark`:`light`))}function I(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var L=e=>`oklch(from ${ne[te[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function se(e){(0,b.useEffect)(()=>{if(!e)return;let t=document.documentElement;return O+=1,t.style.setProperty(`--stage`,e),P(),()=>{--O,t.style.removeProperty(`--stage`),P()}},[e])}function R(e){(0,b.useEffect)(()=>{if(!e)return;let t=document.documentElement;return t.style.setProperty(`--engenty-stage`,L(e)),N(),()=>{t.style.removeProperty(`--engenty-stage`),N()}},[e])}function z(e){(0,b.useEffect)(()=>{if(e)return A=e,P(),()=>{A=null,P()}},[e])}function B(e){(0,b.useEffect)(()=>{if(e)return k=e,P(),()=>{k=null,P()}},[e])}function V(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>k!==null)}var H=e(n(),1),U={name:`engenty wizards`,short:`wizards`},W=(0,b.lazy)(()=>ee(()=>import(`./fluffy-engenty-o_lu9icd.js`).then(e=>({default:e.FluffyEngenty})),__vite__mapDeps([0,1,2,3])));function G({kind:e,size:t=64,fluffy:n,coat:r,costume:i,helmet:a=!1,interactive:o=!0}){let s=e||`round`,c=I(),l=r??(c===`dark`?`jelly`:`fur`);if(n&&t>=120&&(l===`fur`||c===`dark`))return(0,H.jsx)(b.Suspense,{fallback:(0,H.jsx)(p,{costume:i,helmet:a,kind:s,size:Math.round(t*.62)}),children:(0,H.jsx)(W,{costume:i,gooseHelmet:a,coat:l,kind:s,size:t,quality:`medium`,interactive:o})});if(n&&t>=120){let e=Math.round(t*1.08);return(0,H.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:L(s),borderRadius:t*.28,height:t,width:t},children:[(0,H.jsx)(`span`,{className:`pointer-events-none absolute rounded-full bg-white`,style:{filter:`blur(${t*.18}px)`,height:t*.8,opacity:.16,right:-t*.3,top:-t*.3,width:t*.8}}),(0,H.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,H.jsx)(b.Suspense,{fallback:(0,H.jsx)(p,{costume:i,helmet:a,kind:s,size:Math.round(e*.62)}),children:(0,H.jsx)(W,{costume:i,gooseHelmet:a,coat:`jelly`,kind:s,size:e,quality:`medium`,interactive:o})})})]})}return(0,H.jsx)(p,{costume:i,helmet:a,kind:s,size:t,animated:o})}function K(){let e=I(),t=V(),n=e===`dark`?`light`:`dark`;return t?null:(0,H.jsx)(l,{label:h(n===`dark`?`theme.dark`:`theme.light`),onClick:()=>F(n),children:e===`dark`?(0,H.jsx)(y,{className:`size-4`}):(0,H.jsx)(_,{className:`size-4`})})}function ce(e){return Object.fromEntries(re.filter(t=>e[t]?.startsWith(`apple:`)).map(e=>[e,``]))}function le(e){return e.split(/\s+/).map(e=>e[0]??``).join(``).slice(0,2).toUpperCase()}function ue(){let e=q().data?.limits.projects;return e===null||(e??1)>1}function de(){return q().data?.limits.build??!0}function fe(){return q().data?.limits.create??!0}function pe(){let e=q().data;return!e||e.mode===`local`||e.tenant.role!==`member`}function me(e){return e.mode===`managed`?e.credits:e.models?.source===`account`?e.account?.credits??null:null}function he(){let e=o();return t=>{m(t),e.setQueryData([`me`],e=>e&&{...e,lang:t}),i.put(`/api/studio/lang`,{lang:t}).catch(()=>void 0)}}function ge(e){let t=o();(0,b.useEffect)(()=>{if(!e)return;if(e.lang){m(e.lang);return}let n=ie();n&&(t.setQueryData([`me`],e=>e&&{...e,lang:n}),i.put(`/api/studio/lang`,{lang:n}).catch(()=>void 0))},[e,t])}function q(){return d({queryKey:[`me`],queryFn:async()=>{try{return await i.get(`/api/studio/me`)}catch(e){if(e instanceof a&&e.status===401)return null;throw e}},staleTime:3e4})}function J(e=!0){return d({queryKey:s.spaces(),queryFn:()=>i.get(`/api/studio/projects`),enabled:e})}var Y=`wz.project`;function _e(){try{return localStorage.getItem(Y)}catch{return null}}var X=_e(),Z=new Set;function ve(e){X=e;try{localStorage.setItem(Y,e)}catch{}for(let e of Z)e()}function Q(){let e=J(),t=(0,b.useSyncExternalStore)(e=>(Z.add(e),()=>Z.delete(e)),()=>X),n=e.data??[];return{project:n.find(e=>e.id===t)??n[0]??null,projects:n,select:ve,loading:e.isLoading}}function ye(e,t){return d({queryKey:[`cloud`,e],queryFn:()=>i.get(`/api/studio/wizards/${e}/cloud`),enabled:t})}function be(e){return e instanceof a&&e.body?.code===`read_only`?e.message:null}async function xe(){let{account:e}=await(await fetch(u(`/api/auth/sign-out`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:`{}`})).json().catch(()=>({}));if(!e){window.location.href=`${r}/`;return}let t=document.createElement(`form`);t.method=`POST`,t.action=e;let n=document.createElement(`input`);n.type=`hidden`,n.name=`return`,n.value=`${window.location.origin}${r}/`,t.append(n),document.body.append(t),t.submit()}function Se(e=Ce(),t){let n=new URLSearchParams({return:e});f!==r&&n.set(`organization`,f.slice(r.length+1)),t?.trim()&&n.set(`wish`,t.trim()),window.location.href=u(`/api/auth/login?${n}`)}function Ce(){let e=new URLSearchParams(window.location.search);e.delete(`signin`);let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}`}var $=`wizards.wish`,we=1;function Te(e){try{localStorage.setItem($,JSON.stringify({text:e,at:Date.now()}))}catch{}}function Ee(){try{let e=JSON.parse(localStorage.getItem($)??`null`);if(typeof e?.text==`string`&&typeof e.at==`number`&&Date.now()-e.at<we*864e5)return e.text}catch{}return null}function De(){try{localStorage.removeItem($)}catch{}}export{ae as A,F as C,oe as D,z as E,_ as M,R as O,K as S,B as T,he as _,be as a,U as b,me as c,Q as d,pe as f,q as g,fe as h,Ee as i,y as j,I as k,ge as l,de as m,le as n,Se as o,ue as p,Te as r,xe as s,De as t,ye as u,J as v,se as w,G as x,ce as y};
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,G as i,Lt as a,Mr as o,W as s,Xn as c,Yt as l,ot as u,sr as d,tt as f}from"./ui-D_0Xdrjh.js";import{t as ee}from"./preload-helper-DpV6A1kQ.js";import{c as te,s as ne,t as p}from"./engenty-CNjaZCVM.js";import"./logo-CGNoptDg.js";import{O as re,i as m,o as ie,s as h}from"./i18n-CLxuuhp_.js";var g={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};g.node;var _=c(g),v={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};v.node;var y=c(v),b=e(t(),1),x=`wizards.theme`,S=new Set,C=window.matchMedia(`(prefers-color-scheme: dark)`),w=`engenty_theme`;function T(){let e=document.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`${w}=`))?.slice(14);return e===`light`||e===`dark`||e===`system`?e:null}function E(e){let t=window.location.hostname,n=t.split(`.`),r=n.length>1&&!/^\d+$/.test(n[n.length-1])?n.length>2?n.slice(1).join(`.`):t:``,i=window.location.protocol===`https:`?`; Secure`:``;document.cookie=`${w}=${e}; Path=/; Max-Age=31536000; SameSite=Lax${r?`; Domain=${r}`:``}${i}`}function D(){try{let e=T()??localStorage.getItem(x);return e===`system`?null:e===`light`?`light`:`dark`}catch{return`dark`}}var O=0,k=null,A=null;function j(){try{return T()!==null||localStorage.getItem(x)!==null}catch{return!1}}function M(){return O>0?`dark`:k||(A&&!j()?A:D()??(C.matches?`dark`:`light`))}function N(){requestAnimationFrame(()=>{let e=document.querySelector(`meta[name="theme-color"]`),t=document.createElement(`canvas`).getContext(`2d`);if(!e||!t||!document.body)return;t.fillStyle=getComputedStyle(document.body).backgroundColor,t.fillRect(0,0,1,1);let[n,r,i]=t.getImageData(0,0,1,1).data;e.content=`#${[n,r,i].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`})}function P(){let e=M()===`dark`;document.documentElement.classList.toggle(`dark`,e),N();for(let e of S)e()}C.addEventListener(`change`,P),T()||E(D()??`system`),P();function F(e){E(e??`system`);try{localStorage.setItem(x,e??`system`)}catch{document.documentElement.classList.toggle(`dark`,(e??M())===`dark`);return}P()}function ae(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),D)}function oe(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>D()??(C.matches?`dark`:`light`))}function I(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`)}var L=e=>`oklch(from ${ne[te[e]??`cobalt`]} 0.34 calc(c * 0.6) h)`;function se(e){(0,b.useEffect)(()=>{if(!e)return;let t=document.documentElement;return O+=1,t.style.setProperty(`--stage`,e),P(),()=>{--O,t.style.removeProperty(`--stage`),P()}},[e])}function R(e){(0,b.useEffect)(()=>{if(!e)return;let t=document.documentElement;return t.style.setProperty(`--engenty-stage`,L(e)),N(),()=>{t.style.removeProperty(`--engenty-stage`),N()}},[e])}function z(e){(0,b.useEffect)(()=>{if(e)return A=e,P(),()=>{A=null,P()}},[e])}function B(e){(0,b.useEffect)(()=>{if(e)return k=e,P(),()=>{k=null,P()}},[e])}function V(){return(0,b.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>k!==null)}var H=e(n(),1),U={name:`engenty wizards`,short:`wizards`},W=(0,b.lazy)(()=>ee(()=>import(`./fluffy-engenty-o_lu9icd.js`).then(e=>({default:e.FluffyEngenty})),__vite__mapDeps([0,1,2,3])));function G({kind:e,size:t=64,fluffy:n,coat:r,costume:i,helmet:a=!1,interactive:o=!0}){let s=e||`round`,c=I(),l=r??(c===`dark`?`jelly`:`fur`);if(n&&t>=120&&(l===`fur`||c===`dark`))return(0,H.jsx)(b.Suspense,{fallback:(0,H.jsx)(p,{costume:i,helmet:a,kind:s,size:Math.round(t*.62)}),children:(0,H.jsx)(W,{costume:i,gooseHelmet:a,coat:l,kind:s,size:t,quality:`medium`,interactive:o})});if(n&&t>=120){let e=Math.round(t*1.08);return(0,H.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex items-center justify-center overflow-hidden`,style:{background:L(s),borderRadius:t*.28,height:t,width:t},children:[(0,H.jsx)(`span`,{className:`pointer-events-none absolute rounded-full bg-white`,style:{filter:`blur(${t*.18}px)`,height:t*.8,opacity:.16,right:-t*.3,top:-t*.3,width:t*.8}}),(0,H.jsx)(`div`,{className:`relative`,style:{marginTop:t*.04},children:(0,H.jsx)(b.Suspense,{fallback:(0,H.jsx)(p,{costume:i,helmet:a,kind:s,size:Math.round(e*.62)}),children:(0,H.jsx)(W,{costume:i,gooseHelmet:a,coat:`jelly`,kind:s,size:e,quality:`medium`,interactive:o})})})]})}return(0,H.jsx)(p,{costume:i,helmet:a,kind:s,size:t,animated:o})}function K(){let e=I(),t=V(),n=e===`dark`?`light`:`dark`;return t?null:(0,H.jsx)(l,{label:h(n===`dark`?`theme.dark`:`theme.light`),onClick:()=>F(n),children:e===`dark`?(0,H.jsx)(y,{className:`size-4`}):(0,H.jsx)(_,{className:`size-4`})})}function ce(e){return Object.fromEntries(re.filter(t=>e[t]?.startsWith(`apple:`)).map(e=>[e,``]))}function le(e){return e.split(/\s+/).map(e=>e[0]??``).join(``).slice(0,2).toUpperCase()}function ue(){let e=q().data?.limits.projects;return e===null||(e??1)>1}function de(){return q().data?.limits.build??!0}function fe(){return q().data?.limits.create??!0}function pe(){let e=q().data;return!e||e.mode===`local`||e.tenant.role!==`member`}function me(e){return e.mode===`managed`?e.credits:e.models?.source===`account`?e.account?.credits??null:null}function he(){let e=o();return t=>{m(t),e.setQueryData([`me`],e=>e&&{...e,lang:t}),i.put(`/api/studio/lang`,{lang:t}).catch(()=>void 0)}}function ge(e){let t=o();(0,b.useEffect)(()=>{if(!e)return;if(e.lang){m(e.lang);return}let n=ie();n&&(t.setQueryData([`me`],e=>e&&{...e,lang:n}),i.put(`/api/studio/lang`,{lang:n}).catch(()=>void 0))},[e,t])}function q(){return d({queryKey:[`me`],queryFn:async()=>{try{return await i.get(`/api/studio/me`)}catch(e){if(e instanceof a&&e.status===401)return null;throw e}},staleTime:3e4})}function J(e=!0){return d({queryKey:s.spaces(),queryFn:()=>i.get(`/api/studio/projects`),enabled:e})}var Y=`wz.project`;function _e(){try{return localStorage.getItem(Y)}catch{return null}}var X=_e(),Z=new Set;function ve(e){X=e;try{localStorage.setItem(Y,e)}catch{}for(let e of Z)e()}function Q(){let e=J(),t=(0,b.useSyncExternalStore)(e=>(Z.add(e),()=>Z.delete(e)),()=>X),n=e.data??[];return{project:n.find(e=>e.id===t)??n[0]??null,projects:n,select:ve,loading:e.isLoading}}function ye(e,t){return d({queryKey:[`cloud`,e],queryFn:()=>i.get(`/api/studio/wizards/${e}/cloud`),enabled:t})}function be(e){return e instanceof a&&e.body?.code===`read_only`?e.message:null}async function xe(){let{account:e}=await(await fetch(u(`/api/auth/sign-out`),{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:`{}`})).json().catch(()=>({}));if(!e){window.location.href=`${r}/`;return}let t=document.createElement(`form`);t.method=`POST`,t.action=e;let n=document.createElement(`input`);n.type=`hidden`,n.name=`return`,n.value=`${window.location.origin}${r}/`,t.append(n),document.body.append(t),t.submit()}function Se(e=Ce(),t){let n=new URLSearchParams({return:e});f!==r&&n.set(`organization`,f.slice(r.length+1)),t?.trim()&&n.set(`wish`,t.trim()),window.location.href=u(`/api/auth/login?${n}`)}function Ce(){let e=new URLSearchParams(window.location.search);e.delete(`signin`);let t=e.toString();return`${window.location.pathname}${t?`?${t}`:``}`}var $=`wizards.wish`,we=1;function Te(e){try{localStorage.setItem($,JSON.stringify({text:e,at:Date.now()}))}catch{}}function Ee(){try{let e=JSON.parse(localStorage.getItem($)??`null`);if(typeof e?.text==`string`&&typeof e.at==`number`&&Date.now()-e.at<we*864e5)return e.text}catch{}return null}function De(){try{localStorage.removeItem($)}catch{}}export{ae as A,F as C,oe as D,z as E,_ as M,R as O,K as S,B as T,he as _,be as a,U as b,me as c,Q as d,pe as f,q as g,fe as h,Ee as i,y as j,I as k,ge as l,de as m,le as n,Se as o,ue as p,Te as r,xe as s,De as t,ye as u,J as v,se as w,G as x,ce as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bn as r,Hn as i,Jn as a,Qn as o,Vn as s,on as c}from"./ui-DKK_O65k.js";import{t as l}from"./react-dom-hf6EcyAr.js";import{t as u}from"./media-Cej-H610.js";var d=e(t(),1),f=l(),p=e(n(),1),m=(0,d.createContext)({slot:null,narrow:!1,setDetail:()=>void 0});function h(){return(0,d.useContext)(m)}function g({children:e}){let{slot:t}=h();return t?(0,f.createPortal)(e,t):null}function _(e){let{setDetail:t}=h();(0,d.useEffect)(()=>(t(e),()=>t(null)),[e,t])}function v(){return u(`(max-width: 767px)`)}function y(e){return e===`deeper`?`animate-step-deeper`:e===`back`&&`animate-step-back`}function b({title:e,open:t,onBack:n,root:r}){let i=t??r??null,o=t?n:r?.onBack;return(0,p.jsxs)(`div`,{className:`mb-2 flex h-9 min-w-0 items-center px-1`,children:[(0,p.jsx)(`div`,{className:c(`shrink-0 overflow-hidden transition-[width,margin,opacity] duration-200 ease-out`,i&&o?`-ml-1.5 mr-0.5 w-8 opacity-100`:`w-0 opacity-0`),children:(0,p.jsx)(`button`,{type:`button`,onClick:o,"aria-hidden":!(i&&o),tabIndex:i&&o?void 0:-1,"aria-label":t?e:r?.backLabel,className:`grid size-8 place-items-center rounded-lg text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,p.jsx)(a,{className:`size-4`})})}),i?(0,p.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-[0.875rem]`,children:[(0,p.jsx)(i.icon,{className:`size-4 shrink-0 text-ember-strong`}),(0,p.jsx)(`span`,{className:`truncate`,children:i.label})]}):(0,p.jsx)(`span`,{className:`truncate font-medium text-[0.875rem]`,children:e})]})}function x({entries:e,current:t,onPick:n}){return(0,p.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map((i,a)=>(0,p.jsxs)(`li`,{children:[i.group===e[a-1]?.group?null:i.group?(0,p.jsx)(`div`,{className:`px-2 pt-4 pb-1 font-medium text-[0.75rem] text-ink-3 first:pt-1`,children:i.group}):(0,p.jsx)(`div`,{className:`h-3`,"aria-hidden":!0}),(0,p.jsxs)(o,{to:i.to,onClick:e=>{i.id===t?.id&&(e.preventDefault(),n(i))},"aria-current":i.id===t?.id?`page`:void 0,className:c(`group flex items-center gap-2 rounded-lg px-2 py-1 text-[0.875rem] transition max-md:py-2`,i.id===t?.id?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`),children:[(0,p.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,p.jsx)(i.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i.label}),(0,p.jsx)(r,{className:`size-4 text-ink-4 md:hidden`})]})]},i.id))})}function S({label:e,onBack:t}){return(0,p.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-1 flex items-center gap-1 rounded-lg py-1.5 pr-3 pl-1 text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[(0,p.jsx)(s,{className:`size-4`}),e]})}function C(e){let t=(0,d.useRef)({level:e,direction:null});return e!==t.current.level&&(t.current={level:e,direction:e>t.current.level?`deeper`:`back`}),t.current.direction}function w({label:e,collapsible:t,open:n=!0,count:r,children:a}){let[o,s]=(0,d.useState)(n),l=`font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`;return(0,p.jsxs)(`div`,{className:`mt-5 first:mt-0`,children:[t?(0,p.jsxs)(`button`,{type:`button`,onClick:()=>s(!o),"aria-expanded":o,className:c(`mb-1 flex w-full items-center gap-1 px-2 text-left hover:text-ink-2`,l),children:[(0,p.jsx)(`span`,{className:`flex-1`,children:e}),o?null:(0,p.jsx)(`span`,{className:`tabular-nums tracking-normal`,children:r}),(0,p.jsx)(i,{className:c(`size-3.5 transition-transform`,o?null:`-rotate-90`)})]}):(0,p.jsx)(`p`,{className:c(`mb-1 px-2`,l),children:e}),o?(0,p.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:a}):null]})}function T({icon:e,label:t,badge:n,tone:i,toneLabel:a,selected:o,disabled:s,onPick:l}){return(0,p.jsx)(`li`,{children:(0,p.jsxs)(`button`,{type:`button`,onClick:l,disabled:s,"aria-current":o?`page`:void 0,className:c(`group flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-[0.875rem] transition max-md:py-2`,o?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`,s&&`cursor-default opacity-50 hover:bg-transparent hover:text-ink-2`),children:[(0,p.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,p.jsx)(e,{className:c(`size-4 transition-transform duration-200 ease-out`,!s&&`group-hover:scale-110`,o?`text-ember-strong`:`text-ink-3`)})}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n,i?(0,p.jsx)(`span`,{role:`img`,title:a,"aria-label":a,className:c(`size-2 shrink-0 rounded-full`,i===`done`&&`bg-moss`,i===`credits`&&`bg-amber`,i===`on`&&`bg-ember`,i===`off`&&`ring-1 ring-ink-4 ring-inset`)}):null,s?null:(0,p.jsx)(r,{className:`size-4 shrink-0 text-ink-4 md:hidden`})]})})}export{T as a,y as c,h as d,C as f,w as i,_ as l,b as n,m as o,x as r,g as s,S as t,v as u};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Bn as r,Hn as i,Jn as a,Qn as o,Vn as s,on as c}from"./ui-D_0Xdrjh.js";import{t as l}from"./react-dom-hf6EcyAr.js";import{t as u}from"./media-Cej-H610.js";var d=e(t(),1),f=l(),p=e(n(),1),m=(0,d.createContext)({slot:null,narrow:!1,setDetail:()=>void 0});function h(){return(0,d.useContext)(m)}function g({children:e}){let{slot:t}=h();return t?(0,f.createPortal)(e,t):null}function _(e){let{setDetail:t}=h();(0,d.useEffect)(()=>(t(e),()=>t(null)),[e,t])}function v(){return u(`(max-width: 767px)`)}function y(e){return e===`deeper`?`animate-step-deeper`:e===`back`&&`animate-step-back`}function b({title:e,open:t,onBack:n,root:r}){let i=t??r??null,o=t?n:r?.onBack;return(0,p.jsxs)(`div`,{className:`mb-2 flex h-9 min-w-0 items-center px-1`,children:[(0,p.jsx)(`div`,{className:c(`shrink-0 overflow-hidden transition-[width,margin,opacity] duration-200 ease-out`,i&&o?`-ml-1.5 mr-0.5 w-8 opacity-100`:`w-0 opacity-0`),children:(0,p.jsx)(`button`,{type:`button`,onClick:o,"aria-hidden":!(i&&o),tabIndex:i&&o?void 0:-1,"aria-label":t?e:r?.backLabel,className:`grid size-8 place-items-center rounded-lg text-ink-3 transition hover:bg-accent hover:text-ink`,children:(0,p.jsx)(a,{className:`size-4`})})}),i?(0,p.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium text-[0.875rem]`,children:[(0,p.jsx)(i.icon,{className:`size-4 shrink-0 text-ember-strong`}),(0,p.jsx)(`span`,{className:`truncate`,children:i.label})]}):(0,p.jsx)(`span`,{className:`truncate font-medium text-[0.875rem]`,children:e})]})}function x({entries:e,current:t,onPick:n}){return(0,p.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map((i,a)=>(0,p.jsxs)(`li`,{children:[i.group===e[a-1]?.group?null:i.group?(0,p.jsx)(`div`,{className:`px-2 pt-4 pb-1 font-medium text-[0.75rem] text-ink-3 first:pt-1`,children:i.group}):(0,p.jsx)(`div`,{className:`h-3`,"aria-hidden":!0}),(0,p.jsxs)(o,{to:i.to,onClick:e=>{i.id===t?.id&&(e.preventDefault(),n(i))},"aria-current":i.id===t?.id?`page`:void 0,className:c(`group flex items-center gap-2 rounded-lg px-2 py-1 text-[0.875rem] transition max-md:py-2`,i.id===t?.id?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`),children:[(0,p.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,p.jsx)(i.icon,{className:`size-4 transition-transform duration-200 ease-out group-hover:scale-110`})}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i.label}),(0,p.jsx)(r,{className:`size-4 text-ink-4 md:hidden`})]})]},i.id))})}function S({label:e,onBack:t}){return(0,p.jsxs)(`button`,{type:`button`,onClick:t,className:`-ml-1 flex items-center gap-1 rounded-lg py-1.5 pr-3 pl-1 text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[(0,p.jsx)(s,{className:`size-4`}),e]})}function C(e){let t=(0,d.useRef)({level:e,direction:null});return e!==t.current.level&&(t.current={level:e,direction:e>t.current.level?`deeper`:`back`}),t.current.direction}function w({label:e,collapsible:t,open:n=!0,count:r,children:a}){let[o,s]=(0,d.useState)(n),l=`font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.12em]`;return(0,p.jsxs)(`div`,{className:`mt-5 first:mt-0`,children:[t?(0,p.jsxs)(`button`,{type:`button`,onClick:()=>s(!o),"aria-expanded":o,className:c(`mb-1 flex w-full items-center gap-1 px-2 text-left hover:text-ink-2`,l),children:[(0,p.jsx)(`span`,{className:`flex-1`,children:e}),o?null:(0,p.jsx)(`span`,{className:`tabular-nums tracking-normal`,children:r}),(0,p.jsx)(i,{className:c(`size-3.5 transition-transform`,o?null:`-rotate-90`)})]}):(0,p.jsx)(`p`,{className:c(`mb-1 px-2`,l),children:e}),o?(0,p.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:a}):null]})}function T({icon:e,label:t,badge:n,tone:i,toneLabel:a,selected:o,disabled:s,onPick:l}){return(0,p.jsx)(`li`,{children:(0,p.jsxs)(`button`,{type:`button`,onClick:l,disabled:s,"aria-current":o?`page`:void 0,className:c(`group flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-[0.875rem] transition max-md:py-2`,o?`bg-paper-2 font-medium text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`,s&&`cursor-default opacity-50 hover:bg-transparent hover:text-ink-2`),children:[(0,p.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center`,children:(0,p.jsx)(e,{className:c(`size-4 transition-transform duration-200 ease-out`,!s&&`group-hover:scale-110`,o?`text-ember-strong`:`text-ink-3`)})}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n,i?(0,p.jsx)(`span`,{role:`img`,title:a,"aria-label":a,className:c(`size-2 shrink-0 rounded-full`,i===`done`&&`bg-moss`,i===`credits`&&`bg-amber`,i===`on`&&`bg-ember`,i===`off`&&`ring-1 ring-ink-4 ring-inset`)}):null,s?null:(0,p.jsx)(r,{className:`size-4 shrink-0 text-ink-4 md:hidden`})]})})}export{T as a,y as c,h as d,C as f,w as i,_ as l,b as n,m as o,x as r,g as s,S as t,v as u};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/400-CyB00QFz.css","assets/500-DqciRChS.css","assets/600-B9Zp6bBy.css","assets/700-5l7ov3HZ.css","assets/400-n8m3eWIv.css","assets/500-BrSlhPjT.css","assets/600-CfY_-NCo.css","assets/700-CGFQ5xCB.css","assets/400-C1aMvkWZ.css","assets/500-XHIL5p_x.css","assets/600-BpnjcFCp.css","assets/700-BwKwxaTT.css","assets/400-CvPzio2w.css","assets/500-vjb4iIph.css","assets/600-BMp88EpG.css","assets/700-CReDayoA.css","assets/400-C-EAXind.css","assets/500-BacxruX7.css","assets/600-Bv31zJWL.css","assets/700-D1QH7Wga.css","assets/400-an-Q8PSH.css","assets/500-Dk7ZdhaB.css","assets/600-Bu09rnu5.css","assets/700-CEuaYRw2.css","assets/400-BpGVy8f9.css","assets/500-DjLsfQf4.css","assets/600-BvFs-CRM.css","assets/700-BXdZ1Wt4.css","assets/400-Bx8aXxdn.css","assets/500-ueODFTvD.css","assets/600-CX1ZBIY5.css","assets/700-B057BQ0n.css","assets/400-W7eSYfM-.css","assets/500--5BQEKwF.css","assets/600-B1b7x6MC.css","assets/700-pQg9ODXE.css","assets/400-NJi9pVr7.css","assets/400-fDO2E_2J.css","assets/500-Bp7rE3sO.css","assets/600-D7AGNg1U.css","assets/700-CBDkNWxO.css","assets/400-DiVWFxeN.css","assets/400-CWy8yahC.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Cn as r,Ct as i,Dt as a,Et as o,Ft as s,G as c,Kn as l,Lt as u,Mt as d,Nt as f,Ot as p,Pt as m,Qt as h,St as g,Tn as _,Tt as v,Un as y,Xn as b,Yt as x,an as S,bn as C,bt as w,cn as T,ct as E,dn as D,fn as O,gn as k,gt as A,ht as ee,l as j,lt as M,mt as N,on as P,ot as F,pn as te,pt as ne,tn as I}from"./ui-DKK_O65k.js";import{t as re}from"./react-dom-hf6EcyAr.js";import{t as L}from"./preload-helper-DpV6A1kQ.js";import{t as ie}from"./volume-2-CgRP_A7r.js";import{E as ae,T as oe,k as se,x as ce}from"./session-C7ciCzbV.js";import{t as le}from"./phone-DTuPPVhC.js";import{t as ue}from"./engenty-CNjaZCVM.js";import{C as de,Z as R,dt as fe,ft as z,gt as B,ht as pe,k as me,mt as he,n as ge,p as _e,pt as ve,s as V,t as ye,u as H,vt as U,yt as be,z as xe}from"./i18n-Bq6dt_qv.js";import{Ot as Se,ft as Ce,jt as we,mt as Te,pt as Ee,t as De,wt as Oe}from"./index-BdwA-8jc.js";var ke={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};ke.node;var Ae=b(ke),je={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};je.node;var Me=b(je),Ne={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Ne.node;var Pe=b(Ne),Fe={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};Fe.node;var Ie=b(Fe),Le=3e3,Re=new Set;function ze(e,t,n){let r=`${e.family}\n${e.url}`;if(Re.has(r))return;Re.add(r);let i=!1,a=setTimeout(()=>i||n(),Le),o=()=>{i=!0,clearTimeout(a)},s=()=>{o(),n()};if(e.stylesheet){let n=document.createElement(`link`);n.rel=`stylesheet`,n.href=t,n.onerror=s,n.onload=()=>{document.fonts.load(`1em "${e.family.replace(/"/g,``)}"`).then(e=>e.length?o():s(),s)},document.head.append(n);return}new FontFace(e.family,`url("${t.replace(/["\\\n]/g,encodeURIComponent)}")`,{display:`swap`,weight:`100 900`}).load().then(e=>{document.fonts.add(e),o()},s)}var Be=re(),W=e(t(),1),G=e(n(),1),Ve=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function He({since:e}){let[t,n]=(0,W.useState)(Date.now());if((0,W.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,G.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function K({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,G.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:P(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,G.jsx)(I,{className:`size-5`}):a})}function Ue({voice:e}){let t=(0,W.useRef)(null),{captions:n}=e;return(0,W.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,G.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,G.jsx)(`li`,{className:P(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,G.jsx)(`div`,{ref:t})]})}):null}function We({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,a=e.state===`connecting`,[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(!1);(0,W.useEffect)(()=>{s(i?Date.now():null)},[i]);let u=async()=>{l(!1),await e.start(),n&&await e.startCamera()},d=()=>{e.stop(),l(!0)},f=n||e.camera,p=[...e.captions].reverse().find(e=>e.who===`bot`),m=[...e.captions].reverse().find(e=>e.who===`me`),h=e.speaking?V(`talk.speaking`):e.listening?V(`talk.listening`):i?V(`talk.live`):a?V(`talk.connecting`):c?V(`video.ended`):``;return(0,G.jsxs)(`section`,{className:P(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,G.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),h?(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,G.jsx)(`span`,{className:P(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,h]}):null,(0,G.jsx)(He,{since:o})]}),(0,G.jsxs)(`div`,{className:P(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,f?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!f&&i&&e.captions.length?`h-[38%]`:f?``:`flex-1`),children:[(0,G.jsxs)(`div`,{className:P(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!f&&`hidden`),children:[(0,G.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:P(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,G.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,G.jsx)(Pe,{className:`size-8`}),(0,G.jsx)(`span`,{className:`text-[0.8125rem]`,children:V(`video.cameraOff`)})]}),(0,G.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[V(`video.you`),e.muted?(0,G.jsx)(we,{className:`ml-1.5 inline size-3`}):null]})]}),(0,G.jsxs)(`div`,{className:P(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,f?`bg-neutral-900`:`bg-transparent`,f&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,G.jsx)(`div`,{className:P(`rounded-full transition-shadow duration-500`,!f&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!f&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,G.jsx)(ce,{kind:t?.wizard.avatar??`round`,costume:t?.wizard.costume,size:f?140:200,fluffy:!0,interactive:!1})}),f?(0,G.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),i&&!f?(0,G.jsx)(Ue,{voice:e}):i&&(p||m)?(0,G.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[m?(0,G.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:m.text}):null,p?(0,G.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:p.text}):null]})}):null,e.error?(0,G.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{label:V(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,G.jsx)(we,{className:`size-5`}):(0,G.jsx)(_,{className:`size-5`})}),(0,G.jsx)(K,{label:V(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,G.jsx)(T,{className:`size-5`}):(0,G.jsx)(Pe,{className:`size-5`})}),e.camera&&Ve?(0,G.jsx)(K,{label:V(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,G.jsx)(D,{className:`size-5`})}):null,(0,G.jsx)(K,{label:V(`video.leave`),danger:!0,onClick:d,children:(0,G.jsx)(Se,{className:`size-5`})})]}):(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:a||!t?.talk,onClick:()=>void u(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[a?(0,G.jsx)(I,{className:`size-4`}):n?(0,G.jsx)(T,{className:`size-5`}):(0,G.jsx)(_,{className:`size-5`}),V(c?`video.rejoin`:n?`video.join`:`talk.start`)]}),!c&&!e.error?(0,G.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:V(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var Ge=e=>de[e.kind]!==`device`,Ke=1024,qe=4e3;function Je(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Ye(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Cn as r,Ct as i,Dt as a,Et as o,Ft as s,G as c,Kn as l,Lt as u,Mt as d,Nt as f,Ot as p,Pt as m,Qt as h,St as g,Tn as _,Tt as v,Un as y,Xn as b,Yt as x,an as S,bn as C,bt as w,cn as T,ct as E,dn as D,fn as O,gn as k,gt as A,ht as ee,l as j,lt as M,mt as N,on as P,ot as F,pn as te,pt as ne,tn as I}from"./ui-D_0Xdrjh.js";import{t as re}from"./react-dom-hf6EcyAr.js";import{t as L}from"./preload-helper-DpV6A1kQ.js";import{t as ie}from"./volume-2-BGkyA8T9.js";import{E as ae,T as oe,k as se,x as ce}from"./session-COf_im0l.js";import{t as le}from"./phone-DymZ7rLO.js";import{t as ue}from"./engenty-CNjaZCVM.js";import{C as de,Z as R,dt as fe,ft as z,gt as B,ht as pe,k as me,mt as he,n as ge,p as _e,pt as ve,s as V,t as ye,u as H,vt as U,yt as be,z as xe}from"./i18n-CLxuuhp_.js";import{Ot as Se,ft as Ce,jt as we,mt as Te,pt as Ee,t as De,wt as Oe}from"./index-HhslPV6N.js";var ke={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};ke.node;var Ae=b(ke),je={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};je.node;var Me=b(je),Ne={name:`video-off`,size:24,node:[[`path`,{d:`M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196`,key:`w8jjjt`}],[`path`,{d:`M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`1xawa7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Ne.node;var Pe=b(Ne),Fe={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};Fe.node;var Ie=b(Fe),Le=3e3,Re=new Set;function ze(e,t,n){let r=`${e.family}\n${e.url}`;if(Re.has(r))return;Re.add(r);let i=!1,a=setTimeout(()=>i||n(),Le),o=()=>{i=!0,clearTimeout(a)},s=()=>{o(),n()};if(e.stylesheet){let n=document.createElement(`link`);n.rel=`stylesheet`,n.href=t,n.onerror=s,n.onload=()=>{document.fonts.load(`1em "${e.family.replace(/"/g,``)}"`).then(e=>e.length?o():s(),s)},document.head.append(n);return}new FontFace(e.family,`url("${t.replace(/["\\\n]/g,encodeURIComponent)}")`,{display:`swap`,weight:`100 900`}).load().then(e=>{document.fonts.add(e),o()},s)}var Be=re(),W=e(t(),1),G=e(n(),1),Ve=typeof window<`u`&&window.matchMedia(`(pointer: coarse)`).matches;function He({since:e}){let[t,n]=(0,W.useState)(Date.now());if((0,W.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),!e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return(0,G.jsxs)(`span`,{className:`font-mono text-[0.8125rem] text-white/60 tabular-nums`,children:[i,`:`,a]})}function K({label:e,on:t,danger:n,busy:r,onClick:i,children:a}){return(0,G.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"aria-pressed":t,disabled:r,onClick:i,className:P(`flex size-12 items-center justify-center rounded-full transition disabled:opacity-50`,n?`bg-rose text-white hover:brightness-110`:t===!1?`bg-white text-neutral-900 hover:bg-white/90`:`bg-white/15 text-white hover:bg-white/25`),children:r?(0,G.jsx)(I,{className:`size-5`}):a})}function Ue({voice:e}){let t=(0,W.useRef)(null),{captions:n}=e;return(0,W.useEffect)(()=>{n.length&&t.current?.scrollIntoView({block:`end`})},[n]),n.length?(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 sm:px-5`,children:(0,G.jsxs)(`ol`,{className:`mx-auto flex max-w-[720px] flex-col gap-2 py-2`,children:[n.map(e=>(0,G.jsx)(`li`,{className:P(`text-[0.9375rem] leading-snug`,e.who===`bot`?`text-white/95`:`text-right text-white/50`),children:e.text},e.id)),(0,G.jsx)(`div`,{ref:t})]})}):null}function We({voice:e,view:t,video:n,className:r}){let i=e.state===`live`,a=e.state===`connecting`,[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(!1);(0,W.useEffect)(()=>{s(i?Date.now():null)},[i]);let u=async()=>{l(!1),await e.start(),n&&await e.startCamera()},d=()=>{e.stop(),l(!0)},f=n||e.camera,p=[...e.captions].reverse().find(e=>e.who===`bot`),m=[...e.captions].reverse().find(e=>e.who===`me`),h=e.speaking?V(`talk.speaking`):e.listening?V(`talk.listening`):i?V(`talk.live`):a?V(`talk.connecting`):c?V(`video.ended`):``;return(0,G.jsxs)(`section`,{className:P(`relative flex min-h-0 flex-col bg-neutral-950 text-white`,`safe-top`,r),children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 sm:px-5`,children:[(0,G.jsx)(`div`,{className:`min-w-0 flex-1 truncate font-display font-semibold text-[1rem] tracking-tight`,children:t?.wizard.title??``}),h?(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-white/70`,children:[i?(0,G.jsx)(`span`,{className:P(`size-2 rounded-full`,e.speaking?`animate-pulse-dot bg-emerald-400`:`bg-rose`)}):null,h]}):null,(0,G.jsx)(He,{since:o})]}),(0,G.jsxs)(`div`,{className:P(`grid min-h-0 gap-2 px-3 pb-2 sm:px-4`,f?`flex-1 grid-cols-1 sm:grid-cols-2`:`shrink-0 grid-cols-1`,!f&&i&&e.captions.length?`h-[38%]`:f?``:`flex-1`),children:[(0,G.jsxs)(`div`,{className:P(`relative min-h-0 overflow-hidden rounded-2xl bg-neutral-900`,!f&&`hidden`),children:[(0,G.jsx)(`video`,{ref:e.video,muted:!0,playsInline:!0,autoPlay:!0,className:P(`absolute inset-0 h-full w-full object-cover`,e.facing===`user`&&`-scale-x-100`,e.camera?`block`:`hidden`)}),e.camera?null:(0,G.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2 text-white/50`,children:[(0,G.jsx)(Pe,{className:`size-8`}),(0,G.jsx)(`span`,{className:`text-[0.8125rem]`,children:V(`video.cameraOff`)})]}),(0,G.jsxs)(`span`,{className:`absolute bottom-2 left-3 rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:[V(`video.you`),e.muted?(0,G.jsx)(we,{className:`ml-1.5 inline size-3`}):null]})]}),(0,G.jsxs)(`div`,{className:P(`relative flex min-h-0 items-center justify-center overflow-hidden rounded-2xl transition-shadow`,f?`bg-neutral-900`:`bg-transparent`,f&&e.speaking&&`ring-2 ring-emerald-400/70`),children:[(0,G.jsx)(`div`,{className:P(`rounded-full transition-shadow duration-500`,!f&&e.listening&&`shadow-[0_0_80px_20px_rgba(244,63,94,0.25)]`,!f&&e.speaking&&`shadow-[0_0_80px_20px_rgba(52,211,153,0.3)]`,e.speaking&&`animate-breathe`),children:(0,G.jsx)(ce,{kind:t?.wizard.avatar??`round`,costume:t?.wizard.costume,size:f?140:200,fluffy:!0,interactive:!1})}),f?(0,G.jsx)(`span`,{className:`absolute bottom-2 left-3 max-w-[85%] truncate rounded-md bg-black/50 px-2 py-0.5 text-[0.75rem]`,children:t?.wizard.title??``}):null]})]}),i&&!f?(0,G.jsx)(Ue,{voice:e}):i&&(p||m)?(0,G.jsx)(`div`,{className:`shrink-0 px-4 pb-2 sm:px-5`,children:(0,G.jsxs)(`div`,{className:`mx-auto max-w-[720px] space-y-1 text-center`,children:[m?(0,G.jsx)(`p`,{className:`line-clamp-1 text-[0.8125rem] text-white/50`,children:m.text}):null,p?(0,G.jsx)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-white/95 leading-snug`,children:p.text}):null]})}):null,e.error?(0,G.jsx)(`p`,{className:`shrink-0 px-5 pb-2 text-center text-[0.8125rem] text-rose`,children:e.error}):null,(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center gap-3 px-4 pt-1 pb-4`,children:i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{label:V(e.muted?`video.unmute`:`video.mute`),on:!e.muted,onClick:e.toggleMute,children:e.muted?(0,G.jsx)(we,{className:`size-5`}):(0,G.jsx)(_,{className:`size-5`})}),(0,G.jsx)(K,{label:V(e.camera?`talk.cameraOff`:`talk.camera`),on:e.camera,onClick:()=>e.camera?e.stopCamera():void e.startCamera(),children:e.camera?(0,G.jsx)(T,{className:`size-5`}):(0,G.jsx)(Pe,{className:`size-5`})}),e.camera&&Ve?(0,G.jsx)(K,{label:V(`video.flip`),onClick:()=>void e.flipCamera(),children:(0,G.jsx)(D,{className:`size-5`})}):null,(0,G.jsx)(K,{label:V(`video.leave`),danger:!0,onClick:d,children:(0,G.jsx)(Se,{className:`size-5`})})]}):(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:a||!t?.talk,onClick:()=>void u(),className:`flex h-12 items-center gap-2 rounded-full bg-emerald-500 px-6 font-medium text-[0.9375rem] text-white transition hover:brightness-110 disabled:opacity-50`,children:[a?(0,G.jsx)(I,{className:`size-4`}):n?(0,G.jsx)(T,{className:`size-5`}):(0,G.jsx)(_,{className:`size-5`}),V(c?`video.rejoin`:n?`video.join`:`talk.start`)]}),!c&&!e.error?(0,G.jsx)(`p`,{className:`max-w-sm text-center text-[0.75rem] text-white/50`,children:V(n?`video.hint`:`talk.joinHint`)}):null]})})]})}var Ge=e=>de[e.kind]!==`device`,Ke=1024,qe=4e3;function Je(e,t){return e?e.length>t?`${e.slice(0,t)} …`:e:``}function Ye(e,t,n=!1){let r=[`status: ${e.status}`,`camera: ${n?`on`:`off`}`];if(e.ask)return r.push(e.ask.kind===`confirm`?`question: the step wants to "${e.ask.action.summary}" in ${e.ask.service}; answer_ask allows or skips it`:`question: a sign-in at ${e.ask.site.host}; the person types it on the screen, wait`),r.join(`
3
3
  `);if(e.status===`running`){let t=[...e.events].reverse().find(e=>e.type===`tool`||e.type===`info`||e.type===`step_started`);return r.push(`working on: ${e.step?.title??``}`),t&&r.push(`doing: ${ye(t)}`),r.join(`
4
4
  `)}if(e.status===`done`){r.push(`done. made:`);for(let{step:t,output:n}of e.shown)r.push(`- ${t.title}: ${Je(n?.text,400)||`(a file, on the screen)`}`);return r.join(`
5
5
  `)}if(e.status===`failed`)return r.push(`failed: ${e.error??``}; go_back or the person retries on the screen`),r.join(`