@onequery/cli 0.1.62 → 0.1.63-darwin-arm64

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/aarch64-apple-darwin/onequery/onequery +0 -0
  3. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/CompositeItem-BB408Cyb.js +1 -0
  4. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/CompositeList-DbbDW_rT.js +1 -0
  5. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/DialogTitle-ChNkcIa6.js +1 -0
  6. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconArrowRight-DsOD7mDl.js +1 -0
  7. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconCheck-Gc24xPT2.js +1 -0
  8. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconChevronDown-B-39MA7-.js +1 -0
  9. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconChevronRight-DD16tNHZ.js +1 -0
  10. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconCoins-C7Nn0L6R.js +1 -0
  11. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconHistory-DuLS8PKF.js +1 -0
  12. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconLoader2-BpZcTuHV.js +1 -0
  13. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconPlus-CZiRiEUF.js +1 -0
  14. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconTerminal2-PxNqcz3d.js +1 -0
  15. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/IconX-rRpRFwc5.js +1 -0
  16. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/Separator-M05FshHx.js +1 -0
  17. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/_authenticated-CcSc_Pt7.js +1 -0
  18. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/_org_slug-BvJDit6U.js +1 -0
  19. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/alert-BIGxI3XN.js +1 -0
  20. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/api-base-url-DIb6qukm.js +1 -0
  21. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/api-client-tp8XTpAa.js +1 -0
  22. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/api-paths-DcYkf-C_.js +1 -0
  23. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/app-routes-CMyon6Em.js +1 -0
  24. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/audit-CdPU9Jf2.js +2 -0
  25. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/auth-bootstrap-query-B1MHd_NV.js +1 -0
  26. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/auth-client-D-YHMy0G.js +3 -0
  27. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/avatar-SaFoLofF.js +1 -0
  28. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/badge-BFPkSrVD.js +1 -0
  29. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/budget-CX5MplAP.js +1 -0
  30. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/callback-BWQ3ETBy.js +1 -0
  31. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/card-Dllm2lhp.js +1 -0
  32. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/checkbox-Bii9Pcrx.js +1 -0
  33. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/compiler-runtime-DCc3R3Xn.js +1 -0
  34. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/connect-database-C1Jb2l53.js +1 -0
  35. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/copy-button-BO1KBdf9.js +1 -0
  36. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/create-org-BSzKv5ue.js +1 -0
  37. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/createReactComponent-_L2mp4Ui.js +1 -0
  38. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/data-source-connection-form-CbDL0cgG.js +273 -0
  39. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/device-Bbz7apAX.js +1 -0
  40. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/dist-BNi06Dzx.js +3 -0
  41. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/dropdown-menu-Cw2MW0pD.js +1 -0
  42. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/empty-DjRo5ytz.js +1 -0
  43. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/format-date-Rg05aHXh.js +1 -0
  44. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/getDisabledMountTransitionStyles-C0uz3iMh.js +1 -0
  45. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/getPseudoElementBounds-CRlxTrfr.js +12 -0
  46. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/home-BNjpNKdt.js +1 -0
  47. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/index-B4OsjuJp.css +2 -0
  48. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/index-CXR0dKJj.js +10 -0
  49. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/input-BRu0b1Tq.js +1 -0
  50. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/integrations-BWC7iPQ5.js +1 -0
  51. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  52. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  53. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  54. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  55. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  56. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  57. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  58. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/invite._invitationId-DmJnR4R5.js +1 -0
  59. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/jsx-runtime-DG_AJzB_.js +1 -0
  60. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/label-f2wVZcni.js +1 -0
  61. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/link-Cgvqhh5w.js +1 -0
  62. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/matchContext-CDajBC0L.js +1 -0
  63. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/organization-permissions-BXV_ess0.js +1 -0
  64. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/organization-query-keys-ieaSNxMR.js +1 -0
  65. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/query-CY--GYXb.js +1 -0
  66. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/query-timing-YBkSOxxF.js +1 -0
  67. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/queryOptions-bXtOUR_h.js +1 -0
  68. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/routes-CxJ2aoMf.js +1 -0
  69. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/schemas-EcBBwCo1.js +64 -0
  70. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/select-yNaL0SXM.js +1 -0
  71. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/separator-BH7Gsum-.js +1 -0
  72. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/settings-C8us2bWX.js +1 -0
  73. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/signin-BgfqB9QB.js +1 -0
  74. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/src-C5F1uEDb.js +1 -0
  75. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/team-CYPsHFTt.js +1 -0
  76. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/textarea-CnA77PLS.js +1 -0
  77. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/theme-toggle-CRaDbyxE.js +1 -0
  78. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/use-optimistic-mutation-3PPnMc-O.js +1 -0
  79. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useBaseQuery-CO5Q8xm4.js +1 -0
  80. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useBaseUiId-CtNp109T.js +1 -0
  81. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useCompositeItem-D243hyne.js +1 -0
  82. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useControlled-C-85HRFr.js +1 -0
  83. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useQuery-DyOxsY45.js +1 -0
  84. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useRender-CzpKCg11.js +1 -0
  85. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useRouterState-DpT8luFk.js +1 -0
  86. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useSuspenseQuery-CBFRU4At.js +1 -0
  87. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/useValueChanged-BNrgSVVM.js +1 -0
  88. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/utils-C8DGLIgm.js +1 -0
  89. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/xstate-react.esm-Bo3CCIRt.js +1 -0
  90. package/vendor/aarch64-apple-darwin/runtime/dashboard/assets/zod-D0PWrP9q.js +1 -0
  91. package/vendor/aarch64-apple-darwin/runtime/dashboard/favicon.ico +0 -0
  92. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/amplitude/step1_settings_sidebar.png +0 -0
  93. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/amplitude/step2_projects.png +0 -0
  94. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/amplitude/step3_project_keys.png +0 -0
  95. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/amplitude/step4_api_keys.png +0 -0
  96. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/bigquery/step1_service_accounts.png +0 -0
  97. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/bigquery/step2_bigquery_roles.png +0 -0
  98. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/bigquery/step3_add_key_menu.png +0 -0
  99. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/bigquery/step4_create_json_key.png +0 -0
  100. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step2_enable_workers_logs.png +0 -0
  101. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step3_user_api_tokens.png +0 -0
  102. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step4_create_api_token.png +0 -0
  103. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step5_workers_pages_account_id.png +0 -0
  104. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step6_workers_observability_permission.png +0 -0
  105. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/ga4/step1_service_accounts.png +0 -0
  106. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/ga4/step2_create_json_key.png +0 -0
  107. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/ga4/step3_add_user_viewer.png +0 -0
  108. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/ga4/step4_property_details.png +0 -0
  109. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/github-token-guide/step1_signin.png +0 -0
  110. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
  111. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
  112. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/github-token-guide/step4_token_created_sanitized.png +0 -0
  113. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/google-search-console/step1_confirm_property.png +0 -0
  114. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/google-search-console/step2_scope_selected.png +0 -0
  115. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/google-search-console/step3_copy_access_token.png +0 -0
  116. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/mixpanel/step1_service_accounts.png +0 -0
  117. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/mixpanel/step2_create_service_account.png +0 -0
  118. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/mixpanel/step3_credentials.png +0 -0
  119. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/mixpanel/step4_project_settings.png +0 -0
  120. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/postgresql/step1_create_user.png +0 -0
  121. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/postgresql/step2_connection.png +0 -0
  122. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/posthog/step1_project_settings.png +0 -0
  123. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/posthog/step2_personal_api_keys.png +0 -0
  124. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/posthog/step3_create_key_modal.png +0 -0
  125. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/rds/step1_connect.png +0 -0
  126. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/rds/step2_create_user.png +0 -0
  127. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/rds/step3_grant.png +0 -0
  128. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/rds/step4_info.png +0 -0
  129. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/sentry/step1_personal_tokens.png +0 -0
  130. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/sentry/step2_create_token_permissions.png +0 -0
  131. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/sentry/step3_organization_slug.png +0 -0
  132. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/sentry/step4_project_slug.png +0 -0
  133. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/vercel/step1_tokens_page.png +0 -0
  134. package/vendor/aarch64-apple-darwin/runtime/dashboard/images/vercel/step2_configure_token.png +0 -0
  135. package/vendor/aarch64-apple-darwin/runtime/dashboard/index.html +47 -0
  136. package/vendor/aarch64-apple-darwin/runtime/dashboard/onequery.svg +44 -0
  137. package/vendor/aarch64-apple-darwin/runtime/migrations/20260327065242_curious_nightmare.sql +403 -0
  138. package/vendor/aarch64-apple-darwin/runtime/migrations/20260403103652_slippery_hellfire_club.sql +8 -0
  139. package/vendor/aarch64-apple-darwin/runtime/migrations/20260403112219_gigantic_namora.sql +1 -0
  140. package/vendor/aarch64-apple-darwin/runtime/migrations/20260420071232_previous_justin_hammer.sql +141 -0
  141. package/vendor/aarch64-apple-darwin/runtime/migrations/20260420093157_spooky_cassandra_nova.sql +29 -0
  142. package/vendor/aarch64-apple-darwin/runtime/migrations/20260420101631_even_ogun.sql +5 -0
  143. package/vendor/aarch64-apple-darwin/runtime/migrations/20260425110519_smart_amazoness.sql +8 -0
  144. package/vendor/aarch64-apple-darwin/runtime/migrations/20260428033542_rename_source_query_interface_missing.sql +36 -0
  145. package/vendor/aarch64-apple-darwin/runtime/migrations/20260430114113_jittery_scorpion.sql +28 -0
  146. package/vendor/aarch64-apple-darwin/runtime/migrations/20260430135906_flippant_timeslip.sql +4 -0
  147. package/vendor/aarch64-apple-darwin/runtime/migrations/20260502000100_drop_old_workflow_audit_tables.sql +15 -0
  148. package/vendor/aarch64-apple-darwin/runtime/migrations/20260503011110_moaning_jack_flag.sql +22 -0
  149. package/vendor/aarch64-apple-darwin/runtime/migrations/20260514143216_reset_workflow_audit_history.sql +20 -0
  150. package/vendor/aarch64-apple-darwin/runtime/migrations/20260524081943_colorful_firelord.sql +1 -0
  151. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260327065242_snapshot.json +2817 -0
  152. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260403103652_snapshot.json +2864 -0
  153. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260403112219_snapshot.json +2870 -0
  154. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260420071232_snapshot.json +3879 -0
  155. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260420093157_snapshot.json +4088 -0
  156. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260420101631_snapshot.json +3250 -0
  157. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260425110519_snapshot.json +3250 -0
  158. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260428033542_snapshot.json +3250 -0
  159. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260430114113_snapshot.json +3507 -0
  160. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260430135906_snapshot.json +3531 -0
  161. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260503011110_snapshot.json +3089 -0
  162. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/20260524081943_snapshot.json +3082 -0
  163. package/vendor/aarch64-apple-darwin/runtime/migrations/meta/_journal.json +104 -0
  164. package/vendor/aarch64-apple-darwin/runtime/pglite/initdb.wasm +0 -0
  165. package/vendor/aarch64-apple-darwin/runtime/pglite/pglite.data +0 -0
  166. package/vendor/aarch64-apple-darwin/runtime/pglite/pglite.wasm +0 -0
  167. package/vendor/aarch64-apple-darwin/server/onequery-server.mjs +447889 -0
  168. package/vendor/aarch64-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{a as r}from"./link-Cgvqhh5w.js";import{t as i}from"./compiler-runtime-DCc3R3Xn.js";import{P as a,S as o,a as s,f as c,p as l,x as u,y as d}from"./createReactComponent-_L2mp4Ui.js";import{t as f}from"./utils-C8DGLIgm.js";import{d as p,n as m,t as h}from"./useBaseUiId-CtNp109T.js";import{t as g}from"./useControlled-C-85HRFr.js";var _=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),v={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},y={valid(e){return e===null?null:e?{[_.valid]:``}:{[_.invalid]:``}}},b=e(t()),x=b.createContext({invalid:void 0,name:void 0,validityData:{state:v,errors:[],error:``,value:``,initialValue:null},setValidityData:l,disabled:void 0,touched:!1,setTouched:l,dirty:!1,setDirty:l,filled:!1,setFilled:l,focused:!1,setFocused:l,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=c)=>e,getInputValidationProps:(e=c)=>e,inputRef:{current:null},commit:async()=>{}}});function S(e=!0){let t=b.useContext(x);if(t.setValidityData===l&&!e)throw Error(d(28));return t}var C=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:l,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function w(){return b.useContext(C)}var T=b.createContext({controlId:void 0,setControlId:l,labelId:void 0,setLabelId:l,messageIds:[],setMessageIds:l,getDescriptionProps:e=>e});function E(){return b.useContext(T)}function D(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function O(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,setControlId:o}=E(),s=h(t);return u(()=>{if(!(!n&&!t||o===l)){if(n){let e=r?.current;a(e)&&e.closest(`label`)!=null?o(t??null):o(i??s)}else t&&o(t);return()=>{t&&o(void 0)}}},[t,r,i,o,n,s]),i??s}var k=e(r());function A(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:s}=e,{formRef:c}=w(),{invalid:l,markedDirtyRef:d,validityData:f,setValidityData:p}=S(),m=o(e.getValue);u(()=>{if(!t)return;let e=n;e===void 0&&(e=m()),f.initialValue===null&&e!==null&&p(t=>({...t,initialValue:e}))},[t,p,n,f.initialValue,m]),u(()=>{!t||!r||c.current.fields.set(r,{getValue:m,name:i,controlRef:a,validityData:D(f,l),validate(e=!0){let t=n;t===void 0&&(t=m()),d.current=!0,e?k.flushSync(()=>s(t)):s(t)}})},[s,a,t,c,m,r,l,d,i,f,n]),u(()=>{let e=c.current.fields;return()=>{r&&e.delete(r)}},[c,r])}var j=b.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:c,disabled:l=!1,onValueChange:d,defaultValue:f,...h}=e,{state:_,name:v,disabled:x}=S(),C=x||l,w=v??a,T=b.useMemo(()=>({..._,disabled:C}),[_,C]),{setTouched:D,setDirty:k,validityData:j,setFocused:M,setFilled:N,validationMode:P,validation:F}=S(),{labelId:I}=E(),L=O({id:i});u(()=>{let e=c!=null;F.inputRef.current?.value||e&&c!==``?N(!0):e&&c===``&&N(!1)},[F.inputRef,N,c]);let[R,z]=g({controlled:c,default:f,name:`FieldControl`,state:`value`}),B=c!==void 0,V=o((e,t)=>{d?.(e,t),!t.isCanceled&&z(e)});return A({id:L,name:w,commit:F.commit,value:R,getValue:()=>F.inputRef.current?.value,controlRef:F.inputRef}),s(`input`,e,{ref:t,state:T,props:[{id:L,disabled:C,name:w,ref:F.inputRef,"aria-labelledby":I,...B?{value:R}:{defaultValue:f},onChange(e){let t=e.currentTarget.value;V(t,m(p,e.nativeEvent)),k(t!==j.initialValue),N(t!==``)},onFocus(){M(!0)},onBlur(e){D(!0),M(!1),P===`onBlur`&&F.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(D(!0),F.commit(e.currentTarget.value))}},F.getInputValidationProps(),h],stateAttributesMapping:y})}),M=n(),N=b.forwardRef(function(e,t){return(0,M.jsx)(j,{ref:t,...e})}),P=i();function F(e){let t=(0,P.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=f(`dark:bg-input/30 border-input 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 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,M.jsx)(N,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}export{w as a,E as i,A as n,S as o,O as r,y as s,F 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}from"./api-base-url-DIb6qukm.js";import{S as a,a as o,n as s,x as c,y as l}from"./createReactComponent-_L2mp4Ui.js";import{t as u}from"./utils-C8DGLIgm.js";import{c as d,o as f,s as p}from"./select-yNaL0SXM.js";import{n as m,r as h,t as g}from"./checkbox-Bii9Pcrx.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./data-source-connection-form-CbDL0cgG.js";import{t as C}from"./IconLoader2-BpZcTuHV.js";import{t as w}from"./IconPlus-CZiRiEUF.js";import{i as T,n as E,r as D,t as O}from"./alert-BIGxI3XN.js";import{a as ee,c as k,i as A,l as j,n as M,o as N,r as P,s as F,u as te}from"./use-optimistic-mutation-3PPnMc-O.js";import{t as ne}from"./useQuery-DyOxsY45.js";import{t as I}from"./useSuspenseQuery-CBFRU4At.js";import{t as L}from"./queryOptions-bXtOUR_h.js";import{Ct as re,Et as R,ct as ie,i as z}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";import{t as B}from"./useBaseUiId-CtNp109T.js";import{t as V}from"./api-client-tp8XTpAa.js";import{D as H,V as ae,X as U,b as W,q as oe,v as G,x as se,y as ce,z as K}from"./index-CXR0dKJj.js";import{t as le}from"./input-BRu0b1Tq.js";import{d as ue,n as q,r as de,t as fe}from"./dropdown-menu-Cw2MW0pD.js";import{t as pe}from"./format-date-Rg05aHXh.js";import{a as me,n as he,o as ge,r as _e,t as ve}from"./card-Dllm2lhp.js";import{t as ye}from"./badge-BFPkSrVD.js";function J(e){return e}var be=r(),Y=e(t(),1),X=n();function Z(e){let t=(0,be.c)(13),[n,r]=(0,Y.useState)(!1),i;t[0]===e?i=t[1]:(i=t=>{e.onSuccess?.(t),r(!1)},t[0]=e,t[1]=i);let a=i,o;t[2]===e.children?o=t[3]:(o=(0,X.jsx)(j,{render:e.children}),t[2]=e.children,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsxs)(F,{children:[(0,X.jsx)(k,{children:`Add Data Source`}),(0,X.jsx)(ee,{children:`Connect a data source so OneQuery can query your workspace data.`})]}),t[4]=s):s=t[4];let c;t[5]!==a||t[6]!==e.initialProvider||t[7]!==e.organizationId?(c=(0,X.jsxs)(A,{className:`sm:max-w-[720px] max-h-[85vh] overflow-y-auto overflow-x-hidden`,children:[s,(0,X.jsx)(S,{organizationId:e.organizationId,onSuccess:a,className:`py-4`,initialProvider:e.initialProvider})]}),t[5]=a,t[6]=e.initialProvider,t[7]=e.organizationId,t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==o||t[11]!==c?(l=(0,X.jsxs)(P,{open:n,onOpenChange:r,children:[o,c]}),t[9]=n,t[10]=o,t[11]=c,t[12]=l):l=t[12],l}var Q=180,$=/\b(api[-_ ]?key|authorization|bearer|cookie|password|secret|token)\b|-----BEGIN/i;function xe(e,t){let n=t?.replaceAll(/\s+/g,` `).trim();if(n&&n!==e)return n.length>Q||$.test(n)?`Review the data source settings and try again.`:n}function Se(e){let t=xe(e.title,e.description);return K.error(e.title,{action:e.action,className:`max-w-[34rem]`,closeButton:!0,description:t,descriptionClassName:`whitespace-pre-wrap break-words`,duration:t?12e3:8e3,position:`top-center`,richColors:!0})}var Ce=V();async function we(e,t){let n=await Ce.api[`data-sources`][`:id`][`github-repositories`].$get({param:{id:t},query:{organizationId:e}});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(H(e,`Failed to fetch GitHub repositories`))}return n.json()}function Te(e,t){return L({queryFn:async()=>we(e,t),queryKey:[`github-repositories`,t]})}async function Ee(e,t,n){let r=await Ce.api[`data-sources`][`:id`][`github-repositories`].$post({json:{repositories:n},param:{id:t},query:{organizationId:e}});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(H(e,`Failed to update GitHub repositories`))}return r.json()}function De({queryClient:e,organizationId:t,dataSourceId:n,onSuccess:r,onError:i}){let a=Te(t,n);return J({mutationFn:async e=>Ee(t,n,e.repositories),mutationKey:[`github-repositories`,n,`update`],onError:i,onSuccess:(t,n)=>{e.setQueryData(a.queryKey,e=>e&&{...e,selected:t.repositories}),r?.(t,n)}})}var Oe=Y.createContext(void 0);function ke(){let e=Y.useContext(Oe);if(e===void 0)throw Error(l(53));return e}var Ae=function(e){return e.scrollAreaCornerHeight=`--scroll-area-corner-height`,e.scrollAreaCornerWidth=`--scroll-area-corner-width`,e}({});function je(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=n===`x`?`Inline`:`Block`;return n===`x`&&t===`margin`?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}var Me=function(e){return e.orientation=`data-orientation`,e.hovering=`data-hovering`,e.scrolling=`data-scrolling`,e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),Ne=function(e){return e.hasOverflowX=`data-has-overflow-x`,e.hasOverflowY=`data-has-overflow-y`,e.overflowXStart=`data-overflow-x-start`,e.overflowXEnd=`data-overflow-x-end`,e.overflowYStart=`data-overflow-y-start`,e.overflowYEnd=`data-overflow-y-end`,e}({}),Pe={hasOverflowX:e=>e?{[Ne.hasOverflowX]:``}:null,hasOverflowY:e=>e?{[Ne.hasOverflowY]:``}:null,overflowXStart:e=>e?{[Ne.overflowXStart]:``}:null,overflowXEnd:e=>e?{[Ne.overflowXEnd]:``}:null,overflowYStart:e=>e?{[Ne.overflowYStart]:``}:null,overflowYEnd:e=>e?{[Ne.overflowYEnd]:``}:null,cornerHidden:()=>null},Fe={x:0,y:0},Ie={width:0,height:0},Le={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},Re={x:!1,y:!1,corner:!1},ze=Y.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,...s}=e,c=Be(i),l=B(),u=R(),p=R(),{nonce:m,disableStyleElements:h}=f(),[g,_]=Y.useState(!1),[v,y]=Y.useState(!1),[b,x]=Y.useState(!1),[S,C]=Y.useState(!1),[w,T]=Y.useState(Ie),[E,D]=Y.useState(Ie),[O,ee]=Y.useState(Le),[k,A]=Y.useState(Re),j=Y.useRef(null),M=Y.useRef(null),N=Y.useRef(null),P=Y.useRef(null),F=Y.useRef(null),te=Y.useRef(null),ne=Y.useRef(null),I=Y.useRef(!1),L=Y.useRef(0),re=Y.useRef(0),z=Y.useRef(0),V=Y.useRef(0),H=Y.useRef(`vertical`),ae=Y.useRef(Fe),U=a(e=>{let t=e.x-ae.current.x,n=e.y-ae.current.y;ae.current=e,n!==0&&(x(!0),u.start(500,()=>{x(!1)})),t!==0&&(y(!0),p.start(500,()=>{y(!1)}))}),W=a(e=>{e.button===0&&(I.current=!0,L.current=e.clientY,re.current=e.clientX,H.current=e.currentTarget.getAttribute(Me.orientation),M.current&&(z.current=M.current.scrollTop,V.current=M.current.scrollLeft),F.current&&H.current===`vertical`&&F.current.setPointerCapture(e.pointerId),te.current&&H.current===`horizontal`&&te.current.setPointerCapture(e.pointerId))}),oe=a(e=>{if(!I.current)return;let t=e.clientY-L.current,n=e.clientX-re.current;if(M.current){let r=M.current.scrollHeight,i=M.current.clientHeight,a=M.current.scrollWidth,o=M.current.clientWidth;if(F.current&&N.current&&H.current===`vertical`){let n=je(N.current,`padding`,`y`),a=je(F.current,`margin`,`y`),o=F.current.offsetHeight,s=t/(N.current.offsetHeight-o-n-a);M.current.scrollTop=z.current+s*(r-i),e.preventDefault(),x(!0),u.start(500,()=>{x(!1)})}if(te.current&&P.current&&H.current===`horizontal`){let t=je(P.current,`padding`,`x`),r=je(te.current,`margin`,`x`),i=te.current.offsetWidth,s=n/(P.current.offsetWidth-i-t-r);M.current.scrollLeft=V.current+s*(a-o),e.preventDefault(),y(!0),p.start(500,()=>{y(!1)})}}}),G=a(e=>{I.current=!1,F.current&&H.current===`vertical`&&F.current.releasePointerCapture(e.pointerId),te.current&&H.current===`horizontal`&&te.current.releasePointerCapture(e.pointerId)});function se(e){C(e.pointerType===`touch`)}function ce(e){se(e),e.pointerType!==`touch`&&_(ie(j.current,e.target))}let K=Y.useMemo(()=>({hasOverflowX:!k.x,hasOverflowY:!k.y,overflowXStart:O.xStart,overflowXEnd:O.xEnd,overflowYStart:O.yStart,overflowYEnd:O.yEnd,cornerHidden:k.corner}),[k.x,k.y,k.corner,O]),le={role:`presentation`,onPointerEnter:ce,onPointerMove:ce,onPointerDown:se,onPointerLeave(){_(!1)},style:{position:`relative`,[Ae.scrollAreaCornerHeight]:`${w.height}px`,[Ae.scrollAreaCornerWidth]:`${w.width}px`}},ue=o(`div`,e,{state:K,ref:[t,j],props:[le,s],stateAttributesMapping:Pe}),q=Y.useMemo(()=>({handlePointerDown:W,handlePointerMove:oe,handlePointerUp:G,handleScroll:U,cornerSize:w,setCornerSize:T,thumbSize:E,setThumbSize:D,touchModality:S,cornerRef:ne,scrollingX:v,setScrollingX:y,scrollingY:b,setScrollingY:x,hovering:g,setHovering:_,viewportRef:M,rootRef:j,scrollbarYRef:N,scrollbarXRef:P,thumbYRef:F,thumbXRef:te,rootId:l,hiddenState:k,setHiddenState:A,overflowEdges:O,setOverflowEdges:ee,viewportState:K,overflowEdgeThreshold:c}),[W,oe,G,U,w,E,S,v,y,b,x,g,_,l,k,O,K,c]);return(0,X.jsxs)(Oe.Provider,{value:q,children:[!h&&d.getElement(m),ue]})});function Be(e){if(typeof e==`number`){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}var Ve=Y.createContext(void 0);function He(e,t){if(typeof IntersectionObserver>`u`)return()=>{};let n=new IntersectionObserver(e=>{e.forEach(e=>{e.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}var Ue=function(e){return e.scrollAreaOverflowXStart=`--scroll-area-overflow-x-start`,e.scrollAreaOverflowXEnd=`--scroll-area-overflow-x-end`,e.scrollAreaOverflowYStart=`--scroll-area-overflow-y-start`,e.scrollAreaOverflowYEnd=`--scroll-area-overflow-y-end`,e}({}),We=!1;function Ge(){We||re||(typeof CSS<`u`&&`registerProperty`in CSS&&[Ue.scrollAreaOverflowXStart,Ue.scrollAreaOverflowXEnd,Ue.scrollAreaOverflowYStart,Ue.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),We=!0)}var Ke=Y.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{viewportRef:s,scrollbarYRef:l,scrollbarXRef:u,thumbYRef:f,thumbXRef:m,cornerRef:h,cornerSize:g,setCornerSize:_,setThumbSize:v,rootId:y,setHiddenState:b,hiddenState:x,handleScroll:S,setHovering:C,setOverflowEdges:w,overflowEdges:T,overflowEdgeThreshold:E}=ke(),D=z(),O=Y.useRef(!0),ee=R(),k=R(),A=a(()=>{let e=s.current,t=l.current,n=u.current,r=f.current,i=m.current,a=h.current;if(!e)return;let o=e.scrollHeight,c=e.scrollWidth,d=e.clientHeight,y=e.clientWidth,x=e.scrollTop,S=e.scrollLeft;if(o===0||c===0)return;let C=d>=o,T=y>=c,O=y/c,ee=d/o,k=Math.max(0,c-y),A=Math.max(0,o-d),j=0,M=0;T||(j=p(D===`rtl`?-S:S,0,k),M=k-j);let N=C?0:p(x,0,A),P=C?0:A-N,F=T?0:y,te=C?0:d,ne=0,I=0;!T&&!C&&(ne=t?.offsetWidth||0,I=n?.offsetHeight||0);let L=g.width===0&&g.height===0,re=L?ne:0,R=L?I:0,ie=je(n,`padding`,`x`),z=je(t,`padding`,`y`),B=je(i,`margin`,`x`),V=je(r,`margin`,`y`),H=F-ie-B,ae=te-z-V,U=n?Math.min(n.offsetWidth-re,H):H,W=t?Math.min(t.offsetHeight-R,ae):ae,oe=Math.max(16,U*O),G=Math.max(16,W*ee);if(v(e=>e.height===G&&e.width===oe?e:{width:oe,height:G}),t&&r){let e=t.offsetHeight-G-z-V,n=o-d,i=n===0?0:x/n,a=Math.min(e,Math.max(0,i*e));r.style.transform=`translate3d(0,${a}px,0)`}if(n&&i){let e=n.offsetWidth-oe-ie-B,t=c-y,r=t===0?0:S/t,a=D===`rtl`?p(r*e,-e,0):p(r*e,0,e);i.style.transform=`translate3d(${a}px,0,0)`}let se=p(j,0,k),ce=p(M,0,k),K=p(N,0,A),le=p(P,0,A),ue=[[Ue.scrollAreaOverflowXStart,se],[Ue.scrollAreaOverflowXEnd,ce],[Ue.scrollAreaOverflowYStart,K],[Ue.scrollAreaOverflowYEnd,le]];for(let[t,n]of ue)e.style.setProperty(t,`${n}px`);a&&(T||C?_({width:0,height:0}):!T&&!C&&_({width:ne,height:I})),b(e=>{let t=C||T;return e.y===C&&e.x===T&&e.corner===t?e:{y:C,x:T,corner:t}});let q={xStart:!T&&se>E.xStart,xEnd:!T&&ce>E.xEnd,yStart:!C&&K>E.yStart,yEnd:!C&&le>E.yEnd};w(e=>e.xStart===q.xStart&&e.xEnd===q.xEnd&&e.yStart===q.yStart&&e.yEnd===q.yEnd?e:q)});c(()=>{if(!s.current)return;Ge();let e=!1;return He(s.current,()=>{if(!e){e=!0;return}A()})},[A,s]),c(()=>{queueMicrotask(A)},[A,x,D]),c(()=>{s.current?.matches(`:hover`)&&C(!0)},[s,C]),Y.useEffect(()=>{let e=s.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;return}A()});return n.observe(e),k.start(0,()=>{let t=e.getAnimations({subtree:!0});t.length!==0&&Promise.all(t.map(e=>e.finished)).then(A).catch(()=>{})}),()=>{n.disconnect(),k.clear()}},[A,s,k]);function j(){O.current=!1}let M={role:`presentation`,...y&&{"data-id":`${y}-viewport`},...(!x.x||!x.y)&&{tabIndex:0},className:d.className,style:{overflow:`scroll`},onScroll(){s.current&&(A(),O.current||S({x:s.current.scrollLeft,y:s.current.scrollTop}),ee.start(100,()=>{O.current=!0}))},onWheel:j,onTouchMove:j,onPointerMove:j,onPointerEnter:j,onKeyDown:j},N=Y.useMemo(()=>({hasOverflowX:!x.x,hasOverflowY:!x.y,overflowXStart:T.xStart,overflowXEnd:T.xEnd,overflowYStart:T.yStart,overflowYEnd:T.yEnd,cornerHidden:x.corner}),[x.x,x.y,x.corner,T]),P=o(`div`,e,{ref:[t,s],state:N,props:[M,i],stateAttributesMapping:Pe}),F=Y.useMemo(()=>({computeThumbPosition:A}),[A]);return(0,X.jsx)(Ve.Provider,{value:F,children:P})}),qe=Y.createContext(void 0);function Je(){let e=Y.useContext(qe);if(e===void 0)throw Error(l(54));return e}var Ye=function(e){return e.scrollAreaThumbHeight=`--scroll-area-thumb-height`,e.scrollAreaThumbWidth=`--scroll-area-thumb-width`,e}({}),Xe=Y.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,overflowEdges:f,scrollbarYRef:p,scrollbarXRef:m,viewportRef:h,thumbYRef:g,thumbXRef:_,handlePointerDown:v,handlePointerUp:y,rootId:b,thumbSize:x}=ke(),S=Y.useMemo(()=>({hovering:c,scrolling:{horizontal:l,vertical:u}[i],orientation:i,hasOverflowX:!d.x,hasOverflowY:!d.y,overflowXStart:f.xStart,overflowXEnd:f.xEnd,overflowYStart:f.yStart,overflowYEnd:f.yEnd,cornerHidden:d.corner}),[c,l,u,i,d,f]),C=z();Y.useEffect(()=>{let e=h.current,t=i===`vertical`?p.current:m.current;if(!t)return;function n(n){if(!(!e||!t||n.ctrlKey)){if(n.preventDefault(),i===`vertical`){if(e.scrollTop===0&&n.deltaY<0)return}else if(e.scrollLeft===0&&n.deltaX<0)return;if(i===`vertical`){if(e.scrollTop===e.scrollHeight-e.clientHeight&&n.deltaY>0)return}else if(e.scrollLeft===e.scrollWidth-e.clientWidth&&n.deltaX>0)return;i===`vertical`?e.scrollTop+=n.deltaY:e.scrollLeft+=n.deltaX}}return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[i,m,p,h]);let w={...b&&{"data-id":`${b}-scrollbar`},onPointerDown(e){if(e.button===0&&e.currentTarget===e.target&&h.current){if(g.current&&p.current&&i===`vertical`){let t=je(g.current,`margin`,`y`),n=je(p.current,`padding`,`y`),r=g.current.offsetHeight,i=p.current.getBoundingClientRect(),a=e.clientY-i.top-r/2-n+t/2,o=h.current.scrollHeight,s=h.current.clientHeight,c=a/(p.current.offsetHeight-r-n-t)*(o-s);h.current.scrollTop=c}if(_.current&&m.current&&i===`horizontal`){let t=je(_.current,`margin`,`x`),n=je(m.current,`padding`,`x`),r=_.current.offsetWidth,i=m.current.getBoundingClientRect(),a=e.clientX-i.left-r/2-n+t/2,o=h.current.scrollWidth,s=h.current.clientWidth,c=a/(m.current.offsetWidth-r-n-t),l;C===`rtl`?(l=(1-c)*(o-s),h.current.scrollLeft<=0&&(l=-l)):l=c*(o-s),h.current.scrollLeft=l}v(e)}},onPointerUp:y,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,...i===`vertical`&&{top:0,bottom:`var(${Ae.scrollAreaCornerHeight})`,insetInlineEnd:0,[Ye.scrollAreaThumbHeight]:`${x.height}px`},...i===`horizontal`&&{insetInlineStart:0,insetInlineEnd:`var(${Ae.scrollAreaCornerWidth})`,bottom:0,[Ye.scrollAreaThumbWidth]:`${x.width}px`}}},T=o(`div`,e,{ref:[t,i===`vertical`?p:m],state:S,props:[w,s],stateAttributesMapping:Pe}),E=Y.useMemo(()=>({orientation:i}),[i]),D=i===`vertical`?d.y:d.x;return a||!D?(0,X.jsx)(qe.Provider,{value:E,children:T}):null}),Ze=Y.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{thumbYRef:a,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,setScrollingX:d,setScrollingY:f}=ke(),{orientation:p}=Je(),m=Y.useMemo(()=>({orientation:p}),[p]);return o(`div`,e,{ref:[t,p===`vertical`?a:s],state:m,props:[{onPointerDown:c,onPointerMove:l,onPointerUp(e){p===`vertical`&&f(!1),p===`horizontal`&&d(!1),u(e)},style:{...p===`vertical`&&{height:`var(${Ye.scrollAreaThumbHeight})`},...p===`horizontal`&&{width:`var(${Ye.scrollAreaThumbWidth})`}}},i]})}),Qe=Y.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{cornerRef:a,cornerSize:s,hiddenState:c}=ke(),l=o(`div`,e,{ref:[t,a],props:[{style:{position:`absolute`,bottom:0,insetInlineEnd:0,width:s.width,height:s.height}},i]});return c.corner?null:l});function $e(e){let t=(0,be.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=u(`relative`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=(0,X.jsx)(Ke,{"data-slot":`scroll-area-viewport`,className:`focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,children:n}),t[6]=n,t[7]=o);let s,c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(et,{}),c=(0,X.jsx)(Qe,{}),t[8]=s,t[9]=c):(s=t[8],c=t[9]);let l;return t[10]!==i||t[11]!==a||t[12]!==o?(l=(0,X.jsxs)(ze,{"data-slot":`scroll-area`,className:a,...i,children:[o,s,c]}),t[10]=i,t[11]=a,t[12]=o,t[13]=l):l=t[13],l}function et(e){let t=(0,be.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=u(`data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(Ze,{"data-slot":`scroll-area-thumb`,className:`rounded-full bg-border relative flex-1`}),t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==o?(c=(0,X.jsx)(Xe,{"data-slot":`scroll-area-scrollbar`,"data-orientation":a,orientation:a,className:o,...r,children:s}),t[7]=a,t[8]=r,t[9]=o,t[10]=c):c=t[10],c}function tt(e,t){if(e.length!==t.length)return!0;let n=new Set(e);return t.some(e=>!n.has(e))}function nt(e){let t=(0,be.c)(94),[n,r]=(0,Y.useState)(``),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Y.useState)(i),c=(0,Y.useRef)(!1),l=ae(),u;t[1]!==e.dataSourceId||t[2]!==e.organizationId?(u=Te(e.organizationId,e.dataSourceId),t[1]=e.dataSourceId,t[2]=e.organizationId,t[3]=u):u=t[3];let d;t[4]!==e.open||t[5]!==u?(d={...u,enabled:e.open},t[4]=e.open,t[5]=u,t[6]=d):d=t[6];let f=ne(d),p;t[7]===f.data?.repositories?p=t[8]:(p=f.data?.repositories??[],t[7]=f.data?.repositories,t[8]=p);let m=p,h;t[9]===f.data?.selected?h=t[10]:(h=f.data?.selected??[],t[9]=f.data?.selected,t[10]=h);let _=h,v,y;t[11]!==_||t[12]!==e.open||t[13]!==f.data?(v=()=>{if(!e.open){c.current=!1,r(``);return}f.data&&(c.current||=(o(_),!0))},y=[_,e.open,f.data],t[11]=_,t[12]=e.open,t[13]=f.data,t[14]=v,t[15]=y):(v=t[14],y=t[15]),(0,Y.useEffect)(v,y);let b;if(t[16]!==m||t[17]!==n){bb0:{let e=n.trim().toLowerCase();if(!e){b=m;break bb0}b=m.filter(t=>{let n=t.owner.toLowerCase(),r=t.name.toLowerCase(),i=t.fullName.toLowerCase();return n.includes(e)||r.includes(e)||i.includes(e)})}t[16]=m,t[17]=n,t[18]=b}else b=t[18];let x=b,S;t[19]!==_||t[20]!==a?(S=tt(a,_),t[19]=_,t[20]=a,t[21]=S):S=t[21];let w=S,E;t[22]===e?E=t[23]:(E=()=>{K.success(`GitHub repositories updated`),e.onOpenChange(!1)},t[22]=e,t[23]=E);let D;t[24]!==e.dataSourceId||t[25]!==e.organizationId||t[26]!==l||t[27]!==E?(D=De({dataSourceId:e.dataSourceId,onError:it,onSuccess:E,organizationId:e.organizationId,queryClient:l}),t[24]=e.dataSourceId,t[25]=e.organizationId,t[26]=l,t[27]=E,t[28]=D):D=t[28];let O=te(D),j;t[29]===a?j=t[30]:(j=new Set(a),t[29]=a,t[30]=j);let M=j,I;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){o(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},t[31]=I):I=t[31];let L=I,re;t[32]===x?re=t[33]:(re=function(){let e=x.map(rt);o(t=>[...new Set([...t,...e])])},t[32]=x,t[33]=re);let R=re,ie;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(){o([])},t[34]=ie):ie=t[34];let z=ie,B=f.isLoading,V=f.isError,H=w&&!O.isPending,U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,X.jsxs)(F,{children:[(0,X.jsx)(k,{children:`Select GitHub Repositories`}),(0,X.jsx)(ee,{children:`Choose repositories to use for this data source. We only read from the repositories your saved token can access and that you select here.`})]}),t[35]=U):U=t[35];let W;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(T,{size:16,className:`absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground`}),t[36]=W):W=t[36];let oe;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(oe=e=>r(e.target.value),t[37]=oe):oe=t[37];let G;t[38]===n?G=t[39]:(G=(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[W,(0,X.jsx)(le,{value:n,onChange:oe,placeholder:`Search repositories...`,className:`pl-9`})]}),t[38]=n,t[39]=G);let se=x.length===0,ce;t[40]!==R||t[41]!==se?(ce=(0,X.jsx)(s,{variant:`outline`,size:`sm`,onClick:R,disabled:se,children:`Select visible`}),t[40]=R,t[41]=se,t[42]=ce):ce=t[42];let ue=a.length===0,q;t[43]===ue?q=t[44]:(q=(0,X.jsx)(s,{variant:`ghost`,size:`sm`,onClick:z,disabled:ue,children:`Clear`}),t[43]=ue,t[44]=q);let de;t[45]!==G||t[46]!==ce||t[47]!==q?(de=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[G,ce,q]}),t[45]=G,t[46]=ce,t[47]=q,t[48]=de):de=t[48];let fe=m.length>0?` • ${m.length} available`:``,pe;t[49]!==a.length||t[50]!==fe?(pe=(0,X.jsxs)(`span`,{children:[a.length,` selected`,fe]}),t[49]=a.length,t[50]=fe,t[51]=pe):pe=t[51];let me;t[52]===w?me=t[53]:(me=w?(0,X.jsx)(ye,{variant:`outline`,children:`Unsaved`}):null,t[52]=w,t[53]=me);let he;t[54]!==pe||t[55]!==me?(he=(0,X.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[pe,me]}),t[54]=pe,t[55]=me,t[56]=he):he=t[56];let ge;t[57]===B?ge=t[58]:(ge=B?(0,X.jsx)(`div`,{className:`flex items-center justify-center py-12 text-muted-foreground`,children:(0,X.jsx)(C,{size:24,className:`animate-spin`})}):null,t[57]=B,t[58]=ge);let _e;t[59]===V?_e=t[60]:(_e=V?(0,X.jsx)(`p`,{className:`text-sm text-destructive`,children:`Unable to load repositories. Please try again.`}):null,t[59]=V,t[60]=_e);let ve;t[61]!==x||t[62]!==V||t[63]!==B||t[64]!==M?(ve=!B&&!V?(0,X.jsx)($e,{className:`h-[320px] rounded-md border`,children:(0,X.jsxs)(`div`,{className:`p-2 space-y-1`,children:[x.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground px-3 py-6 text-center`,children:`No repositories found.`}):null,x.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`w-full flex items-center gap-3 rounded-md px-3 py-2 hover:bg-accent transition-colors text-left`,onClick:t=>{let n=t.target;n instanceof HTMLElement&&(n.closest(`[data-slot="checkbox"]`)||L(e.fullName))},children:[(0,X.jsx)(g,{checked:M.has(e.fullName),onCheckedChange:()=>L(e.fullName)}),(0,X.jsxs)(`div`,{className:`flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.fullName}),e.private?(0,X.jsx)(ye,{variant:`secondary`,children:`Private`}):null]}),(0,X.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Owner: `,e.owner]})]})]},e.id))]})}):null,t[61]=x,t[62]=V,t[63]=B,t[64]=M,t[65]=ve):ve=t[65];let J;t[66]!==de||t[67]!==he||t[68]!==ge||t[69]!==_e||t[70]!==ve?(J=(0,X.jsxs)(`div`,{className:`space-y-3`,children:[de,he,ge,_e,ve]}),t[66]=de,t[67]=he,t[68]=ge,t[69]=_e,t[70]=ve,t[71]=J):J=t[71];let Z;t[72]===e?Z=t[73]:(Z=()=>e.onOpenChange(!1),t[72]=e,t[73]=Z);let Q;t[74]!==Z||t[75]!==O.isPending?(Q=(0,X.jsx)(s,{variant:`outline`,onClick:Z,disabled:O.isPending,children:`Cancel`}),t[74]=Z,t[75]=O.isPending,t[76]=Q):Q=t[76];let $;t[77]!==a||t[78]!==O?($=()=>O.mutate({repositories:a}),t[77]=a,t[78]=O,t[79]=$):$=t[79];let xe=!H,Se=O.isPending?`Saving...`:`Save`,Ce;t[80]!==$||t[81]!==xe||t[82]!==Se?(Ce=(0,X.jsx)(s,{onClick:$,disabled:xe,children:Se}),t[80]=$,t[81]=xe,t[82]=Se,t[83]=Ce):Ce=t[83];let we;t[84]!==Q||t[85]!==Ce?(we=(0,X.jsxs)(N,{children:[Q,Ce]}),t[84]=Q,t[85]=Ce,t[86]=we):we=t[86];let Ee;t[87]!==J||t[88]!==we?(Ee=(0,X.jsxs)(A,{className:`sm:max-w-[680px]`,children:[U,J,we]}),t[87]=J,t[88]=we,t[89]=Ee):Ee=t[89];let Oe;return t[90]!==e.onOpenChange||t[91]!==e.open||t[92]!==Ee?(Oe=(0,X.jsx)(P,{open:e.open,onOpenChange:e.onOpenChange,children:Ee}),t[90]=e.onOpenChange,t[91]=e.open,t[92]=Ee,t[93]=Oe):Oe=t[93],Oe}function rt(e){return e.fullName}function it(e){Se({title:`Failed to update GitHub repositories`,description:e.message})}function at(e){switch(e){case`active`:return`default`;case`error`:return`destructive`;case`disconnected`:return`secondary`;default:return`outline`}}function ot(e){let t=(0,be.c)(4);if(!e.errorMessage)return null;let n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(U,{className:`size-4`}),r=(0,X.jsx)(D,{children:`Connection needs attention`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e.errorMessage?i=t[3]:(i=(0,X.jsxs)(O,{variant:`destructive`,className:`mt-3 border-destructive/30 bg-destructive/5`,children:[n,r,(0,X.jsx)(E,{className:`max-h-32 overflow-y-auto whitespace-pre-wrap break-words pr-1`,children:e.errorMessage})]}),t[2]=e.errorMessage,t[3]=i),i}function st(e){let t=(0,be.c)(83),{dataSource:n,organizationId:r,openGitHubRepositories:i,providers:a}=e,o;t[0]===r?o=t[1]:(o=G(r),t[0]=r,t[1]=o);let c=o.queryKey,[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(!1),f,p;t[2]!==n.provider||t[3]!==i?(f=()=>{d.current||i&&n.provider===`github`&&(u(!0),d.current=!0)},p=[n.provider,i],t[2]=n.provider,t[3]=i,t[4]=f,t[5]=p):(f=t[4],p=t[5]),(0,Y.useEffect)(f,p);let g;t[6]!==n.id||t[7]!==r?(g=async()=>se(n.id,r),t[6]=n.id,t[7]=r,t[8]=g):g=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=[`data-sources`],t[9]=y):y=t[9];let S;t[10]===g?S=t[11]:(S={mutationFn:g,mutationKey:y,onError:lt,onSuccess:ct},t[10]=g,t[11]=S);let C=te(S),w;t[12]!==n.id||t[13]!==r?(w=async()=>ce(n.id,r),t[12]=n.id,t[13]=r,t[14]=w):w=t[14];let T;t[15]!==n.id||t[16]!==c||t[17]!==w?(T={errorMessage:`Failed to delete data source`,itemId:n.id,mutationFn:w,queryKey:c,successMessage:`Data source deleted`},t[15]=n.id,t[16]=c,t[17]=w,t[18]=T):T=t[18];let E=M(T),D;t[19]===n.provider?D=t[20]:(D=b(n.provider),t[19]=n.provider,t[20]=D);let O=D,ee;t[21]!==n.provider||t[22]!==a?(ee=v(n.provider,a),t[21]=n.provider,t[22]=a,t[23]=ee):ee=t[23];let k=ee,A=k?`Test Connection`:`Test Connection (Unsupported)`,j;t[24]===n.name?j=t[25]:(j=(0,X.jsx)(ge,{className:`text-lg`,children:n.name}),t[24]=n.name,t[25]=j);let N;t[26]===O?N=t[27]:(N=(0,X.jsx)(O,{className:`h-4.5 w-4.5`}),t[26]=O,t[27]=N);let P;t[28]!==n.provider||t[29]!==a?(P=x(n.provider,a),t[28]=n.provider,t[29]=a,t[30]=P):P=t[30];let F;t[31]!==N||t[32]!==P?(F=(0,X.jsxs)(_e,{className:`flex items-center gap-1.5 mt-0.5`,children:[N,P]}),t[31]=N,t[32]=P,t[33]=F):F=t[33];let ne;t[34]!==j||t[35]!==F?(ne=(0,X.jsxs)(`div`,{children:[j,F]}),t[34]=j,t[35]=F,t[36]=ne):ne=t[36];let I;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(ue,{children:(0,X.jsx)(s,{variant:`ghost`,size:`icon-sm`,children:(0,X.jsx)(h,{size:16,stroke:2})})}),t[37]=I):I=t[37];let L;t[38]===C?L=t[39]:(L=()=>C.mutate(),t[38]=C,t[39]=L);let re=C.isPending||!k,R;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,X.jsx)(oe,{size:16,stroke:2}),t[40]=R):R=t[40];let ie=C.isPending?`Testing...`:A,z;t[41]!==L||t[42]!==re||t[43]!==ie?(z=(0,X.jsxs)(de,{onClick:L,disabled:re,children:[R,ie]}),t[41]=L,t[42]=re,t[43]=ie,t[44]=z):z=t[44];let B;t[45]===n.provider?B=t[46]:(B=n.provider===`github`?(0,X.jsxs)(de,{onClick:()=>u(!0),children:[(0,X.jsx)(_,{size:16,stroke:`2`}),`Select Repositories`]}):null,t[45]=n.provider,t[46]=B);let V;t[47]===E?V=t[48]:(V=()=>E.mutate(),t[47]=E,t[48]=V);let H;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,X.jsx)(m,{size:16,stroke:2}),t[49]=H):H=t[49];let ae=E.isPending?`Deleting...`:`Delete`,U;t[50]!==E.isPending||t[51]!==V||t[52]!==ae?(U=(0,X.jsxs)(de,{onClick:V,disabled:E.isPending,className:`text-destructive focus:text-destructive`,children:[H,ae]}),t[50]=E.isPending,t[51]=V,t[52]=ae,t[53]=U):U=t[53];let W;t[54]!==z||t[55]!==B||t[56]!==U?(W=(0,X.jsxs)(fe,{children:[I,(0,X.jsxs)(q,{align:`end`,className:`min-w-40`,children:[z,B,U]})]}),t[54]=z,t[55]=B,t[56]=U,t[57]=W):W=t[57];let K;t[58]!==ne||t[59]!==W?(K=(0,X.jsxs)(me,{className:`flex flex-row items-start justify-between space-y-0 pb-2`,children:[ne,W]}),t[58]=ne,t[59]=W,t[60]=K):K=t[60];let le;t[61]===n.status?le=t[62]:(le=at(n.status),t[61]=n.status,t[62]=le);let J;t[63]!==n.status||t[64]!==le?(J=(0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,X.jsx)(ye,{variant:le,children:n.status})}),t[63]=n.status,t[64]=le,t[65]=J):J=t[65];let Z;t[66]===n.lastUsedAt?Z=t[67]:(Z=n.lastUsedAt&&(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground mt-2`,children:[`Last used: `,pe(n.lastUsedAt)]}),t[66]=n.lastUsedAt,t[67]=Z);let Q;t[68]===n.errorMessage?Q=t[69]:(Q=(0,X.jsx)(ot,{errorMessage:n.errorMessage}),t[68]=n.errorMessage,t[69]=Q);let $;t[70]!==J||t[71]!==Z||t[72]!==Q?($=(0,X.jsxs)(he,{children:[J,Z,Q]}),t[70]=J,t[71]=Z,t[72]=Q,t[73]=$):$=t[73];let xe;t[74]!==n.id||t[75]!==n.provider||t[76]!==r||t[77]!==l?(xe=n.provider===`github`?(0,X.jsx)(nt,{organizationId:r,dataSourceId:n.id,open:l,onOpenChange:u}):null,t[74]=n.id,t[75]=n.provider,t[76]=r,t[77]=l,t[78]=xe):xe=t[78];let Se;return t[79]!==K||t[80]!==$||t[81]!==xe?(Se=(0,X.jsxs)(ve,{children:[K,$,xe]}),t[79]=K,t[80]=$,t[81]=xe,t[82]=Se):Se=t[82],Se}function ct(e){if(e.kind===`unsupported`){K.info(e.message);return}if(e.result.success){K.success(`Data source test successful`);return}Se({title:`Data source test failed`,description:e.result.error??e.result.message??`Unknown error`})}function lt(e){return Se({title:`Failed to test data source`,description:e.message})}function ut(e){return e}function dt(e){let t=(0,be.c)(16),n;t[0]===e.provider.id?n=t[1]:(n=b(e.provider.id),t[0]=e.provider.id,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=(0,X.jsx)(r,{className:`h-5 w-5 text-muted-foreground shrink-0`}),t[2]=r,t[3]=i);let a;t[4]===e.provider.label?a=t[5]:(a=(0,X.jsx)(`p`,{className:`font-medium truncate`,children:e.provider.label}),t[4]=e.provider.label,t[5]=a);let o;t[6]!==i||t[7]!==a?(o=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[i,a]}),t[6]=i,t[7]=a,t[8]=o):o=t[8];let c;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(s,{variant:`secondary`,size:`sm`,children:`Connect`}),t[9]=c):c=t[9];let l;t[10]!==e.organizationId||t[11]!==e.provider.id?(l=(0,X.jsx)(Z,{organizationId:e.organizationId,initialProvider:e.provider.id,children:c}),t[10]=e.organizationId,t[11]=e.provider.id,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,X.jsx)(ve,{className:`border-dashed`,children:(0,X.jsx)(he,{className:`p-4`,children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[o,l]})})}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function ft(e){let t=(0,be.c)(37),{organizationId:n,openGitHubDataSourceId:r}=e,i;t[0]===n?i=t[1]:(i=G(n),t[0]=n,t[1]=i);let{data:a}=I(i),o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=W(),t[2]=o):o=t[2];let{data:c}=I(o),l=c.providers,u,d,f,p,m,h,g,_;if(t[3]!==a||t[4]!==r||t[5]!==n||t[6]!==l){let e=ut(a),i=new Set(e.map(pt)),o=y(l).filter(e=>!i.has(e.id)),c=e.length>0;h=`space-y-8`;let v;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-lg font-semibold`,children:`Connected`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Data sources already connected to your workspace.`})]}),t[15]=v):v=t[15];let b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsxs)(s,{children:[(0,X.jsx)(w,{size:16,stroke:2}),`Add Data Source`]}),t[16]=b):b=t[16],t[17]===n?g=t[18]:(g=(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[v,(0,X.jsx)(Z,{organizationId:n,children:b})]}),t[17]=n,t[18]=g),t[19]===c?_=t[20]:(_=c?null:(0,X.jsxs)(`div`,{className:`text-center py-12`,children:[(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:`No connected data sources yet.`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Connect one below or add a new data source to get started.`})]}),t[19]=c,t[20]=_),u=c?(0,X.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>(0,X.jsx)(st,{dataSource:e,organizationId:n,openGitHubRepositories:r===e.id,providers:l},e.id))}):null,p=`space-y-4`,t[21]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-lg font-semibold`,children:`Not connected`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Available data sources you can connect next.`})]}),t[21]=m):m=t[21],d=`grid gap-4 md:grid-cols-2 lg:grid-cols-3`;let x;t[22]===n?x=t[23]:(x=e=>(0,X.jsx)(dt,{provider:e,organizationId:n},e.id),t[22]=n,t[23]=x),f=o.map(x),t[3]=a,t[4]=r,t[5]=n,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_}else u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14];let v;t[24]!==d||t[25]!==f?(v=(0,X.jsx)(`div`,{className:d,children:f}),t[24]=d,t[25]=f,t[26]=v):v=t[26];let b;t[27]!==v||t[28]!==p||t[29]!==m?(b=(0,X.jsxs)(`div`,{className:p,children:[m,v]}),t[27]=v,t[28]=p,t[29]=m,t[30]=b):b=t[30];let x;return t[31]!==u||t[32]!==b||t[33]!==h||t[34]!==g||t[35]!==_?(x=(0,X.jsxs)(`div`,{className:h,children:[g,_,u,b]}),t[31]=u,t[32]=b,t[33]=h,t[34]=g,t[35]=_,t[36]=x):x=t[36],x}function pt(e){return e.provider}var mt=i(`/_authenticated/$org_slug/integrations`);function ht(){let e=(0,be.c)(4),{organizationId:t}=mt.useRouteContext(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`section`,{children:(0,X.jsxs)(`div`,{className:`mb-6`,children:[(0,X.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Integrations`}),(0,X.jsx)(`p`,{className:`text-muted-foreground mt-2`,children:`Manage the data sources connected to your workspace.`})]})}),e[0]=n):n=e[0];let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsxs)(`div`,{className:`mb-4`,children:[(0,X.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Data Sources`}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm mt-1`,children:`Connect databases, analytics platforms, and other services to provide data for your agents.`})]}),e[1]=r):r=e[1];let i;return e[2]===t?i=e[3]:(i=(0,X.jsxs)(`div`,{className:`p-8 space-y-12`,children:[n,(0,X.jsxs)(`section`,{children:[r,(0,X.jsx)(ft,{organizationId:t})]})]}),e[2]=t,e[3]=i),i}var gt=ht;export{gt as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DG_AJzB_.js";import{t}from"./compiler-runtime-DCc3R3Xn.js";import{a as n,o as r}from"./api-base-url-DIb6qukm.js";import{n as i}from"./createReactComponent-_L2mp4Ui.js";import{t as a}from"./IconCheck-Gc24xPT2.js";import{t as o}from"./IconLoader2-BpZcTuHV.js";import{t as s}from"./IconX-rRpRFwc5.js";import{t as c}from"./auth-client-D-YHMy0G.js";import{a as l,i as u}from"./app-routes-CMyon6Em.js";import{A as d,V as f,j as p}from"./index-CXR0dKJj.js";import{a as m,i as h,r as g,t as _}from"./xstate-react.esm-Bo3CCIRt.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./card-Dllm2lhp.js";import{n as w,t as T}from"./dist-BNi06Dzx.js";var E=t(),D=n(u),O=`Failed to accept invitation`,k=`Failed to navigate. Try again from home.`,A=1500,j={kind:`home`},M={ACCEPT:`inviteAccept/accept`,DECLINE:`inviteAccept/decline`,GO_HOME:`inviteAccept/goHome`},N={ACCEPTING:`accepting`,ERROR:`error`,NAVIGATING:`navigating`,NAVIGATING_FROM_ERROR:`fromError`,NAVIGATING_FROM_READY:`fromReady`,NAVIGATING_FROM_SUCCESS:`fromSuccess`,READY:`ready`,REFRESHING_ORGANIZATIONS:`refreshingOrganizations`,SUCCESS_PENDING_REDIRECT:`successPendingRedirect`},P={ACCEPTING:`accepting`,ERROR:`error`,READY:`ready`,SUCCESS:`success`},F=class extends w(`InviteAcceptRequestError`)(){},I=class extends w(`InviteRedirectResolutionError`)(){};function L(){return{kind:`idle`}}function R(e){return{kind:`accepted`,organizationId:e}}function z(e){return{kind:`error`,message:e}}function B(e){return{invitationId:e,outcome:L(),redirectTarget:null}}function V(e){return B(e.invitationId)}function H(e,t){return{...V(e),outcome:z(t)}}function U(e){return e.redirectTarget??j}function W(e){if(e.outcome.kind!==`accepted`)throw Error(`Accepted organization id is required to resolve redirect`);return e.outcome.organizationId}async function G(e){let t=await T.tryPromise({try:()=>c.acceptInvitation({invitationId:e}),catch:e=>new F({cause:e,message:O,reason:`request_failed`})});if(t.isErr())return T.err(t.error);let n=t.value;return n.error?T.err(new F({message:J(n.error.message,O),reason:`response_failed`})):T.ok({acceptedOrganizationId:n.data.member.organizationId})}async function K(e){let t=await T.tryPromise({try:()=>e.refetchSession(),catch:t=>new I({acceptedOrganizationId:e.acceptedOrganizationId,cause:t,message:`Failed to refresh organizations after accepting invitation`,reason:`session_refresh_failed`,...e.userId?{userId:e.userId}:{}})});if(t.isErr())return Y(t.error),T.err(t.error);let n=await T.tryPromise({try:()=>e.queryClient.fetchQuery({...d(e.userId),staleTime:0}),catch:t=>new I({acceptedOrganizationId:e.acceptedOrganizationId,cause:t,message:`Failed to refresh organizations after accepting invitation`,reason:`organization_list_failed`,...e.userId?{userId:e.userId}:{}})});if(n.isErr())return Y(n.error),T.err(n.error);let r=n.value.find(t=>t.id===e.acceptedOrganizationId);if(r)return T.ok({kind:`organization`,organizationSlug:p(r)});let i=await T.tryPromise({try:()=>c.getFullOrganization({query:{organizationId:e.acceptedOrganizationId}}),catch:t=>new I({acceptedOrganizationId:e.acceptedOrganizationId,cause:t,message:`Failed to load accepted organization details`,reason:`organization_lookup_failed`,...e.userId?{userId:e.userId}:{}})});if(i.isErr())return Y(i.error),T.err(i.error);if(i.value.data?.slug)return T.ok({kind:`organization`,organizationSlug:i.value.data.slug});let a=new I({acceptedOrganizationId:e.acceptedOrganizationId,message:`Accepted invitation but organization was not found`,reason:`organization_missing`,...e.userId?{userId:e.userId}:{}});return Y(a),T.err(a)}function q(e,t){if(!(e instanceof Error))return t;let n=e.message.trim();return n.length===0?t:n}function J(e,t){let n=e?.trim()??``;return n.length>0?n:t}function Y(e){if(e.reason===`organization_missing`){console.error(`[invite] accepted invitation but organization was not found`,{acceptedOrganizationId:e.acceptedOrganizationId,userId:e.userId});return}console.error(`[invite] accepted invitation but failed to refresh orgs`,{acceptedOrganizationId:e.acceptedOrganizationId,error:e.cause??e.message,reason:e.reason,userId:e.userId})}function X(e={}){return Z.provide({delays:{successRedirect:e.successRedirectDelayMs??A}})}var Z=g({actions:{prepareAcceptRequest:h(()=>({outcome:L(),redirectTarget:null})),resetFlow:h(({context:e})=>V(e)),setHomeRedirectTarget:h({redirectTarget:()=>j}),storeAcceptError:h(({context:e},t)=>H(e,q(t.error,O))),storeAcceptedOrganizationId:h({outcome:(e,t)=>R(t.acceptedOrganizationId),redirectTarget:()=>null}),storeNavigationError:h(({context:e},t)=>H(e,Q(t.error))),storeResolvedRedirectTarget:h({redirectTarget:(e,t)=>t.redirectTarget})},actors:{acceptInvitation:m(async({input:e})=>{let t=await G(e.invitationId);if(t.isErr())throw t.error;return t.value}),navigateToInviteTarget:m(async e=>void 0),resolveRedirect:m(async e=>j)},delays:{successRedirect:A},types:{}}).createMachine({context:({input:e})=>B(e.invitationId),id:`inviteAccept`,initial:N.READY,states:{[N.READY]:{tags:P.READY,on:{[M.ACCEPT]:{actions:`prepareAcceptRequest`,target:N.ACCEPTING},[M.DECLINE]:{actions:`setHomeRedirectTarget`,target:`${N.NAVIGATING}.${N.NAVIGATING_FROM_READY}`}}},[N.ACCEPTING]:{tags:P.ACCEPTING,invoke:{src:`acceptInvitation`,input:({context:e})=>({invitationId:e.invitationId}),onDone:{actions:{type:`storeAcceptedOrganizationId`,params:({event:e})=>({acceptedOrganizationId:e.output.acceptedOrganizationId})},target:N.REFRESHING_ORGANIZATIONS},onError:{actions:{type:`storeAcceptError`,params:({event:e})=>({error:e.error})},target:N.ERROR}}},[N.REFRESHING_ORGANIZATIONS]:{tags:P.SUCCESS,invoke:{src:`resolveRedirect`,input:({context:e})=>({acceptedOrganizationId:W(e)}),onDone:{actions:{type:`storeResolvedRedirectTarget`,params:({event:e})=>({redirectTarget:e.output})},target:N.SUCCESS_PENDING_REDIRECT},onError:{actions:`setHomeRedirectTarget`,target:N.SUCCESS_PENDING_REDIRECT}}},[N.SUCCESS_PENDING_REDIRECT]:{tags:P.SUCCESS,after:{successRedirect:`${N.NAVIGATING}.${N.NAVIGATING_FROM_SUCCESS}`}},[N.NAVIGATING]:{initial:N.NAVIGATING_FROM_READY,invoke:{src:`navigateToInviteTarget`,input:({context:e})=>({target:U(e)}),onDone:{actions:`resetFlow`,target:N.READY},onError:{actions:{type:`storeNavigationError`,params:({event:e})=>({error:e.error})},target:N.ERROR}},states:{[N.NAVIGATING_FROM_ERROR]:{tags:P.ERROR},[N.NAVIGATING_FROM_READY]:{tags:P.READY},[N.NAVIGATING_FROM_SUCCESS]:{tags:P.SUCCESS}}},[N.ERROR]:{tags:P.ERROR,on:{[M.GO_HOME]:{actions:`setHomeRedirectTarget`,target:`${N.NAVIGATING}.${N.NAVIGATING_FROM_ERROR}`}}}}}),ee=X();function te(e){return e.hasTag(P.ACCEPTING)?`accepting`:e.hasTag(P.ERROR)?`error`:e.hasTag(P.SUCCESS)?`success`:`ready`}function ne(e){return e.context.outcome.kind===`error`?e.context.outcome.message:null}function Q(e){return q(e,k)}function re(){let e=(0,E.c)(28),t=r(),n=f(),{invitationId:i}=D.useParams(),{auth:a,refetchSession:o}=D.useRouteContext(),s=a.session?.user.id,c;if(e[0]!==t||e[1]!==n||e[2]!==o||e[3]!==s){let r;e[5]===t?r=e[6]:(r=async e=>{let{input:n}=e;try{if(n.target.kind===`home`){await t({to:`/`});return}await t({params:{org_slug:n.target.organizationSlug},to:l})}catch(e){let t=e;throw console.error(`[invite] failed to navigate after accepting invitation`,{error:t,navigationTarget:n.target}),Error(Q(t),{cause:t})}},e[5]=t,e[6]=r);let i;e[7]!==n||e[8]!==o||e[9]!==s?(i=async e=>{let{input:t}=e,r=await K({acceptedOrganizationId:t.acceptedOrganizationId,queryClient:n,refetchSession:o,userId:s});if(r.isErr())throw r.error;return r.value},e[7]=n,e[8]=o,e[9]=s,e[10]=i):i=e[10],c=ee.provide({actors:{navigateToInviteTarget:m(r),resolveRedirect:m(i)}}),e[0]=t,e[1]=n,e[2]=o,e[3]=s,e[4]=c}else c=e[4];let u;e[11]===i?u=e[12]:(u={input:{invitationId:i}},e[11]=i,e[12]=u);let[d,p]=_(c,u),h,g;e[13]===p?(h=e[14],g=e[15]):(h=()=>{p({type:M.ACCEPT})},g=()=>{p({type:M.DECLINE})},e[13]=p,e[14]=h,e[15]=g);let v;e[16]===d?v=e[17]:(v=ne(d),e[16]=d,e[17]=v);let y;e[18]===p?y=e[19]:(y=()=>{p({type:M.GO_HOME})},e[18]=p,e[19]=y);let b;e[20]===d?b=e[21]:(b=te(d),e[20]=d,e[21]=b);let x;return e[22]!==h||e[23]!==g||e[24]!==v||e[25]!==y||e[26]!==b?(x={accept:h,decline:g,errorMessage:v,goHome:y,status:b},e[22]=h,e[23]=g,e[24]=v,e[25]=y,e[26]=b,e[27]=x):x=e[27],x}var $=e();function ie(){let e=(0,E.c)(2),{invitationId:t}=D.useParams(),n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(ae,{},t),e[0]=t,e[1]=n),n}function ae(){let e=(0,E.c)(28),{accept:t,decline:n,errorMessage:r,goHome:c,status:l}=re(),u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsxs)(v,{className:`text-center`,children:[(0,$.jsx)(x,{className:`text-2xl`,children:`Organization Invitation`}),(0,$.jsx)(S,{children:`You've been invited to join an organization`})]}),e[0]=u):u=e[0];let d;e[1]===l?d=e[2]:(d=l===`ready`&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,$.jsx)(`div`,{className:`rounded-full bg-primary/10 p-4`,children:(0,$.jsx)(a,{size:48,className:`text-primary`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`font-medium`,children:`Ready to join`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Click the button below to accept the invitation and join the organization.`})]})]}),e[1]=l,e[2]=d);let f;e[3]===l?f=e[4]:(f=l===`accepting`&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,$.jsx)(o,{size:48,className:`animate-spin text-primary`}),(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Accepting invitation...`})]}),e[3]=l,e[4]=f);let p;e[5]===l?p=e[6]:(p=l===`success`&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,$.jsx)(`div`,{className:`rounded-full bg-green-500/10 p-4`,children:(0,$.jsx)(a,{size:48,className:`text-green-500`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`font-medium text-green-600`,children:`Successfully joined!`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Redirecting to your dashboard...`})]})]}),e[5]=l,e[6]=p);let m;e[7]!==r||e[8]!==l?(m=l===`error`&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,$.jsx)(`div`,{className:`rounded-full bg-destructive/10 p-4`,children:(0,$.jsx)(s,{size:48,className:`text-destructive`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`font-medium text-destructive`,children:`Failed to accept invitation`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:r||`The invitation may have expired or already been used.`})]})]}),e[7]=r,e[8]=l,e[9]=m):m=e[9];let h;e[10]!==d||e[11]!==f||e[12]!==p||e[13]!==m?(h=(0,$.jsxs)(b,{className:`flex justify-center py-8`,children:[d,f,p,m]}),e[10]=d,e[11]=f,e[12]=p,e[13]=m,e[14]=h):h=e[14];let g;e[15]!==t||e[16]!==n||e[17]!==l?(g=l===`ready`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(i,{variant:`outline`,onClick:n,children:`Decline`}),(0,$.jsx)(i,{onClick:t,children:`Accept Invitation`})]}),e[15]=t,e[16]=n,e[17]=l,e[18]=g):g=e[18];let _;e[19]!==c||e[20]!==l?(_=l===`error`&&(0,$.jsx)(i,{variant:`outline`,onClick:c,children:`Go to Home`}),e[19]=c,e[20]=l,e[21]=_):_=e[21];let w;e[22]!==g||e[23]!==_?(w=(0,$.jsxs)(y,{className:`flex justify-center gap-4`,children:[g,_]}),e[22]=g,e[23]=_,e[24]=w):w=e[24];let T;return e[25]!==h||e[26]!==w?(T=(0,$.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:(0,$.jsxs)(C,{className:`w-full max-w-md`,children:[u,h,w]})}),e[25]=h,e[26]=w,e[27]=T):T=e[27],T}var oe=ie;export{oe as component};
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.3`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),f=o(((e,t)=>{t.exports=d()}));export{c as i,u as n,o as r,f as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./jsx-runtime-DG_AJzB_.js";import{t as n}from"./compiler-runtime-DCc3R3Xn.js";import{t as r}from"./utils-C8DGLIgm.js";var i=n();e();var a=t();function o(e){let t=(0,i.c)(8),n,o;t[0]===e?(n=t[1],o=t[2]):({className:n,...o}=e,t[0]=e,t[1]=n,t[2]=o);let s;t[3]===n?s=t[4]:(s=r(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,n),t[3]=n,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,a.jsx)(`label`,{"data-slot":`label`,className:s,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{o as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n,t as r}from"./jsx-runtime-DG_AJzB_.js";import{E as i,O as a,c as o,d as s,k as c,n as l,t as u}from"./useRouterState-DpT8luFk.js";var d=n((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.3`})),f=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=d()})),ee=`Error preloading route! ☝️`,p=e(t(),1),m=p.use,h=typeof window<`u`?p.useLayoutEffect:p.useEffect;function g(e){let t=p.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function _(e,t,n={},r={}){p.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function v(e){let t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}r();var y=e(f(),1);function b(e,t){let n=l(),[r,d]=p.useState(!1),f=p.useRef(!1),m=v(t),{activeProps:h,inactiveProps:g,activeOptions:b,to:w,preload:se,preloadDelay:ce,hashScrollIntoView:le,replace:T,startTransition:E,resetScroll:ue,viewTransition:de,children:D,target:O,disabled:k,style:A,className:j,onClick:M,onFocus:N,onMouseEnter:P,onMouseLeave:F,onTouchStart:I,ignoreBlocker:L,params:fe,search:pe,hash:me,state:he,mask:ge,reloadDocument:_e,unsafeRelative:ve,from:ye,_fromLocation:be,...R}=e,z=u({select:e=>e.location.search,structuralSharing:!0}),B=e.from,V=p.useMemo(()=>({...e,from:B}),[n,z,B,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),H=p.useMemo(()=>n.buildLocation({...V}),[n,V]),U=p.useMemo(()=>{if(k)return;let e=H.maskedLocation?H.maskedLocation.url.href:H.url.href,t=!1;return n.origin&&(e.startsWith(n.origin)?e=n.history.createHref(e.replace(n.origin,``))||`/`:t=!0),{href:e,external:t}},[k,H.maskedLocation,H.url,n.origin,n.history]),W=p.useMemo(()=>{if(U?.external)return c(U.href)?void 0:U.href;try{return new URL(w),c(w)?void 0:w}catch{}},[w,U]),G=e.reloadDocument||W?!1:se??n.options.defaultPreload,K=ce??n.options.defaultPreloadDelay??0,q=u({select:e=>{if(W)return!1;if(b?.exact){if(!o(e.location.pathname,H.pathname,n.basepath))return!1}else{let t=s(e.location.pathname,n.basepath),r=s(H.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(b?.includeSearch??!0)&&!i(e.location.search,H.search,{partial:!b?.exact,ignoreUndefined:!b?.explicitUndefined})?!1:b?.includeHash?e.location.hash===H.hash:!0}}),J=p.useCallback(()=>{n.preloadRoute({...V}).catch(e=>{console.warn(e),console.warn(ee)})},[n,V]);_(m,p.useCallback(e=>{e?.isIntersecting&&J()},[J]),ae,{disabled:!!k||G!==`viewport`}),p.useEffect(()=>{f.current||!k&&G===`render`&&(J(),f.current=!0)},[k,J,G]);let xe=e=>{let t=e.currentTarget.getAttribute(`target`),r=O===void 0?t:O;if(!k&&!oe(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,y.flushSync)(()=>{d(!0)});let t=n.subscribe(`onResolved`,()=>{t(),d(!1)});n.navigate({...V,replace:T,resetScroll:ue,hashScrollIntoView:le,startTransition:E,viewTransition:de,ignoreBlocker:L})}};if(W)return{...R,ref:m,href:W,...D&&{children:D},...O&&{target:O},...k&&{disabled:k},...A&&{style:A},...j&&{className:j},...M&&{onClick:M},...N&&{onFocus:N},...P&&{onMouseEnter:P},...F&&{onMouseLeave:F},...I&&{onTouchStart:I}};let Y=e=>{k||G&&J()},Se=Y,Ce=e=>{if(!(k||!G))if(!K)J();else{let t=e.target;if(S.has(t))return;let n=setTimeout(()=>{S.delete(t),J()},K);S.set(t,n)}},we=e=>{if(k||!G||!K)return;let t=e.target,n=S.get(t);n&&(clearTimeout(n),S.delete(t))},X=q?a(h,{})??te:x,Z=q?x:a(g,{})??x,Q=[j,X.className,Z.className].filter(Boolean).join(` `),$=(A||X.style||Z.style)&&{...A,...X.style,...Z.style};return{...R,...X,...Z,href:U?.href,ref:m,onClick:C([M,xe]),onFocus:C([N,Y]),onMouseEnter:C([P,Ce]),onMouseLeave:C([F,we]),onTouchStart:C([I,Se]),disabled:!!k,target:O,...$&&{style:$},...Q&&{className:Q},...k&&ne,...q&&re,...r&&ie}}var x={},te={className:`active`},ne={role:`link`,"aria-disabled":!0},re={"data-status":`active`,"aria-current":`page`},ie={"data-transitioning":`transitioning`},S=new WeakMap,ae={rootMargin:`100px`},C=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}},w=p.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,ref:a,...o}=b(r,t),s=typeof r.children==`function`?r.children({isActive:o[`data-status`]===`active`}):r.children;return n===void 0&&delete o.disabled,p.createElement(n||`a`,{...o,ref:a},s)});function oe(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}export{f as a,g as i,m as n,h as r,w as t};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{C as n,k as r}from"./useRouterState-DpT8luFk.js";function i(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function a(e){return!!e?.isNotFound}var o=`__root__`;function s(e){if(e.statusCode=e.statusCode||e.code||307,typeof e.href==`string`&&r(e.href))throw Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${n.join(`, `)} protocols are allowed.`);if(!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let i=new Response(null,{status:e.statusCode,headers:t});if(i.options=e,e.throw)throw i;return i}function c(e){return e instanceof Response&&!!e.options}var l=e(t(),1),u=l.createContext(void 0),d=l.createContext(void 0);export{o as a,s as i,u as n,a as o,c as r,i as s,d as t};
@@ -0,0 +1 @@
1
+ var e=[`owner`,`admin`,`member`],t=`,`,n=new Set([`owner`,`admin`]),r={invitationCancel:n,invitationCreate:n,memberDelete:n,memberUpdate:n,organizationUpdate:n},i=new Set(e);function a(e){return i.has(e)}function o(e){let n=Array.isArray(e)?e:typeof e==`string`?e.split(t):[],r=[],i=new Set;for(let e of n){let t=e.trim();!a(t)||i.has(t)||(i.add(t),r.push(t))}return r}function s(n){let r=new Set(o(n));return e.filter(e=>r.has(e)).join(t)}function c(e){let t=r[e.permission];return o(e.rawRole).some(e=>t.has(e))}function l(e){return o(e.rawRole).includes(e.roleName)}function u(e){return c({permission:`organizationUpdate`,rawRole:e.rawRole})}export{s as a,o as i,c as n,l as r,u as t};
@@ -0,0 +1 @@
1
+ function e(e){return e??`anonymous`}var t={all:t=>[`organization`,e(t)],auditList:(e,n,r)=>[...t.all(e),`audit`,n,`list`,r],auditDetail:(e,n,r,i)=>[...t.all(e),`audit`,n,`detail`,r,i],bySlug:(e,n)=>[...t.all(e),`bySlug`,n],list:e=>[...t.all(e),`list`],pendingInvitations:e=>[...t.all(e),`pendingInvitations`]};export{e as n,t};
@@ -0,0 +1 @@
1
+ var e=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},n=new class{#e=t;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function r(e){setTimeout(e,0)}var i=typeof window>`u`||`Deno`in globalThis;function a(){}function o(e,t){return typeof e==`function`?e(t):e}function s(e){return typeof e==`number`&&e>=0&&e!==1/0}function c(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return typeof e==`function`?e(t):e}function u(e,t){return typeof e==`function`?e(t):e}function d(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==p(o,t.options))return!1}else if(!h(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function f(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(m(t.options.mutationKey)!==m(a))return!1}else if(!h(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function p(e,t){return(t?.queryKeyHashFn||m)(e)}function m(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function h(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>h(e[n],t[n])):!1}var g=Object.prototype.hasOwnProperty;function _(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=y(e)&&y(t);if(!r&&!(b(e)&&b(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:g.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=_(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!x(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!x(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function x(e){return Object.prototype.toString.call(e)===`[object Object]`}function S(e){return new Promise(t=>{n.setTimeout(t,e)})}function C(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:_(e,t)}function w(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function T(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var E=Symbol();function D(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===E?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function O(e,t){return typeof e==`function`?e(...t):!!e}function k(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=new class extends e{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!i&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var M=r;function N(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=M,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=N(),F=new class extends e{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!i&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function I(e){return Math.min(1e3*2**e,3e4)}function L(e){return(e??`online`)===`online`?F.isOnline():!0}var R=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function z(e){let t=!1,n=0,r,a=j(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new R(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>A.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),d=()=>L(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,a=n===0?e.initialPromise:void 0;try{r=a??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let a=e.retry??(i?0:3),s=e.retryDelay??I,c=typeof s==`function`?s(n,r):s,l=a===!0||typeof a==`number`&&n<a||typeof a==`function`&&a(n,r);if(t||!l){p(r);return}n++,e.onFail?.(n,r),S(c).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var B=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),s(this.gcTime)&&(this.#e=n.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(n.clearTimeout(this.#e),void 0)}},V=class extends B{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=W(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=W(this.options);e.data!==void 0&&(this.setState(U(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=C(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(a).catch(a):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>u(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===E||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>l(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!c(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=D(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=z({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof R&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof R){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...H(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...U(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function H(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function U(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function W(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}export{e as A,u as C,E as D,O as E,c as O,C as S,v as T,s as _,F as a,a as b,A as c,T as d,D as f,i as g,p as h,z as i,n as k,k as l,m,H as n,P as o,o as p,B as r,j as s,V as t,w as u,f as v,l as w,h as x,d as y};
@@ -0,0 +1 @@
1
+ var e=1e3,t=e*60,n=t*60,r=e*30,i=t,a=t*5,o=t*5,s=n*24;export{r as a,s as i,a as n,o as r,i as t};
@@ -0,0 +1 @@
1
+ function e(e){return e}export{e as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DG_AJzB_.js";import{t}from"./link-Cgvqhh5w.js";import{t as n}from"./compiler-runtime-DCc3R3Xn.js";import{r,t as i}from"./createReactComponent-_L2mp4Ui.js";import{t as a}from"./utils-C8DGLIgm.js";import{t as o}from"./theme-toggle-CRaDbyxE.js";import{o as s}from"./app-routes-CMyon6Em.js";import{q as c}from"./index-CXR0dKJj.js";var l=i(`outline`,`git-compare`,`GitCompare`,[[`path`,{d:`M4 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-0`}],[`path`,{d:`M16 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0`,key:`svg-1`}],[`path`,{d:`M11 6h5a2 2 0 0 1 2 2v8`,key:`svg-2`}],[`path`,{d:`M14 9l-3 -3l3 -3`,key:`svg-3`}],[`path`,{d:`M13 18h-5a2 2 0 0 1 -2 -2v-8`,key:`svg-4`}],[`path`,{d:`M10 15l3 3l-3 3`,key:`svg-5`}]]),u=i(`outline`,`robot`,`Robot`,[[`path`,{d:`M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4`,key:`svg-0`}],[`path`,{d:`M12 2v2`,key:`svg-1`}],[`path`,{d:`M9 12v9`,key:`svg-2`}],[`path`,{d:`M15 12v9`,key:`svg-3`}],[`path`,{d:`M5 16l4 -2`,key:`svg-4`}],[`path`,{d:`M15 14l4 2`,key:`svg-5`}],[`path`,{d:`M9 18h6`,key:`svg-6`}],[`path`,{d:`M10 8v.01`,key:`svg-7`}],[`path`,{d:`M14 8v.01`,key:`svg-8`}]]),d=n(),f=e();function p(){let e=(0,d.c)(3),n,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight sm:text-3xl`,children:`Get started in minutes`}),i=(0,f.jsx)(`p`,{className:`mt-4 max-w-lg text-sm leading-6 text-muted-foreground sm:text-base`,children:`Self-host for free with a single command, or try the managed cloud version.`}),e[0]=n,e[1]=i):(n=e[0],i=e[1]);let o;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,f.jsx)(`section`,{className:`border-t border-border`,children:(0,f.jsx)(`div`,{className:`mx-auto max-w-6xl px-4 py-14 sm:px-6 sm:py-20`,children:(0,f.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[n,i,(0,f.jsx)(t,{to:s,className:a(r({size:`lg`}),`mt-7 px-8 sm:mt-8`),children:`Start Free`})]})})}),e[2]=o):o=e[2],o}var m=[{description:`Connect databases, analytics tools, and connectors without stitching together a custom control plane.`,icon:u,title:`Unified Access`},{description:`Run consistent workflows across databases, analytics, GitHub, and more from the same workspace.`,icon:l,title:`Cross-Source Coverage`},{description:`Manage data source connectivity, budgets, and team access from a single operational surface.`,icon:c,title:`Operational Control`}];function h(){let e=(0,d.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,f.jsxs)(`div`,{className:`text-center`,children:[(0,f.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight sm:text-3xl`,children:`One workspace for connected data`}),(0,f.jsx)(`p`,{className:`mx-auto mt-4 max-w-2xl text-sm leading-6 text-muted-foreground sm:text-base`,children:`Replace scattered setup steps with a single, consistent control plane.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsx)(`section`,{className:`border-t border-border`,children:(0,f.jsxs)(`div`,{className:`mx-auto max-w-6xl px-4 py-14 sm:px-6 sm:py-20`,children:[t,(0,f.jsx)(`div`,{className:`mt-10 grid gap-5 sm:mt-16 sm:gap-8 md:grid-cols-3`,children:m.map(g)})]})}),e[1]=n):n=e[1],n}function g(e){return(0,f.jsxs)(`div`,{className:`flex flex-col rounded-lg border border-border p-5 sm:p-6`,children:[(0,f.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-md bg-muted`,children:(0,f.jsx)(e.icon,{size:20,stroke:1.5,className:`size-5`})}),(0,f.jsx)(`h3`,{className:`mt-4 text-base font-semibold`,children:e.title}),(0,f.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-muted-foreground`,children:e.description})]},e.title)}function _(){let e=(0,d.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,f.jsx)(`footer`,{className:`border-t border-border`,children:(0,f.jsx)(`div`,{className:`mx-auto flex max-w-6xl items-center justify-center px-6 py-8`,children:(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`div`,{className:`flex h-6 w-6 items-center justify-center rounded bg-foreground text-background text-xs font-bold`,children:`V`}),(0,f.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`OneQuery - Autonomous Data Workspace`})]})})}),e[0]=t):t=e[0],t}function v(){let e=(0,d.c)(3),n,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsx)(`h1`,{className:`max-w-4xl text-3xl font-bold leading-tight tracking-tight sm:text-5xl md:text-6xl`,children:`Your autonomous data workspace`}),i=(0,f.jsx)(`p`,{className:`mt-5 max-w-2xl text-base leading-7 text-muted-foreground sm:mt-6 sm:text-lg md:text-xl`,children:`Connect your data sources, query them from one place, and keep your team aligned on the systems that matter. OneQuery gives you a clean control plane for operating your data access.`}),e[0]=n,e[1]=i):(n=e[0],i=e[1]);let o;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,f.jsx)(`section`,{className:`mx-auto max-w-6xl px-4 py-14 sm:px-6 sm:py-20 md:py-28`,children:(0,f.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[n,i,(0,f.jsx)(t,{to:s,className:a(r({size:`lg`}),`mt-8 px-8 sm:mt-10`),children:`Get Started`})]})}),e[2]=o):o=e[2],o}var y=[`PostgreSQL`,`MySQL`,`BigQuery`,`Google Analytics`,`Amplitude`,`Mixpanel`,`PostHog`,`Microsoft Clarity`,`GitHub`,`Vercel`,`Cloudflare Web Analytics`,`Linear`];function b(){let e=(0,d.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,f.jsxs)(`div`,{className:`text-center`,children:[(0,f.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight sm:text-3xl`,children:`Connect your stack`}),(0,f.jsx)(`p`,{className:`mx-auto mt-4 max-w-xl text-sm leading-6 text-muted-foreground sm:text-base`,children:`OneQuery integrates with the tools you already use.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsx)(`section`,{className:`border-t border-border`,children:(0,f.jsxs)(`div`,{className:`mx-auto max-w-6xl px-4 py-14 sm:px-6 sm:py-20`,children:[t,(0,f.jsx)(`div`,{className:`mt-10 flex flex-wrap items-center justify-center gap-x-6 gap-y-4 sm:mt-12 sm:gap-x-8`,children:y.map(x)})]})}),e[1]=n):n=e[1],n}function x(e){return(0,f.jsx)(`div`,{className:`text-sm font-medium text-muted-foreground`,children:e},e)}function S(){let e=(0,d.c)(4),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsxs)(t,{to:`/`,className:`flex items-center gap-2`,children:[(0,f.jsx)(`img`,{src:`/onequery.svg`,alt:`OneQuery`,className:`h-8 w-8`}),(0,f.jsx)(`span`,{className:`font-semibold text-base sm:text-lg`,children:`OneQuery`})]}),e[0]=n):n=e[0];let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,f.jsx)(o,{}),e[1]=i):i=e[1];let c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,f.jsx)(t,{to:s,className:a(r({size:`sm`,variant:`ghost`}),`hidden sm:inline-flex`),children:`Sign in`}),e[2]=c):c=e[2];let l;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,f.jsx)(`header`,{className:`sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60`,children:(0,f.jsxs)(`div`,{className:`mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6`,children:[n,(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,c,(0,f.jsx)(t,{to:s,className:r({size:`sm`,variant:`default`}),children:`Get Started`})]})]})}),e[3]=l):l=e[3],l}function C(){let e=(0,d.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,f.jsx)(S,{}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsxs)(`div`,{className:`flex h-screen flex-col overflow-y-auto`,children:[t,(0,f.jsxs)(`main`,{className:`flex-1`,children:[(0,f.jsx)(v,{}),(0,f.jsx)(h,{}),(0,f.jsx)(b,{}),(0,f.jsx)(p,{})]}),(0,f.jsx)(_,{})]}),e[1]=n):n=e[1],n}var w=C;export{w as component};
@@ -0,0 +1,64 @@
1
+ var e;function t(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var n=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},r=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(e=globalThis).__zod_globalConfig??(e.__zod_globalConfig={});var i=globalThis.__zod_globalConfig;function a(e){return e&&Object.assign(i,e),i}function o(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function s(e,t){return typeof t==`bigint`?t.toString():t}function c(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function l(e){return e==null}function u(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function d(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var f=Symbol(`evaluating`);function p(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==f)return r===void 0&&(r=f,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function m(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function h(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ee(e){return JSON.stringify(e)}function te(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ne=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=c(()=>{if(i.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(g(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(g(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ie(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function oe(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var se={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return y(e,h(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return m(this,`shape`,e),e},checks:[]}))}function le(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return y(e,h(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return m(this,`shape`,r),r},checks:[]}))}function ue(e,t){if(!_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return y(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return m(this,`shape`,n),n}}))}function de(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return m(this,`shape`,n),n}}))}function fe(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return y(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return m(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function pe(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return y(t,h(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return m(this,`shape`,i),i},checks:[]}))}function me(e,t,n){return y(t,h(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return m(this,`shape`,i),i}}))}function x(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function he(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ge(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function S(e){return typeof e==`string`?e:e?.message}function C(e,t,n){let r=e.message?e.message:S(e.inst?._zod.def?.error?.(e))??S(t?.error?.(e))??S(n.customError?.(e))??S(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function w(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function T(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var _e=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,s,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},E=t(`$ZodError`,_e),D=t(`$ZodError`,_e,{Parent:Error});function ve(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ye(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var O=e=>(t,r,i,o)=>{let s=i?{...i,async:!1}:{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new n;if(c.issues.length){let t=new(o?.Err??e)(c.issues.map(e=>C(e,s,a())));throw ne(t,o?.callee),t}return c.value},be=O(D),k=e=>async(t,n,r,i)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>C(e,o,a())));throw ne(t,i?.callee),t}return s.value},xe=k(D),A=e=>(t,r,i)=>{let o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new n;return s.issues.length?{success:!1,error:new(e??E)(s.issues.map(e=>C(e,o,a())))}:{success:!0,data:s.value}},Se=A(D),j=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>C(e,i,a())))}:{success:!0,data:o.value}},Ce=j(D),we=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return O(e)(t,n,i)},Te=e=>(t,n,r)=>O(e)(t,n,r),Ee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return k(e)(t,n,i)},De=e=>async(t,n,r)=>k(e)(t,n,r),Oe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return A(e)(t,n,i)},ke=e=>(t,n,r)=>A(e)(t,n,r),Ae=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return j(e)(t,n,i)},je=e=>async(t,n,r)=>j(e)(t,n,r),Me=/^[cC][0-9a-z]{6,}$/,Ne=/^[0-9a-z]+$/,Pe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fe=/^[0-9a-vA-V]{20}$/,Ie=/^[A-Za-z0-9]{27}$/,Le=/^[a-zA-Z0-9_-]{21}$/,Re=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ze=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Be=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ve=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,He=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Ue(){return new RegExp(He,`u`)}var We=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ge=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ke=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Je=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ye=/^[A-Za-z0-9_-]*$/,Xe=/^https?$/,Ze=/^\+[1-9]\d{6,14}$/,Qe=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,$e=RegExp(`^${Qe}$`);function et(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tt(e){return RegExp(`^${et(e)}$`)}function nt(e){let t=et({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Qe}T(?:${r})$`)}var rt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},it=/^-?\d+$/,at=/^-?\d+(?:\.\d+)?$/,ot=/^(?:true|false)$/i,st=/^[^A-Z]*$/,ct=/^[^a-z]*$/,M=t(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),lt={number:`number`,bigint:`bigint`,object:`date`},ut=t(`$ZodCheckLessThan`,(e,t)=>{M.init(e,t);let n=lt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dt=t(`$ZodCheckGreaterThan`,(e,t)=>{M.init(e,t);let n=lt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ft=t(`$ZodCheckMultipleOf`,(e,t)=>{M.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):d(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),pt=t(`$ZodCheckNumberFormat`,(e,t)=>{M.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=se[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=it)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),mt=t(`$ZodCheckMaxLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=w(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ht=t(`$ZodCheckMinLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=w(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gt=t(`$ZodCheckLengthEquals`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!l(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=w(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),N=t(`$ZodCheckStringFormat`,(e,t)=>{var n,r;M.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),_t=t(`$ZodCheckRegex`,(e,t)=>{N.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vt=t(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=st,N.init(e,t)}),yt=t(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ct,N.init(e,t)}),bt=t(`$ZodCheckIncludes`,(e,t)=>{M.init(e,t);let n=v(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),xt=t(`$ZodCheckStartsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`^${v(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),St=t(`$ZodCheckEndsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`.*${v(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ct=t(`$ZodCheckOverwrite`,(e,t)=>{M.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),wt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
3
+ `))}},Tt={major:4,minor:4,patch:2},P=t(`$ZodType`,(e,t)=>{var r;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Tt;let i=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let i=x(e),a;for(let o of t){if(o._zod.def.when){if(he(e)||!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new n;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||=x(e,t))});else{if(e.issues.length===t)continue;i||=x(e,t)}}return a?a.then(()=>e):e},r=(r,a,o)=>{if(x(r))return r.aborted=!0,r;let s=t(a,i,o);if(s instanceof Promise){if(o.async===!1)throw new n;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction===`backward`){let t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,o)):r(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new n;return s.then(e=>t(e,i,o))}return t(s,i,o)}}p(e,`~standard`,()=>({validate:t=>{try{let n=Se(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ce(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),F=t(`$ZodString`,(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),I=t(`$ZodStringFormat`,(e,t)=>{N.init(e,t),F.init(e,t)}),Et=t(`$ZodGUID`,(e,t)=>{t.pattern??=ze,I.init(e,t)}),Dt=t(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Be(e)}else t.pattern??=Be();I.init(e,t)}),Ot=t(`$ZodEmail`,(e,t)=>{t.pattern??=Ve,I.init(e,t)}),kt=t(`$ZodURL`,(e,t)=>{I.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Xe.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),At=t(`$ZodEmoji`,(e,t)=>{t.pattern??=Ue(),I.init(e,t)}),jt=t(`$ZodNanoID`,(e,t)=>{t.pattern??=Le,I.init(e,t)}),Mt=t(`$ZodCUID`,(e,t)=>{t.pattern??=Me,I.init(e,t)}),Nt=t(`$ZodCUID2`,(e,t)=>{t.pattern??=Ne,I.init(e,t)}),Pt=t(`$ZodULID`,(e,t)=>{t.pattern??=Pe,I.init(e,t)}),Ft=t(`$ZodXID`,(e,t)=>{t.pattern??=Fe,I.init(e,t)}),It=t(`$ZodKSUID`,(e,t)=>{t.pattern??=Ie,I.init(e,t)}),Lt=t(`$ZodISODateTime`,(e,t)=>{t.pattern??=nt(t),I.init(e,t)}),Rt=t(`$ZodISODate`,(e,t)=>{t.pattern??=$e,I.init(e,t)}),zt=t(`$ZodISOTime`,(e,t)=>{t.pattern??=tt(t),I.init(e,t)}),Bt=t(`$ZodISODuration`,(e,t)=>{t.pattern??=Re,I.init(e,t)}),Vt=t(`$ZodIPv4`,(e,t)=>{t.pattern??=We,I.init(e,t),e._zod.bag.format=`ipv4`}),Ht=t(`$ZodIPv6`,(e,t)=>{t.pattern??=Ge,I.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ut=t(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ke,I.init(e,t)}),Wt=t(`$ZodCIDRv6`,(e,t)=>{t.pattern??=qe,I.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Gt(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Kt=t(`$ZodBase64`,(e,t)=>{t.pattern??=Je,I.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Gt(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function qt(e){if(!Ye.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Gt(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Jt=t(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ye,I.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{qt(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Yt=t(`$ZodE164`,(e,t)=>{t.pattern??=Ze,I.init(e,t)});function Xt(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Zt=t(`$ZodJWT`,(e,t)=>{I.init(e,t),e._zod.check=n=>{Xt(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Qt=t(`$ZodNumber`,(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??at,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),$t=t(`$ZodNumberFormat`,(e,t)=>{pt.init(e,t),Qt.init(e,t)}),en=t(`$ZodBoolean`,(e,t)=>{P.init(e,t),e._zod.pattern=ot,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),tn=t(`$ZodUnknown`,(e,t)=>{P.init(e,t),e._zod.parse=e=>e}),nn=t(`$ZodNever`,(e,t)=>{P.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function rn(e,t,n){e.issues.length&&t.issues.push(...ge(n,e.issues)),t.value[n]=e.value}var an=t(`$ZodArray`,(e,t)=>{P.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>rn(t,n,e))):rn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function L(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...ge(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function on(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=oe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function sn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>L(e,n,i,t,u,d))):L(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var cn=t(`$ZodObject`,(e,t)=>{if(P.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=c(()=>on(t));p(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=g,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>L(n,t,e,s,r,i))):L(a,t,e,s,r,i)}return i?sn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),ln=t(`$ZodObjectJIT`,(e,t)=>{cn.init(e,t);let n=e._zod.parse,r=c(()=>on(t)),a=e=>{let t=new wt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ee(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ee(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
4
+ if (${n}.issues.length) {
5
+ if (${o} in input) {
6
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${n}.value === undefined) {
14
+ if (${o} in input) {
15
+ newResult[${o}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${o}] = ${n}.value;
19
+ }
20
+
21
+ `):c?t.write(`
22
+ if (${n}.issues.length) {
23
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
26
+ })));
27
+ }
28
+
29
+ if (${n}.value === undefined) {
30
+ if (${o} in input) {
31
+ newResult[${o}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${o}] = ${n}.value;
35
+ }
36
+
37
+ `):t.write(`
38
+ const ${n}_present = ${o} in input;
39
+ if (${n}.issues.length) {
40
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
41
+ ...iss,
42
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
43
+ })));
44
+ }
45
+ if (!${n}_present && !${n}.issues.length) {
46
+ payload.issues.push({
47
+ code: "invalid_type",
48
+ expected: "nonoptional",
49
+ input: undefined,
50
+ path: [${o}]
51
+ });
52
+ }
53
+
54
+ if (${n}_present) {
55
+ if (${n}.value === undefined) {
56
+ newResult[${o}] = undefined;
57
+ } else {
58
+ newResult[${o}] = ${n}.value;
59
+ }
60
+ }
61
+
62
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=g,l=!i.jitless,u=l&&re.value,d=t.catchall,f;e._zod.parse=(i,c)=>{f??=r.value;let p=i.value;return s(p)?l&&u&&c?.async===!1&&c.jitless!==!0?(o||=a(t.shape),i=o(i,c),d?sn([],p,i,c,f,e):i):n(i,c):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function un(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,a())))}),t)}var dn=t(`$ZodUnion`,(e,t)=>{P.init(e,t),p(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),p(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),p(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>u(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>un(t,r,e,i)):un(o,r,e,i)}}),fn=t(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,dn.init(e,t);let n=e._zod.parse;p(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=c(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!g(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),pn=t(`$ZodIntersection`,(e,t)=>{P.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>mn(e,t,n)):mn(e,i,a)}});function R(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=R(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=R(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=R(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var hn=t(`$ZodEnum`,(e,t)=>{P.init(e,t);let n=o(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?v(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),gn=t(`$ZodLiteral`,(e,t)=>{if(P.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),_n=t(`$ZodTransform`,(e,t)=>{P.init(e,t),e._zod.parse=(i,a)=>{if(a.direction===`backward`)throw new r(e.constructor.name);let o=t.transform(i.value,i);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(i.value=e,i));if(o instanceof Promise)throw new n;return i.value=o,i}});function vn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var yn=t(`$ZodOptional`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>vn(t,e.value)):vn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),bn=t(`$ZodExactOptional`,(e,t)=>{yn.init(e,t),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),xn=t(`$ZodNullable`,(e,t)=>{P.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${u(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Sn=t(`$ZodDefault`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Cn(e,t)):Cn(r,t)}});function Cn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var wn=t(`$ZodPrefault`,(e,t)=>{P.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Tn=t(`$ZodNonOptional`,(e,t)=>{P.init(e,t),p(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>En(t,e)):En(i,e)}});function En(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Dn=t(`$ZodCatch`,(e,t)=>{P.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,a()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,a()))},input:e.value}),e.issues=[]),e)}}),On=t(`$ZodPipe`,(e,t)=>{P.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>z(e,t.in,n)):z(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>z(e,t.out,n)):z(r,t.out,n)}});function z(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var kn=t(`$ZodPreprocess`,(e,t)=>{On.init(e,t),p(e._zod,`optin`,()=>t.out._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout)}),An=t(`$ZodReadonly`,(e,t)=>{P.init(e,t),p(e._zod,`propValues`,()=>t.innerType._zod.propValues),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`optin`,()=>t.innerType?._zod?.optin),p(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(jn):jn(r)}});function jn(e){return e.value=Object.freeze(e.value),e}var Mn=t(`$ZodCustom`,(e,t)=>{M.init(e,t),P.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Nn(t,n,r,e));Nn(i,n,r,e)}});function Nn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(T(e))}}var Pn,Fn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function In(){return new Fn}(Pn=globalThis).__zod_globalRegistry??(Pn.__zod_globalRegistry=In());var B=globalThis.__zod_globalRegistry;function Ln(e,t){return new e({type:`string`,...b(t)})}function Rn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function zn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function Bn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function Vn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function Hn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function Un(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function Wn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function Gn(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function Kn(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function qn(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function Jn(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function Yn(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function Xn(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function Zn(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function Qn(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function $n(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function er(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function tr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function nr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function rr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function ir(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function ar(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function or(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function sr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function cr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function lr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function ur(e,t){return new e({type:`number`,checks:[],...b(t)})}function dr(e,t){return new e({type:`number`,coerce:!0,checks:[],...b(t)})}function fr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function pr(e,t){return new e({type:`boolean`,...b(t)})}function mr(e){return new e({type:`unknown`})}function hr(e,t){return new e({type:`never`,...b(t)})}function gr(e,t){return new ut({check:`less_than`,...b(t),value:e,inclusive:!1})}function V(e,t){return new ut({check:`less_than`,...b(t),value:e,inclusive:!0})}function _r(e,t){return new dt({check:`greater_than`,...b(t),value:e,inclusive:!1})}function H(e,t){return new dt({check:`greater_than`,...b(t),value:e,inclusive:!0})}function vr(e,t){return new ft({check:`multiple_of`,...b(t),value:e})}function yr(e,t){return new mt({check:`max_length`,...b(t),maximum:e})}function U(e,t){return new ht({check:`min_length`,...b(t),minimum:e})}function br(e,t){return new gt({check:`length_equals`,...b(t),length:e})}function xr(e,t){return new _t({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Sr(e){return new vt({check:`string_format`,format:`lowercase`,...b(e)})}function Cr(e){return new yt({check:`string_format`,format:`uppercase`,...b(e)})}function wr(e,t){return new bt({check:`string_format`,format:`includes`,...b(t),includes:e})}function Tr(e,t){return new xt({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function Er(e,t){return new St({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function W(e){return new Ct({check:`overwrite`,tx:e})}function Dr(e){return W(t=>t.normalize(e))}function Or(){return W(e=>e.trim())}function kr(){return W(e=>e.toLowerCase())}function Ar(){return W(e=>e.toUpperCase())}function jr(){return W(e=>te(e))}function Mr(e,t,n){return new e({type:`array`,element:t,...b(n)})}function Nr(e,t,n){let r=b(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Pr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function Fr(e,t){let n=Ir(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(T(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(T(r))}},e(t.value,t)),t);return n}function Ir(e,t){let n=new M({check:`custom`,...b(t)});return n._zod.check=e,n}function Lr(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??B,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function G(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,G(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&K(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Rr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
63
+
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function zr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:q(t,`input`,e.processors),output:q(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function K(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return K(r.element,n);if(r.type===`set`)return K(r.valueType,n);if(r.type===`lazy`)return K(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return K(r.innerType,n);if(r.type===`intersection`)return K(r.left,n)||K(r.right,n);if(r.type===`record`||r.type===`map`)return K(r.keyType,n)||K(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:K(r.in,n)||K(r.out,n);if(r.type===`object`){for(let e in r.shape)if(K(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(K(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(K(e,n))return!0;return!!(r.rest&&K(r.rest,n))}return!1}var Br=(e,t={})=>n=>{let r=Lr({...n,processors:t});return G(e,r),Rr(r,e),zr(r,e)},q=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Lr({...i??{},target:a,io:t,processors:n});return G(e,o),Rr(o,e),zr(o,e)},Vr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Hr=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Vr[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ur=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Wr=(e,t,n,r)=>{n.type=`boolean`},Gr=(e,t,n,r)=>{n.not={}},Kr=(e,t,n,r)=>{let i=e._zod.def,a=o(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},qr=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Jr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Yr=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Xr=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G(a.element,t,{...r,path:[...r.path,`items`]})},Zr=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=G(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Qr=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},$r=(e,t,n,r)=>{let i=e._zod.def,a=G(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ei=(e,t,n,r)=>{let i=e._zod.def,a=G(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ti=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ni=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ri=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ii=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ai=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G(o,t,r);let s=t.seen.get(e);s.ref=o},oi=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},si=(e,t,n,r)=>{let i=e._zod.def;G(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ci=t(`ZodISODateTime`,(e,t)=>{Lt.init(e,t),Z.init(e,t)});function li(e){return or(ci,e)}var ui=t(`ZodISODate`,(e,t)=>{Rt.init(e,t),Z.init(e,t)});function di(e){return sr(ui,e)}var fi=t(`ZodISOTime`,(e,t)=>{zt.init(e,t),Z.init(e,t)});function pi(e){return cr(fi,e)}var mi=t(`ZodISODuration`,(e,t)=>{Bt.init(e,t),Z.init(e,t)});function hi(e){return lr(mi,e)}var J=t(`ZodError`,(e,t)=>{E.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ye(e,t)},flatten:{value:t=>ve(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),gi=O(J),_i=k(J),vi=A(J),yi=j(J),bi=we(J),xi=Te(J),Si=Ee(J),Ci=De(J),wi=Oe(J),Ti=ke(J),Ei=Ae(J),Di=je(J),Oi=new WeakMap;function Y(e,t,n){let r=Object.getPrototypeOf(e),i=Oi.get(r);if(i||(i=new Set,Oi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var X=t(`ZodType`,(e,t)=>(P.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:q(e,`input`),output:q(e,`output`)}}),e.toJSONSchema=Br(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>gi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>vi(e,t,n),e.parseAsync=async(t,n)=>_i(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>yi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>bi(e,t,n),e.decode=(t,n)=>xi(e,t,n),e.encodeAsync=async(t,n)=>Si(e,t,n),e.decodeAsync=async(t,n)=>Ci(e,t,n),e.safeEncode=(t,n)=>wi(e,t,n),e.safeDecode=(t,n)=>Ti(e,t,n),e.safeEncodeAsync=async(t,n)=>Ei(e,t,n),e.safeDecodeAsync=async(t,n)=>Di(e,t,n),Y(e,`ZodType`,{check(...e){let t=this.def;return this.clone(h(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ga(e,t))},superRefine(e,t){return this.check(Ka(e,t))},overwrite(e){return this.check(W(e))},optional(){return Ta(this)},exactOptional(){return Da(this)},nullable(){return ka(this)},nullish(){return Ta(ka(this))},nonoptional(e){return Fa(this,e)},array(){return ca(this)},or(e){return pa([this,e])},and(e){return _a(this,e)},transform(e){return za(this,Ca(e))},default(e){return ja(this,e)},prefault(e){return Na(this,e)},catch(e){return La(this,e)},pipe(e){return za(this,e)},readonly(){return Ha(this)},describe(e){let t=this.clone();return B.add(t,{description:e}),t},meta(...e){if(e.length===0)return B.get(this);let t=this.clone();return B.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return B.get(e)?.description},configurable:!0}),e)),ki=t(`_ZodString`,(e,t)=>{F.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hr(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Y(e,`_ZodString`,{regex(...e){return this.check(xr(...e))},includes(...e){return this.check(wr(...e))},startsWith(...e){return this.check(Tr(...e))},endsWith(...e){return this.check(Er(...e))},min(...e){return this.check(U(...e))},max(...e){return this.check(yr(...e))},length(...e){return this.check(br(...e))},nonempty(...e){return this.check(U(1,...e))},lowercase(e){return this.check(Sr(e))},uppercase(e){return this.check(Cr(e))},trim(){return this.check(Or())},normalize(...e){return this.check(Dr(...e))},toLowerCase(){return this.check(kr())},toUpperCase(){return this.check(Ar())},slugify(){return this.check(jr())}})}),Ai=t(`ZodString`,(e,t)=>{F.init(e,t),ki.init(e,t),e.email=t=>e.check(Rn(Mi,t)),e.url=t=>e.check(Wn(Fi,t)),e.jwt=t=>e.check(ar(Zi,t)),e.emoji=t=>e.check(Gn(Li,t)),e.guid=t=>e.check(zn(Pi,t)),e.uuid=t=>e.check(Bn(Q,t)),e.uuidv4=t=>e.check(Vn(Q,t)),e.uuidv6=t=>e.check(Hn(Q,t)),e.uuidv7=t=>e.check(Un(Q,t)),e.nanoid=t=>e.check(Kn(Ri,t)),e.guid=t=>e.check(zn(Pi,t)),e.cuid=t=>e.check(qn(zi,t)),e.cuid2=t=>e.check(Jn(Bi,t)),e.ulid=t=>e.check(Yn(Vi,t)),e.base64=t=>e.check(nr(Ji,t)),e.base64url=t=>e.check(rr(Yi,t)),e.xid=t=>e.check(Xn(Hi,t)),e.ksuid=t=>e.check(Zn(Ui,t)),e.ipv4=t=>e.check(Qn(Wi,t)),e.ipv6=t=>e.check($n(Gi,t)),e.cidrv4=t=>e.check(er(Ki,t)),e.cidrv6=t=>e.check(tr(qi,t)),e.e164=t=>e.check(ir(Xi,t)),e.datetime=t=>e.check(li(t)),e.date=t=>e.check(di(t)),e.time=t=>e.check(pi(t)),e.duration=t=>e.check(hi(t))});function ji(e){return Ln(Ai,e)}var Z=t(`ZodStringFormat`,(e,t)=>{I.init(e,t),ki.init(e,t)}),Mi=t(`ZodEmail`,(e,t)=>{Ot.init(e,t),Z.init(e,t)});function Ni(e){return Rn(Mi,e)}var Pi=t(`ZodGUID`,(e,t)=>{Et.init(e,t),Z.init(e,t)}),Q=t(`ZodUUID`,(e,t)=>{Dt.init(e,t),Z.init(e,t)}),Fi=t(`ZodURL`,(e,t)=>{kt.init(e,t),Z.init(e,t)});function Ii(e){return Wn(Fi,e)}var Li=t(`ZodEmoji`,(e,t)=>{At.init(e,t),Z.init(e,t)}),Ri=t(`ZodNanoID`,(e,t)=>{jt.init(e,t),Z.init(e,t)}),zi=t(`ZodCUID`,(e,t)=>{Mt.init(e,t),Z.init(e,t)}),Bi=t(`ZodCUID2`,(e,t)=>{Nt.init(e,t),Z.init(e,t)}),Vi=t(`ZodULID`,(e,t)=>{Pt.init(e,t),Z.init(e,t)}),Hi=t(`ZodXID`,(e,t)=>{Ft.init(e,t),Z.init(e,t)}),Ui=t(`ZodKSUID`,(e,t)=>{It.init(e,t),Z.init(e,t)}),Wi=t(`ZodIPv4`,(e,t)=>{Vt.init(e,t),Z.init(e,t)}),Gi=t(`ZodIPv6`,(e,t)=>{Ht.init(e,t),Z.init(e,t)}),Ki=t(`ZodCIDRv4`,(e,t)=>{Ut.init(e,t),Z.init(e,t)}),qi=t(`ZodCIDRv6`,(e,t)=>{Wt.init(e,t),Z.init(e,t)}),Ji=t(`ZodBase64`,(e,t)=>{Kt.init(e,t),Z.init(e,t)}),Yi=t(`ZodBase64URL`,(e,t)=>{Jt.init(e,t),Z.init(e,t)}),Xi=t(`ZodE164`,(e,t)=>{Yt.init(e,t),Z.init(e,t)}),Zi=t(`ZodJWT`,(e,t)=>{Zt.init(e,t),Z.init(e,t)}),Qi=t(`ZodNumber`,(e,t)=>{Qt.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ur(e,t,n,r),Y(e,`ZodNumber`,{gt(e,t){return this.check(_r(e,t))},gte(e,t){return this.check(H(e,t))},min(e,t){return this.check(H(e,t))},lt(e,t){return this.check(gr(e,t))},lte(e,t){return this.check(V(e,t))},max(e,t){return this.check(V(e,t))},int(e){return this.check(ta(e))},safe(e){return this.check(ta(e))},positive(e){return this.check(_r(0,e))},nonnegative(e){return this.check(H(0,e))},negative(e){return this.check(gr(0,e))},nonpositive(e){return this.check(V(0,e))},multipleOf(e,t){return this.check(vr(e,t))},step(e,t){return this.check(vr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function $i(e){return ur(Qi,e)}var ea=t(`ZodNumberFormat`,(e,t)=>{$t.init(e,t),Qi.init(e,t)});function ta(e){return fr(ea,e)}var na=t(`ZodBoolean`,(e,t)=>{en.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wr(e,t,n,r)});function ra(e){return pr(na,e)}var ia=t(`ZodUnknown`,(e,t)=>{tn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function $(){return mr(ia)}var aa=t(`ZodNever`,(e,t)=>{nn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gr(e,t,n,r)});function oa(e){return hr(aa,e)}var sa=t(`ZodArray`,(e,t)=>{an.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xr(e,t,n,r),e.element=t.element,Y(e,`ZodArray`,{min(e,t){return this.check(U(e,t))},nonempty(e){return this.check(U(1,e))},max(e,t){return this.check(yr(e,t))},length(e,t){return this.check(br(e,t))},unwrap(){return this.element}})});function ca(e,t){return Mr(sa,e,t)}var la=t(`ZodObject`,(e,t)=>{ln.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zr(e,t,n,r),p(e,`shape`,()=>t.shape),Y(e,`ZodObject`,{keyof(){return ya(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:$()})},loose(){return this.clone({...this._zod.def,catchall:$()})},strict(){return this.clone({...this._zod.def,catchall:oa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ue(this,e)},safeExtend(e){return de(this,e)},merge(e){return fe(this,e)},pick(e){return ce(this,e)},omit(e){return le(this,e)},partial(...e){return pe(wa,this,e[0])},required(...e){return me(Pa,this,e[0])}})});function ua(e,t){return new la({type:`object`,shape:e??{},...b(t)})}function da(e,t){return new la({type:`object`,shape:e,catchall:$(),...b(t)})}var fa=t(`ZodUnion`,(e,t)=>{dn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qr(e,t,n,r),e.options=t.options});function pa(e,t){return new fa({type:`union`,options:e,...b(t)})}var ma=t(`ZodDiscriminatedUnion`,(e,t)=>{fa.init(e,t),fn.init(e,t)});function ha(e,t,n){return new ma({type:`union`,options:t,discriminator:e,...b(n)})}var ga=t(`ZodIntersection`,(e,t)=>{pn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r)});function _a(e,t){return new ga({type:`intersection`,left:e,right:t})}var va=t(`ZodEnum`,(e,t)=>{hn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kr(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new va({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new va({...t,checks:[],...b(r),entries:i})}});function ya(e,t){return new va({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var ba=t(`ZodLiteral`,(e,t)=>{gn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qr(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function xa(e,t){return new ba({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var Sa=t(`ZodTransform`,(e,t)=>{_n.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yr(e,t,n,r),e._zod.parse=(n,i)=>{if(i.direction===`backward`)throw new r(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(T(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(T(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}});function Ca(e){return new Sa({type:`transform`,transform:e})}var wa=t(`ZodOptional`,(e,t)=>{yn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ta(e){return new wa({type:`optional`,innerType:e})}var Ea=t(`ZodExactOptional`,(e,t)=>{bn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Da(e){return new Ea({type:`optional`,innerType:e})}var Oa=t(`ZodNullable`,(e,t)=>{xn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ka(e){return new Oa({type:`nullable`,innerType:e})}var Aa=t(`ZodDefault`,(e,t)=>{Sn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ja(e,t){return new Aa({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var Ma=t(`ZodPrefault`,(e,t)=>{wn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Na(e,t){return new Ma({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var Pa=t(`ZodNonOptional`,(e,t)=>{Tn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fa(e,t){return new Pa({type:`nonoptional`,innerType:e,...b(t)})}var Ia=t(`ZodCatch`,(e,t)=>{Dn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function La(e,t){return new Ia({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ra=t(`ZodPipe`,(e,t)=>{On.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r),e.in=t.in,e.out=t.out});function za(e,t){return new Ra({type:`pipe`,in:e,out:t})}var Ba=t(`ZodPreprocess`,(e,t)=>{Ra.init(e,t),kn.init(e,t)}),Va=t(`ZodReadonly`,(e,t)=>{An.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ha(e){return new Va({type:`readonly`,innerType:e})}var Ua=t(`ZodCustom`,(e,t)=>{Mn.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jr(e,t,n,r)});function Wa(e,t){return Nr(Ua,e??(()=>!0),t)}function Ga(e,t={}){return Pr(Ua,e,t)}function Ka(e,t){return Fr(e,t)}function qa(e,t){return new Ba({type:`pipe`,in:Ca(e),out:t})}export{li as _,Wa as a,xe as b,xa as c,ua as d,qa as f,Ii as g,$ as h,ra as i,da as l,pa as m,ya as n,ha as o,ji as p,ca as r,Ni as s,Qi as t,$i as u,dr as v,E as x,be as y};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{a as r}from"./link-Cgvqhh5w.js";import{t as i}from"./compiler-runtime-DCc3R3Xn.js";import{C as a,M as o,S as s,a as c,b as l,c as u,d,f,g as p,h as m,t as h,x as g,y as _}from"./createReactComponent-_L2mp4Ui.js";import{t as v}from"./utils-C8DGLIgm.js";import{t as y}from"./IconCheck-Gc24xPT2.js";import{t as b}from"./IconChevronDown-B-39MA7-.js";import{C as x,Ct as S,E as C,Et as w,F as ee,I as T,M as E,O as D,P as O,T as k,b as A,c as j,ct as M,d as te,l as N,n as P,o as F,s as I,t as ne,ut as re,w as L,wt as R,x as z,y as ie}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";import{d as ae,i as B,n as V,r as H,t as U}from"./CompositeList-DbbDW_rT.js";import{_ as oe,d as se,l as W,n as ce,r as G}from"./useBaseUiId-CtNp109T.js";import{a as K,c as le,i as q,l as ue,n as de,o as fe,r as J,s as pe,t as me}from"./getPseudoElementBounds-CRlxTrfr.js";import{a as he,i as ge,n as _e,o as ve,r as ye,s as be}from"./input-BRu0b1Tq.js";import{t as xe}from"./useControlled-C-85HRFr.js";import{t as Se}from"./useValueChanged-BNrgSVVM.js";var Ce=h(`outline`,`chevron-up`,`ChevronUp`,[[`path`,{d:`M6 15l6 -6l6 6`,key:`svg-0`}]]),we=h(`outline`,`selector`,`Selector`,[[`path`,{d:`M8 9l4 -4l4 4`,key:`svg-0`}],[`path`,{d:`M16 15l-4 4l-4 -4`,key:`svg-1`}]]),Y=e(t());function Te(e){let t=Y.useRef(!0);t.current&&(t.current=!1,e())}var Ee=Y.createContext(null),De=Y.createContext(null);function X(){let e=Y.useContext(Ee);if(e===null)throw Error(_(60));return e}function Oe(){let e=Y.useContext(De);if(e===null)throw Error(_(61));return e}var ke=(e,t)=>Object.is(e,t);function Ae(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function je(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Ae(e,t,n))}function Me(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Ae(e,t,n))}function Ne(e,t,n){return e.filter(e=>!Ae(e,t,n))}function Pe(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var Z=n();function Fe(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Ie(e){if(!Array.isArray(e))return e!=null&&!(`null`in e);if(Fe(e)){for(let t of e)for(let e of t.items)if(e&&e.value==null&&e.label!=null)return!0;return!1}for(let t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Le(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Pe(e)}function Re(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Pe(e.value):Pe(e)}function ze(e,t,n){function r(){return Le(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=Fe(t)?t.flatMap(e=>e.items):t;if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Be(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Z.jsx)(Y.Fragment,{children:ze(r,t,n)},i)),e),[])}var Q={id:k(e=>e.id),modal:k(e=>e.modal),multiple:k(e=>e.multiple),items:k(e=>e.items),itemToStringLabel:k(e=>e.itemToStringLabel),itemToStringValue:k(e=>e.itemToStringValue),isItemEqualToValue:k(e=>e.isItemEqualToValue),value:k(e=>e.value),hasSelectedValue:k(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Re(t,r)!==``}),hasNullItemLabel:k((e,t)=>t?Ie(e.items):!1),open:k(e=>e.open),mounted:k(e=>e.mounted),forceMount:k(e=>e.forceMount),transitionStatus:k(e=>e.transitionStatus),openMethod:k(e=>e.openMethod),activeIndex:k(e=>e.activeIndex),selectedIndex:k(e=>e.selectedIndex),isActive:k((e,t)=>e.activeIndex===t),isSelected:k((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Ae(e,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ae(i,n,r)}),isSelectedByFocus:k((e,t)=>e.selectedIndex===t),popupProps:k(e=>e.popupProps),triggerProps:k(e=>e.triggerProps),triggerElement:k(e=>e.triggerElement),positionerElement:k(e=>e.positionerElement),listElement:k(e=>e.listElement),scrollUpArrowVisible:k(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:k(e=>e.scrollDownArrowVisible),hasScrollArrows:k(e=>e.hasScrollArrows)};function Ve(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:o,defaultOpen:c=!1,onOpenChange:u,name:p,disabled:h=!1,readOnly:_=!1,required:v=!1,modal:y=!0,actionsRef:b,inputRef:S,onOpenChangeComplete:w,items:E,multiple:D=!1,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=ke,highlightItemOnHover:j=!0,children:M}=e,{clearErrors:P}=he(),{setDirty:F,setTouched:I,setFocused:ne,shouldValidateOnChange:re,validityData:ae,setFilled:B,name:V,disabled:H,validation:U,validationMode:oe}=ve(),W=ye({id:t}),G=H||h,K=V??p,[q,ue]=xe({controlled:n,default:D?r??d:r,name:`Select`,state:`value`}),[J,me]=xe({controlled:o,default:c,name:`Select`,state:`open`}),ge=Y.useRef([]),be=Y.useRef([]),Ce=Y.useRef(null),we=Y.useRef(null),X=Y.useRef(0),Oe=Y.useRef(null),Ae=Y.useRef([]),je=Y.useRef(!1),Ne=Y.useRef(!1),Pe=Y.useRef(null),Fe=Y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ie=Y.useRef(!1),{mounted:Le,setMounted:ze,transitionStatus:Be}=z(J),{openMethod:Ve,triggerProps:He,reset:Ue}=de(J),$=a(()=>new x({id:W,modal:y,multiple:D,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A,value:q,open:J,mounted:Le,transitionStatus:Be,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,We=L($,Q.activeIndex),Ge=L($,Q.selectedIndex),Ke=L($,Q.triggerElement),qe=L($,Q.positionerElement),Je=Y.useMemo(()=>D&&Array.isArray(q)&&q.length===0?``:Re(q,k),[D,q,k]),Ye=Y.useMemo(()=>D&&Array.isArray(q)?q.map(e=>Re(e,k)):Re(q,k),[D,q,k]),Xe=R($.state.triggerElement);_e({id:W,commit:U.commit,value:q,controlRef:Xe,name:K,getValue:()=>Ye});let Ze=Y.useRef(q);g(()=>{q!==Ze.current&&$.set(`forceMount`,!0)},[$,q]),g(()=>{B(D?Array.isArray(q)&&q.length>0:q!=null)},[D,q,B]),g(function(){if(J)return;let e=Ae.current;if(D){let t=Array.isArray(q)?q:[];if(t.length===0){$.set(`selectedIndex`,null);return}let n=t[t.length-1],r=Me(e,n,A);$.set(`selectedIndex`,r===-1?null:r);return}let t=Me(e,q,A);$.set(`selectedIndex`,t===-1?null:t)},[D,J,q,Ae,A,$]),Se(q,()=>{P(K),F(q!==ae.initialValue),re()?U.commit(q):U.commit(q,!0)});let Qe=s((e,t)=>{if(u?.(e,t),!t.isCanceled&&(me(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(I(!0),ne(!1),oe===`onBlur`&&U.commit(q)),!e&&$.state.activeIndex!==null)){let e=ge.current[$.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),$e=s(()=>{ze(!1),$.set(`activeIndex`,null),Ue(),w?.(!1)});ie({enabled:!b,open:J,ref:Ce,onComplete(){J||$e()}}),Y.useImperativeHandle(b,()=>({unmount:$e}),[$e]);let et=s((e,t)=>{i?.(e,t),!t.isCanceled&&ue(e)}),tt=s(()=>{let e=$.state.listElement||Ce.current;if(!e)return;let t=e.scrollTop,n=e.scrollTop+e.clientHeight,r=t>1,i=n<e.scrollHeight-1;$.state.scrollUpArrowVisible!==r&&$.set(`scrollUpArrowVisible`,r),$.state.scrollDownArrowVisible!==i&&$.set(`scrollDownArrowVisible`,i)}),nt=te({open:J,onOpenChange:Qe,elements:{reference:Ke,floating:qe}}),{getReferenceProps:rt,getFloatingProps:it,getItemProps:at}=N([le(nt,{enabled:!_&&!G,event:`mousedown`}),C(nt,{bubbles:!1}),pe(nt,{enabled:!_&&!G,listRef:ge,activeIndex:We,selectedIndex:Ge,disabledIndices:d,onNavigate(e){e===null&&!J||$.set(`activeIndex`,e)},focusItemOnHover:!1}),fe(nt,{enabled:!_&&!G&&(J||!D),listRef:be,activeIndex:We,selectedIndex:Ge,onMatch(e){J?$.set(`activeIndex`,e):et(Ae.current[e],ce(`none`))},onTypingChange(e){je.current=e}})]),ot=Y.useMemo(()=>l(rt(),He,W?{id:W}:f),[rt,He,W]);Te(()=>{$.update({popupProps:it(),triggerProps:ot})}),g(()=>{$.update({id:W,modal:y,multiple:D,value:q,open:J,mounted:Le,transitionStatus:Be,popupProps:it(),triggerProps:ot,items:E,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A,openMethod:Ve})},[$,W,y,D,q,J,Le,Be,it,ot,E,O,k,A,Ve]);let st=Y.useMemo(()=>({store:$,name:K,required:v,disabled:G,readOnly:_,multiple:D,itemToStringLabel:O,itemToStringValue:k,highlightItemOnHover:j,setValue:et,setOpen:Qe,listRef:ge,popupRef:Ce,scrollHandlerRef:we,handleScrollArrowVisibility:tt,scrollArrowsMountedCountRef:X,getItemProps:at,events:nt.context.events,valueRef:Oe,valuesRef:Ae,labelsRef:be,typingRef:je,selectionRef:Fe,selectedItemTextRef:Pe,validation:U,onOpenChangeComplete:w,keyboardActiveRef:Ne,alignItemWithTriggerActiveRef:Ie,initialValueRef:Ze}),[$,K,v,G,_,D,O,k,j,et,Qe,at,nt.context.events,U,w,tt]),ct=m(S,U.inputRef),lt=D&&Array.isArray(q)&&q.length>0,ut=Y.useMemo(()=>!D||!Array.isArray(q)||!K?null:q.map(e=>{let t=Re(e,k);return(0,Z.jsx)(`input`,{type:`hidden`,name:K,value:t},t)}),[D,q,K,k]);return(0,Z.jsx)(Ee.Provider,{value:st,children:(0,Z.jsxs)(De.Provider,{value:nt,children:[M,(0,Z.jsx)(`input`,{...U.getInputValidationProps({onFocus(){$.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,n=ce(se,e.nativeEvent);function r(){if(D)return;let e=Ae.current.find(e=>Re(e,k).toLowerCase()===t.toLowerCase());e!=null&&(F(e!==ae.initialValue),et(e,n),re()&&U.commit(e))}$.set(`forceMount`,!0),queueMicrotask(r)}}),name:D?void 0:K,value:Je,disabled:G,required:v&&!lt,readOnly:_,ref:ct,style:K?T:ee,tabIndex:-1,"aria-hidden":!0}),ut]})})}var He=2,Ue=400,$=200,We={...I,...be,value:()=>null},Ge=Y.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,...u}=e,{setTouched:d,setFocused:f,validationMode:h,state:g,disabled:_}=ve(),{labelId:v}=ge(),{store:y,setOpen:b,selectionRef:x,validation:S,readOnly:C,required:ee,alignItemWithTriggerActiveRef:T,disabled:D,keyboardActiveRef:O}=X(),k=_||D||a,A=L(y,Q.open),j=L(y,Q.value),te=L(y,Q.triggerProps),N=L(y,Q.positionerElement),P=L(y,Q.listElement),F=L(y,Q.id),I=L(y,Q.hasSelectedValue),ne=!I&&A,z=L(y,Q.hasNullItemLabel,ne),ie=i??F;ye({id:ie});let ae=R(N),B=Y.useRef(null),{getButtonProps:V,buttonRef:H}=p({disabled:k,native:o}),U=m(t,B,H,s(e=>{y.set(`triggerElement`,e)})),oe=w(),W=w(),K=w(),le=w();Y.useEffect(()=>{if(A)return I||z?le.start($,()=>{x.current.allowUnselectedMouseUp=!0,K.start($,()=>{x.current.allowSelectedMouseUp=!0})}):K.start(Ue,()=>{x.current.allowUnselectedMouseUp=!0,x.current.allowSelectedMouseUp=!0}),()=>{K.clear(),le.clear()};x.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},W.clear()},[A,I,z,x,W,K,le]);let q=Y.useMemo(()=>P?.id??re(N)?.id,[P,N]),ue=l(te,{id:ie,role:`combobox`,"aria-expanded":A?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":A?q:void 0,"aria-labelledby":v,"aria-readonly":C||void 0,"aria-required":ee||void 0,tabIndex:k?-1:0,ref:U,onFocus(e){f(!0),A&&T.current&&b(!1,ce(se,e.nativeEvent)),oe.start(0,()=>{y.set(`forceMount`,!0)})},onBlur(e){M(N,e.relatedTarget)||(d(!0),f(!1),h===`onBlur`&&S.commit(j))},onPointerMove(){O.current=!1},onKeyDown(){O.current=!0},onMouseDown(e){if(A)return;let t=E(e.currentTarget);function n(e){if(!B.current)return;let t=e.target;if(M(B.current,t)||M(ae.current,t)||t===B.current)return;let n=me(B.current);e.clientX>=n.left-He&&e.clientX<=n.right+He&&e.clientY>=n.top-He&&e.clientY<=n.bottom+He||b(!1,ce(G,e))}W.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},S.getValidationProps,u,V);ue.role=`combobox`;let de=Y.useMemo(()=>({...g,open:A,disabled:k,value:j,readOnly:C,placeholder:!I}),[g,A,k,j,C,I]);return c(`button`,e,{ref:[t,B],state:de,stateAttributesMapping:We,props:ue})}),Ke={value:()=>null},qe=Y.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,...o}=e,{store:s,valueRef:l}=X(),u=L(s,Q.value),d=L(s,Q.items),f=L(s,Q.itemToStringLabel),p=L(s,Q.hasSelectedValue),m=!p&&a!=null&&i==null,h=L(s,Q.hasNullItemLabel,m),g=Y.useMemo(()=>({value:u,placeholder:!p}),[u,p]),_=null;return _=typeof i==`function`?i(u):i??(!p&&a!=null&&!h?a:Array.isArray(u)?Be(u,d,f):ze(u,d,f)),c(`span`,e,{state:g,ref:[t,l],props:[{children:_},o],stateAttributesMapping:Ke})}),Je=Y.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a}=X(),o=L(a,Q.open);return c(`span`,e,{state:Y.useMemo(()=>({open:o}),[o]),ref:t,props:[{"aria-hidden":!0,children:`▼`},i],stateAttributesMapping:j})}),Ye=Y.createContext(void 0),Xe=Y.forwardRef(function(e,t){let{store:n}=X(),r=L(n,Q.mounted),i=L(n,Q.forceMount);return r||i?(0,Z.jsx)(Ye.Provider,{value:!0,children:(0,Z.jsx)(D,{ref:t,...e})}):null}),Ze=Y.createContext(void 0);function Qe(){let e=Y.useContext(Ze);if(!e)throw Error(_(59));return e}function $e(e,t){e&&Object.assign(e.style,t)}var et={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},tt={position:`fixed`},nt=Y.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:l=`center`,sideOffset:d=0,alignOffset:f=0,collisionBoundary:p=`clipping-ancestors`,collisionPadding:m,arrowPadding:h=5,sticky:_=!1,disableAnchorTracking:v,alignItemWithTrigger:y=!0,collisionAvoidance:b=u,...x}=e,{store:S,listRef:C,labelsRef:w,alignItemWithTriggerActiveRef:ee,selectedItemTextRef:T,valuesRef:E,initialValueRef:D,popupRef:O,setValue:k}=X(),A=Oe(),j=L(S,Q.open),M=L(S,Q.mounted),te=L(S,Q.modal),N=L(S,Q.value),I=L(S,Q.openMethod),ne=L(S,Q.positionerElement),re=L(S,Q.triggerElement),R=L(S,Q.isItemEqualToValue),z=Y.useRef(null),ie=Y.useRef(null),[ae,B]=Y.useState(y),V=M&&ae&&I!==`touch`;!M&&ae!==y&&B(y),g(()=>{M||(Q.scrollUpArrowVisible(S.state)&&S.set(`scrollUpArrowVisible`,!1),Q.scrollDownArrowVisible(S.state)&&S.set(`scrollDownArrowVisible`,!1))},[S,M]),Y.useImperativeHandle(ee,()=>V),J((V||te)&&j&&I!==`touch`,re);let H=P({anchor:n,floatingRootContext:A,positionMethod:r,mounted:M,side:o,sideOffset:d,align:l,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:_,disableAnchorTracking:v??V,collisionAvoidance:b,keepMounted:!0}),oe=V?`none`:H.side,W=V?tt:H.positionerStyles,G=Y.useMemo(()=>{let e={};return j||(e.pointerEvents=`none`),{role:`presentation`,hidden:!M,style:{...W,...e}}},[j,M,W]),le=Y.useMemo(()=>({open:j,side:oe,align:H.align,anchorHidden:H.anchorHidden}),[j,oe,H.align,H.anchorHidden]),ue=c(`div`,e,{ref:[t,s(e=>{S.set(`positionerElement`,e)})],state:le,stateAttributesMapping:F,props:[G,x]}),de=Y.useRef(0),fe=s(e=>{if(e.size===0&&de.current===0||E.current.length===0)return;let t=de.current;if(de.current=e.size,e.size===t)return;let n=ce(se);if(t!==0&&!S.state.multiple&&N!==null&&Me(E.current,N,R)===-1){let e=D.current,t=e!=null&&je(E.current,e,R)?e:null;k(t,n),t===null&&(S.set(`selectedIndex`,null),T.current=null)}if(t!==0&&S.state.multiple&&Array.isArray(N)){let e=N.filter(e=>je(E.current,e,R));(e.length!==N.length||e.some(e=>!je(N,e,R)))&&(k(e,n),e.length===0&&(S.set(`selectedIndex`,null),T.current=null))}if(j&&V){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};$e(ne,e),$e(O.current,e)}}),pe=Y.useMemo(()=>({...H,side:oe,alignItemWithTriggerActive:V,setControlledAlignItemWithTrigger:B,scrollUpArrowRef:z,scrollDownArrowRef:ie}),[H,oe,V,B]);return(0,Z.jsx)(U,{elementsRef:C,labelsRef:w,onMapChange:fe,children:(0,Z.jsxs)(Ze.Provider,{value:pe,children:[M&&te&&(0,Z.jsx)(q,{inert:K(!j),cutout:re}),ue]})})});function rt(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var it=`base-ui-disable-scrollbar`,at={className:it,getElement(e){return(0,Z.jsx)(`style`,{nonce:e,href:it,precedence:`base-ui:low`,children:`.${it}{scrollbar-width:none}.${it}::-webkit-scrollbar{display:none}`})}};function ot(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var st=Y.createContext(void 0),ct={disableStyleElements:!1};function lt(){return Y.useContext(st)??ct}var ut=e(r()),dt={...F,...A},ft=Y.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{store:a,popupRef:l,onOpenChangeComplete:u,setOpen:d,valueRef:f,selectedItemTextRef:p,keyboardActiveRef:m,multiple:h,handleScrollArrowVisibility:_,scrollHandlerRef:v,highlightItemOnHover:y}=X(),{side:b,align:x,alignItemWithTriggerActive:C,setControlledAlignItemWithTrigger:ee,scrollDownArrowRef:T,scrollUpArrowRef:D}=Qe(),k=V(!0)!=null,A=Oe(),{nonce:j,disableStyleElements:M}=lt(),te=w(),N=L(a,Q.id),P=L(a,Q.open),F=L(a,Q.mounted),I=L(a,Q.popupProps),re=L(a,Q.transitionStatus),R=L(a,Q.triggerElement),z=L(a,Q.positionerElement),B=L(a,Q.listElement),H=Y.useRef(0),U=Y.useRef(!1),se=Y.useRef(0),W=Y.useRef(!1),G=Y.useRef({}),K=O(),le=s(e=>{if(!z||!l.current||!W.current)return;if(U.current||!C){_();return}let t=z.style.top===`0px`,n=z.style.bottom===`0px`,r=z.getBoundingClientRect().height,i=E(z),a=getComputedStyle(z),o=parseFloat(a.marginTop),s=parseFloat(a.marginBottom),c=pt(getComputedStyle(l.current)),u=i.documentElement.clientHeight-o-s,d=e.scrollTop,f=e.scrollHeight-e.clientHeight,p=0,m=null,h=!1;if(t){let e=r+(f-d),t=Math.min(e,u);p=t,t===u?h=!0:m=f}else if(n){let e=d-0,t=r+e,n=Math.min(t,u),i=t-u;p=n,n===u?(h=!0,d<f&&(m=d-(e-i))):m=0}p!==0&&(z.style.height=`${p}px`),m!=null&&(e.scrollTop=m),(h||p>=c)&&(U.current=!0),_()});Y.useImperativeHandle(v,()=>le,[le]),ie({open:P,ref:l,onComplete(){P&&u?.(!0)}});let q=Y.useMemo(()=>({open:P,transitionStatus:re,side:b,align:x}),[P,re,b,x]);g(()=>{!z||!l.current||Object.keys(G.current).length||(G.current={top:z.style.top||`0`,left:z.style.left||`0`,right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[l,z]),g(()=>{P||C||(W.current=!1,U.current=!1,H.current=0,se.current=0,$e(z,G.current))},[P,C,z,l]),g(()=>{let e=l.current;if(!(!P||!R||!z||!e||a.state.transitionStatus===`ending`)){if(!C){W.current=!0,K.request(_),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=gt(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(z),n=getComputedStyle(e),r=E(R),i=o(z),a=R.getBoundingClientRect(),s=z.getBoundingClientRect(),c=a.left,l=a.height,u=B||e,d=u.scrollHeight,m=parseFloat(n.borderBottomWidth),h=parseFloat(t.marginTop)||10,g=parseFloat(t.marginBottom)||10,v=parseFloat(t.minHeight)||100,y=pt(n),b=r.documentElement.clientHeight-h-g,x=r.documentElement.clientWidth,C=b-a.bottom+l,w=p.current,T=f.current,D,O=0,k=0;if(w&&T){let e=T.getBoundingClientRect();D=w.getBoundingClientRect();let t=e.left-c,n=D.left-s.left,r=e.top-a.top+e.height/2,i=D.top-s.top+D.height/2;O=t-n,k=i-r}let A=C+k+g+m,j=Math.min(b,A),M=b-h-g,te=A-j,N=Math.max(5,c+O),P=x-5,F=Math.max(0,N+s.width-P);z.style.left=`${N-F}px`,z.style.height=`${j}px`,z.style.maxHeight=`auto`,z.style.marginTop=`${h}px`,z.style.marginBottom=`${g}px`,e.style.height=`100%`;let I=u.scrollHeight-u.clientHeight,ne=te>=I;ne&&(j=Math.min(b,s.height)-(te-I));let re=a.top<20||a.bottom>b-20||j<Math.min(d,v),L=(i.visualViewport?.scale??1)!==1&&S;if(re||L){W.current=!0,$e(z,G.current),ut.flushSync(()=>ee(!1));return}if(ne){let e=Math.max(0,b-A);z.style.top=s.height>=M?`0`:`${e}px`,z.style.height=`${j}px`,u.scrollTop=u.scrollHeight-u.clientHeight,H.current=Math.max(v,j)}else z.style.bottom=`0`,H.current=Math.max(v,j),u.scrollTop=te;if(D){let t=s.top,n=s.height,r=D.top+D.height/2,i=ot(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(H.current===b||j>=y)&&(U.current=!0),_(),setTimeout(()=>{W.current=!0})}finally{t()}})}},[a,P,z,R,f,p,l,_,C,ee,K,T,D,B]),Y.useEffect(()=>{if(!C||!z||!P)return;let e=o(z);function t(e){d(!1,ce(oe,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[d,C,z,P]);let de={...B?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":h||void 0,id:`${N}-list`},onKeyDown(e){m.current=!0,k&&ae.has(e.key)&&e.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(e){if(!y||rt(e)||e.pointerType===`touch`)return;let t=e.currentTarget;te.start(0,()=>{a.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){B||v.current?.(e.currentTarget)},...C&&{style:B?{height:`100%`}:et}},fe=c(`div`,e,{ref:[t,l],state:q,stateAttributesMapping:dt,props:[I,de,ne(re),{className:!B&&C?at.className:void 0},i]});return(0,Z.jsxs)(Y.Fragment,{children:[!M&&at.getElement(j),(0,Z.jsx)(ue,{context:A,modal:!1,disabled:!F,restoreFocus:!0,children:fe})]})});function pt(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}var mt={transform:`none`,scale:`1`,translate:`0 0`};function ht(e,t,n){n?e.setProperty(t,n):e.removeProperty(t)}function gt(e){let{style:t}=e,n={},r=Object.keys(mt);for(let e of r)n[e]=t.getPropertyValue(e),t.setProperty(e,mt[e]);return()=>{for(let e of r)ht(t,e,n[e])}}var _t=Y.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a,scrollHandlerRef:o}=X(),{alignItemWithTriggerActive:l}=Qe(),u=L(a,Q.hasScrollArrows),d=L(a,Q.openMethod),f=L(a,Q.multiple),p={id:`${L(a,Q.id)}-list`,role:`listbox`,"aria-multiselectable":f||void 0,onScroll(e){o.current?.(e.currentTarget)},...l&&{style:et},className:u&&d!==`touch`?at.className:void 0};return c(`div`,e,{ref:[t,s(e=>{a.set(`listElement`,e)})],props:[p,i]})}),vt=Y.createContext(void 0);function yt(){let e=Y.useContext(vt);if(!e)throw Error(_(57));return e}var bt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...l}=e,u=Y.useRef(null),d=B({label:a,textRef:u,indexGuessBehavior:H.GuessFromOrder}),{store:f,getItemProps:m,setOpen:h,setValue:_,selectionRef:v,typingRef:y,valuesRef:b,keyboardActiveRef:x,multiple:S,highlightItemOnHover:C}=X(),ee=w(),T=L(f,Q.isActive,d.index),E=L(f,Q.isSelected,d.index,i),D=L(f,Q.isSelectedByFocus,d.index),O=L(f,Q.isItemEqualToValue),k=d.index,A=k!==-1,j=Y.useRef(null),M=R(k);g(()=>{if(!A)return;let e=b.current;return e[k]=i,()=>{delete e[k]}},[A,k,i,b]),g(()=>{if(!A)return;let e=f.state.value,t=e;S&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Ae(t,i,O)&&f.set(`selectedIndex`,k)},[A,k,S,O,f,i]);let te=Y.useMemo(()=>({disabled:o,selected:E,highlighted:T}),[o,E,T]),N=m({active:T,selected:E});N.onFocus=void 0,N.id=void 0;let P=Y.useRef(null),F=Y.useRef(`mouse`),I=Y.useRef(!1),{getButtonProps:ne,buttonRef:re}=p({disabled:o,focusableWhenDisabled:!0,native:s});function z(e){let t=f.state.value;if(S){let n=Array.isArray(t)?t:[];_(E?Ne(n,i,O):[...n,i],ce(W,e))}else _(i,ce(W,e)),h(!1,ce(W,e))}let ie={role:`option`,"aria-selected":E,tabIndex:T?0:-1,onFocus(){f.set(`activeIndex`,k)},onMouseEnter(){!x.current&&f.state.selectedIndex===null&&f.set(`activeIndex`,k)},onMouseMove(){C&&f.set(`activeIndex`,k)},onMouseLeave(e){!C||x.current||rt(e)||ee.start(0,()=>{f.state.activeIndex===k&&f.set(`activeIndex`,null)})},onTouchStart(){v.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){P.current=e.key,f.set(`activeIndex`,k)},onClick(e){I.current=!1,!(e.type===`keydown`&&P.current===null)&&(o||P.current===` `&&y.current||F.current!==`touch`&&!T||(P.current=null,z(e.nativeEvent)))},onPointerEnter(e){F.current=e.pointerType},onPointerDown(e){F.current=e.pointerType,I.current=!0},onMouseUp(e){if(o)return;if(I.current){I.current=!1;return}let t=!v.current.allowSelectedMouseUp&&E,n=!v.current.allowUnselectedMouseUp&&!E;t||n||F.current!==`touch`&&!T||z(e.nativeEvent)}},ae=c(`div`,e,{ref:[re,t,d.ref,j],state:te,props:[N,ie,l,ne]}),V=Y.useMemo(()=>({selected:E,indexRef:M,textRef:u,selectedByFocus:D,hasRegistered:A}),[E,M,u,D,A]);return(0,Z.jsx)(vt.Provider,{value:V,children:ae})})),xt=Y.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=yt();return n||r?(0,Z.jsx)(St,{...e,ref:t}):null}),St=Y.memo(Y.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=yt(),s=Y.useRef(null),{transitionStatus:l,setMounted:u}=z(o),d=Y.useMemo(()=>({selected:o,transitionStatus:l}),[o,l]),f=c(`span`,e,{ref:[t,s],state:d,props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:A});return ie({open:o,ref:s,onComplete(){o||u(!1)}}),f})),Ct=Y.memo(Y.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=yt(),{selectedItemTextRef:o}=X(),{className:s,render:l,...u}=e;return c(`div`,e,{ref:[Y.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:u})})),wt=Y.forwardRef(function(e,t){let{render:n,className:r,direction:i,keepMounted:a=!1,...o}=e,{store:s,popupRef:l,listRef:u,handleScrollArrowVisibility:d,scrollArrowsMountedCountRef:f}=X(),{side:p,scrollDownArrowRef:m,scrollUpArrowRef:h}=Qe(),_=L(s,i===`up`?Q.scrollUpArrowVisible:Q.scrollDownArrowVisible),v=L(s,Q.openMethod),y=_&&v!==`touch`,b=w(),x=i===`up`?h:m,{transitionStatus:S,setMounted:C}=z(y);g(()=>(f.current+=1,s.state.hasScrollArrows||s.set(`hasScrollArrows`,!0),()=>{f.current=Math.max(0,f.current-1),f.current===0&&s.state.hasScrollArrows&&s.set(`hasScrollArrows`,!1)}),[s,f]),ie({open:y,ref:x,onComplete(){y||C(!1)}});let ee=Y.useMemo(()=>({direction:i,visible:y,side:p,transitionStatus:S}),[i,y,p,S]),T=c(`div`,e,{ref:[t,x],state:ee,props:[{"aria-hidden":!0,children:i===`up`?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;s.set(`activeIndex`,null);function t(){let e=s.state.listElement??l.current;if(!e)return;s.set(`activeIndex`,null),d();let n=e.scrollTop===0,r=Math.round(e.scrollTop+e.clientHeight)>=e.scrollHeight;if(u.current.length===0&&(i===`up`?s.set(`scrollUpArrowVisible`,!n):s.set(`scrollDownArrowVisible`,!r)),i===`up`&&n||i===`down`&&r){b.clear();return}if((s.state.listElement||l.current)&&u.current&&u.current.length>0){let t=u.current,n=x.current?.offsetHeight||0;if(i===`up`){let r=0,i=e.scrollTop+n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop>=i){r=e;break}}let a=Math.max(0,r-1);if(a<r){let r=t[a];r&&(e.scrollTop=Math.max(0,r.offsetTop-n))}else e.scrollTop=0}else{let r=t.length-1,i=e.scrollTop+e.clientHeight-n;for(let e=0;e<t.length;e+=1){let n=t[e];if(n&&n.offsetTop+n.offsetHeight>i){r=Math.max(0,e-1);break}}let a=Math.min(t.length-1,r+1);if(a>r){let r=t[a];r&&(e.scrollTop=r.offsetTop+r.offsetHeight-e.clientHeight+n)}else e.scrollTop=e.scrollHeight-e.clientHeight}}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},o]});return y||a?T:null}),Tt=Y.forwardRef(function(e,t){return(0,Z.jsx)(wt,{...e,ref:t,direction:`down`})}),Et=Y.forwardRef(function(e,t){return(0,Z.jsx)(wt,{...e,ref:t,direction:`up`})}),Dt=i(),Ot=Ve;function kt(e){let t=(0,Dt.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=v(`flex flex-1 text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(qe,{"data-slot":`select-value`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function At(e){let t=(0,Dt.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=v(`border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 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 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Je,{render:(0,Z.jsx)(we,{className:`text-muted-foreground size-4 pointer-events-none`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,Z.jsxs)(Ge,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function jt(e){let t=(0,Dt.c)(26),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:r,children:n,side:a,sideOffset:o,align:s,alignOffset:c,alignItemWithTrigger:l,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=a===void 0?`bottom`:a,d=o===void 0?4:o,f=s===void 0?`center`:s,p=c===void 0?0:c,m=l===void 0?!0:l,h;t[9]===r?h=t[10]:(h=v(`bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto`,r),t[9]=r,t[10]=h);let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(Nt,{}),t[11]=g):g=t[11];let _;t[12]===n?_=t[13]:(_=(0,Z.jsx)(_t,{children:n}),t[12]=n,t[13]=_);let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Pt,{}),t[14]=y):y=t[14];let b;t[15]!==i||t[16]!==h||t[17]!==_?(b=(0,Z.jsxs)(ft,{"data-slot":`select-content`,className:h,...i,children:[g,_,y]}),t[15]=i,t[16]=h,t[17]=_,t[18]=b):b=t[18];let x;return t[19]!==f||t[20]!==m||t[21]!==p||t[22]!==u||t[23]!==d||t[24]!==b?(x=(0,Z.jsx)(Xe,{children:(0,Z.jsx)(nt,{side:u,sideOffset:d,align:f,alignOffset:p,alignItemWithTrigger:m,className:`isolate z-50`,children:b})}),t[19]=f,t[20]=m,t[21]=p,t[22]=u,t[23]=d,t[24]=b,t[25]=x):x=t[25],x}function Mt(e){let t=(0,Dt.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=v(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=(0,Z.jsx)(Ct,{className:`flex flex-1 gap-2 shrink-0 whitespace-nowrap`,children:n}),t[6]=n,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(xt,{render:(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,Z.jsx)(y,{className:`pointer-events-none`})}),t[8]=s):s=t[8];let c;return t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(bt,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Nt(e){let t=(0,Dt.c)(9),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=v(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ce,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Z.jsx)(Et,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function Pt(e){let t=(0,Dt.c)(9),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=v(`bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(b,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Z.jsx)(Tt,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}export{kt as a,at as c,At as i,jt as n,lt as o,Mt as r,ot as s,Ot as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DG_AJzB_.js";import{t}from"./compiler-runtime-DCc3R3Xn.js";import{t as n}from"./utils-C8DGLIgm.js";import{t as r}from"./Separator-M05FshHx.js";var i=t(),a=e();function o(e){let t=(0,i.c)(10),o,s,c;t[0]===e?(o=t[1],s=t[2],c=t[3]):({className:o,orientation:c,...s}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=c);let l=c===void 0?`horizontal`:c,u;t[4]===o?u=t[5]:(u=n(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch`,o),t[4]=o,t[5]=u);let d;return t[6]!==l||t[7]!==s||t[8]!==u?(d=(0,a.jsx)(r,{"data-slot":`separator`,orientation:l,className:u,...s}),t[6]=l,t[7]=s,t[8]=u,t[9]=d):d=t[9],d}export{o as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DG_AJzB_.js";import{t}from"./compiler-runtime-DCc3R3Xn.js";import{a as n,n as r,o as i,r as a,t as o}from"./card-Dllm2lhp.js";var s=t(),c=e();function l(){let e=(0,s.c)(6),t,l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Settings`}),l=(0,c.jsx)(`p`,{className:`text-muted-foreground mt-2`,children:`Manage your organization settings`}),e[0]=t,e[1]=l):(t=e[0],l=e[1]);let u;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,c.jsxs)(n,{children:[(0,c.jsx)(i,{children:`Coming soon`}),(0,c.jsx)(a,{children:`Additional organization settings will be available soon.`})]}),e[2]=u):u=e[2];let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,c.jsxs)(o,{children:[u,(0,c.jsx)(r,{children:(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Organization settings now focus on billing, access, and data source controls.`})})]}),e[3]=d):d=e[3];let f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,c.jsxs)(n,{children:[(0,c.jsx)(i,{children:`Organization deletion`}),(0,c.jsx)(a,{children:`Self-serve organization deletion is disabled.`})]}),e[4]=f):f=e[4];let p;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,c.jsxs)(`div`,{className:`p-8 max-w-2xl`,children:[t,l,(0,c.jsxs)(`div`,{className:`mt-8 space-y-6`,children:[d,(0,c.jsxs)(o,{children:[f,(0,c.jsxs)(r,{children:[(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Owners cannot delete organizations in-app. If an organization needs to be removed, contact your deployment operator for a reviewed hard-delete request.`}),(0,c.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:`This protects memberships, connectors, data sources, and other org-owned records from accidental cascade deletion.`})]})]})]})]}),e[5]=p):p=e[5],p}export{l as component};