@onequery/cli 0.1.64 → 0.1.65-darwin-x64

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 (172) hide show
  1. package/package.json +17 -24
  2. package/vendor/x86_64-apple-darwin/onequery/onequery +0 -0
  3. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/CompositeItem-BB408Cyb.js +1 -0
  4. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/CompositeList-DbbDW_rT.js +1 -0
  5. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/DialogTitle-ChNkcIa6.js +1 -0
  6. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconArrowRight-DsOD7mDl.js +1 -0
  7. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconCheck-Gc24xPT2.js +1 -0
  8. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconChevronDown-B-39MA7-.js +1 -0
  9. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconChevronRight-DD16tNHZ.js +1 -0
  10. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconCoins-C7Nn0L6R.js +1 -0
  11. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconHistory-DuLS8PKF.js +1 -0
  12. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconLoader2-BpZcTuHV.js +1 -0
  13. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconPlus-CZiRiEUF.js +1 -0
  14. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconTerminal2-PxNqcz3d.js +1 -0
  15. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconX-rRpRFwc5.js +1 -0
  16. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/Separator-M05FshHx.js +1 -0
  17. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/_authenticated-CcSc_Pt7.js +1 -0
  18. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/_org_slug-BvJDit6U.js +1 -0
  19. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/alert-BIGxI3XN.js +1 -0
  20. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/api-base-url-DIb6qukm.js +1 -0
  21. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/api-client-tp8XTpAa.js +1 -0
  22. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/api-paths-DcYkf-C_.js +1 -0
  23. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/app-routes-CMyon6Em.js +1 -0
  24. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/audit-CdPU9Jf2.js +2 -0
  25. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/auth-bootstrap-query-B1MHd_NV.js +1 -0
  26. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/auth-client-D-YHMy0G.js +3 -0
  27. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/avatar-SaFoLofF.js +1 -0
  28. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/badge-BFPkSrVD.js +1 -0
  29. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/budget-CX5MplAP.js +1 -0
  30. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/callback-BWQ3ETBy.js +1 -0
  31. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/card-Dllm2lhp.js +1 -0
  32. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/checkbox-Bii9Pcrx.js +1 -0
  33. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/compiler-runtime-DCc3R3Xn.js +1 -0
  34. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/connect-database-C1Jb2l53.js +1 -0
  35. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/copy-button-BO1KBdf9.js +1 -0
  36. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/create-org-BSzKv5ue.js +1 -0
  37. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/createReactComponent-_L2mp4Ui.js +1 -0
  38. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/data-source-connection-form-CbDL0cgG.js +273 -0
  39. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/device-Bbz7apAX.js +1 -0
  40. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/dist-BNi06Dzx.js +3 -0
  41. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/dropdown-menu-Cw2MW0pD.js +1 -0
  42. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/empty-DjRo5ytz.js +1 -0
  43. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/format-date-Rg05aHXh.js +1 -0
  44. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/getDisabledMountTransitionStyles-C0uz3iMh.js +1 -0
  45. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/getPseudoElementBounds-CRlxTrfr.js +12 -0
  46. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/home-BNjpNKdt.js +1 -0
  47. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/index-B4OsjuJp.css +2 -0
  48. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/index-CXR0dKJj.js +10 -0
  49. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/input-BRu0b1Tq.js +1 -0
  50. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/integrations-BWC7iPQ5.js +1 -0
  51. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  52. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  53. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  54. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  55. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  56. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  57. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  58. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/invite._invitationId-DmJnR4R5.js +1 -0
  59. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/jsx-runtime-DG_AJzB_.js +1 -0
  60. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/label-f2wVZcni.js +1 -0
  61. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/link-Cgvqhh5w.js +1 -0
  62. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/matchContext-CDajBC0L.js +1 -0
  63. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/organization-permissions-BXV_ess0.js +1 -0
  64. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/organization-query-keys-ieaSNxMR.js +1 -0
  65. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/query-CY--GYXb.js +1 -0
  66. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/query-timing-YBkSOxxF.js +1 -0
  67. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/queryOptions-bXtOUR_h.js +1 -0
  68. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/routes-CxJ2aoMf.js +1 -0
  69. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/schemas-EcBBwCo1.js +64 -0
  70. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/select-yNaL0SXM.js +1 -0
  71. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/separator-BH7Gsum-.js +1 -0
  72. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/settings-C8us2bWX.js +1 -0
  73. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/signin-BgfqB9QB.js +1 -0
  74. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/src-C5F1uEDb.js +1 -0
  75. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/team-CYPsHFTt.js +1 -0
  76. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/textarea-CnA77PLS.js +1 -0
  77. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/theme-toggle-CRaDbyxE.js +1 -0
  78. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/use-optimistic-mutation-3PPnMc-O.js +1 -0
  79. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useBaseQuery-CO5Q8xm4.js +1 -0
  80. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useBaseUiId-CtNp109T.js +1 -0
  81. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useCompositeItem-D243hyne.js +1 -0
  82. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useControlled-C-85HRFr.js +1 -0
  83. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useQuery-DyOxsY45.js +1 -0
  84. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useRender-CzpKCg11.js +1 -0
  85. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useRouterState-DpT8luFk.js +1 -0
  86. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useSuspenseQuery-CBFRU4At.js +1 -0
  87. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useValueChanged-BNrgSVVM.js +1 -0
  88. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/utils-C8DGLIgm.js +1 -0
  89. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/xstate-react.esm-Bo3CCIRt.js +1 -0
  90. package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/zod-D0PWrP9q.js +1 -0
  91. package/vendor/x86_64-apple-darwin/runtime/dashboard/favicon.ico +0 -0
  92. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step1_settings_sidebar.png +0 -0
  93. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step2_projects.png +0 -0
  94. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step3_project_keys.png +0 -0
  95. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step4_api_keys.png +0 -0
  96. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step1_service_accounts.png +0 -0
  97. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step2_bigquery_roles.png +0 -0
  98. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step3_add_key_menu.png +0 -0
  99. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step4_create_json_key.png +0 -0
  100. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step2_enable_workers_logs.png +0 -0
  101. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step3_user_api_tokens.png +0 -0
  102. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step4_create_api_token.png +0 -0
  103. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step5_workers_pages_account_id.png +0 -0
  104. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step6_workers_observability_permission.png +0 -0
  105. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step1_service_accounts.png +0 -0
  106. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step2_create_json_key.png +0 -0
  107. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step3_add_user_viewer.png +0 -0
  108. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step4_property_details.png +0 -0
  109. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step1_signin.png +0 -0
  110. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
  111. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
  112. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step4_token_created_sanitized.png +0 -0
  113. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/google-search-console/step1_confirm_property.png +0 -0
  114. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/google-search-console/step2_scope_selected.png +0 -0
  115. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/google-search-console/step3_copy_access_token.png +0 -0
  116. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step1_service_accounts.png +0 -0
  117. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step2_create_service_account.png +0 -0
  118. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step3_credentials.png +0 -0
  119. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step4_project_settings.png +0 -0
  120. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/postgresql/step1_create_user.png +0 -0
  121. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/postgresql/step2_connection.png +0 -0
  122. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/posthog/step1_project_settings.png +0 -0
  123. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/posthog/step2_personal_api_keys.png +0 -0
  124. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/posthog/step3_create_key_modal.png +0 -0
  125. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step1_connect.png +0 -0
  126. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step2_create_user.png +0 -0
  127. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step3_grant.png +0 -0
  128. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step4_info.png +0 -0
  129. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step1_personal_tokens.png +0 -0
  130. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step2_create_token_permissions.png +0 -0
  131. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step3_organization_slug.png +0 -0
  132. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step4_project_slug.png +0 -0
  133. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/vercel/step1_tokens_page.png +0 -0
  134. package/vendor/x86_64-apple-darwin/runtime/dashboard/images/vercel/step2_configure_token.png +0 -0
  135. package/vendor/x86_64-apple-darwin/runtime/dashboard/index.html +47 -0
  136. package/vendor/x86_64-apple-darwin/runtime/dashboard/onequery.svg +44 -0
  137. package/vendor/x86_64-apple-darwin/runtime/migrations/20260327065242_curious_nightmare.sql +403 -0
  138. package/vendor/x86_64-apple-darwin/runtime/migrations/20260403103652_slippery_hellfire_club.sql +8 -0
  139. package/vendor/x86_64-apple-darwin/runtime/migrations/20260403112219_gigantic_namora.sql +1 -0
  140. package/vendor/x86_64-apple-darwin/runtime/migrations/20260420071232_previous_justin_hammer.sql +141 -0
  141. package/vendor/x86_64-apple-darwin/runtime/migrations/20260420093157_spooky_cassandra_nova.sql +29 -0
  142. package/vendor/x86_64-apple-darwin/runtime/migrations/20260420101631_even_ogun.sql +5 -0
  143. package/vendor/x86_64-apple-darwin/runtime/migrations/20260425110519_smart_amazoness.sql +8 -0
  144. package/vendor/x86_64-apple-darwin/runtime/migrations/20260428033542_rename_source_query_interface_missing.sql +36 -0
  145. package/vendor/x86_64-apple-darwin/runtime/migrations/20260430114113_jittery_scorpion.sql +28 -0
  146. package/vendor/x86_64-apple-darwin/runtime/migrations/20260430135906_flippant_timeslip.sql +4 -0
  147. package/vendor/x86_64-apple-darwin/runtime/migrations/20260502000100_drop_old_workflow_audit_tables.sql +15 -0
  148. package/vendor/x86_64-apple-darwin/runtime/migrations/20260503011110_moaning_jack_flag.sql +22 -0
  149. package/vendor/x86_64-apple-darwin/runtime/migrations/20260514143216_reset_workflow_audit_history.sql +20 -0
  150. package/vendor/x86_64-apple-darwin/runtime/migrations/20260524081943_colorful_firelord.sql +1 -0
  151. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260327065242_snapshot.json +2817 -0
  152. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260403103652_snapshot.json +2864 -0
  153. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260403112219_snapshot.json +2870 -0
  154. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260420071232_snapshot.json +3879 -0
  155. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260420093157_snapshot.json +4088 -0
  156. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260420101631_snapshot.json +3250 -0
  157. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260425110519_snapshot.json +3250 -0
  158. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260428033542_snapshot.json +3250 -0
  159. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260430114113_snapshot.json +3507 -0
  160. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260430135906_snapshot.json +3531 -0
  161. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260503011110_snapshot.json +3089 -0
  162. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260524081943_snapshot.json +3082 -0
  163. package/vendor/x86_64-apple-darwin/runtime/migrations/meta/_journal.json +104 -0
  164. package/vendor/x86_64-apple-darwin/runtime/pglite/initdb.wasm +0 -0
  165. package/vendor/x86_64-apple-darwin/runtime/pglite/pglite.data +0 -0
  166. package/vendor/x86_64-apple-darwin/runtime/pglite/pglite.wasm +0 -0
  167. package/vendor/x86_64-apple-darwin/server/onequery-server.mjs +447972 -0
  168. package/vendor/x86_64-apple-darwin/server/polyglot_sql_wasm_bg.wasm +0 -0
  169. package/bin/onequery.js +0 -266
  170. package/bin/package-constants.d.ts +0 -75
  171. package/bin/package-constants.js +0 -160
  172. package/runtime-bundle.json +0 -55
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./link-Cgvqhh5w.js";import{n as i}from"./useRouterState-DpT8luFk.js";import{a,o,t as s}from"./api-base-url-DIb6qukm.js";import{n as c}from"./createReactComponent-_L2mp4Ui.js";import{t as l}from"./theme-toggle-CRaDbyxE.js";import{i as u,n as d}from"./auth-client-D-YHMy0G.js";import{t as f}from"./useQuery-DyOxsY45.js";import{d as p,p as m,s as h}from"./schemas-EcBBwCo1.js";import{G as g,K as _,U as v,V as y}from"./index-CXR0dKJj.js";import{t as b}from"./input-BRu0b1Tq.js";import{t as x}from"./label-f2wVZcni.js";import{a as S,n as C,o as w,r as T,t as E}from"./card-Dllm2lhp.js";import{n as D,t as O}from"./zod-D0PWrP9q.js";import{t as k}from"./auth-bootstrap-query-B1MHd_NV.js";var A=e(t(),1),j=n(),M=p({email:h(`Please enter a valid email`),password:m().min(8,`Password must be at least 8 characters`)}),N=p({email:h(`Please enter a valid email`),name:m().min(2,`Name must be at least 2 characters`),password:m().min(8,`Password must be at least 8 characters`)}),P=N.extend({organizationName:m().min(2,`Organization name must be at least 2 characters`),organizationSlug:m().min(2,`Organization slug must be at least 2 characters`).regex(/^[a-z0-9-]+$/,`Organization slug can only contain lowercase letters, numbers, and hyphens`)}),F=a(`/signin`);function I(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,`-`).replaceAll(/^-|-$/g,``)}function L(e,t){if(!(e instanceof Error))return t;let n=e.message.trim();return n.length>0?n:t}async function R(e){let t=await e.json().catch(()=>null),n=p({error:m().optional(),message:m().optional()}).safeParse(t);return n.data?.error??n.data?.message??`Failed to complete bootstrap`}function z(){let e=o(),t=y(),n=i(),[a,h]=(0,A.useState)(`signin`),[z,B]=(0,A.useState)(!1),{redirect:V}=F.useSearch(),H=_(V),U=f(k()).data,W=U?.signupMode===`first-user`,G=W?`signup`:a,K=D({defaultValues:{email:``,password:``},resolver:O(M)}),q=D({defaultValues:{name:``,email:``,password:``},resolver:O(N)}),J=D({defaultValues:{email:``,name:``,organizationName:``,organizationSlug:``,password:``},resolver:O(P)}),Y=typeof window>`u`?`your-host`:window.location.host;async function X(t){B(!0);try{let r=await d.email({email:t.email,password:t.password});if(r.error){console.error(`[auth] sign-in failed`,{error:r.error}),K.setError(`root`,{message:r.error.message??`Invalid email or password`}),B(!1);return}await n.invalidate(),await e({to:H.path})}catch(e){console.error(`[auth] sign-in failed`,{error:e}),K.setError(`root`,{message:L(e,`Couldn't sign in right now. Try again.`)}),B(!1)}}async function Z(t){B(!0);try{let n=await u.email({email:t.email,name:t.name,password:t.password});if(n.error){console.error(`[auth] sign-up failed`,{error:n.error}),q.setError(`root`,{message:n.error.message??`Failed to create account`}),B(!1);return}await e({to:v(V)})}catch(e){console.error(`[auth] sign-up failed`,{error:e}),q.setError(`root`,{message:L(e,`Couldn't create your account right now. Try again.`)}),B(!1)}}async function Q(r){B(!0);try{let i=await fetch(`${s()}/api/bootstrap/complete`,{body:JSON.stringify(r),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`});if(!i.ok){J.setError(`root`,{message:await R(i)}),B(!1);return}let a=p({bootstrap:p({organizationId:m().min(1)})}).safeParse(await i.json().catch(()=>null));if(!a.success){J.setError(`root`,{message:`Bootstrap completed, but the response was invalid`}),B(!1);return}let o=g({organizationId:a.data.bootstrap.organizationId,redirectPath:V});await t.invalidateQueries({queryKey:k().queryKey}),await n.invalidate({sync:!0}),await e({to:v(o)})}catch(e){console.error(`[auth] bootstrap failed`,{error:e}),J.setError(`root`,{message:L(e,`Couldn't finish setup right now. Try again.`)}),B(!1)}}function $(){W||(h(a===`signin`?`signup`:`signin`),K.reset(),q.reset())}let ee=J.watch(`organizationName`);return(0,j.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,j.jsxs)(`header`,{className:`flex h-14 items-center justify-between px-4 sm:px-6`,children:[(0,j.jsxs)(r,{to:`/`,className:`flex items-center gap-2`,children:[(0,j.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-md bg-foreground text-background font-bold`,children:`V`}),(0,j.jsx)(`span`,{className:`font-semibold text-base sm:text-lg`,children:`OneQuery`})]}),(0,j.jsx)(l,{})]}),(0,j.jsx)(`main`,{className:`flex flex-1 items-start justify-center px-4 pb-10 pt-12 sm:items-center sm:px-6 sm:py-6`,children:(0,j.jsxs)(E,{className:`w-full max-w-sm`,children:[(0,j.jsxs)(S,{className:`text-center`,children:[(0,j.jsx)(w,{className:`text-xl`,children:G===`signin`?`Sign in to OneQuery`:W?`Create the initial owner account`:`Create an account`}),(0,j.jsx)(T,{children:G===`signin`?`Enter your email and password to continue`:W?`Finish the first-run bootstrap by creating the owner account for this self-hosted server.`:U?.signupMode===`invite-only`?`Use the email address that received an invitation from your OneQuery admin.`:`Enter your details to get started`})]}),(0,j.jsx)(C,{children:G===`signin`?(0,j.jsxs)(`form`,{onSubmit:e=>{K.handleSubmit(X)(e)},className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`email`,children:`Email`}),(0,j.jsx)(b,{id:`email`,type:`email`,placeholder:`user@example.com`,autoComplete:`email`,...K.register(`email`)}),K.formState.errors.email&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:K.formState.errors.email.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`password`,children:`Password`}),(0,j.jsx)(b,{id:`password`,type:`password`,placeholder:`Enter your password`,autoComplete:`current-password`,...K.register(`password`)}),K.formState.errors.password&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:K.formState.errors.password.message})]}),K.formState.errors.root&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:K.formState.errors.root.message}),(0,j.jsx)(c,{type:`submit`,className:`w-full`,disabled:z,children:z?`Signing in...`:`Sign in`}),(0,j.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[U?.signupMode===`invite-only`?`Need an account? Ask an admin for an invitation, then use the invited email to sign up.`:`Don't have an account? `,U?.signupMode===`invite-only`?(0,j.jsx)(`button`,{type:`button`,onClick:$,className:`text-foreground underline underline-offset-4 hover:text-foreground/80`,children:`I have an invitation`}):(0,j.jsx)(`button`,{type:`button`,onClick:$,className:`text-foreground underline underline-offset-4 hover:text-foreground/80`,children:`Sign up`})]})]}):W?(0,j.jsxs)(`form`,{onSubmit:e=>{J.handleSubmit(Q)(e)},className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`bootstrap-name`,children:`Your name`}),(0,j.jsx)(b,{id:`bootstrap-name`,type:`text`,placeholder:`Jane Doe`,autoComplete:`name`,...J.register(`name`)}),J.formState.errors.name&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:J.formState.errors.name.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`bootstrap-email`,children:`Email`}),(0,j.jsx)(b,{id:`bootstrap-email`,type:`email`,placeholder:`owner@example.com`,autoComplete:`email`,...J.register(`email`)}),J.formState.errors.email&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:J.formState.errors.email.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`bootstrap-organization-name`,children:`Organization name`}),(0,j.jsx)(b,{id:`bootstrap-organization-name`,type:`text`,placeholder:`Acme Inc.`,...J.register(`organizationName`,{onChange:e=>{J.setValue(`organizationSlug`,I(e.target.value))}})}),J.formState.errors.organizationName&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:J.formState.errors.organizationName.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`bootstrap-organization-slug`,children:`URL slug`}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[Y,`/`]}),(0,j.jsx)(b,{id:`bootstrap-organization-slug`,placeholder:`acme`,...J.register(`organizationSlug`),className:`flex-1`})]}),J.formState.errors.organizationSlug&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:J.formState.errors.organizationSlug.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`bootstrap-password`,children:`Password`}),(0,j.jsx)(b,{id:`bootstrap-password`,type:`password`,placeholder:`Create a password`,autoComplete:`new-password`,...J.register(`password`)}),J.formState.errors.password&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:J.formState.errors.password.message})]}),J.formState.errors.root&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:J.formState.errors.root.message}),(0,j.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This setup screen is only available until the first owner account is created.`}),(0,j.jsx)(c,{type:`submit`,className:`w-full`,disabled:z||ee.trim().length===0,children:z?`Creating owner...`:`Create owner account`})]}):(0,j.jsxs)(`form`,{onSubmit:e=>{q.handleSubmit(Z)(e)},className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`name`,children:`Name`}),(0,j.jsx)(b,{id:`name`,type:`text`,placeholder:`John Doe`,autoComplete:`name`,...q.register(`name`)}),q.formState.errors.name&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:q.formState.errors.name.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`signup-email`,children:`Email`}),(0,j.jsx)(b,{id:`signup-email`,type:`email`,placeholder:`user@example.com`,autoComplete:`email`,...q.register(`email`)}),q.formState.errors.email&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:q.formState.errors.email.message})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(x,{htmlFor:`signup-password`,children:`Password`}),(0,j.jsx)(b,{id:`signup-password`,type:`password`,placeholder:`Create a password`,autoComplete:`new-password`,...q.register(`password`)}),q.formState.errors.password&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:q.formState.errors.password.message})]}),q.formState.errors.root&&(0,j.jsx)(`p`,{className:`text-sm text-destructive`,children:q.formState.errors.root.message}),U?.signupMode===`invite-only`?(0,j.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Account creation is limited to email addresses with a pending organization invitation.`}):null,(0,j.jsx)(c,{type:`submit`,className:`w-full`,disabled:z,children:z?`Creating account...`:W?`Create owner account`:`Create account`}),W?null:(0,j.jsxs)(`p`,{className:`text-center text-sm text-muted-foreground`,children:[`Already have an account?`,` `,(0,j.jsx)(`button`,{type:`button`,onClick:$,className:`text-foreground underline underline-offset-4 hover:text-foreground/80`,children:`Sign in`})]})]})})]})})]})}var B=z;export{B as component};
@@ -0,0 +1 @@
1
+ var e=10080*60*1e3;function t(t=new Date){let n=t.getTime();if(!Number.isFinite(n))throw Error(`Reference date must be valid`);return new Date(n+e)}var n=e=>typeof e==`object`&&!!e&&!Array.isArray(e);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{a as i,n as a,t as o}from"./api-base-url-DIb6qukm.js";import{n as s,t as c}from"./createReactComponent-_L2mp4Ui.js";import{a as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./copy-button-BO1KBdf9.js";import{n as g,r as _,t as v}from"./checkbox-Bii9Pcrx.js";import{t as y}from"./IconLoader2-BpZcTuHV.js";import{t as b}from"./IconX-rRpRFwc5.js";import{l as x}from"./app-routes-CMyon6Em.js";import{a as S,c as C,i as w,l as T,n as E,o as D,r as O,s as k,t as A,u as j}from"./use-optimistic-mutation-3PPnMc-O.js";import{t as M}from"./useQuery-DyOxsY45.js";import{t as N}from"./useSuspenseQuery-CBFRU4At.js";import{_ as P,d as F,p as I,s as L}from"./schemas-EcBBwCo1.js";import{n as ee}from"./src-C5F1uEDb.js";import{a as R,r as z}from"./organization-permissions-BXV_ess0.js";import{C as B,S as V,V as H,w as U,z as W}from"./index-CXR0dKJj.js";import{t as te}from"./input-BRu0b1Tq.js";import{n as ne,r as re,t as ie}from"./avatar-SaFoLofF.js";import{d as ae,n as oe,r as se,t as ce}from"./dropdown-menu-Cw2MW0pD.js";import{i as G,r as le,t as ue}from"./xstate-react.esm-Bo3CCIRt.js";import{t as de}from"./format-date-Rg05aHXh.js";import{t as fe}from"./label-f2wVZcni.js";import{t as pe}from"./badge-BFPkSrVD.js";import{r as K}from"./api-paths-DcYkf-C_.js";import{n as me,t as he}from"./zod-D0PWrP9q.js";var ge=c(`outline`,`user-edit`,`UserEdit`,[[`path`,{d:`M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0`,key:`svg-0`}],[`path`,{d:`M6 21v-2a4 4 0 0 1 4 -4h3.5`,key:`svg-1`}],[`path`,{d:`M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39`,key:`svg-2`}]]),_e=c(`outline`,`user-plus`,`UserPlus`,[[`path`,{d:`M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0`,key:`svg-0`}],[`path`,{d:`M16 19h6`,key:`svg-1`}],[`path`,{d:`M19 16v6`,key:`svg-2`}],[`path`,{d:`M6 21v-2a4 4 0 0 1 4 -4h4`,key:`svg-3`}]]),q=r(),J=n();function ve(e){switch(e){case`owner`:return`default`;case`admin`:return`secondary`;case`member`:return`outline`}}function ye(e){switch(e){case`owner`:return`Owner`;case`admin`:return`Admin`;case`member`:return`Member`}}function be(e){let t=(0,q.c)(7),{role:n}=e,r;t[0]===n?r=t[1]:(r=ve(n),t[0]=n,t[1]=r);let i;t[2]===n?i=t[3]:(i=ye(n),t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a=(0,J.jsx)(pe,{variant:r,children:i}),t[4]=r,t[5]=i,t[6]=a):a=t[6],a}function xe(e){let t=(0,q.c)(9),{roleNames:n,rawRole:r,emptyLabel:i}=e;if(n.length===0){let e;t[0]!==i||t[1]!==r?(e=r?.trim()||i,t[0]=i,t[1]=r,t[2]=e):e=t[2];let n=e,a;return t[3]===n?a=t[4]:(a=n?(0,J.jsx)(pe,{variant:`outline`,children:n}):null,t[3]=n,t[4]=a),a}let a;t[5]===n?a=t[6]:(a=n.map(Se),t[5]=n,t[6]=a);let o;return t[7]===a?o=t[8]:(o=(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:a}),t[7]=a,t[8]=o),o}function Se(e){return(0,J.jsx)(be,{role:e},e)}var Ce=F({expiresAt:P().optional(),id:I(),role:I().optional()}),we=F({id:I(),role:I()}),Te=F({member:we});async function Ee(e,t){if((e.headers.get(`content-type`)??``).includes(`application/json`)){let n=await e.json().catch(()=>null),r=F({code:I().optional(),error:I().optional(),message:I().optional()}).safeParse(n);if(r.success)return r.data.error??r.data.message??t}return await e.text().catch(()=>``)||t}async function Y(e){let t=await fetch(`${o()}${e.path}`,{body:e.body?JSON.stringify(e.body):void 0,credentials:`include`,headers:{"Content-Type":`application/json`},method:e.method});if(!t.ok)throw Error(await Ee(t,e.errorMessage));let n=await t.json().catch(()=>null),r=e.successSchema.safeParse(n);if(!r.success)throw Error(e.errorMessage);return r.data}async function De(e){return Y({body:{email:e.email,role:e.roleNames.length===1?e.roleNames[0]:[...e.roleNames]},errorMessage:`Failed to create invitation link`,method:`POST`,path:K(e.organizationId,`invitations`),successSchema:Ce})}async function Oe(e){return Y({errorMessage:`Failed to cancel invitation`,method:`DELETE`,path:K(e.organizationId,`invitations`,e.invitationId),successSchema:Ce})}async function ke(e){return Y({body:{role:e.roleNames.length===1?e.roleNames[0]:[...e.roleNames]},errorMessage:`Failed to update role`,method:`PATCH`,path:K(e.organizationId,`members`,e.memberId,`role`),successSchema:we})}async function Ae(e){return Y({errorMessage:`Failed to remove member`,method:`DELETE`,path:K(e.organizationId,`members`,e.memberId),successSchema:Te})}function je(e){let t=Date.parse(e)-Date.now();if(t<0)return`Expired`;let n=Math.floor(t/(1e3*60*60*24)),r=Math.floor(t%(1e3*60*60*24)/(1e3*60*60));return n>0?`Expires in ${n}d`:r>0?`Expires in ${r}h`:`Expires soon`}function Me(e){let t=(0,q.c)(31),{invitation:n,currentUserId:r,organizationId:i,canManageInvitationMutations:a}=e,o=n.id,c;t[0]!==n.id||t[1]!==i?(c=async()=>{await Oe({invitationId:n.id,organizationId:i})},t[0]=n.id,t[1]=i,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==n.organizationId?(l=V(r,n.organizationId),t[3]=r,t[4]=n.organizationId,t[5]=l):l=t[5];let d;t[6]!==n.id||t[7]!==c||t[8]!==l.queryKey?(d={errorMessage:`Failed to cancel invitation`,itemId:o,mutationFn:c,queryKey:l.queryKey,successMessage:`Invitation cancelled`},t[6]=n.id,t[7]=c,t[8]=l.queryKey,t[9]=d):d=t[9];let f=E(d),p=n.expiresAt?Date.parse(n.expiresAt)<Date.now():!1,h;t[10]===n.email?h=t[11]:(h=(0,J.jsx)(u,{children:(0,J.jsx)(`span`,{className:`font-medium`,children:n.email})}),t[10]=n.email,t[11]=h);let g;t[12]!==n.rawRole||t[13]!==n.roleNames?(g=(0,J.jsx)(u,{children:(0,J.jsx)(xe,{roleNames:n.roleNames,rawRole:n.rawRole,emptyLabel:`Member`})}),t[12]=n.rawRole,t[13]=n.roleNames,t[14]=g):g=t[14];let _=p?`text-destructive`:`text-muted-foreground`,v;t[15]===n.expiresAt?v=t[16]:(v=n.expiresAt?je(n.expiresAt):`Pending`,t[15]=n.expiresAt,t[16]=v);let x;t[17]!==_||t[18]!==v?(x=(0,J.jsx)(u,{children:(0,J.jsx)(`span`,{className:_,children:v})}),t[17]=_,t[18]=v,t[19]=x):x=t[19];let S;t[20]!==a||t[21]!==f||t[22]!==p?(S=a&&!p&&(0,J.jsx)(s,{variant:`ghost`,size:`icon-sm`,onClick:()=>f.mutate(),disabled:f.isPending,title:`Cancel invitation`,children:f.isPending?(0,J.jsx)(y,{size:16,className:`animate-spin`}):(0,J.jsx)(b,{size:16,stroke:2})}),t[20]=a,t[21]=f,t[22]=p,t[23]=S):S=t[23];let C;t[24]===S?C=t[25]:(C=(0,J.jsx)(u,{className:`text-right`,children:S}),t[24]=S,t[25]=C);let w;return t[26]!==C||t[27]!==h||t[28]!==g||t[29]!==x?(w=(0,J.jsxs)(m,{children:[h,g,x,C]}),t[26]=C,t[27]=h,t[28]=g,t[29]=x,t[30]=w):w=t[30],w}function Ne(e){let t=(0,q.c)(31),{currentUserId:n,organizationId:r,canManageInvitationMutations:i}=e,a;t[0]!==n||t[1]!==r?(a=V(n,r),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=M(a);if(o.isPending){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`text-center py-8 text-muted-foreground`,children:`Loading invitations...`}),t[3]=e):e=t[3],e}if(o.isLoadingError){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`text-center py-8 text-destructive`,children:`Failed to load invitations.`}),t[4]=e):e=t[4],e}let s=o.data,c,u,h,g,_,v;if(t[5]!==i||t[6]!==n||t[7]!==s||t[8]!==r){v=Symbol.for(`react.early_return_sentinel`);bb0:{let e=s.filter(Pe);if(e.length===0){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`text-center py-8 text-muted-foreground`,children:`No pending invitations.`}),t[15]=e):e=t[15],v=e;break bb0}_=`rounded-md border`,u=d,t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(f,{children:(0,J.jsxs)(m,{children:[(0,J.jsx)(l,{children:`Email`}),(0,J.jsx)(l,{children:`Role`}),(0,J.jsx)(l,{children:`Status`}),(0,J.jsx)(l,{className:`text-right w-[50px]`})]})}),t[16]=g):g=t[16],c=p;let a;t[17]!==i||t[18]!==n||t[19]!==r?(a=e=>(0,J.jsx)(Me,{invitation:e,currentUserId:n,organizationId:r,canManageInvitationMutations:i},e.id),t[17]=i,t[18]=n,t[19]=r,t[20]=a):a=t[20],h=e.map(a)}t[5]=i,t[6]=n,t[7]=s,t[8]=r,t[9]=c,t[10]=u,t[11]=h,t[12]=g,t[13]=_,t[14]=v}else c=t[9],u=t[10],h=t[11],g=t[12],_=t[13],v=t[14];if(v!==Symbol.for(`react.early_return_sentinel`))return v;let y;t[21]!==c||t[22]!==h?(y=(0,J.jsx)(c,{children:h}),t[21]=c,t[22]=h,t[23]=y):y=t[23];let b;t[24]!==u||t[25]!==g||t[26]!==y?(b=(0,J.jsxs)(u,{children:[g,y]}),t[24]=u,t[25]=g,t[26]=y,t[27]=b):b=t[27];let x;return t[28]!==_||t[29]!==b?(x=(0,J.jsx)(`div`,{className:_,children:b}),t[28]=_,t[29]=b,t[30]=x):x=t[30],x}function Pe(e){return e.status===`pending`}var X=e(t(),1),Fe=[`admin`,`member`],Ie=[{label:`Admin`,value:`admin`},{label:`Member`,value:`member`}],Le=[`member`],Z={RESET:`teamRoleSelection/reset`,SOURCE_ROLE_NAMES_SYNCED:`teamRoleSelection/sourceRoleNamesSynced`,TOGGLE_ROLE:`teamRoleSelection/toggleRole`},Q={CLEAN:`clean`,DIRTY:`dirty`,EVALUATING:`evaluating`},Re={DIRTY:`dirty`};function $(e){let t=new Set;for(let n of e)(n===`admin`||n===`member`)&&t.add(n);return Fe.filter(e=>t.has(e))}function ze(e){let t=$(e);return{selectedRoleNames:[...t],sourceRoleNames:[...t]}}var Be=le({actions:{resetSelectedRoleNames:G({selectedRoleNames:({context:e})=>[...e.sourceRoleNames]}),syncSourceRoleNames:G({selectedRoleNames:(e,t)=>[...t.roleNames],sourceRoleNames:(e,t)=>[...t.roleNames]}),toggleRoleName:G({selectedRoleNames:({context:e},t)=>{let n=new Set(e.selectedRoleNames);return n.has(t.roleName)?n.delete(t.roleName):n.add(t.roleName),Fe.filter(e=>n.has(e))}})},guards:{hasRoleSelectionChanges:({context:e})=>R(e.selectedRoleNames)!==R(e.sourceRoleNames)},types:{}}).createMachine({context:({input:e})=>ze(e.initialRoleNames),id:`teamRoleSelection`,initial:Q.EVALUATING,on:{[Z.RESET]:{actions:`resetSelectedRoleNames`,target:`.${Q.EVALUATING}`},[Z.SOURCE_ROLE_NAMES_SYNCED]:{actions:{type:`syncSourceRoleNames`,params:({event:e})=>({roleNames:$(e.roleNames)})},target:`.${Q.EVALUATING}`},[Z.TOGGLE_ROLE]:{actions:{type:`toggleRoleName`,params:({event:e})=>({roleName:e.roleName})},target:`.${Q.EVALUATING}`}},states:{[Q.EVALUATING]:{always:[{guard:`hasRoleSelectionChanges`,target:Q.DIRTY},{target:Q.CLEAN}]},[Q.CLEAN]:{},[Q.DIRTY]:{tags:Re.DIRTY}}});function Ve(e){let t=(0,q.c)(19),n;t[0]===e.initialRoleNames?n=t[1]:(n=$(e.initialRoleNames),t[0]=e.initialRoleNames,t[1]=n);let r;t[2]===n?r=t[3]:(r={input:{initialRoleNames:n}},t[2]=n,t[3]=r);let[i,a]=ue(Be,r),o;t[4]===i?o=t[5]:(o=i.hasTag(Re.DIRTY),t[4]=i,t[5]=o);let s=i.context.selectedRoleNames.length===0,c;t[6]===a?c=t[7]:(c=()=>{a({type:Z.RESET})},t[6]=a,t[7]=c);let l=c,u;t[8]===a?u=t[9]:(u=e=>{a({type:Z.SOURCE_ROLE_NAMES_SYNCED,roleNames:e})},t[8]=a,t[9]=u);let d=u,f;t[10]===a?f=t[11]:(f=e=>{a({type:Z.TOGGLE_ROLE,roleName:e})},t[10]=a,t[11]=f);let p=f,m;return t[12]!==i.context.selectedRoleNames||t[13]!==o||t[14]!==s||t[15]!==l||t[16]!==d||t[17]!==p?(m={hasChanges:o,isSelectionEmpty:s,reset:l,resetToRoleNames:d,selectedRoleNames:i.context.selectedRoleNames,toggleRole:p},t[12]=i.context.selectedRoleNames,t[13]=o,t[14]=s,t[15]=l,t[16]=d,t[17]=p,t[18]=m):m=t[18],m}function He(e){return e instanceof HTMLElement&&e.closest(`[data-slot="checkbox"]`)!==null}function Ue(e){let t=(0,q.c)(12),{errorMessage:n,helperText:r,onToggleRole:i,selectedRoleNames:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(fe,{children:`Roles`}),t[0]=o):o=t[0];let s;t[1]!==i||t[2]!==a?(s=Ie.map(e=>(0,J.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left hover:bg-accent/40`,onClick:t=>{He(t.target)||i(e.value)},children:[(0,J.jsx)(v,{checked:a.includes(e.value),onCheckedChange:()=>i(e.value)}),(0,J.jsx)(`div`,{children:(0,J.jsx)(`p`,{className:`font-medium`,children:e.label})})]},e.value)),t[1]=i,t[2]=a,t[3]=s):s=t[3];let c;t[4]===s?c=t[5]:(c=(0,J.jsx)(`div`,{className:`space-y-2`,children:s}),t[4]=s,t[5]=c);let l;t[6]!==n||t[7]!==r?(l=n?(0,J.jsx)(`p`,{className:`text-sm text-destructive`,children:n}):(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),t[6]=n,t[7]=r,t[8]=l):l=t[8];let u;return t[9]!==c||t[10]!==l?(u=(0,J.jsxs)(`div`,{className:`space-y-2`,children:[o,c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11],u}var We=F({email:L(`Please enter a valid email address`)});function Ge(e){let t=(0,q.c)(44),{children:n,currentUserId:r,organizationId:i}=e,[o,c]=(0,X.useState)(!1),[l,u]=(0,X.useState)(null),[d,f]=(0,X.useState)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={initialRoleNames:Le},t[0]=p):p=t[0];let m=Ve(p),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g={defaultValues:{email:``},resolver:he(We)},t[1]=g):g=t[1];let _=me(g),v;t[2]===i?v=t[3]:(v=e=>({id:`temp-${crypto.randomUUID()}`,email:e.email,rawRole:R(e.roleNames),roleNames:[...e.roleNames],status:`pending`,expiresAt:ee().toISOString(),organizationId:i,inviterId:`current-user`}),t[2]=i,t[3]=v);let y;t[4]===i?y=t[5]:(y=async e=>De({email:e.email,organizationId:i,roleNames:e.roleNames}),t[4]=i,t[5]=y);let b;t[6]!==_||t[7]!==m?(b=e=>{e?.id&&u({expiresAt:e.expiresAt??ee().toISOString(),url:`${a()}${x(e.id)}`}),_.reset(),m.reset(),f(null)},t[6]=_,t[7]=m,t[8]=b):b=t[8];let E;t[9]!==r||t[10]!==i?(E=V(r,i),t[9]=r,t[10]=i,t[11]=E):E=t[11];let j;t[12]!==v||t[13]!==y||t[14]!==b||t[15]!==E.queryKey?(j={createOptimisticItem:v,errorMessage:`Failed to create invitation link`,mutationFn:y,onSuccess:b,queryKey:E.queryKey,successMessage:`Invitation link created`},t[12]=v,t[13]=y,t[14]=b,t[15]=E.queryKey,t[16]=j):j=t[16];let M=A(j),N;t[17]!==M||t[18]!==m.isSelectionEmpty||t[19]!==m.selectedRoleNames?(N=e=>{if(m.isSelectionEmpty){f(`Select at least one role`);return}M.mutate({...e,roleNames:m.selectedRoleNames})},t[17]=M,t[18]=m.isSelectionEmpty,t[19]=m.selectedRoleNames,t[20]=N):N=t[20];let P=N,F;t[21]!==_||t[22]!==m?(F=e=>{c(e),e||(u(null),f(null),m.reset(),_.reset())},t[21]=_,t[22]=m,t[23]=F):F=t[23];let I=F,L;t[24]!==d||t[25]!==m?(L=e=>{d&&f(null),m.toggleRole(e)},t[24]=d,t[25]=m,t[26]=L):L=t[26];let z=L,B;t[27]===n?B=t[28]:(B=(0,J.jsx)(T,{render:n}),t[27]=n,t[28]=B);let H;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsxs)(k,{children:[(0,J.jsx)(C,{children:`Create Invitation Link`}),(0,J.jsx)(S,{children:`Create a shareable invitation link for this organization. The recipient will sign in with an existing account or create their own before accepting.`})]}),t[29]=H):H=t[29];let U;t[30]!==_||t[31]!==z||t[32]!==l||t[33]!==M||t[34]!==P||t[35]!==d||t[36]!==m.isSelectionEmpty||t[37]!==m.selectedRoleNames?(U=(0,J.jsxs)(w,{className:`sm:max-w-[400px]`,children:[H,l?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`space-y-2 pt-4`,children:[(0,J.jsx)(fe,{children:`Invitation Link`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(te,{value:l.url,readOnly:!0,className:`flex-1 text-sm`}),(0,J.jsx)(h,{value:l.url})]}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Share this link with the invitee. They'll accept it after signing in or creating an account. The link expires on`,` `,de(l.expiresAt),`.`]})]}),(0,J.jsxs)(D,{children:[(0,J.jsx)(s,{type:`button`,variant:`outline`,onClick:()=>u(null),children:`Create Another Link`}),(0,J.jsx)(s,{type:`button`,onClick:()=>c(!1),children:`Done`})]})]}):(0,J.jsxs)(`form`,{onSubmit:e=>{_.handleSubmit(P)(e)},className:`space-y-4 pt-4`,children:[(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(fe,{htmlFor:`email`,children:`Email Address`}),(0,J.jsx)(te,{id:`email`,type:`email`,placeholder:`colleague@example.com`,..._.register(`email`)}),_.formState.errors.email&&(0,J.jsx)(`p`,{className:`text-sm text-destructive`,children:_.formState.errors.email.message})]}),(0,J.jsx)(Ue,{errorMessage:d,helperText:`Select one or more roles for this invitation.`,onToggleRole:z,selectedRoleNames:m.selectedRoleNames}),(0,J.jsxs)(D,{children:[(0,J.jsx)(s,{type:`button`,variant:`outline`,onClick:()=>c(!1),children:`Cancel`}),(0,J.jsx)(s,{type:`submit`,disabled:M.isPending||m.isSelectionEmpty,children:M.isPending?`Creating Link...`:`Create Invitation Link`})]})]})]}),t[30]=_,t[31]=z,t[32]=l,t[33]=M,t[34]=P,t[35]=d,t[36]=m.isSelectionEmpty,t[37]=m.selectedRoleNames,t[38]=U):U=t[38];let W;return t[39]!==I||t[40]!==o||t[41]!==B||t[42]!==U?(W=(0,J.jsxs)(O,{open:o,onOpenChange:I,children:[B,U]}),t[39]=I,t[40]=o,t[41]=B,t[42]=U,t[43]=W):W=t[43],W}function Ke({currentUserId:e,open:t,onOpenChange:n,member:r}){let i=H(),a=(0,X.useMemo)(()=>$(r.roleNames),[R(r.roleNames)]),o=Ve({initialRoleNames:a});(0,X.useEffect)(()=>{t&&o.resetToRoleNames(a)},[a,r.id,t,o.resetToRoleNames]);let c=j({mutationFn:async()=>{await ke({memberId:r.id,organizationId:r.organizationId,roleNames:o.selectedRoleNames})},onError:e=>{W.error(e.message||`Failed to update role`)},onSuccess:()=>{W.success(`Role updated`),i.invalidateQueries({queryKey:B(e,r.organizationId).queryKey}),n(!1)}});return(0,J.jsx)(O,{open:t,onOpenChange:n,children:(0,J.jsxs)(w,{className:`sm:max-w-[400px]`,children:[(0,J.jsxs)(k,{children:[(0,J.jsx)(C,{children:`Change Role`}),(0,J.jsxs)(S,{children:[`Update the role for `,r.user.name]})]}),(0,J.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),!o.hasChanges){n(!1);return}c.mutate()},className:`space-y-4 pt-4`,children:[(0,J.jsx)(Ue,{helperText:`Select one or more roles for this member.`,onToggleRole:o.toggleRole,selectedRoleNames:o.selectedRoleNames}),(0,J.jsxs)(D,{children:[(0,J.jsx)(s,{type:`button`,variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,J.jsx)(s,{type:`submit`,disabled:c.isPending||o.isSelectionEmpty,children:c.isPending?`Updating...`:`Update Role`})]})]})]})})}function qe(e){return e.split(` `).map(e=>e[0]).join(``).toUpperCase().slice(0,2)}function Je(e){let t=(0,q.c)(51),{member:n,currentUserId:r,canManageMemberMutations:i}=e,[a,o]=(0,X.useState)(!1),c=n.userId===r,l;t[0]===n.rawRole?l=t[1]:(l=z({roleName:`owner`,rawRole:n.rawRole}),t[0]=n.rawRole,t[1]=l);let d=l,f=n.id,p;t[2]!==n.id||t[3]!==n.organizationId?(p=async()=>{await Ae({memberId:n.id,organizationId:n.organizationId})},t[2]=n.id,t[3]=n.organizationId,t[4]=p):p=t[4];let h;t[5]!==r||t[6]!==n.organizationId?(h=B(r,n.organizationId),t[5]=r,t[6]=n.organizationId,t[7]=h):h=t[7];let v;t[8]!==n.id||t[9]!==p||t[10]!==h.queryKey?(v={errorMessage:`Failed to remove member`,itemId:f,mutationFn:p,queryKey:h.queryKey,successMessage:`Member removed`},t[8]=n.id,t[9]=p,t[10]=h.queryKey,t[11]=v):v=t[11];let y=E(v),b=i&&!d&&!c,x=i&&!d&&!c,S;t[12]===n.user.image?S=t[13]:(S=n.user.image&&(0,J.jsx)(re,{src:n.user.image}),t[12]=n.user.image,t[13]=S);let C;t[14]===n.user.name?C=t[15]:(C=qe(n.user.name),t[14]=n.user.name,t[15]=C);let w;t[16]===C?w=t[17]:(w=(0,J.jsx)(ne,{children:C}),t[16]=C,t[17]=w);let T;t[18]!==S||t[19]!==w?(T=(0,J.jsxs)(ie,{size:`sm`,children:[S,w]}),t[18]=S,t[19]=w,t[20]=T):T=t[20];let D;t[21]===n.user.name?D=t[22]:(D=(0,J.jsx)(`div`,{className:`font-medium`,children:n.user.name}),t[21]=n.user.name,t[22]=D);let O;t[23]===n.user.email?O=t[24]:(O=(0,J.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:n.user.email}),t[23]=n.user.email,t[24]=O);let k;t[25]!==D||t[26]!==O?(k=(0,J.jsxs)(`div`,{children:[D,O]}),t[25]=D,t[26]=O,t[27]=k):k=t[27];let A;t[28]!==k||t[29]!==T?(A=(0,J.jsx)(u,{children:(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[T,k]})}),t[28]=k,t[29]=T,t[30]=A):A=t[30];let j;t[31]!==n.rawRole||t[32]!==n.roleNames?(j=(0,J.jsx)(u,{children:(0,J.jsx)(xe,{roleNames:n.roleNames,rawRole:n.rawRole})}),t[31]=n.rawRole,t[32]=n.roleNames,t[33]=j):j=t[33];let M;t[34]!==b||t[35]!==x||t[36]!==y?(M=(b||x)&&(0,J.jsxs)(ce,{children:[(0,J.jsx)(ae,{children:(0,J.jsx)(s,{variant:`ghost`,size:`icon-sm`,children:(0,J.jsx)(_,{size:16,stroke:2})})}),(0,J.jsxs)(oe,{align:`end`,children:[b&&(0,J.jsxs)(se,{onClick:()=>o(!0),children:[(0,J.jsx)(ge,{size:16,stroke:2}),`Change Role`]}),x&&(0,J.jsxs)(se,{onClick:()=>y.mutate(),disabled:y.isPending,className:`text-destructive focus:text-destructive`,children:[(0,J.jsx)(g,{size:16,stroke:2}),y.isPending?`Removing...`:`Remove`]})]})]}),t[34]=b,t[35]=x,t[36]=y,t[37]=M):M=t[37];let N;t[38]===M?N=t[39]:(N=(0,J.jsx)(u,{className:`text-right`,children:M}),t[38]=M,t[39]=N);let P;t[40]!==A||t[41]!==j||t[42]!==N?(P=(0,J.jsxs)(m,{children:[A,j,N]}),t[40]=A,t[41]=j,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==r||t[45]!==n||t[46]!==a?(F=(0,J.jsx)(Ke,{open:a,onOpenChange:o,currentUserId:r,member:n}),t[44]=r,t[45]=n,t[46]=a,t[47]=F):F=t[47];let I;return t[48]!==P||t[49]!==F?(I=(0,J.jsxs)(J.Fragment,{children:[P,F]}),t[48]=P,t[49]=F,t[50]=I):I=t[50],I}function Ye(e){let t=(0,q.c)(11),{members:n,currentUserId:r,canManageMemberMutations:i}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`text-center py-8 text-muted-foreground`,children:`No members found.`}),t[0]=e):e=t[0],e}let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(f,{children:(0,J.jsxs)(m,{children:[(0,J.jsx)(l,{children:`Member`}),(0,J.jsx)(l,{children:`Role`}),(0,J.jsx)(l,{className:`text-right w-[50px]`})]})}),t[1]=a):a=t[1];let o;if(t[2]!==i||t[3]!==r||t[4]!==n){let e;t[6]!==i||t[7]!==r?(e=e=>(0,J.jsx)(Je,{member:e,currentUserId:r,canManageMemberMutations:i},e.id),t[6]=i,t[7]=r,t[8]=e):e=t[8],o=n.map(e),t[2]=i,t[3]=r,t[4]=n,t[5]=o}else o=t[5];let s;return t[9]===o?s=t[10]:(s=(0,J.jsx)(`div`,{className:`rounded-md border`,children:(0,J.jsxs)(d,{children:[a,(0,J.jsx)(p,{children:o})]})}),t[9]=o,t[10]=s),s}var Xe=i(`/_authenticated/$org_slug/team`);function Ze(e){let t=(0,q.c)(27),n;t[0]!==e.currentUserId||t[1]!==e.organizationId?(n=B(e.currentUserId,e.organizationId),t[0]=e.currentUserId,t[1]=e.organizationId,t[2]=n):n=t[2];let{data:r}=N(n),i;t[3]!==r||t[4]!==e.currentUserId?(i=U({currentUserId:e.currentUserId,members:r}),t[3]=r,t[4]=e.currentUserId,t[5]=i):i=t[5];let{canInviteMembers:a,canManageMembershipMutations:o,canReadInvitations:c}=i,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Members`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`People who have access to this organization. Invite teammates to let them join with their own account.`})]}),t[6]=l):l=t[6];let u;t[7]!==a||t[8]!==o||t[9]!==e.currentUserId||t[10]!==e.organizationId?(u=a?(0,J.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:o?(0,J.jsx)(Ge,{currentUserId:e.currentUserId,organizationId:e.organizationId,children:(0,J.jsxs)(s,{children:[(0,J.jsx)(_e,{size:16,stroke:2}),`Create Invitation Link`]})}):null}):null,t[7]=a,t[8]=o,t[9]=e.currentUserId,t[10]=e.organizationId,t[11]=u):u=t[11];let d;t[12]===u?d=t[13]:(d=(0,J.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[l,u]}),t[12]=u,t[13]=d);let f;t[14]!==o||t[15]!==r||t[16]!==e.currentUserId?(f=(0,J.jsx)(Ye,{members:r,currentUserId:e.currentUserId,canManageMemberMutations:o}),t[14]=o,t[15]=r,t[16]=e.currentUserId,t[17]=f):f=t[17];let p;t[18]!==o||t[19]!==c||t[20]!==e.currentUserId||t[21]!==e.organizationId?(p=c?(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-xl font-semibold mb-2`,children:`Pending Invitations`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:`Invitations that haven't been accepted yet.`}),(0,J.jsx)(Ne,{currentUserId:e.currentUserId,organizationId:e.organizationId,canManageInvitationMutations:o})]}):null,t[18]=o,t[19]=c,t[20]=e.currentUserId,t[21]=e.organizationId,t[22]=p):p=t[22];let m;return t[23]!==d||t[24]!==f||t[25]!==p?(m=(0,J.jsxs)(`div`,{className:`space-y-8`,children:[d,f,p]}),t[23]=d,t[24]=f,t[25]=p,t[26]=m):m=t[26],m}function Qe(){let e=(0,q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsxs)(`div`,{className:`mb-8`,children:[(0,J.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Team`}),(0,J.jsx)(`p`,{className:`text-muted-foreground mt-2`,children:`Manage your members and create invitation links for new teammates.`})]}),e[0]=t):t=e[0],t}function $e(){let e=(0,q.c)(4),{organizationId:t,session:n}=Xe.useRouteContext(),r=n.user.id,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,J.jsx)(Qe,{}),e[0]=i):i=e[0];let a;return e[1]!==r||e[2]!==t?(a=(0,J.jsxs)(`div`,{className:`p-8`,children:[i,(0,J.jsx)(Ze,{organizationId:t,currentUserId:r})]}),e[1]=r,e[2]=t,e[3]=a):a=e[3],a}var et=$e;export{et as component};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{S as i,_ as a,a as o,d as s,f as c,h as l}from"./createReactComponent-_L2mp4Ui.js";import{t as u}from"./utils-C8DGLIgm.js";import{i as d}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";import{C as f,D as p,E as m,O as h,S as g,T as _,_ as v,a as y,b,c as x,g as S,h as C,l as w,m as T,o as E,p as D,s as O,t as k,u as A,v as j,w as M,x as N,y as P}from"./CompositeList-DbbDW_rT.js";function F(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var I=`data-composite-item-active`,L=e(t()),R=[];function z(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:a=!1,orientation:o=`both`,direction:s,highlightedIndex:c,onHighlightedIndexChange:u,rootRef:d,enableHomeAndEndKeys:C=!1,stopEventPropagation:k=!1,disabledIndices:I,modifierKeys:z=R}=e,[V,H]=L.useState(0),U=n>1,W=L.useRef(null),G=l(W,d),K=L.useRef([]),q=L.useRef(!1),J=c??V,Y=i((e,t=!1)=>{if((u??H)(e),t){let t=K.current[e];P(W.current,t,s,o)}}),X=i(e=>{if(e.size===0||q.current)return;q.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&Y(r),P(W.current,n,s,o)}),Z=L.useMemo(()=>({"aria-orientation":o===`both`?void 0:o,ref:G,onFocus(e){!W.current||!j(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let i=C?y:O;if(!i.has(e.key)||B(e,z)||!W.current)return;let c=s===`rtl`,l=c?x:w,u={horizontal:l,vertical:E,both:l}[o],d=c?w:x,P={horizontal:d,vertical:A,both:d}[o];if(j(e.target)&&!F(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==P&&t<r.length||e.key!==u&&t>0)return}let L=J,R=m(K,I),V=_(K,I);if(U){let i=t||Array.from({length:K.current.length},()=>({width:1,height:1})),s=b(i,n,a),l=s.findIndex(e=>e!=null&&!h(K,e,I)),u=s.reduce((e,t,n)=>t!=null&&!h(K,t,I)?n:e,-1);L=s[M({current:s.map(e=>e?K.current[e]:null)},{event:e,orientation:o,loopFocus:r,cols:n,disabledIndices:f([...I||K.current.map((e,t)=>h(K,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:g(J>V?R:J,i,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let H={horizontal:[l],vertical:[E],both:[l,E]}[o],G={horizontal:[d],vertical:[A],both:[d,A]}[o],q=U?i:{horizontal:C?T:D,vertical:C?v:S,both:i}[o];C&&(e.key===`Home`?L=R:e.key===`End`&&(L=V)),L===J&&(H.includes(e.key)||G.includes(e.key))&&(L=r&&L===V&&H.includes(e.key)?R:r&&L===R&&G.includes(e.key)?V:N(K,{startingIndex:L,decrement:G.includes(e.key),disabledIndices:I})),L!==J&&!p(K,L)&&(k&&e.stopPropagation(),q.has(e.key)&&e.preventDefault(),Y(L,!0),queueMicrotask(()=>{K.current[L]?.focus()}))}}),[n,a,s,I,K,C,J,U,t,r,G,z,Y,o,k]);return L.useMemo(()=>({props:Z,highlightedIndex:J,onHighlightedIndexChange:Y,elementsRef:K,disabledIndices:I,onMapChange:X,relayKeyboardEvent:Z.onKeyDown}),[Z,J,Y,K,I,X])}function B(e,t){for(let n of C.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var V=n();function H(e){let{render:t,className:n,refs:r=s,props:i=s,state:l=c,stateAttributesMapping:u,highlightedIndex:f,onHighlightedIndexChange:p,orientation:m,dense:h,itemSizes:g,loopFocus:_,cols:v,enableHomeAndEndKeys:y,onMapChange:b,stopEventPropagation:x=!0,rootRef:S,disabledIndices:C,modifierKeys:w,highlightItemOnHover:T=!1,tag:E=`div`,...D}=e,{props:O,highlightedIndex:A,onHighlightedIndexChange:j,elementsRef:M,onMapChange:N,relayKeyboardEvent:P}=z({itemSizes:g,cols:v,loopFocus:_,dense:h,orientation:m,highlightedIndex:f,onHighlightedIndexChange:p,rootRef:S,stopEventPropagation:x,enableHomeAndEndKeys:y,direction:d(),disabledIndices:C,modifierKeys:w}),F=o(E,e,{state:l,ref:r,props:[O,...i,D],stateAttributesMapping:u}),I=L.useMemo(()=>({highlightedIndex:A,onHighlightedIndexChange:j,highlightItemOnHover:T,relayKeyboardEvent:P}),[A,j,T,P]);return(0,V.jsx)(a.Provider,{value:I,children:(0,V.jsx)(k,{elementsRef:M,onMapChange:e=>{b?.(e),N(e)},children:F})})}var U=r();function W(e){let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,V.jsx)(`textarea`,{"data-slot":`textarea`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{H as n,I as r,W as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DG_AJzB_.js";import{t}from"./compiler-runtime-DCc3R3Xn.js";import{n,t as r}from"./createReactComponent-_L2mp4Ui.js";import{B as i}from"./index-CXR0dKJj.js";import{a,d as o,i as s,n as c,t as l}from"./dropdown-menu-Cw2MW0pD.js";var u=r(`outline`,`device-desktop`,`DeviceDesktop`,[[`path`,{d:`M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10`,key:`svg-0`}],[`path`,{d:`M7 20h10`,key:`svg-1`}],[`path`,{d:`M9 16v4`,key:`svg-2`}],[`path`,{d:`M15 16v4`,key:`svg-3`}]]),d=r(`outline`,`moon`,`Moon`,[[`path`,{d:`M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008`,key:`svg-0`}]]),f=r(`outline`,`sun`,`Sun`,[[`path`,{d:`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7`,key:`svg-1`}]]),p=t(),m=e();function h(){let e=(0,p.c)(8),{theme:t,setTheme:r}=i(),h;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,m.jsx)(n,{variant:`ghost`,size:`icon`}),e[0]=h):h=e[0];let g;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,m.jsxs)(o,{render:h,"aria-label":`Toggle theme`,children:[(0,m.jsx)(f,{size:16,stroke:2,className:`rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,m.jsx)(d,{size:16,stroke:2,className:`absolute rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`})]}),e[1]=g):g=e[1];let _;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,m.jsxs)(a,{value:`light`,children:[(0,m.jsx)(f,{size:16,stroke:2,className:`mr-2`}),`Light`]}),e[2]=_):_=e[2];let v;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,m.jsxs)(a,{value:`dark`,children:[(0,m.jsx)(d,{size:16,stroke:2,className:`mr-2`}),`Dark`]}),e[3]=v):v=e[3];let y;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,m.jsxs)(a,{value:`system`,children:[(0,m.jsx)(u,{size:16,stroke:2,className:`mr-2`}),`System`]}),e[4]=y):y=e[4];let b;return e[5]!==r||e[6]!==t?(b=(0,m.jsxs)(l,{children:[g,(0,m.jsx)(c,{align:`end`,children:(0,m.jsxs)(s,{value:t,onValueChange:r,children:[_,v,y]})})]}),e[5]=r,e[6]=t,e[7]=b):b=e[7],b}export{h as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{a as i,g as a,n as o,o as s,y as c}from"./createReactComponent-_L2mp4Ui.js";import{t as l}from"./utils-C8DGLIgm.js";import{t as u}from"./IconX-rRpRFwc5.js";import{A as d,E as f,T as p,b as m,m as h,o as g}from"./query-CY--GYXb.js";import{_,c as v,l as y}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";import{t as b}from"./useBaseUiId-CtNp109T.js";import{c as x}from"./getPseudoElementBounds-CRlxTrfr.js";import{H as S,V as C,z as w}from"./index-CXR0dKJj.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./DialogTitle-ChNkcIa6.js";var N=class extends d{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),p(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??S();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){g.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},P=e(t(),1);function F(e,t){let n=C(t),[r]=P.useState(()=>new N(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(g.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((e,t)=>{r.mutate(e,t).catch(m)},[r]);if(i.error&&f(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var I=P.forwardRef(function(e,t){let{render:n,className:r,disabled:o=!1,nativeButton:l=!0,id:u,payload:d,handle:f,...p}=e,m=E(!0),h=f?.store??m?.store;if(!h)throw Error(c(79));let g=b(u),S=h.useState(`floatingRootContext`),C=h.useState(`isOpenedByTrigger`,g),w=P.useRef(null),{registerTrigger:T,isMountedByThisTrigger:D}=_(g,w,h,{payload:d}),{getButtonProps:O,buttonRef:k}=a({disabled:o,native:l}),A=y([x(S,{enabled:S!=null})]),j=P.useMemo(()=>({disabled:o,open:C}),[o,C]),M=h.useState(`triggerProps`,D);return i(`button`,e,{state:j,ref:[k,t,T,w],props:[A.getReferenceProps(),M,{[s]:``,id:g},p,O],stateAttributesMapping:v})}),L=r(),R=n();function z(e){let t=(0,L.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(O,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function B(e){let t=(0,L.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(I,{"data-slot":`dialog-trigger`,...n}),t[2]=n,t[3]=r),r}function V(e){let t=(0,L.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(A,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function H(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(j,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function U(e){let t=(0,L.c)(20),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:r,children:n,showCloseButton:s,overlayClassName:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=s===void 0?!0:s,d;t[6]===i?d=t[7]:(d=(0,R.jsx)(H,{className:i}),t[6]=i,t[7]=d);let f;t[8]===r?f=t[9]:(f=l(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,r),t[8]=r,t[9]=f);let p;t[10]===c?p=t[11]:(p=c&&(0,R.jsxs)(k,{"data-slot":`dialog-close`,render:(0,R.jsx)(o,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,R.jsx)(u,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[10]=c,t[11]=p);let m;t[12]!==n||t[13]!==a||t[14]!==f||t[15]!==p?(m=(0,R.jsxs)(D,{"data-slot":`dialog-content`,className:f,...a,children:[n,p]}),t[12]=n,t[13]=a,t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;return t[17]!==d||t[18]!==m?(h=(0,R.jsxs)(V,{children:[d,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19],h}function W(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`gap-2 flex flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function G(e){let t=(0,L.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?!1:a,c;t[5]===r?c=t[6]:(c=l(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=c);let u;t[7]===s?u=t[8]:(u=s&&(0,R.jsx)(k,{render:(0,R.jsx)(o,{variant:`outline`}),children:`Close`}),t[7]=s,t[8]=u);let d;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==u?(d=(0,R.jsxs)(`div`,{"data-slot":`dialog-footer`,className:c,...i,children:[n,u]}),t[9]=n,t[10]=i,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function K(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`text-sm leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(M,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function q(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(T,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function J(e){let t=(0,L.c)(27),{mutationFn:n,queryKey:r,optimisticUpdate:i,onSuccess:a,onError:o,successMessage:s,errorMessage:c}=e,l=C(),u;t[0]!==c||t[1]!==o||t[2]!==l||t[3]!==r?(u=(e,t,n)=>{n?.previousData!==void 0&&l.setQueryData(r,n.previousData);let i=c??(e.message?e.message:`Operation failed`);w.error(i),o?.(e,t)},t[0]=c,t[1]=o,t[2]=l,t[3]=r,t[4]=u):u=t[4];let d;t[5]!==i||t[6]!==l||t[7]!==r?(d=async e=>{await l.cancelQueries({queryKey:r});let t=l.getQueryData(r);return t!==void 0&&l.setQueryData(r,t=>t===void 0?t:i(t,e)),{previousData:t}},t[5]=i,t[6]=l,t[7]=r,t[8]=d):d=t[8];let f;t[9]!==l||t[10]!==r?(f=()=>{l.invalidateQueries({queryKey:r})},t[9]=l,t[10]=r,t[11]=f):f=t[11];let p;t[12]!==a||t[13]!==s?(p=(e,t)=>{s&&w.success(s),a?.(e,t)},t[12]=a,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==u||t[17]!==d||t[18]!==f||t[19]!==p?(m={mutationFn:n,onError:u,onMutate:d,onSettled:f,onSuccess:p},t[15]=n,t[16]=u,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20];let h=F(m),g=h.mutate,_=h.mutateAsync,v;return t[21]!==h.isError||t[22]!==h.isPending||t[23]!==h.isSuccess||t[24]!==g||t[25]!==_?(v={isError:h.isError,isPending:h.isPending,isSuccess:h.isSuccess,mutate:g,mutateAsync:_},t[21]=h.isError,t[22]=h.isPending,t[23]=h.isSuccess,t[24]=g,t[25]=_,t[26]=v):v=t[26],v}function Y({mutationFn:e,queryKey:t,itemId:n,getId:r=e=>e.id,onSuccess:i,onError:a,successMessage:o,errorMessage:s=`Failed to delete`}){return J({errorMessage:s,mutationFn:async()=>e(),onError:a?e=>a(e):void 0,onSuccess:i?e=>i(e):void 0,optimisticUpdate:e=>e.filter(e=>r(e)!==n),queryKey:t,successMessage:o})}function X(e){let t=(0,L.c)(10),{mutationFn:n,queryKey:r,createOptimisticItem:i,onSuccess:a,onError:o,successMessage:s,errorMessage:c}=e,l;t[0]===i?l=t[1]:(l=(e,t)=>[...e,i(t)],t[0]=i,t[1]=l);let u;return t[2]!==c||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r||t[7]!==s||t[8]!==l?(u={errorMessage:c,mutationFn:n,onError:o,onSuccess:a,optimisticUpdate:l,queryKey:r,successMessage:s},t[2]=c,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=s,t[8]=l,t[9]=u):u=t[9],J(u)}export{q as a,K as c,U as i,B as l,Y as n,G as o,z as r,W as s,X as t,F as u};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{A as r,C as i,E as a,O as o,S as s,T as c,_ as l,b as u,c as d,g as f,k as p,n as m,o as h,s as g,w as _}from"./query-CY--GYXb.js";import{V as v}from"./index-CXR0dKJj.js";var y=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=g(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof i(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!c(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&C(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||_(this.options.staleTime,this.#t)!==_(t.staleTime,this.#t))&&this.#g();let a=this.#_();r&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#g(){this.#b();let e=_(this.options.staleTime,this.#t);if(f||this.#r.isStale||!l(e))return;let t=o(this.#r.dataUpdatedAt,e)+1;this.#d=p.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(f||i(this.options.enabled,this.#t)===!1||!l(this.#p)||this.#p===0)&&(this.#f=p.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(p.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(p.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,a=this.#r,o=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&x(e,t),o=i&&C(e,n,t,r);(a||o)&&(d={...d,...m(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:h,errorUpdatedAt:_,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=s(a?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(a&&p===o?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=s(a?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(h=this.#s,p=this.#l,_=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:_,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:i(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,i=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{i(this.#o=O.promise=g())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||O.data!==o.value)&&a();break;case`rejected`:(!r||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!c(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){h.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return i(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,n){if(i(t.enabled,e)!==!1&&_(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&w(e,t)}return!1}function C(e,t,n,r){return(e!==t||i(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&w(e,n)}function w(e,t){return i(t.enabled,e)!==!1&&e.isStaleByTime(_(t.staleTime,e))}function T(e,t){return!c(e.getCurrentResult(),t)}var E=e(t(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider,n();function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?a(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||a(n,[e.error,r])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=j(),a=v(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,I(o),M(o,i,s),N(i);let c=!a.getQueryCache().get(o.queryHash),[l]=E.useState(()=>new t(a,o)),d=l.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(e=>{let t=p?l.subscribe(h.batchCalls(e)):u;return l.updateResult(),t},[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(o)},[o,l]),R(o,d))throw z(o,l,i);if(P({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!f&&L(d,r)&&(c?z(o,l,i):s?.promise)?.catch(u).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?d:l.trackResult(d)}export{F as n,y as r,B as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{f as n}from"./createReactComponent-_L2mp4Ui.js";var r=e(t()),i={...r},a=0;function o(e,t=`mui`){let[n,i]=r.useState(e),o=e||n;return r.useEffect(()=>{n??(a+=1,i(`${t}-${a}`))},[n,t]),o}var s=i.useId;function c(e,t){if(s!==void 0){let n=s();return e??(t?`${t}-${n}`:n)}return o(e,t)}var l=`none`,u=`trigger-press`,d=`trigger-hover`,f=`trigger-focus`,p=`outside-press`,m=`item-press`,h=`close-press`,g=`focus-out`,_=`escape-key`,v=`list-navigation`,y=`cancel-open`,b=`sibling-open`,x=`disabled`,S=`imperative-action`,C=`window-resize`;function w(e,t,r,i){let a=!1,o=!1,s=i??n;return{reason:e,event:t??new Event(`base-ui`),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:r,...s}}function T(e){return c(e,`base-ui`)}export{C as _,x as a,S as c,l as d,p as f,u as g,d as h,h as i,m as l,f as m,w as n,_ as o,b as p,y as r,g as s,T as t,v as u,c as v};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{h as n,v as r}from"./createReactComponent-_L2mp4Ui.js";import{i}from"./CompositeList-DbbDW_rT.js";var a=e(t());function o(e={}){let{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:s}=r(),{ref:c,index:l}=i(e),u=o===l,d=a.useRef(null),f=n(c,d);return{compositeProps:a.useMemo(()=>({tabIndex:u?0:-1,onFocus(){s(l)},onMouseMove(){let e=d.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!u&&!n&&e.focus()}}),[u,s,l,t]),compositeRef:f,index:l}}export{o as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";var n=e(t());function r({controlled:e,default:t,name:r,state:i=`value`}){let{current:a}=n.useRef(e!==void 0),[o,s]=n.useState(t);return[a?e:o,n.useCallback(e=>{a||s(e)},[])]}export{r as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./useBaseQuery-CO5Q8xm4.js";function n(n,r){return t(n,e,r)}export{n as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./createReactComponent-_L2mp4Ui.js";function t(t){return e(t.defaultTagName??`div`,t,t)}export{t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n}from"./jsx-runtime-DG_AJzB_.js";function r(e){return e[e.length-1]}function i(e){return typeof e==`function`}function a(e,t){return i(e)?e(t):e}var o=Object.prototype.hasOwnProperty;function s(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=t,i=d(e)&&d(r);if(!i&&!(l(e)&&l(r)))return r;let a=i?e:c(e);if(!a)return r;let u=i?r:c(r);if(!u)return r;let f=a.length,p=u.length,m=i?Array(p):{},h=0;for(let t=0;t<p;t++){let a=i?t:u[t],c=e[a],l=r[a];if(c===l){m[a]=c,(i?t<f:o.call(e,a))&&h++;continue}if(c===null||l===null||typeof c!=`object`||typeof l!=`object`){m[a]=l;continue}let d=s(c,l,n+1);m[a]=d,d===c&&h++}return f===p&&h===f?e:m}function c(e){let t=[],n=Object.getOwnPropertyNames(e);for(let r of n){if(!Object.prototype.propertyIsEnumerable.call(e,r))return!1;t.push(r)}let r=Object.getOwnPropertySymbols(e);for(let n of r){if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;t.push(n)}return t}function l(e){if(!u(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!u(n)||!n.hasOwnProperty(`isPrototypeOf`))}function u(e){return Object.prototype.toString.call(e)===`[object Object]`}function d(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function f(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!f(e[r],t[r],n))return!1;return!0}if(l(e)&&l(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!f(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!f(e[o],t[o],n)))return!1;return i===a}return!1}function p(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function m(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function h(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function g(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function _(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return g(t)}var v=[`http:`,`https:`,`mailto:`,`tel:`];function y(e){if(!e)return!1;try{let t=new URL(e);return!v.includes(t.protocol)}catch{return!1}}var b={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},x=/[&><\u2028\u2029]/g;function S(e){return e.replace(x,e=>b[e])}function ee(e,t){if(!e)return e;let n=t?RegExp(`${t.join(`|`)}`,`gi`):/%25|%5C/gi,r=0,i=``,a;for(;(a=n.exec(e))!==null;)i+=_(e.slice(r,a.index))+a[0],r=n.lastIndex;return i+=_(r?e.slice(r):e),i.startsWith(`//`)&&(i=`/`+i.replace(/^\/+/,``)),i}var te=!0,C=`Invariant failed`;function w(e,t){if(!e){if(te)throw Error(C);var n=typeof t==`function`?t():t,r=n?`${C}: ${n}`:C;throw Error(r)}}function T(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var E=4,ne=5,D=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,O=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,re=/^([^{]*)\{\$\}([^}]*)$/;function k(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.match(re);if(o){let r=o[1].length;return n[0]=2,n[1]=t+r,n[2]=t+r+1,n[3]=t+r+2,n[4]=t+r+3,n[5]=e.length,n}let s=a.match(O);if(s){let e=s[1],r=s[2],a=s[3],o=e.length;return n[0]=3,n[1]=t+o,n[2]=t+o+3,n[3]=t+o+3+r.length,n[4]=i-a.length,n[5]=i,n}let c=a.match(D);if(c){let e=c[1],r=c[2],a=c[3],o=e.length;return n[0]=1,n[1]=t+o,n[2]=t+o+2,n[3]=t+o+2+r.length,n[4]=i-a.length,n[5]=i,n}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function A(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=k(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=N(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=N(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=P(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=P(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=P(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=N(n.fullPath??n.from);e.kind=ne,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=N(n.fullPath??n.from);e.kind=E,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)A(e,t,r,s,i,a,o)}function j(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function M(e){if(e.pathless)for(let t of e.pathless)M(t);if(e.static)for(let t of e.static.values())M(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())M(t);if(e.dynamic?.length){e.dynamic.sort(j);for(let t of e.dynamic)M(t)}if(e.optional?.length){e.optional.sort(j);for(let t of e.optional)M(t)}if(e.wildcard?.length){e.wildcard.sort(j);for(let t of e.wildcard)M(t)}}function N(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function P(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function ie(e,t){let n=N(`/`),r=new Uint16Array(6);for(let t of e)A(!1,r,t,1,n,0);M(n),t.masksTree=n,t.flatCache=T(1e3)}function ae(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=F(e,t.masksTree);return t.flatCache.set(e,r),r}function oe(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=N(`/`),A(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),F(r,o,n)}function se(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=F(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ue(a.route)),t.matchCache.set(r,a),a}function ce(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function le(e,t=!1,n){let r=N(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return A(t,i,e,1,r,0,e=>{if(n?.(e,s),w(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=ce(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),M(r),{processedTree:{segmentTree:r,singleCache:T(1e3),matchCache:T(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function F(e,t,n=!1){let r=e.split(`/`),i=fe(e,r,t,n);if(!i)return null;let[a]=I(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function I(e,t,n){let r=de(n.node),i=null,a={},o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0;for(;s<r.length;o++,s++,c++){let l=r[s],u=t[o],d=c;if(u&&(c+=u.length),l.kind===1){i??=n.node.fullPath.split(`/`);let e=i[s],t=l.prefix?.length??0;if(e.charCodeAt(t)===123){let n=l.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=u.substring(t,u.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(u)}}else if(l.kind===3){if(n.skipped&1<<s){o--;continue}i??=n.node.fullPath.split(`/`);let e=i[s],t=l.prefix?.length??0,r=l.suffix?.length??0,c=e.substring(t+3,e.length-r-1),d=l.suffix||l.prefix?u.substring(t,u.length-r):u;d&&(a[c]=decodeURIComponent(d))}else if(l.kind===2){let t=l,n=e.substring(d+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c}]}function ue(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function de(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function fe(e,t,n,i){if(e===`/`&&n.index)return{node:n.index,skipped:0};let a=!r(t),o=a&&e!==`/`,s=t.length-(a?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],l=null,u=null,d=null;for(;c.length;){let n=c.pop(),{node:r,index:a,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(r.skipOnParamError){if(!L(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}i&&r.route&&r.kind!==E&&R(u,n)&&(u=n);let b=a===s;if(b&&(r.route&&!o&&R(d,n)&&(d=n),!r.optional&&!r.wildcard&&!r.index&&!r.pathless))continue;let x=b?void 0:t[a],S;if(b&&r.index){let n={node:r.index,index:a,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(r.index.skipOnParamError&&!L(e,t,n))continue;if(m===s&&!h&&!g&&!f)return n;R(d,n)&&(d=n)}if(r.wildcard&&R(l,n))for(let n of r.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(a).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let o={node:n,index:s,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!L(e,t,o))){l=o;break}}if(r.optional){let e=f|1<<p,t=p+1;for(let n=r.optional.length-1;n>=0;n--){let i=r.optional[n];c.push({node:i,index:a,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=r.optional.length-1;e>=0;e--){let n=r.optional[e],{prefix:i,suffix:o}=n;if(i||o){let e=n.caseSensitive?x:S??=x.toLowerCase();if(i&&!e.startsWith(i)||o&&!e.endsWith(o))continue}c.push({node:n,index:a+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&r.dynamic&&x)for(let e=r.dynamic.length-1;e>=0;e--){let t=r.dynamic[e],{prefix:n,suffix:i}=t;if(n||i){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||i&&!e.endsWith(i))continue}c.push({node:t,index:a+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&r.staticInsensitive){let e=r.staticInsensitive.get(S??=x.toLowerCase());e&&c.push({node:e,index:a+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&r.static){let e=r.static.get(x);e&&c.push({node:e,index:a+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(r.pathless){let e=p+1;for(let t=r.pathless.length-1;t>=0;t--){let n=r.pathless[t];c.push({node:n,index:a,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(d&&l)return R(l,d)?d:l;if(d)return d;if(l)return l;if(i&&u){let n=u.index;for(let e=0;e<u.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return u.rawParams??={},u.rawParams[`**`]=decodeURIComponent(r),u}return null}function L(e,t,n){try{let[r,i]=I(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function R(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===E)>(e.node.kind===E)||t.node.kind===E==(e.node.kind===E)&&t.depth>e.depth))):!0}function z(e){return B(e.filter(e=>e!==void 0).join(`/`))}function B(e){return e.replace(/\/{2,}/g,`/`)}function V(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function H(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function pe(e){return H(V(e))}function U(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function me(e,t,n){return U(e,n)===U(t,n)}function he({base:e,to:t,trailingSlash:n=`never`,cache:i}){let a=t.startsWith(`/`),o=!a&&t===`.`,s;if(i){s=a?t:o?e:e+`\0`+t;let n=i.get(s);if(n)return n}let c;if(o)c=e.split(`/`);else if(a)c=t.split(`/`);else{for(c=e.split(`/`);c.length>1&&r(c)===``;)c.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&c.push(r):c=[r]:r===`..`?c.pop():r===`.`||c.push(r)}}c.length>1&&(r(c)===``?n===`never`&&c.pop():n===`always`&&c.push(``));let l,u=``;for(let e=0;e<c.length;e++){e>0&&(u+=`/`);let t=c[e];if(!t)continue;l=k(t,0,l);let n=l[0];if(n===0){u+=t;continue}let r=l[5],i=t.substring(0,l[1]),a=t.substring(l[4],r),o=t.substring(l[2],l[3]);n===1?u+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?u+=i||a?`${i}{$}${a}`:`$`:u+=`${i}{-$${o}}${a}`}u=B(u);let d=u||`/`;return s&&i&&i.set(s,d),d}function W(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?encodeURI(r):_e(r,n):r}function ge({path:e,params:t,decodeCharMap:n}){let r=!1,i={};if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:i,isMissingParams:r};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:i,isMissingParams:r};let a=e.length,o=0,s,c=``;for(;o<a;){let a=o;s=k(e,a,s);let l=s[5];if(o=l+1,a===l)continue;let u=s[0];if(u===0){c+=`/`+e.substring(a,l);continue}if(u===2){let o=t._splat;i._splat=o,i[`*`]=o;let u=e.substring(a,s[1]),d=e.substring(s[4],l);if(!o){r=!0,(u||d)&&(c+=`/`+u+d);continue}let f=W(`_splat`,t,n);c+=`/`+u+f+d;continue}if(u===1){let o=e.substring(s[2],s[3]);!r&&!(o in t)&&(r=!0),i[o]=t[o];let u=e.substring(a,s[1]),d=e.substring(s[4],l),f=W(o,t,n)??`undefined`;c+=`/`+u+f+d;continue}if(u===3){let r=e.substring(s[2],s[3]),o=t[r];if(o==null)continue;i[r]=o;let u=e.substring(a,s[1]),d=e.substring(s[4],l),f=W(r,t,n)??``;c+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(c+=`/`),{usedParams:i,interpolatedPath:c||`/`,isMissingParams:r}}function _e(e,t){let n=encodeURIComponent(e);if(t)for(let[e,r]of t)n=n.replaceAll(e,r);return n}var ve=!0;function G(e,t){if(!ve){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var ye=n((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),K=n(((e,t)=>{t.exports=ye()})),q=n((e=>{var n=t(),r=K();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),J=n(((e,t)=>{t.exports=q()})),be=J();function xe(e,t=e=>e,n={}){let r=n.equal??Se;return(0,be.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function Se(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Y(e);if(n.length!==Y(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Y(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var X=e(t(),1),Z=X.createContext(null);function Q(){return typeof document>`u`?Z:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Z,Z)}function $(e){let t=X.useContext(Q());return G(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}function Ce(e){let t=$({warn:e?.router===void 0}),n=e?.router||t,r=(0,X.useRef)(void 0);return xe(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=s(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}export{m as A,v as C,S as D,f as E,r as M,s as N,a as O,w as S,ee as T,se as _,K as a,le as b,me as c,U as d,he as f,ae as g,H as h,J as i,h as j,y as k,ge as l,V as m,$ as n,G as o,pe as p,Q as r,B as s,Ce as t,z as u,oe as v,p as w,T as x,ie as y};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./useBaseQuery-CO5Q8xm4.js";function r(r,i){return n({...r,enabled:!0,suspense:!0,throwOnError:e,placeholderData:void 0},t,i)}export{r as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{S as n,x as r}from"./createReactComponent-_L2mp4Ui.js";var i=e(t());function a(e,t){let a=i.useRef(e),o=n(t);r(()=>{a.current!==e&&o(a.current)},[e,o]),r(()=>{a.current=e},[e])}export{a as t};
@@ -0,0 +1 @@
1
+ function e(t){var n,r,i=``;if(typeof t==`string`||typeof t==`number`)i+=t;else if(typeof t==`object`)if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=` `),i+=r)}else for(r in t)t[r]&&(i&&(i+=` `),i+=r);return i}function t(){for(var t,n,r=0,i=``,a=arguments.length;r<a;r++)(t=arguments[r])&&(n=e(t))&&(i&&(i+=` `),i+=n);return i}var n=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},r=(e,t)=>({classGroupId:e,validator:t}),i=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),a=`-`,o=[],s=`arbitrary..`,c=e=>{let t=d(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return u(e);let n=e.split(a);return l(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=i[e],a=r[e];return t?a?n(a,t):t:a||o}return r[e]||o}}},l=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=l(e,t+1,i);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(a):e.slice(t).join(a),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},u=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?s+r:void 0})(),d=e=>{let{theme:t,classGroups:n}=e;return f(n,t)},f=(e,t)=>{let n=i();for(let r in e){let i=e[r];p(i,n,r,t)}return n},p=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];m(i,t,n,r)}},m=(e,t,n,r)=>{if(typeof e==`string`){h(e,t,n);return}if(typeof e==`function`){g(e,t,n,r);return}_(e,t,n,r)},h=(e,t,n)=>{let r=e===``?t:v(t,e);r.classGroupId=n},g=(e,t,n,i)=>{if(y(e)){p(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(r(n,e))},_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];p(o,v(t,a),n,r)}},v=(e,t)=>{let n=e,r=t.split(a),o=r.length;for(let e=0;e<o;e++){let t=r[e],a=n.nextPart.get(t);a||(a=i(),n.nextPart.set(t,a)),n=a}return n},y=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,b=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},x=`!`,S=`:`,C=[],w=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),T=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===S){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(x)?(c=s.slice(0,-1),l=!0):s.startsWith(x)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return w(t,l,c,u)};if(t){let e=t+S,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):w(C,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},E=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ee=e=>({cache:b(e.cacheSize),parseClassName:T(e),sortModifiers:E(e),...c(e)}),D=/\s+/,te=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(D),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+x:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},O=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=k(n))&&(i&&(i+=` `),i+=r);return i},k=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=k(e[r]))&&(n&&(n+=` `),n+=t);return n},A=(e,...t)=>{let n,r,i,a,o=o=>(n=ee(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=te(e,n);return i(e,a),a};return a=o,(...e)=>a(O(...e))},j=[],M=e=>{let t=t=>t[e]||j;return t.isThemeGetter=!0,t},N=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,P=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ne=/^\d+\/\d+$/,re=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,F=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,I=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,L=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z=e=>ne.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),ie=e=>e.endsWith(`%`)&&B(e.slice(0,-1)),H=e=>re.test(e),ae=()=>!0,oe=e=>F.test(e)&&!I.test(e),U=()=>!1,se=e=>L.test(e),W=e=>R.test(e),ce=e=>!G(e)&&!J(e),le=e=>Z(e,ve,U),G=e=>N.test(e),K=e=>Z(e,ye,oe),ue=e=>Z(e,be,B),de=e=>Z(e,$,U),fe=e=>Z(e,_e,W),q=e=>Z(e,Se,se),J=e=>P.test(e),Y=e=>Q(e,ye),pe=e=>Q(e,xe),me=e=>Q(e,$),he=e=>Q(e,ve),ge=e=>Q(e,_e),X=e=>Q(e,Se,!0),Z=(e,t,n)=>{let r=N.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=P.exec(e);return r?r[1]?t(r[1]):n:!1},$=e=>e===`position`||e===`percentage`,_e=e=>e===`image`||e===`url`,ve=e=>e===`length`||e===`size`||e===`bg-size`,ye=e=>e===`length`,be=e=>e===`number`,xe=e=>e===`family-name`,Se=e=>e===`shadow`,Ce=A(()=>{let e=M(`color`),t=M(`font`),n=M(`text`),r=M(`font-weight`),i=M(`tracking`),a=M(`leading`),o=M(`breakpoint`),s=M(`container`),c=M(`spacing`),l=M(`radius`),u=M(`shadow`),d=M(`inset-shadow`),f=M(`text-shadow`),p=M(`drop-shadow`),m=M(`blur`),h=M(`perspective`),g=M(`aspect`),_=M(`ease`),v=M(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,G,c],T=()=>[z,`full`,`auto`,...w()],E=()=>[V,`none`,`subgrid`,J,G],ee=()=>[`auto`,{span:[`full`,V,J,G]},V,J,G],D=()=>[V,`auto`,J,G],te=()=>[`auto`,`min`,`max`,`fr`,J,G],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[z,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,J,G],P=()=>[...b(),me,de,{position:[J,G]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,he,le,{size:[J,G]}],F=()=>[ie,Y,K],I=()=>[``,`none`,`full`,l,J,G],L=()=>[``,B,Y,K],R=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[B,ie,me,de],se=()=>[``,`none`,m,J,G],W=()=>[`none`,B,J,G],Z=()=>[`none`,B,J,G],Q=()=>[B,J,G],$=()=>[z,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[H],breakpoint:[H],color:[ae],container:[H],"drop-shadow":[H],ease:[`in`,`out`,`in-out`],font:[ce],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[H],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[H],shadow:[H],spacing:[`px`,B],text:[H],"text-shadow":[H],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,z,G,J,g]}],container:[`container`],columns:[{columns:[B,G,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[V,`auto`,J,G]}],basis:[{basis:[z,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[B,z,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,B,J,G]}],shrink:[{shrink:[``,B,J,G]}],order:[{order:[V,`first`,`last`,`none`,J,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Y,K]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,J,ue]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ie,G]}],"font-family":[{font:[pe,G,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,G]}],"line-clamp":[{"line-clamp":[B,`none`,J,ue]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,J,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...R(),`wavy`]}],"text-decoration-thickness":[{decoration:[B,`from-font`,`auto`,J,K]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[B,`auto`,J,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},V,J,G],radial:[``,J,G],conic:[V,J,G]},ge,fe]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":L()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...R(),`hidden`,`none`]}],"divide-style":[{divide:[...R(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...R(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[B,J,G]}],"outline-w":[{outline:[``,B,Y,K]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,X,q]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,X,q]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:L()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[B,K]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,X,q]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[B,J,G]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[J,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,G]}],filter:[{filter:[``,`none`,J,G]}],blur:[{blur:se()}],brightness:[{brightness:[B,J,G]}],contrast:[{contrast:[B,J,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,X,q]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,B,J,G]}],"hue-rotate":[{"hue-rotate":[B,J,G]}],invert:[{invert:[``,B,J,G]}],saturate:[{saturate:[B,J,G]}],sepia:[{sepia:[``,B,J,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,G]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[B,J,G]}],"backdrop-contrast":[{"backdrop-contrast":[B,J,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,B,J,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,J,G]}],"backdrop-invert":[{"backdrop-invert":[``,B,J,G]}],"backdrop-opacity":[{"backdrop-opacity":[B,J,G]}],"backdrop-saturate":[{"backdrop-saturate":[B,J,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,B,J,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[B,`initial`,J,G]}],ease:[{ease:[`linear`,`initial`,_,J,G]}],delay:[{delay:[B,J,G]}],animate:[{animate:[`none`,v,J,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:W()}],"rotate-x":[{"rotate-x":W()}],"rotate-y":[{"rotate-y":W()}],"rotate-z":[{"rotate-z":W()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":[`scale-3d`],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[J,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,G]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[B,Y,K,ue]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function we(...e){return Ce(t(e))}export{t as n,we as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{a as n,i as r}from"./useRouterState-DpT8luFk.js";var i=e(t()),a=i.useLayoutEffect;function o(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global}function s(){let e=o();if(e.__xstate__)return e.__xstate__}var c=e=>{if(typeof window>`u`)return;let t=s();t&&t.register(e)},l=class{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}},u=``,d=`#`,f=`*`,p=`xstate.init`,m=`xstate.stop`;function ee(e,t){return{type:`xstate.after.${e}.${t}`}}function h(e,t){return{type:`xstate.done.state.${e}`,output:t}}function te(e,t){return{type:`xstate.done.actor.${e}`,output:t,actorId:e}}function ne(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function re(e){return{type:p,input:e}}function g(e){setTimeout(()=>{throw e})}var ie=typeof Symbol==`function`&&Symbol.observable||`@@observable`;function ae(e,t){let n=oe(e),r=oe(t);return typeof r==`string`?typeof n==`string`?r===n:!1:typeof n==`string`?n in r:Object.keys(n).every(e=>e in r?ae(n[e],r[e]):!1)}function _(e){if(de(e))return e;let t=[],n=``;for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n=``;continue}n+=e[r]}return t.push(n),t}function oe(e){return ct(e)?e.value:typeof e==`string`?se(_(e)):e}function se(e){if(e.length===1)return e[0];let t={},n=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)n[e[t]]=e[t+1];else{let r=n;n={},r[e[t]]=n}return t}function ce(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i];n[a]=t(e[a],a,e,i)}return n}function le(e){return de(e)?e:[e]}function v(e){return e===void 0?[]:le(e)}function ue(e,t,n,r){return typeof e==`function`?e({context:t,event:n,self:r}):e}function de(e){return Array.isArray(e)}function fe(e){return e.type.startsWith(`xstate.error.actor`)}function y(e){return le(e).map(e=>e===void 0||typeof e==`string`?{target:e}:e)}function pe(e){if(!(e===void 0||e===u))return v(e)}function b(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}function me(e,t){return`${t}.${e}`}function x(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,r,i]=n,a=e.getStateNodeById(i).config.invoke;return(Array.isArray(a)?a[r]:a).src}function he(e,t){if(t===e||t===f)return!0;if(!t.endsWith(`.*`))return!1;let n=t.split(`.`),r=e.split(`.`);for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t===`*`)return e===n.length-1;if(t!==i)return!1}return!0}function ge(e,t){return`${e.sessionId}.${t}`}var _e=0;function ve(e,t){let n=new Map,r=new Map,i=new WeakMap,a=new Set,o={},{clock:s,logger:c}=t,l={schedule:(e,t,n,r,i=Math.random().toString(36).slice(2))=>{let a={source:e,target:t,event:n,delay:r,id:i,startedAt:Date.now()},c=ge(e,i);u._snapshot._scheduledEvents[c]=a,o[c]=s.setTimeout(()=>{delete o[c],delete u._snapshot._scheduledEvents[c],u._relay(e,t,n)},r)},cancel:(e,t)=>{let n=ge(e,t),r=o[n];delete o[n],delete u._snapshot._scheduledEvents[n],r!==void 0&&s.clearTimeout(r)},cancelAll:e=>{for(let t in u._snapshot._scheduledEvents){let n=u._snapshot._scheduledEvents[t];n.source===e&&l.cancel(e,n.id)}}},u={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${_e++}`,_register:(e,t)=>(n.set(e,t),e),_unregister:e=>{n.delete(e.sessionId);let t=i.get(e);t!==void 0&&(r.delete(t),i.delete(e))},get:e=>r.get(e),getAll:()=>Object.fromEntries(r.entries()),_set:(e,t)=>{let n=r.get(e);if(n&&n!==t)throw Error(`Actor with system ID '${e}' already exists.`);r.set(e,t),i.set(t,e)},inspect:e=>{let t=b(e);return a.add(t),{unsubscribe(){a.delete(t)}}},_sendInspectionEvent:t=>{if(!a.size)return;let n={...t,rootId:e.sessionId};a.forEach(e=>e.next?.(n))},_relay:(e,t,n)=>{u._sendInspectionEvent({type:`@xstate.event`,sourceRef:e,actorRef:t,event:n}),t._send(n)},scheduler:l,getSnapshot:()=>({_scheduledEvents:{...u._snapshot._scheduledEvents}}),start:()=>{let e=u._snapshot._scheduledEvents;u._snapshot._scheduledEvents={};for(let t in e){let{source:n,target:r,event:i,delay:a,id:o}=e[t];l.schedule(n,r,i,a,o)}},_clock:s,_logger:c};return u}var S=!1,C=function(e){return e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`,e}({}),ye={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1},be=class{constructor(e,t){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new l(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=C.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let n={...ye,...t},{clock:r,logger:i,parent:a,syncSnapshot:o,id:s,systemId:c,inspect:u}=n;this.system=a?a.system:ve(this,{clock:r,logger:i}),u&&!a&&this.system.inspect(b(u)),this.sessionId=this.system._bookId(),this.id=s??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=a,this._syncSnapshot=o,this.options=n,this.src=n.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),n=this.eventListeners.get(`*`);if(!t&&!n)return;let r=[...t?t.values():[],...n?n.values():[]];for(let t of r)try{t(e)}catch(e){g(e)}},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:`@xstate.action`,actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=S;try{S=!0,e.exec(e.info,e.params)}finally{S=t}};this._processingStatus===C.Running?t():this._deferred.push(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:`@xstate.actor`,actorRef:this}),c&&(this.systemId=c,this.system._set(c,this)),this._initState(t?.snapshot??t?.state),c&&this._snapshot.status!==`active`&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:`error`,output:void 0,error:e}}}update(e,t){this._snapshot=e;let n;for(;n=this._deferred.shift();)try{n()}catch(t){this._deferred.length=0,this._snapshot={...e,status:`error`,error:t}}switch(this._snapshot.status){case`active`:for(let t of this.observers)try{t.next?.(e)}catch(e){g(e)}break;case`done`:for(let t of this.observers)try{t.next?.(e)}catch(e){g(e)}this._stopProcedure(),this._complete(),this._doneEvent=te(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case`error`:this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:`@xstate.snapshot`,actorRef:this,event:t,snapshot:e})}subscribe(e,t,n){let r=b(e,t,n);if(this._processingStatus!==C.Stopped)this.observers.add(r);else switch(this._snapshot.status){case`done`:try{r.complete?.()}catch(e){g(e)}break;case`error`:{let e=this._snapshot.error;if(!r.error)g(e);else try{r.error(e)}catch(e){g(e)}break}}return{unsubscribe:()=>{this.observers.delete(r)}}}on(e,t){let n=this.eventListeners.get(e);n||(n=new Set,this.eventListeners.set(e,n));let r=t.bind(void 0);return n.add(r),{unsubscribe:()=>{n.delete(r)}}}select(e,t=Object.is){return{subscribe:n=>{let r=b(n),i=e(this.getSnapshot());return this.subscribe(n=>{let a=e(n);t(i,a)||(i=a,r.next?.(a))})},get:()=>e(this.getSnapshot())}}start(){if(this._processingStatus===C.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{e.status===`active`&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=C.Running;let e=re(this.options.input);switch(this.system._sendInspectionEvent({type:`@xstate.event`,sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case`done`:return this.update(this._snapshot,e),this;case`error`:return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(e){return this._snapshot={...this._snapshot,status:`error`,error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,n;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){n={err:e}}if(n){let{err:e}=n;this._snapshot={...this._snapshot,status:`error`,error:e},this._error(e);return}this.update(t,e),e.type===`xstate.stop`&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===C.Stopped?this:(this.mailbox.clear(),this._processingStatus===C.NotStarted?(this._processingStatus=C.Stopped,this):(this.mailbox.enqueue({type:m}),this))}stop(){if(this._parent)throw Error(`A non-root actor cannot be stopped directly.`);return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){g(e)}this.observers.clear(),this.eventListeners.clear()}_reportError(e){if(!this.observers.size){this._parent||g(e),this.eventListeners.clear();return}let t=!1;for(let n of this.observers){let r=n.error;t||=!r;try{r?.(e)}catch(e){g(e)}}this.observers.clear(),this.eventListeners.clear(),t&&g(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,ne(this.id,e))}_stopProcedure(){return this._processingStatus===C.Running?(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new l(this._process.bind(this)),this._processingStatus=C.Stopped,this.system._unregister(this),this):this}_send(e){this._processingStatus!==C.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:e}=this.options;e&&(typeof e==`function`?e:c)(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[ie](){return this}getSnapshot(){return this._snapshot}};function w(e,...[t]){return new be(e,t)}function xe(e,t,n,r,{sendId:i}){return[t,{sendId:typeof i==`function`?i(n,r):i},void 0]}function Se(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function T(e){function t(e,t){}return t.type=`xstate.cancel`,t.sendId=e,t.resolve=xe,t.execute=Se,t}function Ce(e,t,n,r,{id:i,systemId:a,src:o,input:s,syncSnapshot:c}){let l=typeof o==`string`?x(t.machine,o):o,u=typeof i==`function`?i(n):i,d,f;return l&&(f=typeof s==`function`?s({context:t.context,event:n.event,self:e.self}):s,d=w(l,{id:u,src:o,parent:e.self,syncSnapshot:c,systemId:a,input:f})),[Y(t,{children:{...t.children,[u]:d}}),{id:i,systemId:a,actorRef:d,src:o,input:f},void 0]}function we(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==C.Stopped&&t.start()})}function E(...[e,{id:t,systemId:n,input:r,syncSnapshot:i=!1}={}]){function a(e,t){}return a.type=`xstate.spawnChild`,a.id=t,a.systemId=n,a.src=e,a.input=r,a.syncSnapshot=i,a.resolve=Ce,a.execute=we,a}function Te(e,t,n,r,{actorRef:i}){let a=typeof i==`function`?i(n,r):i,o=typeof a==`string`?t.children[a]:a,s=t.children;return o&&(s={...s},delete s[o.id]),[Y(t,{children:s}),o,void 0]}function Ee(e,t){let n=t.getSnapshot();if(n&&`children`in n)for(let t of Object.values(n.children))Ee(e,t);e.system._unregister(t)}function De(e,t){if(t){if(Ee(e,t),t._processingStatus!==C.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function D(e){function t(e,t){}return t.type=`xstate.stopChild`,t.actorRef=e,t.resolve=Te,t.execute=De,t}function O(e,t,n,r){let{machine:i}=r,a=typeof e==`function`,o=a?e:i.implementations.guards[typeof e==`string`?e:e.type];if(!a&&!o)throw Error(`Guard '${typeof e==`string`?e:e.type}' is not implemented.'.`);if(typeof o!=`function`)return O(o,t,n,r);let s={context:t,event:n},c=a||typeof e==`string`?void 0:`params`in e?typeof e.params==`function`?e.params({context:t,event:n}):e.params:void 0;return`check`in o?o.check(r,s,o):o(s,c)}function Oe(e){return e.type===`atomic`||e.type===`final`}function k(e){return Object.values(e.states).filter(e=>e.type!==`history`)}function A(e,t){let n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function j(e){let t=new Set(e),n=Ae(t);for(let e of t)if(e.type===`compound`&&(!n.get(e)||!n.get(e).length))ze(e).forEach(e=>t.add(e));else if(e.type===`parallel`){for(let n of k(e))if(n.type!==`history`&&!t.has(n)){let e=ze(n);for(let n of e)t.add(n)}}for(let e of t){let n=e.parent;for(;n;)t.add(n),n=n.parent}return t}function ke(e,t){let n=t.get(e);if(!n)return{};if(e.type===`compound`){let e=n[0];if(e){if(Oe(e))return e.key}else return{}}let r={};for(let e of n)r[e.key]=ke(e,t);return r}function Ae(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function je(e,t){return ke(e,Ae(j(t)))}function M(e,t){return t.type===`compound`?k(t).some(t=>t.type===`final`&&e.has(t)):t.type===`parallel`?k(t).every(t=>M(e,t)):t.type===`final`}var N=e=>e[0]===d;function Me(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(e=>he(t,e)).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t))}function Ne(e){let t=e.config.after;if(!t)return[];let n=t=>{let n=ee(t,e.id),r=n.type;return e.entry.push(yt(n,{id:r,delay:t})),e.exit.push(T(r)),r};return Object.keys(t).flatMap(e=>{let r=t[e],i=typeof r==`string`?{target:r}:r,a=Number.isNaN(+e)?e:+e,o=n(a);return v(i).map(e=>({...e,event:o,delay:a}))}).map(t=>{let{delay:n}=t;return{...P(e,t.event,t),delay:n}})}function P(e,t,n){let r=pe(n.target),i=n.reenter??!1,a=Le(e,r),o={...n,actions:v(n.actions),guard:n.guard,target:a,source:e,reenter:i,eventType:t,toJSON:()=>({...o,source:`#${e.id}`,target:a?a.map(e=>`#${e.id}`):void 0})};return o}function Pe(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(n===``)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=e.config.on[n];t.set(n,y(r).map(t=>P(e,n,t)))}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,y(e.config.onDone).map(t=>P(e,n,t)))}for(let n of e.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;t.set(r,y(n.onDone).map(t=>P(e,r,t)))}if(n.onError){let r=`xstate.error.actor.${n.id}`;t.set(r,y(n.onError).map(t=>P(e,r,t)))}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;t.set(r,y(n.onSnapshot).map(t=>P(e,r,t)))}}for(let n of e.after){let e=t.get(n.eventType);e||(e=[],t.set(n.eventType,e)),e.push(n)}return t}function Fe(e){let t=[],n=r=>{Object.values(r).forEach(r=>{if(r.config.route&&r.config.id){let n=r.config.id,i=r.config.route.guard,a=(e,t)=>e.event.to===`#${n}`?i&&typeof i==`function`?i(e,t):!0:!1,o={...r.config.route,guard:a,target:`#${n}`};t.push(P(e,`xstate.route`,o))}r.states&&n(r.states)})};n(e.states),t.length>0&&e.transitions.set(`xstate.route`,t)}function Ie(e,t){let n=typeof t==`string`?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let r={source:e,actions:!t||typeof t==`string`?[]:v(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function Le(e,t){if(t!==void 0)return t.map(t=>{if(typeof t!=`string`)return t;if(N(t))return e.machine.getStateNodeById(t);let n=t[0]===`.`;if(n&&!e.parent)return L(e,t.slice(1));let r=n?e.key+t:t;if(e.parent)try{return L(e.parent,r)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}':\n${t.message}`)}else throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}function Re(e){let t=pe(e.config.target);return t?{target:t.map(t=>typeof t==`string`?L(e.parent,t):t)}:e.parent.initial}function F(e){return e.type===`history`}function ze(e){let t=Be(e);for(let n of t)for(let r of A(n,e))t.add(r);return t}function Be(e){let t=new Set;function n(e){if(!t.has(e)){if(t.add(e),e.type===`compound`)n(e.initial.target[0]);else if(e.type===`parallel`)for(let t of k(e))n(t)}}return n(e),t}function I(e,t){if(N(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let n=e.states[t];if(!n)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function L(e,t){if(typeof t==`string`&&N(t))try{return e.machine.getStateNodeById(t)}catch{}let n=_(t).slice(),r=e;for(;n.length;){let e=n.shift();if(!e.length)break;r=I(r,e)}return r}function R(e,t){if(typeof t==`string`){let n=e.states[t];if(!n)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,n]}let n=Object.keys(t),r=n.map(t=>I(e,t)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((n,r)=>{let i=I(e,r);if(!i)return n;let a=R(i,t[r]);return n.concat(a)},[]))}function Ve(e,t,n,r){let i=I(e,t).next(n,r);return!i||!i.length?e.next(n,r):i}function He(e,t,n,r){let i=Object.keys(t),a=z(I(e,i[0]),t[i[0]],n,r);return!a||!a.length?e.next(n,r):a}function Ue(e,t,n,r){let i=[];for(let a of Object.keys(t)){let o=t[a];if(!o)continue;let s=z(I(e,a),o,n,r);s&&i.push(...s)}return i.length?i:e.next(n,r)}function z(e,t,n,r){return typeof t==`string`?Ve(e,t,n,r):Object.keys(t).length===1?He(e,t,n,r):Ue(e,t,n,r)}function We(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>e.type===`history`)}function B(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function Ge(e,t){let n=new Set(e),r=new Set(t);for(let e of n)if(r.has(e))return!0;for(let e of r)if(n.has(e))return!0;return!1}function Ke(e,t,n){let r=new Set;for(let i of e){let e=!1,a=new Set;for(let o of r)if(Ge(H([i],t,n),H([o],t,n)))if(B(i.source,o.source))a.add(o);else{e=!0;break}if(!e){for(let e of a)r.delete(e);r.add(i)}}return Array.from(r)}function qe(e){let[t,...n]=e;for(let e of A(t,void 0))if(n.every(t=>B(t,e)))return e}function V(e,t){if(!e.target)return[];let n=new Set;for(let r of e.target)if(F(r))if(t[r.id])for(let e of t[r.id])n.add(e);else for(let e of V(Re(r),t))n.add(e);else n.add(r);return[...n]}function Je(e,t){let n=V(e,t);if(!n)return;if(!e.reenter&&n.every(t=>t===e.source||B(t,e.source)))return e.source;let r=qe(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function H(e,t,n){let r=new Set;for(let i of e)if(i.target?.length){let e=Je(i,n);i.reenter&&i.source===e&&r.add(e);for(let n of t)B(n,e)&&r.add(n)}return[...r]}function Ye(e,t){if(e.length!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Xe(e,t,n,r,i){return U([{target:[...Be(e)],source:e,reenter:!0,actions:[],eventType:null,toJSON:null}],t,n,r,!0,i)}function U(e,t,n,r,i,a){let o=[];if(!e.length)return[t,o];let s=n.actionExecutor;n.actionExecutor=e=>{o.push(e),s(e)};try{let s=new Set(t._nodes),c=t.historyValue,l=Ke(e,s,c),u=t;i||([u,c]=tt(u,r,n,l,s,c,a,n.actionExecutor)),u=K(u,r,n,l.flatMap(e=>e.actions),a,void 0),u=Qe(u,r,n,l,s,a,c,i);let d=[...s];u.status===`done`&&(u=K(u,r,n,d.sort((e,t)=>t.order-e.order).flatMap(e=>e.exit),a,void 0));try{return c===t.historyValue&&Ye(t._nodes,s)?[u,o]:[Y(u,{_nodes:d,historyValue:c}),o]}catch(e){throw e}}finally{n.actionExecutor=s}}function Ze(e,t,n,r,i){if(r.output===void 0)return;let a=h(i.id,i.output!==void 0&&i.parent?ue(i.output,e.context,t,n.self):void 0);return ue(r.output,e.context,a,n.self)}function Qe(e,t,n,r,i,a,o,s){let c=e,l=new Set,u=new Set;$e(r,o,u,l),s&&u.add(e.machine.root);let d=new Set;for(let e of[...l].sort((e,t)=>e.order-t.order)){i.add(e);let r=[];r.push(...e.entry);for(let t of e.invoke)r.push(E(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(u.has(e)){let t=e.initial.actions;r.push(...t)}if(c=K(c,t,n,r,a,e.invoke.map(e=>e.id)),e.type===`final`){let r=e.parent,o=r?.type===`parallel`?r:r?.parent,s=o||e;for(r?.type===`compound`&&a.push(h(r.id,e.output===void 0?void 0:ue(e.output,c.context,t,n.self)));o?.type===`parallel`&&!d.has(o)&&M(i,o);)d.add(o),a.push(h(o.id)),s=o,o=o.parent;if(o)continue;c=Y(c,{status:`done`,output:Ze(c,t,n,c.machine.root,s)})}}return c}function $e(e,t,n,r){for(let i of e){let e=Je(i,t);for(let a of i.target||[])!F(a)&&(i.source!==a||i.source!==e||i.reenter)&&(r.add(a),n.add(a)),W(a,t,n,r);let a=V(i,t);for(let o of a){let a=A(o,e);e?.type===`parallel`&&a.push(e),et(r,t,n,a,!i.source.parent&&i.reenter?void 0:e)}}}function W(e,t,n,r){if(F(e))if(t[e.id]){let i=t[e.id];for(let e of i)r.add(e),W(e,t,n,r);for(let a of i)G(a,e.parent,r,t,n)}else{let i=Re(e);for(let a of i.target)r.add(a),i===e.parent?.initial&&n.add(e.parent),W(a,t,n,r);for(let a of i.target)G(a,e.parent,r,t,n)}else if(e.type===`compound`){let[i]=e.initial.target;F(i)||(r.add(i),n.add(i)),W(i,t,n,r),G(i,e,r,t,n)}else if(e.type===`parallel`)for(let i of k(e).filter(e=>!F(e)))[...r].some(e=>B(e,i))||(F(i)||(r.add(i),n.add(i)),W(i,t,n,r))}function et(e,t,n,r,i){for(let a of r)if((!i||B(a,i))&&e.add(a),a.type===`parallel`)for(let r of k(a).filter(e=>!F(e)))[...e].some(e=>B(e,r))||(e.add(r),W(r,t,n,e))}function G(e,t,n,r,i){et(n,r,i,A(e,t))}function tt(e,t,n,r,i,a,o,s){let c=e,l=H(r,i,a);l.sort((e,t)=>t.order-e.order);let u;for(let e of l)for(let t of We(e)){let n;n=t.history===`deep`?t=>Oe(t)&&B(t,e):t=>t.parent===e,u??={...a},u[t.id]=Array.from(i).filter(n)}for(let e of l)c=K(c,t,n,[...e.exit,...e.invoke.map(e=>D(e.id))],o,void 0),i.delete(e);return[c,u||a]}function nt(e,t){return e.implementations.actions[t]}function rt(e,t,n,r,i,a){let{machine:o}=e,s=e;for(let e of r){let r=typeof e==`function`,c=r?e:nt(o,typeof e==`string`?e:e.type),l={context:s.context,event:t,self:n.self,system:n.system},u=r||typeof e==`string`?void 0:`params`in e?typeof e.params==`function`?e.params({context:s.context,event:t}):e.params:void 0;if(!c||!(`resolve`in c)){n.actionExecutor({type:typeof e==`string`?e:typeof e==`object`?e.type:e.name||`(anonymous)`,info:l,params:u,exec:c});continue}let d=c,[f,p,m]=d.resolve(n,s,l,u,c,i);s=f,`retryResolve`in d&&a?.push([d,p]),`execute`in d&&n.actionExecutor({type:d.type,info:l,params:p,exec:d.execute.bind(null,n,p)}),m&&(s=rt(s,t,n,m,i,a))}return s}function K(e,t,n,r,i,a){let o=a?[]:void 0,s=rt(e,t,n,r,{internalQueue:i,deferredActorIds:a},o);return o?.forEach(([e,t])=>{e.retryResolve(n,s,t)}),s}function q(e,t,n,r){let i=e,a=[];function o(e,t,r){n.system._sendInspectionEvent({type:`@xstate.microstep`,actorRef:n.self,event:t,snapshot:e[0],_transitions:r}),a.push(e)}if(t.type===`xstate.stop`)return i=Y(it(i,t,n),{status:`stopped`}),o([i,[]],t,[]),{snapshot:i,microsteps:a};let s=t;if(s.type!==p){let t=s,c=fe(t),l=at(t,i);if(c&&!l.length)return i=Y(e,{status:`error`,error:t.error}),o([i,[]],t,[]),{snapshot:i,microsteps:a};let u=U(l,e,n,s,!1,r);i=u[0],o(u,t,l)}let c=!0,l=e.machine.options?.maxIterations??1/0,u=0;for(;i.status===`active`;){if(u++,u>l)throw Error(`Infinite loop detected: the machine has processed more than ${l} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let e=c?ot(i,s):[],t=e.length?i:void 0;if(!e.length){if(!r.length)break;s=r.shift(),e=at(s,i)}let a=U(e,i,n,s,!1,r);i=a[0],c=i!==t,o(a,s,e)}return i.status!==`active`&&it(i,s,n),{snapshot:i,microsteps:a}}function it(e,t,n){return K(e,t,n,Object.values(e.children).map(e=>D(e)),[],void 0)}function at(e,t){return t.machine.getTransitionData(t,e)}function ot(e,t){let n=new Set,r=e._nodes.filter(Oe);for(let i of r)loop:for(let r of[i].concat(A(i,void 0)))if(r.always){for(let i of r.always)if(i.guard===void 0||O(i.guard,e.context,t,e)){n.add(i);break loop}}return Ke(Array.from(n),new Set(e._nodes),e.historyValue)}function st(e,t){return je(e,[...j(R(e,t))])}function ct(e){return!!e&&typeof e==`object`&&`machine`in e&&`value`in e}var lt=function(e){return ae(e,this.value)},ut=function(e){return this.tags.has(e)},dt=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>e.target!==void 0||e.actions.length)},ft=function(){let{_nodes:e,tags:t,machine:n,getMeta:r,toJSON:i,can:a,hasTag:o,matches:s,...c}=this;return{...c,tags:Array.from(t)}},pt=function(){return this._nodes.reduce((e,t)=>(t.meta!==void 0&&(e[t.id]=t.meta),e),{})};function J(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:je(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:lt,hasTag:ut,can:dt,getMeta:pt,toJSON:ft}}function Y(e,t={}){return J({...e,...t},e.machine)}function mt(e){if(typeof e!=`object`||!e)return{};let t={};for(let n in e){let r=e[n];Array.isArray(r)&&(t[n]=r.map(e=>({id:e.id})))}return t}function ht(e,t){let{_nodes:n,tags:r,machine:i,children:a,context:o,can:s,hasTag:c,matches:l,getMeta:u,toJSON:d,...f}=e,p={};for(let e in a){let n=a[e];p[e]={snapshot:n.getPersistedSnapshot(t),src:n.src,systemId:n.systemId,syncSnapshot:n._syncSnapshot}}return{...f,context:gt(o),children:p,historyValue:mt(f.historyValue)}}function gt(e){let t;for(let n in e){let r=e[n];if(r&&typeof r==`object`)if(`sessionId`in r&&`send`in r&&`ref`in r)t??=Array.isArray(e)?e.slice():{...e},t[n]={xstate$$type:1,id:r.id};else{let i=gt(r);i!==r&&(t??=Array.isArray(e)?e.slice():{...e},t[n]=i)}}return t??e}function _t(e,t,n,r,{event:i,id:a,delay:o},{internalQueue:s}){let c=t.machine.implementations.delays;if(typeof i==`string`)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let l=typeof i==`function`?i(n,r):i,u;if(typeof o==`string`){let e=c&&c[o];u=typeof e==`function`?e(n,r):e}else u=typeof o==`function`?o(n,r):o;return typeof u!=`number`&&s.push(l),[t,{event:l,id:a,delay:u},void 0]}function vt(e,t){let{event:n,delay:r,id:i}=t;if(typeof r==`number`){e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,n,r,i)});return}}function yt(e,t){function n(e,t){}return n.type=`xstate.raise`,n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=_t,n.execute=vt,n}var bt=`xstate.promise.resolve`,xt=`xstate.promise.reject`,X=new WeakMap;function St(e){return{config:e,transition:(e,t,n)=>{if(e.status!==`active`)return e;switch(t.type){case bt:{let n=t.data;return{...e,status:`done`,output:n,input:void 0}}case xt:return{...e,status:`error`,error:t.data,input:void 0};case m:return X.get(n.self)?.abort(),X.delete(n.self),{...e,status:`stopped`,input:void 0};default:return e}},start:(t,{self:n,system:r,emit:i})=>{if(t.status!==`active`)return;let a=new AbortController;X.set(n,a),Promise.resolve(e({input:t.input,system:r,self:n,signal:a.signal,emit:i})).then(e=>{n.getSnapshot().status===`active`&&(X.delete(n),r._relay(n,n,{type:bt,data:e}))},e=>{n.getSnapshot().status===`active`&&(X.delete(n),r._relay(n,n,{type:xt,data:e}))})},getInitialSnapshot:(e,t)=>({status:`active`,output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}function Ct(e,{machine:t,context:n},r,i){let a=(a,o)=>{if(typeof a==`string`){let s=x(t,a);if(!s)throw Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);let c=w(s,{id:o?.id,parent:e.self,syncSnapshot:o?.syncSnapshot,input:typeof o?.input==`function`?o.input({context:n,event:r,self:e.self}):o?.input,src:a,systemId:o?.systemId});return i[c.id]=c,c}else return w(a,{id:o?.id,parent:e.self,syncSnapshot:o?.syncSnapshot,input:o?.input,src:a,systemId:o?.systemId})};return(t,n)=>{let r=a(t,n);return i[r.id]=r,e.defer(()=>{r._processingStatus!==C.Stopped&&r.start()}),r}}function wt(e,t,n,r,{assignment:i}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let a={},o={context:t.context,event:n.event,spawn:Ct(e,t,n.event,a),self:e.self,system:e.system},s={};if(typeof i==`function`)s=i(o,r);else for(let e of Object.keys(i)){let t=i[e];s[e]=typeof t==`function`?t(o,r):t}return[Y(t,{context:Object.assign({},t.context,s),children:Object.keys(a).length?{...t.children,...a}:t.children}),void 0,void 0]}function Z(e){function t(e,t){}return t.type=`xstate.assign`,t.assignment=e,t.resolve=wt,t}var Tt=new WeakMap;function Q(e,t,n){let r=Tt.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Tt.set(e,r)),r[t]}var Et={},$=e=>typeof e==`string`?{type:e}:typeof e==`function`?`resolve`in e?{type:e.type}:{type:e.name}:e,Dt=class e{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(`.`),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?`compound`:this.config.history?`history`:`atomic`),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?ce(this.config.states,(t,n)=>new e(t,{_parent:this,_key:n,_machine:this.machine})):Et,this.type===`compound`&&!this.config.initial)throw Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?`shallow`:this.config.history||!1,this.entry=v(this.config.entry).slice(),this.exit=v(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type===`final`||!this.parent?this.config.output:void 0,this.tags=v(t.tags).slice()}_initialize(){this.transitions=Pe(this),this.config.always&&(this.always=y(this.config.always).map(e=>P(this,``,e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map($),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map($),eventType:null})}:void 0,history:this.history,states:ce(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map($)})),entry:this.entry.map($),exit:this.exit.map($),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Q(this,`invoke`,()=>v(this.config.invoke).map((e,t)=>{let{src:n,systemId:r}=e,i=e.id??me(this.id,t),a=typeof n==`string`?n:`xstate.invoke.${me(this.id,t)}`;return{...e,src:a,id:i,systemId:r,toJSON(){let{onDone:t,onError:n,...r}=e;return{...r,type:`xstate.invoke`,src:a,id:i}}}}))}get on(){return Q(this,`on`,()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,n])=>(e[t]=e[t]||[],e[t].push(n),e),{}))}get after(){return Q(this,`delayedTransitions`,()=>Ne(this))}get initial(){return Q(this,`initial`,()=>Ie(this,this.config.initial))}next(e,t){let n=t.type,r=[],i,a=Q(this,`candidates-${n}`,()=>Me(this,n));for(let o of a){let{guard:a}=o,s=e.context,c=!1;try{c=!a||O(a,s,t,e)}catch(e){let t=typeof a==`string`?a:typeof a==`object`?a.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:``}in transition for event '${n}' in state node '${this.id}':\n${e.message}`)}if(c){r.push(...o.actions),i=o;break}}return i?[i]:void 0}get events(){return Q(this,`events`,()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let n of Object.keys(e)){let r=e[n];if(r.states)for(let e of r.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){let e=Object.keys(Object.fromEntries(this.transitions)),t=new Set(e.filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter))));return Array.from(t)}},Ot=class e{constructor(e,t){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||`(machine)`,this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new Dt(e,{_key:this.id,_machine:this}),this.root._initialize(),Fe(this.root),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:n,guards:r,actors:i,delays:a}=this.implementations;return new e(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...i,...t.actors},delays:{...a,...t.delays}})}resolveState(e){let t=st(this.root,e.value),n=j(R(this.root,t));return J({_nodes:[...n],context:e.context||{},children:{},status:M(n,this.root)?`done`:e.status||`active`,output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,n){return q(e,t,n,[]).snapshot}microstep(e,t,n){return q(e,t,n,[]).microsteps.map(([e])=>e)}getTransitionData(e,t){return z(this.root,e.value,e,t)||[]}_getPreInitialState(e,t,n){let{context:r}=this.config,i=J({context:typeof r!=`function`&&r?r:{},_nodes:[this.root],children:{},status:`active`},this);return typeof r==`function`?K(i,t,e,[Z(({spawn:e,event:t,self:n})=>r({spawn:e,input:t.input,self:n}))],n,void 0):i}getInitialSnapshot(e,t){let n=re(t),r=[],i=this._getPreInitialState(e,n,r),[a]=Xe(this.root,i,e,n,r),{snapshot:o}=q(a,n,e,r);return o}start(e){Object.values(e.children).forEach(e=>{e.getSnapshot().status===`active`&&e.start()})}getStateNodeById(e){let t=_(e),n=t.slice(1),r=N(t[0])?t[0].slice(1):t[0],i=this.idMap.get(r);if(!i)throw Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);return L(i,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return ht(e,t)}restoreSnapshot(e,t){let n={},r=e.children;Object.keys(r).forEach(e=>{let i=r[e],a=i.snapshot,o=i.src,s=typeof o==`string`?x(this,o):o;s&&(n[e]=w(s,{id:e,parent:t.self,syncSnapshot:i.syncSnapshot,snapshot:a,src:o,systemId:i.systemId}))});function i(e,t){if(t instanceof Dt)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}function a(e,t){if(!t||typeof t!=`object`)return{};let n={};for(let r in t){let a=t[r];for(let t of a){let a=i(e,t);a&&(n[r]??=[],n[r].push(a))}}return n}let o=a(this.root,e.historyValue),s=J({...e,children:n,_nodes:Array.from(j(R(this.root,e.value))),historyValue:o},this),c=new Set;function l(e,t){if(!c.has(e)){c.add(e);for(let n in e){let r=e[n];if(r&&typeof r==`object`){if(`xstate$$type`in r&&r.xstate$$type===1){e[n]=t[r.id];continue}l(r,t)}}}}return l(s.context,n),s}};function kt(e,t,n,r,{event:i}){return[t,{event:typeof i==`function`?i(n,r):i},void 0]}function At(e,{event:t}){e.defer(()=>e.emit(t))}function jt(e){function t(e,t){}return t.type=`xstate.emit`,t.event=e,t.resolve=kt,t.execute=At,t}var Mt=function(e){return e.Parent=`#_parent`,e.Internal=`#_internal`,e}({});function Nt(e,t,n,r,{to:i,event:a,id:o,delay:s},c){let l=t.machine.implementations.delays;if(typeof a==`string`)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${a}" }) instead`);let u=typeof a==`function`?a(n,r):a,d;if(typeof s==`string`){let e=l&&l[s];d=typeof e==`function`?e(n,r):e}else d=typeof s==`function`?s(n,r):s;let f=typeof i==`function`?i(n,r):i,p;if(typeof f==`string`){if(p=f===Mt.Parent?e.self._parent:f===Mt.Internal?e.self:f.startsWith(`#_`)?t.children[f.slice(2)]:c.deferredActorIds?.includes(f)?f:t.children[f],!p)throw Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`)}else p=f||e.self;return[t,{to:p,targetId:typeof f==`string`?f:void 0,event:u,id:o,delay:d},void 0]}function Pt(e,t,n){typeof n.to==`string`&&(n.to=t.children[n.to])}function Ft(e,t){e.defer(()=>{let{to:n,event:r,delay:i,id:a}=t;if(typeof i==`number`){e.system.scheduler.schedule(e.self,n,r,i,a);return}e.system._relay(e.self,n,r.type===`xstate.error`?ne(e.self.id,r.data):r)})}function It(e,t,n){function r(e,t){}return r.type=`xstate.sendTo`,r.to=e,r.event=t,r.id=n?.id,r.delay=n?.delay,r.resolve=Nt,r.retryResolve=Pt,r.execute=Ft,r}function Lt(e,t){return It(Mt.Parent,e,t)}function Rt(e,t,n,r,{collect:i}){let a=[],o=function(e){a.push(e)};return o.assign=(...e)=>{a.push(Z(...e))},o.cancel=(...e)=>{a.push(T(...e))},o.raise=(...e)=>{a.push(yt(...e))},o.sendTo=(...e)=>{a.push(It(...e))},o.sendParent=(...e)=>{a.push(Lt(...e))},o.spawnChild=(...e)=>{a.push(E(...e))},o.stopChild=(...e)=>{a.push(D(...e))},o.emit=(...e)=>{a.push(jt(...e))},i({context:n.context,event:n.event,enqueue:o,check:e=>O(e,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,a]}function zt(e){function t(e,t){}return t.type=`xstate.enqueueActions`,t.collect=e,t.resolve=Rt,t}function Bt(e,t,n,r,{value:i,label:a}){return[t,{value:typeof i==`function`?i(n,r):i,label:a},void 0]}function Vt({logger:e},{value:t,label:n}){n?e(n,t):e(t)}function Ht(e=({context:e,event:t})=>({context:e,event:t}),t){function n(e,t){}return n.type=`xstate.log`,n.value=e,n.label=t,n.resolve=Bt,n.execute=Vt,n}function Ut(e,t){let n=v(t);if(!n.some(t=>he(e.type,t))){let t=n.length===1?`type matching "${n[0]}"`:`one of types matching "${n.join(`", "`)}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function Wt(e,t){return new Ot(e,t)}function Gt({schemas:e,actors:t,actions:n,guards:r,delays:i}){return{assign:Z,sendTo:It,raise:yt,log:Ht,cancel:T,stopChild:D,enqueueActions:zt,emit:jt,spawnChild:E,createStateConfig:e=>e,createAction:e=>e,createMachine:a=>Wt({...a,schemas:e},{actors:t,actions:n,guards:r,delays:i}),extend:a=>Gt({schemas:e,actors:t,actions:{...n,...a.actions},guards:{...r,...a.guards},delays:{...i,...a.delays}})}}r();var Kt=n(),qt=(e,t)=>{t(e);let n=e.getSnapshot().children;n&&Object.values(n).forEach(e=>{qt(e,t)})};function Jt(e){let t=[];qt(e,e=>{t.push([e,e.getSnapshot()]),e.observers=new Set});let n=e.system.getSnapshot?.();e.stop(),e.system._snapshot=n,t.forEach(([e,t])=>{e._processingStatus=0,e._snapshot=t})}function Yt(e,...[t]){let[[n,r],o]=(0,i.useState)(()=>{let n=w(e,t);return[e.config,n]});if(e.config!==n){let n=w(e,{...t,snapshot:r.getPersistedSnapshot({__unsafeAllowInlineActors:!0})});o([e.config,n]),r=n}return a(()=>{r.logic.implementations=e.implementations}),r}function Xt(e,...[t]){let n=Yt(e,t),r=(0,i.useCallback)(()=>n.getSnapshot(),[n]),a=(0,Kt.useSyncExternalStore)((0,i.useCallback)(e=>{let{unsubscribe:t}=n.subscribe({next:e,error:e});return t},[n]),r,r),o=`status`in a?a:void 0;if(o?.status===`error`)throw o.error;return(0,i.useEffect)(()=>(n.start(),()=>{Jt(n)}),[n]),[a,n.send,n]}export{St as a,Z as i,Ut as n,Gt as r,Xt as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{b as n,x as r,y as i}from"./schemas-EcBBwCo1.js";var a=e(t(),1),o=e=>e.type===`checkbox`,s=e=>e instanceof Date,c=e=>e==null,l=e=>typeof e==`object`,u=e=>!c(e)&&!Array.isArray(e)&&l(e)&&!s(e),d=e=>u(e)&&e.target?o(e.target)?e.target.checked:e.target.value:e,f=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,p=(e,t)=>e.has(f(t)),m=e=>{let t=e.constructor&&e.constructor.prototype;return u(t)&&t.hasOwnProperty(`isPrototypeOf`)},h=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function g(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(h&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(u(e)&&m(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=g(e[t]));return r}var _=e=>/^\w*$/.test(e),v=e=>e===void 0,y=e=>Array.isArray(e)?e.filter(Boolean):[],b=e=>y(e.replace(/["|']|\]/g,``).split(/\.|\[/)),x=(e,t,n)=>{if(!t||!u(e))return n;let r=(_(t)?[t]:b(t)).reduce((e,t)=>c(e)?e:e[t],e);return v(r)||r===e?v(e[t])?n:e[t]:r},S=e=>typeof e==`boolean`,C=e=>typeof e==`function`,w=(e,t,n)=>{let r=-1,i=_(t)?[t]:b(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=u(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`||t===`constructor`||t===`prototype`)return;e[t]=a,e=e[t]}},T={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`},E={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},D={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},O=a.createContext(null);O.displayName=`HookFormControlContext`;var k=(e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==E.all&&(t._proxyFormState[i]=!r||E.all),n&&(n[i]=!0),e[i]}});return i},A=typeof window<`u`?a.useLayoutEffect:a.useEffect,j=e=>typeof e==`string`,ee=(e,t,n,r,i)=>j(e)?(r&&t.watch.add(e),x(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),x(n,e))):(r&&(t.watchAll=!0),n),M=e=>c(e)||!l(e);function N(e,t,n=new WeakSet){if(M(e)||M(t))return Object.is(e,t);if(s(e)&&s(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(let a of r){let r=e[a];if(!i.includes(a))return!1;if(a!==`ref`){let e=t[a];if(s(r)&&s(e)||u(r)&&u(e)||Array.isArray(r)&&Array.isArray(e)?!N(r,e,n):!Object.is(r,e))return!1}}return!0}var P=a.createContext(null);P.displayName=`HookFormContext`;var F=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},I=e=>Array.isArray(e)?e:[e],te=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function ne(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&u(i)&&a){let e=ne(i,a);u(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var L=e=>u(e)&&!Object.keys(e).length,re=e=>e.type===`file`,R=e=>{if(!h)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ie=e=>e.type===`select-multiple`,ae=e=>e.type===`radio`,oe=e=>ae(e)||o(e),se=e=>R(e)&&e.isConnected;function ce(e,t){let n=t.slice(0,-1).length,r=0;for(;r<n;)e=v(e)?r++:e[t[r++]];return e}function le(e){for(let t in e)if(e.hasOwnProperty(t)&&!v(e[t]))return!1;return!0}function z(e,t){let n=Array.isArray(t)?t:_(t)?[t]:b(t),r=n.length===1?e:ce(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(u(r)&&L(r)||Array.isArray(r)&&le(r))&&z(e,n.slice(0,-1)),e}var ue=e=>{for(let t in e)if(C(e[t]))return!0;return!1};function B(e){return Array.isArray(e)||u(e)&&!ue(e)}function V(e,t={}){for(let n in e){let r=e[n];B(r)?(t[n]=Array.isArray(r)?[]:{},V(r,t[n])):v(r)||(t[n]=!0)}return t}function H(e,t,n){n||=V(t);for(let r in e){let i=e[r];if(B(i))v(t)||M(n[r])?n[r]=V(i,Array.isArray(i)?[]:{}):H(i,c(t)?{}:t[r],n[r]);else{let e=t[r];n[r]=!N(i,e)}}return n}var U={value:!1,isValid:!1},de={value:!0,isValid:!0},W=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!v(e[0].attributes.value)?v(e[0].value)||e[0].value===``?de:{value:e[0].value,isValid:!0}:de:U}return U},fe=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>v(e)?e:t?e===``?NaN:e&&+e:n&&j(e)?new Date(e):r?r(e):e,pe={isValid:!1,value:null},G=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,pe):pe;function me(e){let t=e.ref;return re(t)?t.files:ae(t)?G(e.refs).value:ie(t)?[...t.selectedOptions].map(({value:e})=>e):o(t)?W(e.refs).value:fe(v(t.value)?e.ref.value:t.value,e)}var he=(e,t,n,r)=>{let i={};for(let n of e){let e=x(t,n);e&&w(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},K=e=>e instanceof RegExp,q=e=>v(e)?e:K(e)?e.source:u(e)?K(e.value)?e.value.source:e.value:e,ge=e=>({isOnSubmit:!e||e===E.onSubmit,isOnBlur:e===E.onBlur,isOnChange:e===E.onChange,isOnAll:e===E.all,isOnTouch:e===E.onTouched}),_e=`AsyncFunction`,ve=e=>!!e&&!!e.validate&&!!(C(e.validate)&&e.validate.constructor.name===_e||u(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===_e)),ye=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),be=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))),J=(e,t,n,r)=>{for(let i of n||Object.keys(e)){let n=x(e,i);if(n){let{_f:e,...a}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(J(a,t))break}else if(u(a)&&J(a,t))break}}};function xe(e,t,n){let r=x(e,n);if(r||_(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=x(t,r),o=x(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Se=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return L(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!r||E.all))},Ce=(e,t,n)=>!e||!t||e===t||I(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))),we=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Te=(e,t)=>!y(x(e,t)).length&&z(e,t),Ee=(e,t,n)=>{let r=I(x(e,n));return w(r,`root`,t[n]),w(e,n,r),e};function Y(e,t,n=`validate`){if(j(e)||Array.isArray(e)&&e.every(j)||S(e)&&!e)return{type:n,message:j(e)?e:``,ref:t}}var X=e=>u(e)&&!K(e)?e:{value:e,message:``},De=async(e,t,n,r,i,a)=>{let{ref:s,refs:l,required:d,maxLength:f,minLength:p,min:m,max:h,pattern:g,validate:_,name:y,valueAsNumber:b,mount:w}=e._f,T=x(n,y);if(!w||t.has(y))return{};let E=l?l[0]:s,O=e=>{i&&E.reportValidity&&(E.setCustomValidity(S(e)?``:e||``),E.reportValidity())},k={},A=ae(s),ee=o(s),M=A||ee,N=(b||re(s))&&v(s.value)&&v(T)||R(s)&&s.value===``||T===``||Array.isArray(T)&&!T.length,P=F.bind(null,y,r,k),I=(e,t,n,r=D.maxLength,i=D.minLength)=>{let a=e?t:n;k[y]={type:e?r:i,message:a,ref:s,...P(e?r:i,a)}};if(a?!Array.isArray(T)||!T.length:d&&(!M&&(N||c(T))||S(T)&&!T||ee&&!W(l).isValid||A&&!G(l).isValid)){let{value:e,message:t}=j(d)?{value:!!d,message:d}:X(d);if(e&&(k[y]={type:D.required,message:t,ref:E,...P(D.required,t)},!r))return O(t),k}if(!N&&(!c(m)||!c(h))){let e,t,n=X(h),i=X(m);if(!c(T)&&!isNaN(T)){let r=s.valueAsNumber||T&&+T;c(n.value)||(e=r>n.value),c(i.value)||(t=r<i.value)}else{let r=s.valueAsDate||new Date(T),a=e=>new Date(new Date().toDateString()+` `+e),o=s.type==`time`,c=s.type==`week`;j(n.value)&&T&&(e=o?a(T)>a(n.value):c?T>n.value:r>new Date(n.value)),j(i.value)&&T&&(t=o?a(T)<a(i.value):c?T<i.value:r<new Date(i.value))}if((e||t)&&(I(!!e,n.message,i.message,D.max,D.min),!r))return O(k[y].message),k}if((f||p)&&!N&&(j(T)||a&&Array.isArray(T))){let e=X(f),t=X(p),n=!c(e.value)&&T.length>+e.value,i=!c(t.value)&&T.length<+t.value;if((n||i)&&(I(n,e.message,t.message),!r))return O(k[y].message),k}if(g&&!N&&j(T)){let{value:e,message:t}=X(g);if(K(e)&&!T.match(e)&&(k[y]={type:D.pattern,message:t,ref:s,...P(D.pattern,t)},!r))return O(t),k}if(_){if(C(_)){let e=Y(await _(T,n),E);if(e&&(k[y]={...e,...P(D.validate,e.message)},!r))return O(e.message),k}else if(u(_)){let e={};for(let t in _){if(!L(e)&&!r)break;let i=Y(await _[t](T,n),E,t);i&&(e={...i,...P(t,i.message)},O(i.message),r&&(k[y]=e))}if(!L(e)&&(k[y]={ref:E,...e},!r))return k}}return O(!0),k},Oe={mode:E.onSubmit,reValidateMode:E.onChange,shouldFocusError:!0};function Z(e={}){let t={...Oe,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:C(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=(u(t.defaultValues)||u(t.values))&&g(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:g(i),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},m,_=0,b={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},D={...b},O={...D},k={array:te(),state:te()},A=t.criteriaMode===E.all,M=e=>t=>{clearTimeout(_),_=setTimeout(e,t)},P=async e=>{if(!l.keepIsValid&&!t.disabled&&(D.isValid||O.isValid||e)){let e;t.resolver?(e=L((await U()).errors),F()):e=await W(r,!0),e!==n.isValid&&k.state.next({isValid:e})}},F=(e,r)=>{!t.disabled&&(D.isValidating||D.validatingFields||O.isValidating||O.validatingFields)&&((e||Array.from(f.mount)).forEach(e=>{e&&(r?w(n.validatingFields,e,r):z(n.validatingFields,e))}),k.state.next({validatingFields:n.validatingFields,isValidating:!L(n.validatingFields)}))},ae=(e,o=[],s,c,u=!0,d=!0)=>{if(c&&s&&!t.disabled){if(l.action=!0,d&&Array.isArray(x(r,e))){let t=s(x(r,e),c.argA,c.argB);u&&w(r,e,t)}if(d&&Array.isArray(x(n.errors,e))){let t=s(x(n.errors,e),c.argA,c.argB);u&&w(n.errors,e,t),Te(n.errors,e)}if((D.touchedFields||O.touchedFields)&&d&&Array.isArray(x(n.touchedFields,e))){let t=s(x(n.touchedFields,e),c.argA,c.argB);u&&w(n.touchedFields,e,t)}(D.dirtyFields||O.dirtyFields)&&(n.dirtyFields=H(i,a)),k.state.next({name:e,isDirty:G(e,o),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else w(a,e,o)},ce=(e,t)=>{w(n.errors,e,t),k.state.next({errors:n.errors})},le=e=>{n.errors=e,k.state.next({errors:n.errors,isValid:!1})},ue=(e,t,n,o)=>{let s=x(r,e);if(s){let r=x(a,e,v(n)?x(i,e):n);v(r)||o&&o.defaultChecked||t?w(a,e,t?r:me(s._f)):Y(e,r),l.mount&&!l.action&&P()}},B=(e,r,a,o,s)=>{let c=!1,l=!1,u={name:e};if(!t.disabled){if(!a||o){(D.isDirty||O.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=G(),c=l!==u.isDirty);let t=N(x(i,e),r);l=!!x(n.dirtyFields,e),t?z(n.dirtyFields,e):w(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c||=(D.dirtyFields||O.dirtyFields)&&l!==!t}if(a){let t=x(n.touchedFields,e);t||(w(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c||=(D.touchedFields||O.touchedFields)&&t!==a)}c&&s&&k.state.next(u)}return c?u:{}},V=(e,r,i,a)=>{let o=x(n.errors,e),s=(D.isValid||O.isValid)&&S(r)&&n.isValid!==r;if(t.delayError&&i?(m=M(()=>ce(e,i)),m(t.delayError)):(clearTimeout(_),m=null,i?w(n.errors,e,i):z(n.errors,e)),(i?!N(o,i):o)||!L(a)||s){let t={...a,...s&&S(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},k.state.next(t)}},U=async e=>(F(e,!0),await t.resolver(a,t.context,he(e||f.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),de=async e=>{let{errors:t}=await U(e);if(F(e),e)for(let r of e){let e=x(t,r);e?w(n.errors,r,e):z(n.errors,r)}else n.errors=t;return t},W=async(r,i,o={valid:!0})=>{for(let s in r){let c=r[s];if(c){let{_f:r,...s}=c;if(r){let s=f.array.has(r.name),l=c._f&&ve(c._f);l&&D.validatingFields&&F([r.name],!0);let u=await De(c,f.disabled,a,A,t.shouldUseNativeValidation&&!i,s);if(l&&D.validatingFields&&F([r.name]),u[r.name]&&(o.valid=!1,i||e.shouldUseNativeValidation))break;!i&&(x(u,r.name)?s?Ee(n.errors,u,r.name):w(n.errors,r.name,u[r.name]):z(n.errors,r.name))}!L(s)&&await W(s,i,o)}}return o.valid},pe=()=>{for(let e of f.unMount){let t=x(r,e);t&&(t._f.refs?t._f.refs.every(e=>!se(e)):!se(t._f.ref))&&Le(e)}f.unMount=new Set},G=(e,n)=>!t.disabled&&(e&&n&&w(a,e,n),!N(Ae(),i)),K=(e,t,n)=>ee(e,f,{...l.mount?a:v(t)?i:j(e)?{[e]:t}:t},n,t),_e=e=>y(x(l.mount?a:i,e,t.shouldUnregister?x(i,e,[]):[])),Y=(e,t,n={})=>{let i=x(r,e),s=t;if(i){let n=i._f;n&&(!n.disabled&&w(a,e,fe(t,n)),s=R(n.ref)&&c(t)?``:t,ie(n.ref)?[...n.ref.options].forEach(e=>e.selected=s.includes(e.value)):n.refs?o(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):n.refs.forEach(e=>e.checked=e.value===s):re(n.ref)?n.ref.value=``:(n.ref.value=s,n.ref.type||k.state.next({name:e,values:g(a)})))}(n.shouldDirty||n.shouldTouch)&&B(e,s,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&$(e)},X=(e,t,n)=>{for(let i in t){if(!t.hasOwnProperty(i))return;let a=t[i],o=e+`.`+i,c=x(r,o);(f.array.has(e)||u(a)||c&&!c._f)&&!s(a)?X(o,a,n):Y(o,a,n)}},Z=(e,t,o={})=>{let s=x(r,e),u=f.array.has(e),d=g(t);w(a,e,d),u?(k.array.next({name:e,values:g(a)}),(D.isDirty||D.dirtyFields||O.isDirty||O.dirtyFields)&&o.shouldDirty&&k.state.next({name:e,dirtyFields:H(i,a),isDirty:G(e,d)})):s&&!s._f&&!c(d)?X(e,d,o):Y(e,d,o),be(e,f)?k.state.next({...n,name:e,values:g(a)}):k.state.next({name:l.mount?e:void 0,values:g(a)})},ke=async e=>{l.mount=!0;let i=e.target,o=i.name,c=!0,u=x(r,o),p=e=>{c=Number.isNaN(e)||s(e)&&isNaN(e.getTime())||N(e,x(a,o,e))},h=ge(t.mode),_=ge(t.reValidateMode);if(u){let s,l,v=i.type?me(u._f):d(e),y=e.type===T.BLUR||e.type===T.FOCUS_OUT,b=!ye(u._f)&&!t.resolver&&!x(n.errors,o)&&!u._f.deps||we(y,x(n.touchedFields,o),n.isSubmitted,_,h),S=be(o,f,y);w(a,o,v),y?(!i||!i.readOnly)&&(u._f.onBlur&&u._f.onBlur(e),m&&m(0)):u._f.onChange&&u._f.onChange(e);let C=B(o,v,y),E=!L(C)||S;if(!y&&k.state.next({name:o,type:e.type,values:g(a)}),b)return(D.isValid||O.isValid)&&(t.mode===`onBlur`?y&&P():y||P()),E&&k.state.next({name:o,...S?{}:C});if(!y&&S&&k.state.next({...n}),t.resolver){let{errors:e}=await U([o]);if(F([o]),p(v),c){let t=xe(n.errors,r,o),i=xe(e,r,t.name||o);s=i.error,o=i.name,l=L(e)}}else F([o],!0),s=(await De(u,f.disabled,a,A,t.shouldUseNativeValidation))[o],F([o]),p(v),c&&(s?l=!1:(D.isValid||O.isValid)&&(l=await W(r,!0)));c&&(u._f.deps&&(!Array.isArray(u._f.deps)||u._f.deps.length>0)&&$(u._f.deps),V(o,l,s,C))}},Q=(e,t)=>{if(x(n.errors,t)&&e.focus)return e.focus(),1},$=async(e,i={})=>{let a,o,s=I(e);if(t.resolver){let t=await de(v(e)?e:s);a=L(t),o=e?!s.some(e=>x(t,e)):a}else e?(o=(await Promise.all(s.map(async e=>{let t=x(r,e);return await W(t&&t._f?{[e]:t}:t)}))).every(Boolean),!(!o&&!n.isValid)&&P()):o=a=await W(r);return k.state.next({...!j(e)||(D.isValid||O.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&J(r,Q,e?s:f.mount),o},Ae=(e,t)=>{let r={...l.mount?a:i};return t&&(r=ne(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),v(e)?r:j(e)?x(r,e):e.map(e=>x(r,e))},je=(e,t)=>({invalid:!!x((t||n).errors,e),isDirty:!!x((t||n).dirtyFields,e),error:x((t||n).errors,e),isValidating:!!x(n.validatingFields,e),isTouched:!!x((t||n).touchedFields,e)}),Me=e=>{e&&I(e).forEach(e=>z(n.errors,e)),k.state.next({errors:e?n.errors:{}})},Ne=(e,t,i)=>{let a=(x(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=x(n.errors,e)||{};w(n.errors,e,{...l,...t,ref:a}),k.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},Pe=(e,t)=>C(e)?k.state.subscribe({next:n=>`values`in n&&e(K(void 0,t),n)}):K(e,t,!0),Fe=e=>k.state.subscribe({next:t=>{Ce(e.name,t.name,e.exact)&&Se(t,e.formState||D,qe,e.reRenderRoot)&&e.callback({values:{...a},...n,...t,defaultValues:i})}}).unsubscribe,Ie=e=>(l.mount=!0,O={...O,...e.formState},Fe({...e,formState:{...b,...e.formState}})),Le=(e,o={})=>{for(let s of e?I(e):f.mount)f.mount.delete(s),f.array.delete(s),o.keepValue||(z(r,s),z(a,s)),!o.keepError&&z(n.errors,s),!o.keepDirty&&z(n.dirtyFields,s),!o.keepTouched&&z(n.touchedFields,s),!o.keepIsValidating&&z(n.validatingFields,s),!t.shouldUnregister&&!o.keepDefaultValue&&z(i,s);k.state.next({values:g(a)}),k.state.next({...n,...o.keepDirty?{isDirty:G()}:{}}),!o.keepIsValid&&P()},Re=({disabled:e,name:t})=>{if(S(e)&&l.mount||e||f.disabled.has(t)){let n=f.disabled.has(t)!==!!e;e?f.disabled.add(t):f.disabled.delete(t),n&&l.mount&&!l.action&&P()}},ze=(e,n={})=>{let a=x(r,e),o=S(n.disabled)||S(t.disabled);return w(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),f.mount.add(e),a?Re({disabled:S(n.disabled)?n.disabled:t.disabled,name:e}):ue(e,!0,n.value),{...o?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:q(n.min),max:q(n.max),minLength:q(n.minLength),maxLength:q(n.maxLength),pattern:q(n.pattern)}:{},name:e,onChange:ke,onBlur:ke,ref:o=>{if(o){ze(e,n),a=x(r,e);let t=v(o.value)&&o.querySelectorAll&&o.querySelectorAll(`input,select,textarea`)[0]||o,s=oe(t),c=a._f.refs||[];if(s?c.find(e=>e===t):t===a._f.ref)return;w(r,e,{_f:{...a._f,...s?{refs:[...c.filter(se),t,...Array.isArray(x(i,e))?[{}]:[]],ref:{type:t.type,name:e}}:{ref:t}}}),ue(e,!1,void 0,t)}else a=x(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(p(f.array,e)&&l.action)&&f.unMount.add(e)}}},Be=()=>t.shouldFocusError&&J(r,Q,f.mount),Ve=e=>{S(e)&&(k.state.next({disabled:e}),J(r,(t,n)=>{let i=x(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},He=(e,i)=>async o=>{let s;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let c=g(a);if(k.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await U();F(),n.errors=e,c=g(t)}else await W(r);if(f.disabled.size)for(let e of f.disabled)z(c,e);if(z(n.errors,`root`),L(n.errors)){k.state.next({errors:{}});try{await e(c,o)}catch(e){s=e}}else i&&await i({...n.errors},o),Be(),setTimeout(Be);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:L(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},Ue=(e,t={})=>{x(r,e)&&(v(t.defaultValue)?Z(e,g(x(i,e))):(Z(e,t.defaultValue),w(i,e,g(t.defaultValue))),t.keepTouched||z(n.touchedFields,e),t.keepDirty||(z(n.dirtyFields,e),n.isDirty=t.defaultValue?G(e,g(x(i,e))):G()),t.keepError||(z(n.errors,e),D.isValid&&P()),k.state.next({...n}))},We=(e,o={})=>{let s=e?g(e):i,c=g(s),u=L(e),d=u?i:c;if(o.keepDefaultValues||(i=s),!o.keepValues){if(o.keepDirtyValues){let e=new Set([...f.mount,...Object.keys(H(i,a))]);for(let t of Array.from(e)){let e=x(n.dirtyFields,t),r=x(a,t),i=x(d,t);e&&!v(r)?w(d,t,r):!e&&!v(i)&&Z(t,i)}}else{if(h&&v(e))for(let e of f.mount){let t=x(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(R(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(o.keepFieldsRef)for(let e of f.mount)Z(e,x(d,e));else r={}}a=t.shouldUnregister?o.keepDefaultValues?g(i):{}:g(d),k.array.next({values:{...d}}),k.state.next({values:{...d}})}f={mount:o.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},l.mount=!D.isValid||!!o.keepIsValid||!!o.keepDirtyValues||!t.shouldUnregister&&!L(d),l.watch=!!t.shouldUnregister,l.keepIsValid=!!o.keepIsValid,l.action=!1,o.keepErrors||(n.errors={}),k.state.next({submitCount:o.keepSubmitCount?n.submitCount:0,isDirty:u?!1:o.keepDirty?n.isDirty:!!(o.keepDefaultValues&&!N(e,i)),isSubmitted:o.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:u?{}:o.keepDirtyValues?o.keepDefaultValues&&a?H(i,a):n.dirtyFields:o.keepDefaultValues&&e?H(i,e):o.keepDirty?n.dirtyFields:{},touchedFields:o.keepTouched?n.touchedFields:{},errors:o.keepErrors?n.errors:{},isSubmitSuccessful:o.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Ge=(e,n)=>We(C(e)?e(a):e,{...t.resetOptions,...n}),Ke=(e,t={})=>{let n=x(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&C(e.select)&&e.select()})}},qe=e=>{n={...n,...e}},Je={control:{register:ze,unregister:Le,getFieldState:je,handleSubmit:He,setError:Ne,_subscribe:Fe,_runSchema:U,_updateIsValidating:F,_focusError:Be,_getWatch:K,_getDirty:G,_setValid:P,_setFieldArray:ae,_setDisabledField:Re,_setErrors:le,_getFieldArray:_e,_reset:We,_resetDefaultValues:()=>C(t.defaultValues)&&t.defaultValues().then(e=>{Ge(e,t.resetOptions),k.state.next({isLoading:!1})}),_removeUnmounted:pe,_disableForm:Ve,_subjects:k,_proxyFormState:D,get _fields(){return r},get _formValues(){return a},get _state(){return l},set _state(e){l=e},get _defaultValues(){return i},get _names(){return f},set _names(e){f=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e}}},subscribe:Ie,trigger:$,register:ze,handleSubmit:He,watch:Pe,setValue:Z,getValues:Ae,reset:Ge,resetField:Ue,clearErrors:Me,unregister:Le,setError:Ne,setFocus:Ke,getFieldState:je};return{...Je,formControl:Je}}function ke(e={}){let t=a.useRef(void 0),n=a.useRef(void 0),[r,i]=a.useState({isDirty:!1,isValidating:!1,isLoading:C(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:C(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!C(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...i}=Z(e);t.current={...i,formState:r}}let o=t.current.control;return o._options=e,A(()=>{let e=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(e=>({...e,isReady:!0})),o._formState.isReady=!0,e},[o]),a.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),a.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),a.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),a.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),a.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==r.isDirty&&o._subjects.state.next({isDirty:e})}},[o,r.isDirty]),a.useEffect(()=>{e.values&&!N(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,i(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),a.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=a.useMemo(()=>k(r,o),[o,r]),t.current}var Q=(e,t,n)=>{if(e&&`reportValidity`in e){let r=x(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},$=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?Q(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>Q(t,n,e))}},Ae=(e,t)=>{t.shouldUseNativeValidation&&$(e,t);let n={};for(let r in e){let i=x(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(je(t.names||Object.keys(e),r)){let e=Object.assign({},x(n,r));w(e,`root`,a),w(n,r,e)}else w(n,r,a)}return n},je=(e,t)=>{let n=Me(t);return e.some(e=>Me(e).match(`^${n}\\.\\d+`))};function Me(e){return e.replace(/\]|\[/g,``)}function Ne(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function Pe(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(`unionErrors`in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=F(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function Fe(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors[0][0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=F(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function Ie(e,t,a){if(a===void 0&&(a={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(n,r,i){try{return Promise.resolve(Ne(function(){return Promise.resolve(e[a.mode===`sync`?`parse`:`parseAsync`](n,t)).then(function(e){return i.shouldUseNativeValidation&&$({},i),{errors:{},values:a.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:Ae(Pe(e.errors,!i.shouldUseNativeValidation&&i.criteriaMode===`all`),i)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(o,s,c){try{return Promise.resolve(Ne(function(){return Promise.resolve((a.mode===`sync`?i:n)(e,o,t)).then(function(e){return c.shouldUseNativeValidation&&$({},c),{errors:{},values:a.raw?Object.assign({},o):e}})},function(e){if(function(e){return e instanceof r}(e))return{values:{},errors:Ae(Fe(e.issues,!c.shouldUseNativeValidation&&c.criteriaMode===`all`),c)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}export{ke as n,Ie as t};