@onequery/cli 0.1.62 → 0.1.63-darwin-x64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -24
- package/vendor/x86_64-apple-darwin/onequery/onequery +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/CompositeItem-BB408Cyb.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/CompositeList-DbbDW_rT.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/DialogTitle-ChNkcIa6.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconArrowRight-DsOD7mDl.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconCheck-Gc24xPT2.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconChevronDown-B-39MA7-.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconChevronRight-DD16tNHZ.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconCoins-C7Nn0L6R.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconHistory-DuLS8PKF.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconLoader2-BpZcTuHV.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconPlus-CZiRiEUF.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconTerminal2-PxNqcz3d.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/IconX-rRpRFwc5.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/Separator-M05FshHx.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/_authenticated-CcSc_Pt7.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/_org_slug-BvJDit6U.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/alert-BIGxI3XN.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/api-base-url-DIb6qukm.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/api-client-tp8XTpAa.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/api-paths-DcYkf-C_.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/app-routes-CMyon6Em.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/audit-CdPU9Jf2.js +2 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/auth-bootstrap-query-B1MHd_NV.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/auth-client-D-YHMy0G.js +3 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/avatar-SaFoLofF.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/badge-BFPkSrVD.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/budget-CX5MplAP.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/callback-BWQ3ETBy.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/card-Dllm2lhp.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/checkbox-Bii9Pcrx.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/compiler-runtime-DCc3R3Xn.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/connect-database-C1Jb2l53.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/copy-button-BO1KBdf9.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/create-org-BSzKv5ue.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/createReactComponent-_L2mp4Ui.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/data-source-connection-form-CbDL0cgG.js +273 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/device-Bbz7apAX.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/dist-BNi06Dzx.js +3 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/dropdown-menu-Cw2MW0pD.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/empty-DjRo5ytz.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/format-date-Rg05aHXh.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/getDisabledMountTransitionStyles-C0uz3iMh.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/getPseudoElementBounds-CRlxTrfr.js +12 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/home-BNjpNKdt.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/index-B4OsjuJp.css +2 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/index-CXR0dKJj.js +10 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/input-BRu0b1Tq.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/integrations-BWC7iPQ5.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/invite._invitationId-DmJnR4R5.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/jsx-runtime-DG_AJzB_.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/label-f2wVZcni.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/link-Cgvqhh5w.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/matchContext-CDajBC0L.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/organization-permissions-BXV_ess0.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/organization-query-keys-ieaSNxMR.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/query-CY--GYXb.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/query-timing-YBkSOxxF.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/queryOptions-bXtOUR_h.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/routes-CxJ2aoMf.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/schemas-EcBBwCo1.js +64 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/select-yNaL0SXM.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/separator-BH7Gsum-.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/settings-C8us2bWX.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/signin-BgfqB9QB.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/src-C5F1uEDb.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/team-CYPsHFTt.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/textarea-CnA77PLS.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/theme-toggle-CRaDbyxE.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/use-optimistic-mutation-3PPnMc-O.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useBaseQuery-CO5Q8xm4.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useBaseUiId-CtNp109T.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useCompositeItem-D243hyne.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useControlled-C-85HRFr.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useQuery-DyOxsY45.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useRender-CzpKCg11.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useRouterState-DpT8luFk.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useSuspenseQuery-CBFRU4At.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/useValueChanged-BNrgSVVM.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/utils-C8DGLIgm.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/xstate-react.esm-Bo3CCIRt.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/assets/zod-D0PWrP9q.js +1 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/favicon.ico +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step1_settings_sidebar.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step2_projects.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step3_project_keys.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/amplitude/step4_api_keys.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step1_service_accounts.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step2_bigquery_roles.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step3_add_key_menu.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/bigquery/step4_create_json_key.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step2_enable_workers_logs.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step3_user_api_tokens.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step4_create_api_token.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step5_workers_pages_account_id.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/cloudflare-workers-observability/step6_workers_observability_permission.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step1_service_accounts.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step2_create_json_key.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step3_add_user_viewer.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/ga4/step4_property_details.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step1_signin.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/github-token-guide/step4_token_created_sanitized.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/google-search-console/step1_confirm_property.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/google-search-console/step2_scope_selected.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/google-search-console/step3_copy_access_token.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step1_service_accounts.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step2_create_service_account.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step3_credentials.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/mixpanel/step4_project_settings.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/postgresql/step1_create_user.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/postgresql/step2_connection.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/posthog/step1_project_settings.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/posthog/step2_personal_api_keys.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/posthog/step3_create_key_modal.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step1_connect.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step2_create_user.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step3_grant.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/rds/step4_info.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step1_personal_tokens.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step2_create_token_permissions.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step3_organization_slug.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/sentry/step4_project_slug.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/vercel/step1_tokens_page.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/images/vercel/step2_configure_token.png +0 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/index.html +47 -0
- package/vendor/x86_64-apple-darwin/runtime/dashboard/onequery.svg +44 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260327065242_curious_nightmare.sql +403 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260403103652_slippery_hellfire_club.sql +8 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260403112219_gigantic_namora.sql +1 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260420071232_previous_justin_hammer.sql +141 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260420093157_spooky_cassandra_nova.sql +29 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260420101631_even_ogun.sql +5 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260425110519_smart_amazoness.sql +8 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260428033542_rename_source_query_interface_missing.sql +36 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260430114113_jittery_scorpion.sql +28 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260430135906_flippant_timeslip.sql +4 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260502000100_drop_old_workflow_audit_tables.sql +15 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260503011110_moaning_jack_flag.sql +22 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260514143216_reset_workflow_audit_history.sql +20 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/20260524081943_colorful_firelord.sql +1 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260327065242_snapshot.json +2817 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260403103652_snapshot.json +2864 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260403112219_snapshot.json +2870 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260420071232_snapshot.json +3879 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260420093157_snapshot.json +4088 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260420101631_snapshot.json +3250 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260425110519_snapshot.json +3250 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260428033542_snapshot.json +3250 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260430114113_snapshot.json +3507 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260430135906_snapshot.json +3531 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260503011110_snapshot.json +3089 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/20260524081943_snapshot.json +3082 -0
- package/vendor/x86_64-apple-darwin/runtime/migrations/meta/_journal.json +104 -0
- package/vendor/x86_64-apple-darwin/runtime/pglite/initdb.wasm +0 -0
- package/vendor/x86_64-apple-darwin/runtime/pglite/pglite.data +0 -0
- package/vendor/x86_64-apple-darwin/runtime/pglite/pglite.wasm +0 -0
- package/vendor/x86_64-apple-darwin/server/onequery-server.mjs +447889 -0
- package/vendor/x86_64-apple-darwin/server/polyglot_sql_wasm_bg.wasm +0 -0
- package/bin/onequery.js +0 -266
- package/bin/package-constants.d.ts +0 -75
- package/bin/package-constants.js +0 -160
- package/runtime-bundle.json +0 -55
package/package.json
CHANGED
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"homepage": "https://onequery.dev",
|
|
2
|
+
"cpu": [
|
|
3
|
+
"x64"
|
|
4
|
+
],
|
|
6
5
|
"bugs": {
|
|
7
6
|
"url": "https://github.com/wordbricks/onequery/issues"
|
|
8
7
|
},
|
|
9
|
-
"
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/wordbricks/onequery.git",
|
|
13
|
-
"directory": "apps/cli"
|
|
14
|
-
},
|
|
15
|
-
"bin": {
|
|
16
|
-
"onequery": "bin/onequery.js"
|
|
17
|
-
},
|
|
8
|
+
"description": "OneQuery CLI",
|
|
18
9
|
"files": [
|
|
19
|
-
"
|
|
20
|
-
"runtime-bundle.json",
|
|
10
|
+
"vendor",
|
|
21
11
|
"README.md"
|
|
22
12
|
],
|
|
23
|
-
"
|
|
13
|
+
"homepage": "https://onequery.dev",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"name": "@onequery/cli",
|
|
16
|
+
"os": [
|
|
17
|
+
"darwin"
|
|
18
|
+
],
|
|
24
19
|
"publishConfig": {
|
|
25
20
|
"access": "public"
|
|
26
21
|
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"onequery-win32-x64": "npm:@onequery/cli@0.1.62-win32-x64"
|
|
34
|
-
}
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/wordbricks/onequery.git",
|
|
25
|
+
"directory": "apps/cli"
|
|
26
|
+
},
|
|
27
|
+
"version": "0.1.63-darwin-x64"
|
|
35
28
|
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,d as t,f as n}from"./createReactComponent-_L2mp4Ui.js";import{t as r}from"./useCompositeItem-D243hyne.js";function i(i){let{render:a,className:o,state:s=n,props:c=t,refs:l=t,metadata:u,stateAttributesMapping:d,tag:f=`div`,...p}=i,{compositeProps:m,compositeRef:h}=r({metadata:u});return e(f,i,{state:s,ref:[...l,h],props:[m,...c,p],stateAttributesMapping:d})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{C as r,F as i,S as a,x as o,y as s}from"./createReactComponent-_L2mp4Ui.js";import{$ as c,it as l}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";function u(e,t,n){return Math.floor(e/t)!==n}function d(e,t){return t<0||t>=e.current.length}function f(e,t){return m(e,{disabledIndices:t})}function p(e,t){return m(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function m(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&y(e,a,r));return a}function h(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:f,prevIndex:p,stopEvent:h=!1}){let g=p,_=[],v={},b=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(e==null)return;let i=e.closest(`[role="row"]`);i&&(b=!0),(i!==t||n===-1)&&(t=i,n+=1,_[n]=[]),_[n].push(r),v[r]=n})}let x=b&&_.length>0&&_.some(e=>e.length!==a);function S(t){if(!x||p===-1)return;let n=v[p];if(n==null)return;let i=_[n].indexOf(p),a=t===`up`?n-1:n+1;r&&(a<0?a=_.length-1:a>=_.length&&(a=0));let s=new Set;for(;a>=0&&a<_.length&&!s.has(a);){s.add(a);let n=_[a];if(n.length===0){a=t===`up`?a-1:a+1;continue}let c=Math.min(i,n.length-1);for(let t=c;t>=0;--t){let r=n[t];if(!y(e,r,o))return r}a=t===`up`?a-1:a+1,r&&(a<0?a=_.length-1:a>=_.length&&(a=0))}}if(t.key===`ArrowUp`){let n=S(`up`);if(n!==void 0)h&&l(t),g=n;else{if(h&&l(t),p===-1)g=f;else if(g=m(e,{startingIndex:g,amount:a,decrement:!0,disabledIndices:o}),r&&(p-a<s||g<0)){let e=p%a,t=f%a,n=f-(t-e);g=t===e?f:t>e?n:n-a}d(e,g)&&(g=p)}}if(t.key===`ArrowDown`){let n=S(`down`);n===void 0?(h&&l(t),p===-1?g=s:(g=m(e,{startingIndex:p,amount:a,disabledIndices:o}),r&&p+a>f&&(g=m(e,{startingIndex:p%a-a,amount:a,disabledIndices:o}))),d(e,g)&&(g=p)):(h&&l(t),g=n)}if(n===`both`){let n=c(p/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(h&&l(t),p%a===a-1?r&&(g=m(e,{startingIndex:p-p%a-1,disabledIndices:o})):(g=m(e,{startingIndex:p,disabledIndices:o}),r&&u(g,a,n)&&(g=m(e,{startingIndex:p-p%a-1,disabledIndices:o}))),u(g,a,n)&&(g=p)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(h&&l(t),p%a===0?r&&(g=m(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:o})):(g=m(e,{startingIndex:p,decrement:!0,disabledIndices:o}),r&&u(g,a,n)&&(g=m(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:o}))),u(g,a,n)&&(g=p));let s=c(f/a)===n;d(e,g)&&(g=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?f:m(e,{startingIndex:p-p%a-1,disabledIndices:o}):p)}return g}function g(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function _(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function v(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function y(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r?r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`:!1}var b=`ArrowUp`,x=`ArrowDown`,S=`ArrowLeft`,C=`ArrowRight`,w=`Home`,T=new Set([S,C]),E=new Set([S,C,w,`End`]),D=new Set([b,x]),O=new Set([b,x,w,`End`]),k=new Set([...T,...D]),A=new Set([...k,w,`End`]),j=new Set([b,x,S,C,w,`End`]),M=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function N(e){return i(e)&&e.tagName===`INPUT`}function P(e){return!!(N(e)&&e.selectionStart!=null||i(e)&&e.tagName===`TEXTAREA`)}function F(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=I(e,t,`left`),a=L(e),o=L(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=I(e,t,`top`),r=L(e),i=L(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function I(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function L(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var R=e(t()),z=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function B(){return R.useContext(z)}var V=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function H(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:s,unregister:c,subscribeMapChange:l,elementsRef:u,labelsRef:d,nextIndexRef:f}=B(),p=R.useRef(-1),[m,h]=R.useState(a??(i===V.GuessFromOrder?()=>{if(p.current===-1){let e=f.current;f.current+=1,p.current=e}return p.current}:-1)),g=R.useRef(null),_=R.useCallback(e=>{if(g.current=e,m!==-1&&e!==null&&(u.current[m]=e,d)){let n=t!==void 0;d.current[m]=n?t:r?.current?.textContent??e.textContent}},[m,u,d,t,r]);return o(()=>{if(a!=null)return;let e=g.current;if(e)return s(e,n),()=>{c(e)}},[a,s,c,n]),o(()=>{if(a==null)return l(e=>{let t=g.current?e.get(g.current)?.index:null;t!=null&&h(t)})},[a,l,h]),R.useMemo(()=>({ref:_,index:m}),[m,_])}var U=R.createContext(void 0);function W(e){let t=R.useContext(U);if(t===void 0&&!e)throw Error(s(69));return t}var G=n();function K(e){let{children:t,elementsRef:n,labelsRef:i,onMapChange:s}=e,c=a(s),l=R.useRef(0),u=r(J).current,d=r(q).current,[f,p]=R.useState(0),m=R.useRef(f),h=a((e,t)=>{d.set(e,t??null),m.current+=1,p(m.current)}),g=a(e=>{d.delete(e),m.current+=1,p(m.current)}),_=R.useMemo(()=>{let e=new Map;return Array.from(d.keys()).filter(e=>e.isConnected).sort(Y).forEach((t,n)=>{let r=d.get(t)??{};e.set(t,{...r,index:n})}),e},[d,f]);o(()=>{if(typeof MutationObserver!=`function`||_.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(m.current+=1,p(m.current))});return _.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[_]),o(()=>{m.current===f&&(n.current.length!==_.size&&(n.current.length=_.size),i&&i.current.length!==_.size&&(i.current.length=_.size),l.current=_.size),c(_)},[c,_,n,i,f]),o(()=>()=>{n.current=[]},[n]),o(()=>()=>{i&&(i.current=[])},[i]);let v=a(e=>(u.add(e),()=>{u.delete(e)}));o(()=>{u.forEach(e=>e(_))},[u,_]);let y=R.useMemo(()=>({register:h,unregister:g,subscribeMapChange:v,elementsRef:n,labelsRef:i,nextIndexRef:l}),[h,g,v,n,i,l]);return(0,G.jsx)(z.Provider,{value:y,children:t})}function q(){return new Map}function J(){return new Set}function Y(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}export{v as C,d as D,f as E,y as O,_ as S,p as T,O as _,A as a,g as b,S as c,j as d,w as f,D as g,M as h,H as i,C as l,E as m,W as n,x as o,T as p,V as r,k as s,K as t,b as u,P as v,h as w,m as x,F as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{C as r,S as i,a,g as o,y as s}from"./createReactComponent-_L2mp4Ui.js";import{E as c,O as l,S as u,T as d,a as f,b as p,ct as m,dt as h,f as g,g as _,h as v,l as y,m as b,o as x,p as S,u as C,y as w}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";import{d as T}from"./CompositeList-DbbDW_rT.js";import{c as E,i as D,n as O,t as k}from"./useBaseUiId-CtNp109T.js";import{a as A,i as j,l as M,n as N,r as P}from"./getPseudoElementBounds-CRlxTrfr.js";import{n as F}from"./Separator-M05FshHx.js";var I=e(t()),L=I.createContext(void 0);function R(e){let t=I.useContext(L);if(e===!1&&t===void 0)throw Error(s(27));return t}var z={...x,...p},B=I.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...o}=e,{store:s}=R(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d=s.useState(`transitionStatus`);return a(`div`,e,{state:I.useMemo(()=>({open:c,transitionStatus:d}),[c,d]),ref:[s.context.backdropRef,t],stateAttributesMapping:z,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:i||!l})}),V=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:s=!0,...c}=e,{store:l}=R(),u=l.useState(`open`);function d(e){u&&l.setOpen(!1,O(D,e.nativeEvent))}let{getButtonProps:f,buttonRef:p}=o({disabled:i,native:s});return a(`button`,e,{state:I.useMemo(()=>({disabled:i}),[i]),ref:[t,p],props:[{onClick:d},c,f]})}),H=I.forwardRef(function(e,t){let{render:n,className:r,id:i,...o}=e,{store:s}=R(),c=k(i);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),a(`p`,e,{ref:t,props:[{id:c},o]})}),U=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),W=function(e){return e[e.open=f.open]=`open`,e[e.closed=f.closed]=`closed`,e[e.startingStyle=f.startingStyle]=`startingStyle`,e[e.endingStyle=f.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),G=I.createContext(void 0);function K(){let e=I.useContext(G);if(e===void 0)throw Error(s(26));return e}var q=n(),J={...x,...p,nestedDialogOpen(e){return e?{[W.nestedDialogOpen]:``}:null}},Y=I.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:o,...s}=e,{store:c}=R(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`);K(),w({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=i===void 0?S:i,E=g>0,D=a(`div`,e,{state:I.useMemo(()=>({open:_,nested:h,transitionStatus:b,nestedDialogOpen:E}),[_,h,b,E]),props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){T.has(e.key)&&e.stopPropagation()},style:{[U.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:J});return(0,q.jsx)(M,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:D})}),X=I.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=R(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,q.jsx)(G.Provider,{value:n,children:(0,q.jsxs)(l,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(j,{ref:i.context.internalBackdropRef,inert:A(!s)}),e.children]})}):null});function Z(e){let{store:t,parentContext:n,actionsRef:r}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),l=t.useState(`popupElement`),{openMethod:u,triggerProps:d,reset:f}=N(a);v(t);let{forceUnmount:p}=_(a,t,()=>{f()}),g=i(e=>{let n=O(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),b=I.useCallback(()=>{t.setOpen(!1,g(E))},[t,g]);I.useImperativeHandle(r,()=>({unmount:p,close:b}),[p,b]);let x=C({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[S,w]=I.useState(0),T=S===0,D=F(x),k=c(x,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=h(e);if(T&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||m(e,l)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:T});P(a&&s===!0,l);let{getReferenceProps:A,getFloatingProps:j,getTriggerProps:M}=y([D,k]);t.useContextCallback(`onNestedDialogOpen`,e=>{w(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{w(0)}),I.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(S),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[a,n,S]);let L=I.useMemo(()=>A(d),[A,d]),R=I.useMemo(()=>M(d),[M,d]),z=I.useMemo(()=>j(),[j]);t.useSyncedValues({openMethod:u,activeTriggerProps:L,inactiveTriggerProps:R,popupProps:z,floatingRootContext:x,nestedOpenDialogCount:S})}var Q={...S,modal:d(e=>e.modal),nested:d(e=>e.nested),nestedOpenDialogCount:d(e=>e.nestedOpenDialogCount),disablePointerDismissal:d(e=>e.disablePointerDismissal),openMethod:d(e=>e.openMethod),descriptionElementId:d(e=>e.descriptionElementId),titleElementId:d(e=>e.titleElementId),viewportElement:d(e=>e.viewportElement),role:d(e=>e.role)},$=class extends u{constructor(e){super(ee(e),{popupRef:I.createRef(),backdropRef:I.createRef(),internalBackdropRef:I.createRef(),triggerElements:new b,onOpenChange:void 0,onOpenChangeComplete:void 0},Q)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function ee(e={}){return{...g(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function te(e){let{children:t,open:n,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=R(!0),m=!!p,h=r(()=>u?.store??new $({open:n??i,activeTriggerId:d===void 0?f:d,modal:c,disablePointerDismissal:s,nested:m})).current;h.useControlledProp(`open`,n,i),h.useControlledProp(`activeTriggerId`,d,f),h.useSyncedValues({disablePointerDismissal:s,nested:m,modal:c}),h.useContextCallback(`onOpenChange`,a),h.useContextCallback(`onOpenChangeComplete`,o);let g=h.useState(`payload`);Z({store:h,actionsRef:l,parentContext:p?.store.context,onOpenChange:a,triggerIdProp:d});let _=I.useMemo(()=>({store:h}),[h]);return(0,q.jsx)(L.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})}var ne=I.forwardRef(function(e,t){let{render:n,className:r,id:i,...o}=e,{store:s}=R(),c=k(i);return s.useSyncedValueWithCleanup(`titleElementId`,c),a(`h2`,e,{ref:t,props:[{id:c},o]})});export{H as a,R as c,Y as i,te as n,V as o,X as r,B as s,ne as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`arrow-right`,`ArrowRight`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M13 18l6 -6`,key:`svg-1`}],[`path`,{d:`M13 6l6 6`,key:`svg-2`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`chevron-right`,`ChevronRight`,[[`path`,{d:`M9 6l6 6l-6 6`,key:`svg-0`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`coins`,`Coins`,[[`path`,{d:`M9 14c0 1.657 2.686 3 6 3s6 -1.343 6 -3s-2.686 -3 -6 -3s-6 1.343 -6 3`,key:`svg-0`}],[`path`,{d:`M9 14v4c0 1.656 2.686 3 6 3s6 -1.344 6 -3v-4`,key:`svg-1`}],[`path`,{d:`M3 6c0 1.072 1.144 2.062 3 2.598s4.144 .536 6 0c1.856 -.536 3 -1.526 3 -2.598c0 -1.072 -1.144 -2.062 -3 -2.598s-4.144 -.536 -6 0c-1.856 .536 -3 1.526 -3 2.598`,key:`svg-2`}],[`path`,{d:`M3 6v10c0 .888 .772 1.45 2 2`,key:`svg-3`}],[`path`,{d:`M3 11c0 .888 .772 1.45 2 2`,key:`svg-4`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`history`,`History`,[[`path`,{d:`M12 8l0 4l2 2`,key:`svg-0`}],[`path`,{d:`M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`,key:`svg-1`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`loader-2`,`Loader2`,[[`path`,{d:`M12 3a9 9 0 1 0 9 9`,key:`svg-0`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`key`,`Key`,[[`path`,{d:`M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0`,key:`svg-0`}],[`path`,{d:`M15 9h.01`,key:`svg-1`}]]),n=e(`outline`,`terminal-2`,`Terminal2`,[[`path`,{d:`M8 9l3 3l-3 3`,key:`svg-0`}],[`path`,{d:`M13 15l3 0`,key:`svg-1`}],[`path`,{d:`M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12`,key:`svg-2`}]]);export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createReactComponent-_L2mp4Ui.js";var t=e(`outline`,`x`,`X`,[[`path`,{d:`M18 6l-12 12`,key:`svg-0`}],[`path`,{d:`M6 6l12 12`,key:`svg-1`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{a as n,f as r}from"./createReactComponent-_L2mp4Ui.js";import{V as i,ut as a}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";import{v as o}from"./useBaseUiId-CtNp109T.js";var s=e(t()),c=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function l(e,t={}){let n=`rootStore`in e?e.rootStore:e,l=n.useState(`open`),u=n.useState(`floatingId`),d=n.useState(`domReferenceElement`),f=n.useState(`floatingElement`),{enabled:p=!0,role:m=`dialog`}=t,h=o(),g=d?.id||h,_=s.useMemo(()=>a(f)?.id||u,[f,u]),v=c.get(m)??m,y=i()!=null,b=s.useMemo(()=>v===`tooltip`||m===`label`?r:{"aria-haspopup":v===`alertdialog`?`dialog`:v,"aria-expanded":`false`,...v===`listbox`&&{role:`combobox`},...v===`menu`&&y&&{role:`menuitem`},...m===`select`&&{"aria-autocomplete":`none`},...m===`combobox`&&{"aria-autocomplete":`list`}},[v,y,m]),x=s.useMemo(()=>v===`tooltip`||m===`label`?{[`aria-${m===`label`?`labelledby`:`describedby`}`]:l?_:void 0}:{...b,"aria-expanded":l?`true`:`false`,"aria-controls":l?_:void 0,...v===`menu`&&{id:g}},[v,_,l,g,m,b]),S=s.useMemo(()=>{let e={id:_,...v&&{role:v}};return v===`tooltip`||m===`label`?e:{...e,...v===`menu`&&{"aria-labelledby":g}}},[v,_,g,m]),C=s.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${_}-fui-option`}};switch(m){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[_,m]);return s.useMemo(()=>p?{reference:x,floating:S,item:C,trigger:b}:{},[p,x,S,b,C])}var u=s.forwardRef(function(e,t){let{className:r,render:i,orientation:a=`horizontal`,...o}=e;return n(`div`,e,{state:s.useMemo(()=>({orientation:a}),[a]),ref:t,props:[{role:`separator`,"aria-orientation":a},o]})});export{l as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DG_AJzB_.js";import{t}from"./compiler-runtime-DCc3R3Xn.js";import{Z as n}from"./index-CXR0dKJj.js";var r=t(),i=e();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./link-Cgvqhh5w.js";import{t as i}from"./compiler-runtime-DCc3R3Xn.js";import{n as a,t as o}from"./useRouterState-DpT8luFk.js";import{a as s,c,o as l}from"./api-base-url-DIb6qukm.js";import{b as u,i as d,n as f,r as p,t as m}from"./createReactComponent-_L2mp4Ui.js";import{t as h}from"./utils-C8DGLIgm.js";import{t as g}from"./IconCheck-Gc24xPT2.js";import{t as _}from"./IconChevronDown-B-39MA7-.js";import{t as v}from"./IconCoins-C7Nn0L6R.js";import{t as y}from"./theme-toggle-CRaDbyxE.js";import{t as b}from"./IconHistory-DuLS8PKF.js";import{t as x}from"./IconPlus-CZiRiEUF.js";import{t as S}from"./IconX-rRpRFwc5.js";import{r as C}from"./auth-client-D-YHMy0G.js";import{t as w}from"./useQuery-DyOxsY45.js";import{t as T}from"./useSuspenseQuery-CBFRU4At.js";import{n as E,t as D}from"./organization-permissions-BXV_ess0.js";import{A as O,C as k,M as A,N as j,P as M,Z as N,j as ee,k as te}from"./index-CXR0dKJj.js";import{t as P}from"./useRender-CzpKCg11.js";import"./input-BRu0b1Tq.js";import{t as F}from"./separator-BH7Gsum-.js";import{a as I,i as L,n as R,o as z,r as B,s as V,t as H}from"./DialogTitle-ChNkcIa6.js";import{n as U,t as W}from"./avatar-SaFoLofF.js";import{c as ne,d as re,l as ie,n as ae,o as G,r as K,s as oe,t as q,u as se}from"./dropdown-menu-Cw2MW0pD.js";function J(e){return o({select:t=>e?.select?e.select(t.location):t.location})}var ce=m(`outline`,`home`,`Home`,[[`path`,{d:`M5 12l-2 0l9 -9l9 9l-2 0`,key:`svg-0`}],[`path`,{d:`M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7`,key:`svg-1`}],[`path`,{d:`M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6`,key:`svg-2`}]]),le=m(`outline`,`layout-sidebar`,`LayoutSidebar`,[[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-0`}],[`path`,{d:`M9 4l0 16`,key:`svg-1`}]]),ue=m(`outline`,`logout`,`Logout`,[[`path`,{d:`M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M9 12h12l-3 -3`,key:`svg-1`}],[`path`,{d:`M18 15l3 -3`,key:`svg-2`}]]),de=m(`outline`,`plug-connected`,`PlugConnected`,[[`path`,{d:`M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5`,key:`svg-0`}],[`path`,{d:`M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5`,key:`svg-1`}],[`path`,{d:`M3 21l2.5 -2.5`,key:`svg-2`}],[`path`,{d:`M18.5 5.5l2.5 -2.5`,key:`svg-3`}],[`path`,{d:`M10 11l-2 2`,key:`svg-4`}],[`path`,{d:`M13 14l-2 2`,key:`svg-5`}]]),fe=m(`outline`,`settings`,`Settings`,[[`path`,{d:`M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065`,key:`svg-0`}],[`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`,key:`svg-1`}]]),pe=m(`outline`,`users`,`Users`,[[`path`,{d:`M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}],[`path`,{d:`M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2`,key:`svg-1`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`svg-2`}],[`path`,{d:`M21 21v-2a4 4 0 0 0 -3 -3.85`,key:`svg-3`}]]),Y=i(),X=e(t(),1),Z=n();function me(e){let t=(0,Y.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(R,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function he(e){let t=(0,Y.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(B,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function ge(e){let t=(0,Y.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=h(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(V,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _e(e){let t=(0,Y.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`right`:a,c=o===void 0?!0:o,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(ge,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=h(`bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,Z.jsxs)(z,{"data-slot":`sheet-close`,render:(0,Z.jsx)(f,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,Z.jsx)(S,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[9]=c,t[10]=d);let p;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==u||t[15]!==d?(p=(0,Z.jsxs)(he,{children:[l,(0,Z.jsxs)(L,{"data-slot":`sheet-content`,"data-side":s,className:u,...i,children:[n,d]})]}),t[11]=n,t[12]=i,t[13]=s,t[14]=u,t[15]=d,t[16]=p):p=t[16],p}function ve(e){let t=(0,Y.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=h(`gap-0.5 p-4 flex flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ye(e){let t=(0,Y.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=h(`text-foreground text-base font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(H,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,Y.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=h(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(I,{"data-slot":`sheet-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xe(e){let t=(0,Y.c)(3),n=e===void 0?768:e,[r,i]=X.useState(void 0),a,o;return t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=window.matchMedia(`(max-width: ${n-1}px)`),t=()=>{i(window.innerWidth<n)};return e.addEventListener(`change`,t),i(window.innerWidth<n),()=>e.removeEventListener(`change`,t)},o=[n],t[0]=n,t[1]=a,t[2]=o),X.useEffect(a,o),!!r}var Se=`sidebar_state`,Ce=3600*24*7,we=`16rem`,Te=`18rem`,Ee=`3rem`,De=`b`,Oe=X.createContext(null);function Q(){let e=X.useContext(Oe);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function ke(e){let t=(0,Y.c)(36),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=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);let l=c===void 0?!0:c,u=xe(),[d,f]=X.useState(!1),[p,m]=X.useState(l),g=i??p,_;t[8]!==g||t[9]!==o?(_=e=>{let t=typeof e==`function`?e(g):e;o?o(t):m(t),document.cookie=`${Se}=${t}; path=/; max-age=${Ce}`},t[8]=g,t[9]=o,t[10]=_):_=t[10];let v=_,y;t[11]!==u||t[12]!==v?(y=()=>u?f(je):v(Ae),t[11]=u,t[12]=v,t[13]=y):y=t[13];let b=y,x,S;t[14]===b?(x=t[15],S=t[16]):(x=()=>{let e=e=>{e.key===De&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},S=[b],t[14]=b,t[15]=x,t[16]=S),X.useEffect(x,S);let C=g?`expanded`:`collapsed`,w;t[17]!==u||t[18]!==g||t[19]!==d||t[20]!==v||t[21]!==C||t[22]!==b?(w={state:C,open:g,setOpen:v,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:b},t[17]=u,t[18]=g,t[19]=d,t[20]=v,t[21]=C,t[22]=b,t[23]=w):w=t[23];let T=w,E;t[24]===s?E=t[25]:(E={"--sidebar-width":we,"--sidebar-width-icon":Ee,...s},t[24]=s,t[25]=E);let D=E,O;t[26]===r?O=t[27]:(O=h(`group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full`,r),t[26]=r,t[27]=O);let k;t[28]!==n||t[29]!==a||t[30]!==D||t[31]!==O?(k=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:D,className:O,...a,children:n}),t[28]=n,t[29]=a,t[30]=D,t[31]=O,t[32]=k):k=t[32];let A;return t[33]!==T||t[34]!==k?(A=(0,Z.jsx)(Oe.Provider,{value:T,children:k}),t[33]=T,t[34]=k,t[35]=A):A=t[35],A}function Ae(e){return!e}function je(e){return!e}function Me(e){let t=(0,Y.c)(46),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offExamples`:s,{isMobile:d,state:f,openMobile:p,setOpenMobile:m}=Q();if(u===`none`){let e;t[7]===r?e=t[8]:(e=h(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=a):a=t[12],a}if(d){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":Te},t[13]=e):e=t[13];let r;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(ve,{className:`sr-only`,children:[(0,Z.jsx)(ye,{children:`Sidebar`}),(0,Z.jsx)(be,{children:`Displays the mobile sidebar.`})]}),t[14]=r):r=t[14];let a;t[15]===n?a=t[16]:(a=(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:n}),t[15]=n,t[16]=a);let o;t[17]!==c||t[18]!==a?(o=(0,Z.jsxs)(_e,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:e,side:c,children:[r,a]}),t[17]=c,t[18]=a,t[19]=o):o=t[19];let s;return t[20]!==p||t[21]!==i||t[22]!==m||t[23]!==o?(s=(0,Z.jsx)(me,{open:p,onOpenChange:m,...i,children:o}),t[20]=p,t[21]=i,t[22]=m,t[23]=o,t[24]=s):s=t[24],s}let g=f===`collapsed`?u:``,_=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,v;t[25]===_?v=t[26]:(v=h(`transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent`,`group-data-[collapsible=offExamples]:w-0`,`group-data-[side=right]:rotate-180`,_),t[25]=_,t[26]=v);let y;t[27]===v?y=t[28]:(y=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:v}),t[27]=v,t[28]=y);let b=c===`left`?`left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]`,x=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,S;t[29]!==r||t[30]!==b||t[31]!==x?(S=h(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,b,x,r),t[29]=r,t[30]=b,t[31]=x,t[32]=S):S=t[32];let C;t[33]===n?C=t[34]:(C=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col`,children:n}),t[33]=n,t[34]=C);let w;t[35]!==i||t[36]!==S||t[37]!==C?(w=(0,Z.jsx)(`div`,{"data-slot":`sidebar-container`,className:S,...i,children:C}),t[35]=i,t[36]=S,t[37]=C,t[38]=w):w=t[38];let T;return t[39]!==c||t[40]!==f||t[41]!==w||t[42]!==g||t[43]!==y||t[44]!==l?(T=(0,Z.jsxs)(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":f,"data-collapsible":g,"data-variant":l,"data-side":c,"data-slot":`sidebar`,children:[y,w]}),t[39]=c,t[40]=f,t[41]=w,t[42]=g,t[43]=y,t[44]=l,t[45]=T):T=t[45],T}function Ne(e){let t=(0,Y.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=Q(),o;t[4]===n?o=t[5]:(o=h(n),t[4]=n,t[5]=o);let s;t[6]!==r||t[7]!==a?(s=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=s):s=t[8];let c,l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(le,{}),l=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[9]=c,t[10]=l):(c=t[9],l=t[10]);let u;return t[11]!==i||t[12]!==o||t[13]!==s?(u=(0,Z.jsxs)(f,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:o,onClick:s,...i,children:[c,l]}),t[11]=i,t[12]=o,t[13]=s,t[14]=u):u=t[14],u}function Pe(e){let t=(0,Y.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=h(`bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fe(e){let t=(0,Y.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=h(`gap-2 p-2 flex flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ie(e){let t=(0,Y.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=h(`no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Le(e){let t=(0,Y.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=h(`p-2 relative flex w-full min-w-0 flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Re(e){let t=(0,Y.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=h(`text-sm w-full`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ze(e){let t=(0,Y.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=h(`gap-0 flex w-full min-w-0 flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Be(e){let t=(0,Y.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=h(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Ve=d(`ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function He(e){let t=(0,Y.c)(15),{render:n,isActive:r,variant:i,size:a,tooltip:o,className:s,...c}=e,l=r===void 0?!1:r,d=i===void 0?`default`:i,f=a===void 0?`default`:a,{isMobile:p,state:m}=Q(),g=u({className:h(Ve({variant:d,size:f}),s)},c),_=o?M:n,v;t[0]!==l||t[1]!==f?(v={slot:`sidebar-menu-button`,sidebar:`menu-button`,size:f,active:l},t[0]=l,t[1]=f,t[2]=v):v=t[2];let y;t[3]!==g||t[4]!==_||t[5]!==v?(y={defaultTagName:`button`,props:g,render:_,state:v},t[3]=g,t[4]=_,t[5]=v,t[6]=y):y=t[6];let b=P(y);if(!o)return b;if(typeof o==`string`){let e;t[7]===o?e=t[8]:(e={children:o},t[7]=o,t[8]=e),o=e}let x=m!==`collapsed`||p,S;t[9]!==x||t[10]!==o?(S=(0,Z.jsx)(j,{side:`right`,align:`center`,hidden:x,...o}),t[9]=x,t[10]=o,t[11]=S):S=t[11];let C;return t[12]!==b||t[13]!==S?(C=(0,Z.jsxs)(A,{children:[b,S]}),t[12]=b,t[13]=S,t[14]=C):C=t[14],C}var Ue=[{icon:ce,label:`Home`,to:`/$org_slug/home`},{icon:b,label:`Audit`,to:`/$org_slug/audit`},{icon:v,label:`Budget`,to:`/$org_slug/budget`},{icon:de,label:`Integrations`,to:`/$org_slug/integrations`},{icon:pe,label:`Team`,to:`/$org_slug/team`}];function $(e,t){let n=e.replace(`/$org_slug/`,``);return n===`home`?t.endsWith(`/home`):t.includes(`/${n}`)}var We=s(`/_authenticated/$org_slug`);function Ge(e){let t=e?.trim();if(!t)return`?`;let n=t.split(/\s+/),r=n.at(0);if(!r)return`?`;let i=r.at(0);if(!i)return`?`;if(n.length===1)return i.toUpperCase();let a=n.at(-1);if(!a)return i.toUpperCase();let o=a.at(0);return o?`${i}${o}`.toUpperCase():i.toUpperCase()}function Ke(e){for(let t of Ue)if($(t.to,e))return t.label;return`OneQuery`}function qe(){let e=(0,Y.c)(23),t=J(),n=l(),r=We.useRouteContext(),i=a(),o=r.session.user,s=o?.name,c=o?.email,u;e[0]===s?u=e[1]:(u=Ge(s),e[0]=s,e[1]=u);let d=u,f;e[2]===t.pathname?f=e[3]:(f=Ke(t.pathname),e[2]=t.pathname,e[3]=f);let m=f,h;e[4]!==n||e[5]!==i?(h=function(){(async()=>{await C(),await i.invalidate(),await n({to:`/`})})()},e[4]=n,e[5]=i,e[6]=h):h=e[6];let g=h,_,v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(Ne,{className:`-ml-1`}),v=(0,Z.jsx)(F,{orientation:`vertical`,className:`mr-2 h-4`}),e[7]=_,e[8]=v):(_=e[7],v=e[8]);let b;e[9]===m?b=e[10]:(b=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,v,(0,Z.jsx)(`span`,{className:`font-medium truncate max-w-[70vw]`,children:m})]}),e[9]=m,e[10]=b);let x;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(y,{}),e[11]=x):x=e[11];let S;e[12]!==g||e[13]!==o||e[14]!==c||e[15]!==d||e[16]!==s?(S=o&&(0,Z.jsxs)(q,{children:[(0,Z.jsxs)(re,{className:p({className:`gap-2`,size:`sm`,variant:`ghost`}),children:[(0,Z.jsx)(W,{size:`sm`,children:(0,Z.jsx)(U,{children:d})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:s})]}),(0,Z.jsxs)(ae,{align:`end`,className:`min-w-56`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-2 py-2`,children:[(0,Z.jsx)(W,{children:(0,Z.jsx)(U,{children:d})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:s}),(0,Z.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:c})]})]}),(0,Z.jsx)(G,{}),(0,Z.jsxs)(K,{onClick:g,children:[(0,Z.jsx)(ue,{size:16,stroke:2}),`Sign out`]})]})]}),e[12]=g,e[13]=o,e[14]=c,e[15]=d,e[16]=s,e[17]=S):S=e[17];let w;e[18]===S?w=e[19]:(w=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[x,S]}),e[18]=S,e[19]=w);let T;return e[20]!==b||e[21]!==w?(T=(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 bg-background flex h-[var(--app-header-height)] shrink-0 items-center justify-between gap-2 border-b px-4`,children:[b,w]}),e[20]=b,e[21]=w,e[22]=T):T=e[22],T}var Je=s(`/_authenticated/$org_slug`);function Ye(e){let t=(0,Y.c)(55),{activeOrganization:n,organizations:r,menuOrgSlug:i}=e,a=l(),o=Je.useRouteContext(),s;t[0]!==o.organizationId||t[1]!==o.session.user.id?(s=k(o.session.user.id,o.organizationId),t[0]=o.organizationId,t[1]=o.session.user.id,t[2]=s):s=t[2];let c=w(s),u=n.name,d;t[3]===n.name?d=t[4]:(d=te(n.name),t[3]=n.name,t[4]=d);let f=d,m=r.length>0,h;if(t[5]!==c.data||t[6]!==o.session.user.id){let e=c.data?.find(e=>e.userId===o.session.user.id)?.rawRole;h=E({permission:`organizationUpdate`,rawRole:e}),t[5]=c.data,t[6]=o.session.user.id,t[7]=h}else h=t[7];let v=h,y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=p({className:`-mx-2 h-auto w-full justify-start gap-2 rounded-md px-2 py-1.5 text-left`,size:`sm`,variant:`ghost`}),t[8]=y):y=t[8];let b;t[9]===f?b=t[10]:(b=(0,Z.jsx)(`div`,{className:`flex size-6 items-center justify-center rounded bg-primary text-xs font-semibold text-primary-foreground`,children:f}),t[9]=f,t[10]=b);let S;t[11]===u?S=t[12]:(S=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:u}),t[11]=u,t[12]=S);let C;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(_,{size:12,stroke:2,className:`shrink-0 opacity-50`}),t[13]=C):C=t[13];let T;t[14]===S?T=t[15]:(T=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[S,C]}),t[14]=S,t[15]=T);let D;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(`div`,{className:`text-xs leading-none text-muted-foreground`,children:`Workspace`}),t[16]=D):D=t[16];let O;t[17]===T?O=t[18]:(O=(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[T,D]}),t[17]=T,t[18]=O);let A;t[19]!==O||t[20]!==b?(A=(0,Z.jsx)(re,{className:y,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,O]})}),t[19]=O,t[20]=b,t[21]=A):A=t[21];let j;t[22]!==v||t[23]!==i||t[24]!==a?(j=v?(0,Z.jsxs)(K,{onClick:()=>{a({params:{org_slug:i},to:`/$org_slug/settings`})},children:[(0,Z.jsx)(fe,{size:16,stroke:2}),`Settings`]}):null,t[22]=v,t[23]=i,t[24]=a,t[25]=j):j=t[25];let M;t[26]!==i||t[27]!==a?(M=()=>{a({params:{org_slug:i},to:`/$org_slug/team`})},t[26]=i,t[27]=a,t[28]=M):M=t[28];let N;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(pe,{size:16,stroke:2}),t[29]=N):N=t[29];let P;t[30]===M?P=t[31]:(P=(0,Z.jsxs)(K,{onClick:M,children:[N,`Invite and manage members`]}),t[30]=M,t[31]=P);let F;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(G,{}),t[32]=F):F=t[32];let I;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(se,{children:`Switch organization`}),t[33]=I):I=t[33];let L;t[34]!==n.id||t[35]!==m||t[36]!==a||t[37]!==r?(L=m?r.map(e=>{let t=n.id===e.id,r=ee(e);return(0,Z.jsxs)(K,{onClick:()=>{a({params:{org_slug:r},to:`/$org_slug/home`})},children:[(0,Z.jsx)(`span`,{className:`truncate`,children:e.name}),t?(0,Z.jsx)(oe,{children:(0,Z.jsx)(g,{size:16,stroke:2})}):null]},e.id)}):(0,Z.jsx)(K,{disabled:!0,children:`No organizations`}),t[34]=n.id,t[35]=m,t[36]=a,t[37]=r,t[38]=L):L=t[38];let R;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(G,{}),t[39]=R):R=t[39];let z;t[40]===a?z=t[41]:(z=()=>{a({to:`/onboarding/create-org`})},t[40]=a,t[41]=z);let B;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(x,{size:16,stroke:2}),t[42]=B):B=t[42];let V;t[43]===z?V=t[44]:(V=(0,Z.jsxs)(K,{onClick:z,children:[B,`Create organization`]}),t[43]=z,t[44]=V);let H;t[45]!==L||t[46]!==V?(H=(0,Z.jsxs)(ne,{children:[I,(0,Z.jsxs)(ie,{className:`w-56`,children:[L,R,V]})]}),t[45]=L,t[46]=V,t[47]=H):H=t[47];let U;t[48]!==j||t[49]!==P||t[50]!==H?(U=(0,Z.jsxs)(ae,{align:`start`,className:`w-64`,children:[j,P,F,H]}),t[48]=j,t[49]=P,t[50]=H,t[51]=U):U=t[51];let W;return t[52]!==A||t[53]!==U?(W=(0,Z.jsx)(Fe,{className:`h-14 flex-row items-center border-b px-3`,children:(0,Z.jsxs)(q,{children:[A,U]})}),t[52]=A,t[53]=U,t[54]=W):W=t[54],W}var Xe=s(`/_authenticated/$org_slug`);function Ze(e){let t=(0,Y.c)(31),{orgSlug:n}=e,r=J(),i=Xe.useRouteContext(),a;t[0]!==i.organizationId||t[1]!==i.session.user.id?(a=k(i.session.user.id,i.organizationId),t[0]=i.organizationId,t[1]=i.session.user.id,t[2]=a):a=t[2];let o;t[3]===a?o=t[4]:(o={...a},t[3]=a,t[4]=o);let s=w(o),c,l,u,d,f,p;if(t[5]!==r||t[6]!==s.data||t[7]!==n||t[8]!==i.session.user.id){let e=s.data?.find(e=>e.userId===i.session.user.id)?.rawRole,a=D({rawRole:e}),o=Ue.filter(e=>!e.organizationAdminOnly||a);d=Ie,p=`overflow-hidden`,u=Le,l=Re,c=ze;let m;t[15]!==r||t[16]!==n?(m=e=>(0,Z.jsx)(Qe,{item:e,orgSlug:n,pathname:r.pathname},e.to),t[15]=r,t[16]=n,t[17]=m):m=t[17],f=o.map(m),t[5]=r,t[6]=s.data,t[7]=n,t[8]=i.session.user.id,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p}else c=t[9],l=t[10],u=t[11],d=t[12],f=t[13],p=t[14];let m;t[18]!==c||t[19]!==f?(m=(0,Z.jsx)(c,{children:f}),t[18]=c,t[19]=f,t[20]=m):m=t[20];let h;t[21]!==l||t[22]!==m?(h=(0,Z.jsx)(l,{children:m}),t[21]=l,t[22]=m,t[23]=h):h=t[23];let g;t[24]!==u||t[25]!==h?(g=(0,Z.jsx)(u,{children:h}),t[24]=u,t[25]=h,t[26]=g):g=t[26];let _;return t[27]!==d||t[28]!==p||t[29]!==g?(_=(0,Z.jsx)(d,{className:p,children:g}),t[27]=d,t[28]=p,t[29]=g,t[30]=_):_=t[30],_}function Qe(e){let t=(0,Y.c)(19),{item:n,orgSlug:i,pathname:a,onClick:o}=e,s;t[0]!==n.to||t[1]!==a?(s=$(n.to,a),t[0]=n.to,t[1]=a,t[2]=s):s=t[2];let c=s,l=c?`!bg-foreground/10 hover:!bg-foreground/10`:``,u;t[3]===i?u=t[4]:(u={org_slug:i},t[3]=i,t[4]=u);let d;t[5]!==n.to||t[6]!==u?(d=(0,Z.jsx)(r,{to:n.to,params:u}),t[5]=n.to,t[6]=u,t[7]=d):d=t[7];let f;t[8]===n.icon?f=t[9]:(f=(0,Z.jsx)(n.icon,{size:20,stroke:1.5}),t[8]=n.icon,t[9]=f);let p;t[10]===n.label?p=t[11]:(p=(0,Z.jsx)(`span`,{children:n.label}),t[10]=n.label,t[11]=p);let m;return t[12]!==c||t[13]!==o||t[14]!==l||t[15]!==d||t[16]!==f||t[17]!==p?(m=(0,Z.jsx)(Be,{children:(0,Z.jsxs)(He,{isActive:c,className:l,onClick:o,render:d,children:[f,p]})}),t[12]=c,t[13]=o,t[14]=l,t[15]=d,t[16]=f,t[17]=p,t[18]=m):m=t[18],m}var $e=s(`/_authenticated/$org_slug`);function et(e){let t=(0,Y.c)(18),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={from:`/_authenticated/$org_slug`},t[0]=r):r=t[0];let i=c(r),a=$e.useRouteContext(),o=i.org_slug??``,s;t[1]===a.session.user.id?s=t[2]:(s=O(a.session.user.id),t[1]=a.session.user.id,t[2]=s);let l=T(s).data,u=a.organization,d=a.organizationSlug,f;t[3]!==u||t[4]!==d||t[5]!==l?(f=(0,Z.jsx)(Ye,{activeOrganization:u,organizations:l,menuOrgSlug:d}),t[3]=u,t[4]=d,t[5]=l,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=(0,Z.jsx)(Ze,{orgSlug:o}),t[7]=o,t[8]=p);let m;t[9]!==f||t[10]!==p?(m=(0,Z.jsxs)(Me,{children:[f,p]}),t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(qe,{}),t[12]=h):h=t[12];let g;t[13]===n?g=t[14]:(g=(0,Z.jsxs)(Pe,{className:`flex min-h-0 overflow-y-auto [--app-header-height:3.5rem]`,children:[h,(0,Z.jsx)(`main`,{className:`h-[calc(100%-var(--app-header-height))]`,children:n})]}),t[13]=n,t[14]=g);let _;return t[15]!==m||t[16]!==g?(_=(0,Z.jsxs)(ke,{className:`!h-svh`,children:[m,g]}),t[15]=m,t[16]=g,t[17]=_):_=t[17],_}function tt(){let e=(0,Y.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(et,{children:(0,Z.jsx)(N,{})}),e[0]=t):t=e[0],t}export{tt as component};
|
|
@@ -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{i as r,t as i}from"./createReactComponent-_L2mp4Ui.js";import{t as a}from"./utils-C8DGLIgm.js";var o=i(`outline`,`search`,`Search`,[[`path`,{d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0`,key:`svg-0`}],[`path`,{d:`M21 21l-6 -6`,key:`svg-1`}]]),s=n();e();var c=t(),l=r(`grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function u(e){let t=(0,s.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let o;t[4]!==n||t[5]!==i?(o=a(l({variant:i}),n),t[4]=n,t[5]=i,t[6]=o):o=t[6];let u;return t[7]!==r||t[8]!==o?(u=(0,c.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:o,...r}),t[7]=r,t[8]=o,t[9]=u):u=t[9],u}function d(e){let t=(0,s.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=a(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,c.jsx)(`div`,{"data-slot":`alert-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function f(e){let t=(0,s.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=a(`text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,c.jsx)(`div`,{"data-slot":`alert-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}export{o as i,f as n,d as r,u 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"./link-Cgvqhh5w.js";import{S as i,h as a,m as o,n as s,t as c,u as l}from"./useRouterState-DpT8luFk.js";import{a as u,i as d,n as f,s as p,t as m}from"./matchContext-CDajBC0L.js";var h=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=u:this.parentRoute||i(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?u:t?.path;r&&r!==`/`&&(r=o(r));let s=t?.id||r,c=n?u:l([this.parentRoute.id===`__root__`?``:this.parentRoute.id,s]);r===`__root__`&&(r=`/`),c!==`__root__`&&(c=l([`/`,c]));let d=c===`__root__`?`/`:l([this.parentRoute.fullPath,r]);this._path=r,this._id=c,this._fullPath=d,this._to=a(d)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>d({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},g=class{constructor({id:e}){this.notFound=e=>p({routeId:this.id,...e}),this.redirect=e=>d({from:this.id,...e}),this.id=e}},_=class extends h{constructor(e){super(e)}},v=e(t(),1);function y(e){let t=v.useContext(e.from?m:f);return c({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(i(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function b(e){return y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function x(e){let{select:t,...n}=e;return y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function S(e){return y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function C(e){return y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function w(e){let t=s();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var T=n();function E(e){return new D({id:e})}var D=class extends g{constructor({id:e}){super({id:e}),this.useMatch=e=>y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>y({from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>C({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>S({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>x({...e,from:this.id,strict:!1}),this.useLoaderData=e=>b({...e,from:this.id,strict:!1}),this.useNavigate=()=>w({from:s().routesById[this.id].fullPath}),this.notFound=e=>p({routeId:this.id,...e}),this.Link=v.forwardRef((e,t)=>{let n=s().routesById[this.id].fullPath;return(0,T.jsx)(r,{ref:t,from:n,...e})})}},O=class extends h{constructor(e){super(e),this.useMatch=e=>y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>y({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>C({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>S({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>x({...e,from:this.id}),this.useLoaderData=e=>b({...e,from:this.id}),this.useNavigate=()=>w({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,T.jsx)(r,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function k(e){return new O(e)}function A(){return e=>M(e)}var j=class extends _{constructor(e){super(e),this.useMatch=e=>y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>y({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>C({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>S({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>x({...e,from:this.id}),this.useLoaderData=e=>b({...e,from:this.id}),this.useNavigate=()=>w({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,T.jsx)(r,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function M(e){return new j(e)}function N(){return typeof window>`u`?``:window.location.origin}function P(){return N()}export{E as a,S as c,y as d,k as i,x as l,N as n,w as o,A as r,C as s,P as t,b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./api-base-url-DIb6qukm.js";var t=/^[\w!#$%&'*.^`|~+-]+$/,n=(e,n,r={})=>{if(!t.test(e))throw Error(`Invalid cookie name`);let i=`${e}=${n}`;if(e.startsWith(`__Secure-`)&&!r.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!r.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(r.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(r.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`])if(r[e]&&/[;\r\n]/.test(r[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(r&&typeof r.maxAge==`number`&&r.maxAge>=0){if(r.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);i+=`; Max-Age=${r.maxAge|0}`}if(r.domain&&r.prefix!==`host`&&(i+=`; Domain=${r.domain}`),r.path&&(i+=`; Path=${r.path}`),r.expires){if(r.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+=`; HttpOnly`),r.secure&&(i+=`; Secure`),r.sameSite&&(i+=`; SameSite=${r.sameSite.charAt(0).toUpperCase()+r.sameSite.slice(1)}`),r.priority&&(i+=`; Priority=${r.priority.charAt(0).toUpperCase()+r.priority.slice(1)}`),r.partitioned){if(!r.secure)throw Error(`Partitioned Cookie must have Secure attributes`);i+=`; Partitioned`}return i},r=(e,t,r)=>(t=encodeURIComponent(t),n(e,t,r)),i=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),a=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},o=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},s=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},c=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function l(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function u(e,t){if(!l(e)&&!l(t))return t;let n={...e};for(let e in t){let r=t[e];l(n[e])&&l(r)?n[e]=u(n[e],r):n[e]=r}return n}var d=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return d(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),f=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),i={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,i]of Object.entries(e.cookie))t.push(r(n,i,{path:`/`}));i.Cookie=t.join(`,`)}this.cType&&(i[`Content-Type`]=this.cType);let o=new Headers(i??void 0),s=this.url;s=c(s),s=a(s,this.pathParams),this.queryParams&&(s=s+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let l=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(s,{body:l?this.rBody:void 0,method:n,headers:o,...t?.init})}},p=(e,t)=>d(function n(r){let l=t?.buildSearchParams??o,d=[...r.path],p=d.slice(-3).reverse();if(p[0]===`toString`)return p[1]===`name`?p[2]||``:n.toString();if(p[0]===`valueOf`)return p[1]===`name`?p[2]||``:n;let m=``;if(/^\$/.test(p[0])){let e=d.pop();e&&(m=e.replace(/^\$/,``))}let h=i(e,d.join(`/`));if(m===`url`||m===`path`){let t=h;return r.args[0]&&(r.args[0].param&&(t=a(h,r.args[0].param)),r.args[0].query&&(t=t+`?`+l(r.args[0].query).toString())),t=c(t),m===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(m===`ws`){let e=s(r.args[0]&&r.args[0].param?a(h,r.args[0].param):h,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let g=new f(h,m,{buildSearchParams:l});if(m){t??={};let e=u(t,{...r.args[1]});return g.fetch(r.args[0],e)}return g},[]);function m(e=``,t){return p(e,t)}function h(t=e(),n){return m(t,n)}export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`/api`,t=`${e}/auth/bootstrap-state`,n=`${e}/team/organizations`;function r(e,...t){return[n,e,...t].join(`/`)}export{t as n,r,e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=RegExp(`^[A-Z0-9]{8}$`);function t(t){let n=t?.trim().replaceAll(`-`,``).toUpperCase();if(!(!n||!e.test(n)))return n}var n=128;function r(e){let t=e?.trim();if(t&&!(t.length>n||/\s/.test(t)))return t}var i=`/signin`,a=`/device`,o=`/auth/callback`,s=`/onboarding/connect-database`,c=`/invite/$invitationId`,l=`/$org_slug/home`;function u(e,n){let i=t(e);if(!i)return a;let o=new URLSearchParams({user_code:i}),s=r(n);return s&&o.set(`orgId`,s),`${a}?${o.toString()}`}function d(e){let t=r(e);return t?`${s}?${new URLSearchParams({orgId:t}).toString()}`:s}function f(e){return`/invite/${e}`}export{l as a,u as c,t as d,c as i,f as l,s as n,i as o,a as r,d as s,o as t,r as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
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,o as a}from"./api-base-url-DIb6qukm.js";import{n as o,r as s,t as c}from"./createReactComponent-_L2mp4Ui.js";import{t as l}from"./utils-C8DGLIgm.js";import{t as u}from"./IconArrowRight-DsOD7mDl.js";import{t as d}from"./IconCheck-Gc24xPT2.js";import{t as f}from"./IconChevronRight-DD16tNHZ.js";import{a as p,i as m,n as h,r as g,t as _}from"./select-yNaL0SXM.js";import{a as v,i as y,n as b,o as x,r as S,s as C,t as w}from"./copy-button-BO1KBdf9.js";import{t as T}from"./IconHistory-DuLS8PKF.js";import{i as E,n as D,r as O,t as k}from"./alert-BIGxI3XN.js";import{t as A}from"./IconX-rRpRFwc5.js";import{t as j}from"./useQuery-DyOxsY45.js";import{t as M}from"./useSuspenseQuery-CBFRU4At.js";import{h as N,l as P,p as F,u as I}from"./schemas-EcBBwCo1.js";import{M as L,N as R,P as z,X as B,a as V,i as ee,n as H,o as U,q as te,r as ne,s as re,t as W}from"./index-CXR0dKJj.js";import{t as ie}from"./input-BRu0b1Tq.js";import{a as G,i as ae,n as oe,r as se,t as ce}from"./empty-DjRo5ytz.js";import{i as le,r as ue,t as de}from"./xstate-react.esm-Bo3CCIRt.js";import{n as fe}from"./format-date-Rg05aHXh.js";import{t as pe}from"./label-f2wVZcni.js";var me=c(`outline`,`arrow-left`,`ArrowLeft`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M5 12l6 6`,key:`svg-1`}],[`path`,{d:`M5 12l6 -6`,key:`svg-2`}]]),he=c(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),K=r(),q={CLOSE_DETAILS:`auditDetailPanel/closeDetails`,ROW_SELECTED:`auditDetailPanel/rowSelected`},J={CLOSED:`closed`,OPEN:`open`},ge={DETAILS_VISIBLE:`detailsVisible`},_e=ue({actions:{selectItem:le({selectedItem:(e,t)=>t.item})},guards:{isSelectedItem:({context:e},t)=>e.selectedItem.id===t.item.id},types:{}}).createMachine({context:({input:e})=>({selectedItem:e.initialItem}),id:`auditDetailPanel`,initial:J.CLOSED,states:{[J.CLOSED]:{on:{[q.ROW_SELECTED]:{actions:{params:({event:e})=>({item:e.item}),type:`selectItem`},target:J.OPEN}}},[J.OPEN]:{on:{[q.CLOSE_DETAILS]:{target:J.CLOSED},[q.ROW_SELECTED]:[{guard:{params:({event:e})=>({item:e.item}),type:`isSelectedItem`},target:J.CLOSED},{actions:{params:({event:e})=>({item:e.item}),type:`selectItem`},target:J.OPEN}]},tags:ge.DETAILS_VISIBLE}}});function Y(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function ve(e,t=160){return e.length<=t?e:`${e.slice(0,t-1)}…`}var ye={failed:`bg-red-500`,pending:`bg-amber-500`,succeeded:`bg-emerald-500`};function be(e){return e.originActor.email??`System`}function xe(e){return e.family===`query_action`?[e.metrics?.elapsedMs!==null&&e.metrics?.elapsedMs!==void 0?`${e.metrics.elapsedMs} ms`:null,e.metrics?.rowCount!==null&&e.metrics?.rowCount!==void 0?`${e.metrics.rowCount} rows`:null].filter(Boolean).join(` · `):[e.metrics?.pageCount!==null&&e.metrics?.pageCount!==void 0?`${e.metrics.pageCount} pages`:null,e.metrics?.httpStatus!==null&&e.metrics?.httpStatus!==void 0?`HTTP ${e.metrics.httpStatus}`:null].filter(Boolean).join(` · `)}function Se(e){return e.family===`query_action`?ve(e.preview?.queryText??e.subtitle):ve([e.preview?.method,e.preview?.selector].filter(Boolean).join(` `)||e.subtitle)}function Ce(e){return e==null?`n/a`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function we(e){return e.family===`query_action`?e.metrics?.elapsedMs?`${e.metrics.elapsedMs} ms`:`n/a`:e.metrics?.httpStatus?`HTTP ${e.metrics.httpStatus}`:`n/a`}function Te(e){return e.family===`query_action`?e.metrics?.rowCount!==null&&e.metrics?.rowCount!==void 0?`${e.metrics.rowCount.toLocaleString()} rows`:`n/a`:[e.metrics?.pageCount!==null&&e.metrics?.pageCount!==void 0?`${e.metrics.pageCount} pages`:null,Ce(e.metrics?.responseBytes)].filter(e=>e&&e!==`n/a`).join(` · `)}function Ee(e){return e.family===`source_api_action`?e.preview?.operation??e.preview?.selector??e.preview?.method??e.target.displayName??e.target.sourceName??`API`:e.target.displayName??e.target.sourceName??e.target.provider??`Query`}function De(e){return e.id.length>12?e.id.slice(0,12):e.id}function Oe(e){return e.requestId?e.requestId.length>18?`${e.requestId.slice(0,17)}…`:e.requestId:`n/a`}function ke(e){return e.length===0?``:e.length===1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`}function Ae(e){return ke((e.search.family?[e.search.family]:ne).filter(t=>t===`query_action`?e.projectionLag.queryAction:e.projectionLag.sourceApiAction).map(Y))}var X=n();function je(e){let t=(0,K.c)(74),{isDetailOpen:n,isSelected:r,item:i,onSelect:a}=e,o;t[0]===i?o=t[1]:(o=xe(i),t[0]=i,t[1]=o);let s=o,c=r?`border-l-blue-500 bg-blue-50/60 hover:bg-blue-50/70`:`border-l-transparent hover:bg-muted/40`,u;t[2]===c?u=t[3]:(u=l(c),t[2]=c,t[3]=u);let d=r?`selected`:void 0,p=r?n:void 0,m;t[4]===i.startedAt?m=t[5]:(m=fe(i.startedAt),t[4]=i.startedAt,t[5]=m);let h;t[6]===m?h=t[7]:(h=(0,X.jsx)(y,{className:`w-[132px] border-l-2 py-2 align-middle`,children:(0,X.jsx)(`div`,{className:`text-xs tabular-nums`,children:m})}),t[6]=m,t[7]=h);let g=ye[i.outcome],_;t[8]===g?_=t[9]:(_=l(`size-2 rounded-full`,g),t[8]=g,t[9]=_);let v;t[10]===_?v=t[11]:(v=(0,X.jsx)(`span`,{className:_}),t[10]=_,t[11]=v);let b;t[12]===i.outcome?b=t[13]:(b=Y(i.outcome),t[12]=i.outcome,t[13]=b);let x;t[14]!==v||t[15]!==b?(x=(0,X.jsx)(y,{className:`w-[104px] py-2 align-middle`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[v,b]})}),t[14]=v,t[15]=b,t[16]=x):x=t[16];let S;t[17]===i?S=t[18]:(S=be(i),t[17]=i,t[18]=S);let w;t[19]===S?w=t[20]:(w=(0,X.jsx)(y,{className:`w-[172px] py-2 align-middle`,children:(0,X.jsx)(`div`,{className:`truncate text-xs font-medium`,children:S})}),t[19]=S,t[20]=w);let T;t[21]===i.target.sourceKey?T=t[22]:(T=(0,X.jsx)(y,{className:`w-[132px] py-2 align-middle`,children:(0,X.jsx)(`div`,{className:`truncate text-xs`,children:i.target.sourceKey})}),t[21]=i.target.sourceKey,t[22]=T);let E;t[23]===i.title?E=t[24]:(E=(0,X.jsx)(`div`,{className:`truncate text-xs font-medium`,children:i.title}),t[23]=i.title,t[24]=E);let D;t[25]===i?D=t[26]:(D=Se(i),t[25]=i,t[26]=D);let O;t[27]===D?O=t[28]:(O=(0,X.jsx)(`div`,{className:`text-muted-foreground mt-1 truncate font-mono text-[11px]`,children:D}),t[27]=D,t[28]=O);let k;t[29]!==E||t[30]!==O?(k=(0,X.jsxs)(y,{className:`min-w-[320px] py-2 align-middle`,children:[E,O]}),t[29]=E,t[30]=O,t[31]=k):k=t[31];let A;t[32]===i?A=t[33]:(A=Ee(i),t[32]=i,t[33]=A);let j;t[34]===A?j=t[35]:(j=(0,X.jsx)(y,{className:`w-[160px] py-2 align-middle`,children:(0,X.jsx)(`div`,{className:`truncate text-xs`,children:A})}),t[34]=A,t[35]=j);let M;t[36]===i?M=t[37]:(M=we(i),t[36]=i,t[37]=M);let N;t[38]===M?N=t[39]:(N=(0,X.jsx)(y,{className:`w-[92px] py-2 text-right align-middle text-xs tabular-nums`,children:M}),t[38]=M,t[39]=N);let P;t[40]!==i||t[41]!==s?(P=Te(i)||s||`n/a`,t[40]=i,t[41]=s,t[42]=P):P=t[42];let F;t[43]===P?F=t[44]:(F=(0,X.jsx)(y,{className:`w-[112px] py-2 text-right align-middle text-xs tabular-nums`,children:P}),t[43]=P,t[44]=F);let I=i.requestId??void 0,L;t[45]===i?L=t[46]:(L=Oe(i),t[45]=i,t[46]=L);let R;t[47]!==I||t[48]!==L?(R=(0,X.jsx)(y,{className:`w-[152px] py-2 align-middle`,children:(0,X.jsx)(`div`,{className:`text-muted-foreground truncate font-mono text-[11px]`,title:I,children:L})}),t[47]=I,t[48]=L,t[49]=R):R=t[49];let z;t[50]===i?z=t[51]:(z=De(i),t[50]=i,t[51]=z);let B;t[52]===z?B=t[53]:(B=(0,X.jsx)(y,{className:`w-[112px] py-2 align-middle`,children:(0,X.jsx)(`div`,{className:`text-muted-foreground truncate font-mono text-[11px]`,children:z})}),t[52]=z,t[53]=B);let V=r&&n&&`rotate-90`,ee;t[54]===V?ee=t[55]:(ee=l(`text-muted-foreground size-4 transition-transform`,V),t[54]=V,t[55]=ee);let H;t[56]===ee?H=t[57]:(H=(0,X.jsx)(y,{className:`w-8 py-2 align-middle`,children:(0,X.jsx)(f,{className:ee})}),t[56]=ee,t[57]=H);let U;return t[58]!==a||t[59]!==x||t[60]!==w||t[61]!==T||t[62]!==k||t[63]!==j||t[64]!==N||t[65]!==F||t[66]!==R||t[67]!==u||t[68]!==B||t[69]!==H||t[70]!==d||t[71]!==p||t[72]!==h?(U=(0,X.jsxs)(C,{className:u,onClick:a,"data-state":d,"aria-expanded":p,children:[h,x,w,T,k,j,N,F,R,B,H]}),t[58]=a,t[59]=x,t[60]=w,t[61]=T,t[62]=k,t[63]=j,t[64]=N,t[65]=F,t[66]=R,t[67]=u,t[68]=B,t[69]=H,t[70]=d,t[71]=p,t[72]=h,t[73]=U):U=t[73],U}function Me(e){let t=(0,K.c)(13),{isDetailOpen:n,items:r,onSelectItem:i,selectedItemId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`div`,{className:`flex items-center justify-between border-b px-3 py-2`,children:(0,X.jsx)(`div`,{children:(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Audit entries`})})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(x,{className:`bg-background sticky top-0 z-10`,children:(0,X.jsxs)(C,{children:[(0,X.jsx)(v,{className:`w-[132px]`,children:`Time`}),(0,X.jsx)(v,{className:`w-[104px]`,children:`Outcome`}),(0,X.jsx)(v,{className:`w-[172px]`,children:`Actor`}),(0,X.jsx)(v,{className:`w-[132px]`,children:`Source`}),(0,X.jsx)(v,{children:`Action`}),(0,X.jsx)(v,{className:`w-[160px]`,children:`Target`}),(0,X.jsx)(v,{className:`w-[92px] text-right`,children:`Duration`}),(0,X.jsx)(v,{className:`w-[112px] text-right`,children:`Rows / Pages`}),(0,X.jsx)(v,{className:`w-[152px]`,children:`Request ID`}),(0,X.jsx)(v,{className:`w-[112px]`,children:`Trace ID`}),(0,X.jsx)(v,{})]})}),t[1]=s):s=t[1];let c;if(t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a){let e;t[7]!==n||t[8]!==i||t[9]!==a?(e=e=>(0,X.jsx)(je,{isDetailOpen:n,isSelected:n&&a===e.id,item:e,onSelect:()=>i(e)},e.id),t[7]=n,t[8]=i,t[9]=a,t[10]=e):e=t[10],c=r.map(e),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=c}else c=t[6];let l;return t[11]===c?l=t[12]:(l=(0,X.jsxs)(`section`,{className:`min-w-0 rounded-md border`,children:[o,(0,X.jsx)(`div`,{className:`max-h-[calc(100vh-240px)] overflow-auto`,children:(0,X.jsxs)(b,{className:`min-w-[1372px]`,children:[s,(0,X.jsx)(S,{children:c})]})})]}),t[11]=c,t[12]=l),l}var Ne=N().transform(e=>{if(e==null)return`Not recorded`;if(typeof e==`string`){let t=e.trim();return t.length>0?t:`Not recorded`}return JSON.stringify(e,null,2)??String(e)}).catch(`Not recorded`),Pe=P({displayName:F().nullable().optional(),name:F().optional(),provider:F().optional(),sourceId:F().optional(),sourceKey:F().optional(),sourceStatus:F().optional()}).nullable().catch(null),Fe=P({descriptorVersion:F().nullable().optional(),kind:F().nullable().optional(),method:F().nullable().optional(),operation:F().optional(),paginationPolicy:F().nullable().optional(),selector:F().nullable().optional()}).nullable().catch(null),Ie=P({nextPageIndex:I().int().optional()}).nullable().catch(null);function Z(e){let t=(0,K.c)(7),{label:n,value:r}=e;if(!r)return null;let i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`div`,{className:`mt-1 truncate text-xs font-medium`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Le(e){let t=(0,K.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:n}),t[0]=n,t[1]=r),r}function Q(e){return e?.trim()||null}function $(e){let t=Q(e);return t?Y(t):null}function Re(e){return Ne.parse(e)}function ze(e){let t=(0,K.c)(10),{children:n,meta:r,title:i}=e,a;t[0]===i?a=t[1]:(a=(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:i}),t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,X.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:r}):null,t[2]=r,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==n||t[8]!==s?(c=(0,X.jsxs)(`section`,{className:`space-y-2 border-t pt-3`,children:[s,n]}),t[7]=n,t[8]=s,t[9]=c):c=t[9],c}function Be(e){let t=(0,K.c)(17),{maxHeightClassName:n,title:r,value:i}=e,a=n===void 0?`max-h-64`:n,o;t[0]===i?o=t[1]:(o=Re(i),t[0]=i,t[1]=o);let s=o,c;t[2]===r?c=t[3]:(c=(0,X.jsx)(`h4`,{className:`text-xs font-medium`,children:r}),t[2]=r,t[3]=c);let u;t[4]===s?u=t[5]:(u=(0,X.jsx)(w,{value:s,className:`size-7 shrink-0`}),t[4]=s,t[5]=u);let d;t[6]!==c||t[7]!==u?(d=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[c,u]}),t[6]=c,t[7]=u,t[8]=d):d=t[8];let f;t[9]===a?f=t[10]:(f=l(`bg-muted/40 overflow-auto rounded-md border p-3 font-mono text-[11px] leading-5 break-words whitespace-pre-wrap`,a),t[9]=a,t[10]=f);let p;t[11]!==s||t[12]!==f?(p=(0,X.jsx)(`pre`,{className:f,children:s}),t[11]=s,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==d||t[15]!==p?(m=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[d,p]}),t[14]=d,t[15]=p,t[16]=m):m=t[16],m}function Ve(e){let t=(0,K.c)(12),{item:n}=e,r=n.preview?.errorDetail,i=n.family===`query_action`?n.preview?.errorHint:null;if(!r)return null;let a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(B,{className:`size-4`}),o=(0,X.jsx)(O,{children:`Failure detail`}),t[0]=a,t[1]=o):(a=t[0],o=t[1]);let s;t[2]===n.failureCode?s=t[3]:(s=n.failureCode?(0,X.jsx)(`div`,{className:`text-xs font-medium`,children:Y(n.failureCode)}):null,t[2]=n.failureCode,t[3]=s);let c;t[4]===r?c=t[5]:(c=(0,X.jsx)(`p`,{className:`whitespace-pre-wrap`,children:r}),t[4]=r,t[5]=c);let l;t[6]===i?l=t[7]:(l=i?(0,X.jsx)(`p`,{className:`text-muted-foreground whitespace-pre-wrap`,children:i}):null,t[6]=i,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,X.jsxs)(k,{variant:`destructive`,children:[a,o,(0,X.jsxs)(D,{className:`space-y-2`,children:[s,c,l]})]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function He(e){let t=(0,K.c)(9),{value:n}=e,r,i;if(t[0]!==n){let e=Pe.parse(n);r=`space-y-3`,i=e?(0,X.jsxs)(Le,{children:[(0,X.jsx)(Z,{label:`Display name`,value:Q(e.displayName)}),(0,X.jsx)(Z,{label:`Name`,value:Q(e.name)}),(0,X.jsx)(Z,{label:`Provider`,value:$(e.provider)}),(0,X.jsx)(Z,{label:`Source key`,value:e.sourceKey}),(0,X.jsx)(Z,{label:`Source ID`,value:e.sourceId}),(0,X.jsx)(Z,{label:`Status`,value:$(e.sourceStatus)})]}):null,t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;t[3]===n?a=t[4]:(a=(0,X.jsx)(Be,{maxHeightClassName:`max-h-48`,title:`Descriptor`,value:n}),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==i||t[7]!==a?(o=(0,X.jsxs)(`div`,{className:r,children:[i,a]}),t[5]=r,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}function Ue(e){let t=(0,K.c)(59),{action:n}=e,r,i,a,o,s,c,l,u,d,f,p,m;if(t[0]!==n.invokeMode||t[1]!==n.pageProgress||t[2]!==n.preparedRequestFingerprint||t[3]!==n.requestDescriptor||t[4]!==n.requestKind){let e=Fe.parse(n.requestDescriptor),h;t[17]===n.pageProgress?h=t[18]:(h=Ie.parse(n.pageProgress),t[17]=n.pageProgress,t[18]=h),a=h;let g=Q(e?.method),_=Q(e?.operation),v=Q(e?.selector);m=`space-y-3`,f=`rounded-md border p-3`,p=(0,X.jsxs)(`div`,{className:`mb-3 flex min-w-0 items-center gap-2`,children:[g?(0,X.jsx)(`span`,{className:`bg-muted shrink-0 rounded px-1.5 py-0.5 font-mono text-[11px] font-medium`,children:g}):null,(0,X.jsx)(`div`,{className:`min-w-0 truncate text-xs font-medium`,children:_??v??n.preparedRequestFingerprint??`n/a`})]}),i=Le,t[19]===v?c=t[20]:(c=(0,X.jsx)(Z,{label:`Selector`,value:v}),t[19]=v,t[20]=c);let y;t[21]===n.requestKind?y=t[22]:(y=Y(n.requestKind),t[21]=n.requestKind,t[22]=y),t[23]===y?l=t[24]:(l=(0,X.jsx)(Z,{label:`Request kind`,value:y}),t[23]=y,t[24]=l);let b;t[25]===n.invokeMode?b=t[26]:(b=$(n.invokeMode),t[25]=n.invokeMode,t[26]=b),t[27]===b?u=t[28]:(u=(0,X.jsx)(Z,{label:`Invoke mode`,value:b}),t[27]=b,t[28]=u),d=(0,X.jsx)(Z,{label:`Operation kind`,value:$(e?.kind)}),r=Z,o=`Pagination`,s=$(e?.paginationPolicy),t[0]=n.invokeMode,t[1]=n.pageProgress,t[2]=n.preparedRequestFingerprint,t[3]=n.requestDescriptor,t[4]=n.requestKind,t[5]=r,t[6]=i,t[7]=a,t[8]=o,t[9]=s,t[10]=c,t[11]=l,t[12]=u,t[13]=d,t[14]=f,t[15]=p,t[16]=m}else r=t[5],i=t[6],a=t[7],o=t[8],s=t[9],c=t[10],l=t[11],u=t[12],d=t[13],f=t[14],p=t[15],m=t[16];let h;t[29]!==r||t[30]!==o||t[31]!==s?(h=(0,X.jsx)(r,{label:o,value:s}),t[29]=r,t[30]=o,t[31]=s,t[32]=h):h=t[32];let g=a?.nextPageIndex===void 0?null:`${a.nextPageIndex}`,_;t[33]===g?_=t[34]:(_=(0,X.jsx)(Z,{label:`Next page`,value:g}),t[33]=g,t[34]=_);let v=n.attemptNumber===null?null:`${n.attemptNumber}`,y;t[35]===v?y=t[36]:(y=(0,X.jsx)(Z,{label:`Attempt`,value:v}),t[35]=v,t[36]=y);let b;t[37]!==i||t[38]!==h||t[39]!==_||t[40]!==y||t[41]!==c||t[42]!==l||t[43]!==u||t[44]!==d?(b=(0,X.jsxs)(i,{children:[c,l,u,d,h,_,y]}),t[37]=i,t[38]=h,t[39]=_,t[40]=y,t[41]=c,t[42]=l,t[43]=u,t[44]=d,t[45]=b):b=t[45];let x;t[46]!==b||t[47]!==f||t[48]!==p?(x=(0,X.jsxs)(`div`,{className:f,children:[p,b]}),t[46]=b,t[47]=f,t[48]=p,t[49]=x):x=t[49];let S;t[50]===n.requestDescriptor?S=t[51]:(S=(0,X.jsx)(Be,{maxHeightClassName:`max-h-48`,title:`Request descriptor`,value:n.requestDescriptor}),t[50]=n.requestDescriptor,t[51]=S);let C;t[52]===n.pageProgress?C=t[53]:(C=(0,X.jsx)(Be,{maxHeightClassName:`max-h-36`,title:`Page progress`,value:n.pageProgress}),t[52]=n.pageProgress,t[53]=C);let w;return t[54]!==x||t[55]!==S||t[56]!==C||t[57]!==m?(w=(0,X.jsxs)(`div`,{className:m,children:[x,S,C]}),t[54]=x,t[55]=S,t[56]=C,t[57]=m,t[58]=w):w=t[58],w}function We(e){let t=(0,K.c)(19),{action:n}=e,r;t[0]===n.queryText?r=t[1]:(r=(0,X.jsx)(Be,{maxHeightClassName:`max-h-72`,title:`SQL`,value:n.queryText}),t[0]=n.queryText,t[1]=r);let i;t[2]===n.queryMode?i=t[3]:(i=$(n.queryMode),t[2]=n.queryMode,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,X.jsx)(Z,{label:`Query mode`,value:i}),t[4]=i,t[5]=a);let o;t[6]===n.usageRecordingStatus?o=t[7]:(o=Y(n.usageRecordingStatus),t[6]=n.usageRecordingStatus,t[7]=o);let s;t[8]===o?s=t[9]:(s=(0,X.jsx)(Z,{label:`Usage recording`,value:o}),t[8]=o,t[9]=s);let c;t[10]!==a||t[11]!==s?(c=(0,X.jsxs)(Le,{children:[a,s]}),t[10]=a,t[11]=s,t[12]=c):c=t[12];let l;t[13]===n.validatedQuery?l=t[14]:(l=(0,X.jsx)(Be,{maxHeightClassName:`max-h-56`,title:`Validated query`,value:n.validatedQuery}),t[13]=n.validatedQuery,t[14]=l);let u;return t[15]!==r||t[16]!==c||t[17]!==l?(u=(0,X.jsxs)(`div`,{className:`space-y-3`,children:[r,c,l]}),t[15]=r,t[16]=c,t[17]=l,t[18]=u):u=t[18],u}function Ge(e){let t=(0,K.c)(4),{events:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Ke),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(`div`,{className:`divide-y rounded-md border`,children:r}),t[2]=r,t[3]=i),i}function Ke(e){return(0,X.jsxs)(`div`,{className:`grid grid-cols-[28px_minmax(0,1fr)] gap-2 px-3 py-2`,children:[(0,X.jsx)(`div`,{className:`bg-muted flex size-6 items-center justify-center rounded-full text-[11px] tabular-nums`,children:e.sequence}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`truncate text-xs font-medium`,children:Y(e.eventType)}),(0,X.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px]`,children:Ce(e.payload.byteLength)})]}),(0,X.jsx)(`div`,{className:`text-muted-foreground mt-1 truncate font-mono text-[11px]`,children:fe(e.occurredAt)})]})]},e.id)}function qe(e){let t=(0,K.c)(25),{action:n,item:r,meta:i}=e,a=ye[r.outcome],o;t[0]===a?o=t[1]:(o=l(`size-2 rounded-full`,a),t[0]=a,t[1]=o);let s;t[2]===o?s=t[3]:(s=(0,X.jsx)(`span`,{className:o}),t[2]=o,t[3]=s);let c;t[4]===r.outcome?c=t[5]:(c=Y(r.outcome),t[4]=r.outcome,t[5]=c);let u;t[6]===c?u=t[7]:(u=(0,X.jsx)(`span`,{className:`font-medium`,children:c}),t[6]=c,t[7]=u);let d;t[8]===i?d=t[9]:(d=(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i}),t[8]=i,t[9]=d);let f;t[10]!==s||t[11]!==u||t[12]!==d?(f=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[s,u,d]}),t[10]=s,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]===r.title?p=t[15]:(p=(0,X.jsx)(`h2`,{className:`mt-2 truncate text-base font-semibold`,children:r.title}),t[14]=r.title,t[15]=p);let m;t[16]===r.subtitle?m=t[17]:(m=(0,X.jsx)(`p`,{className:`text-muted-foreground mt-1 truncate text-xs`,children:r.subtitle}),t[16]=r.subtitle,t[17]=m);let h;t[18]!==f||t[19]!==p||t[20]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[f,p,m]}),t[18]=f,t[19]=p,t[20]=m,t[21]=h):h=t[21];let g;return t[22]!==n||t[23]!==h?(g=(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[h,n]}),t[22]=n,t[23]=h,t[24]=g):g=t[24],g}function Je(e){let t=(0,K.c)(5),{item:n}=e,r;t[0]===n?r=t[1]:(r=(0,X.jsx)(qe,{item:n,meta:n.family}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`div`,{className:`rounded-md border p-3 text-xs`,children:`Loading full command and event trace…`}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[r,i]}),t[3]=r,t[4]=a),a}function Ye(e){let t=(0,K.c)(86),{detail:n,item:r}=e,i;t[0]===n.commands?i=t[1]:(i=n.commands.at(0),t[0]=n.commands,t[1]=i);let a=i,o;t[2]===r.id?o=t[3]:(o=(0,X.jsx)(w,{value:r.id,className:`size-7 shrink-0`}),t[2]=r.id,t[3]=o);let s;t[4]===r.startedAt?s=t[5]:(s=fe(r.startedAt),t[4]=r.startedAt,t[5]=s);let c;t[6]!==r||t[7]!==o||t[8]!==s?(c=(0,X.jsx)(`div`,{className:`space-y-3`,children:(0,X.jsx)(qe,{action:o,item:r,meta:s})}),t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9];let l;t[10]===r?l=t[11]:(l=be(r),t[10]=r,t[11]=l);let u;t[12]===l?u=t[13]:(u=(0,X.jsx)(Z,{label:`Actor`,value:l}),t[12]=l,t[13]=u);let d;t[14]===r.target.sourceKey?d=t[15]:(d=(0,X.jsx)(Z,{label:`Source`,value:r.target.sourceKey}),t[14]=r.target.sourceKey,t[15]=d);let f;t[16]===r?f=t[17]:(f=we(r),t[16]=r,t[17]=f);let p;t[18]===f?p=t[19]:(p=(0,X.jsx)(Z,{label:`Duration`,value:f}),t[18]=f,t[19]=p);let m;t[20]===r?m=t[21]:(m=Te(r)||`n/a`,t[20]=r,t[21]=m);let h;t[22]===m?h=t[23]:(h=(0,X.jsx)(Z,{label:`Rows / Pages`,value:m}),t[22]=m,t[23]=h);let g;t[24]===r.phase?g=t[25]:(g=Y(r.phase),t[24]=r.phase,t[25]=g);let _;t[26]===g?_=t[27]:(_=(0,X.jsx)(Z,{label:`Phase`,value:g}),t[26]=g,t[27]=_);let v;t[28]===r.actionName?v=t[29]:(v=Y(r.actionName),t[28]=r.actionName,t[29]=v);let y;t[30]===v?y=t[31]:(y=(0,X.jsx)(Z,{label:`Action`,value:v}),t[30]=v,t[31]=y);let b;t[32]===r.lastEventType?b=t[33]:(b=Y(r.lastEventType),t[32]=r.lastEventType,t[33]=b);let x;t[34]===b?x=t[35]:(x=(0,X.jsx)(Z,{label:`Last event`,value:b}),t[34]=b,t[35]=x);let S;t[36]===r.failureCode?S=t[37]:(S=r.failureCode?Y(r.failureCode):`n/a`,t[36]=r.failureCode,t[37]=S);let C;t[38]===S?C=t[39]:(C=(0,X.jsx)(Z,{label:`Failure`,value:S}),t[38]=S,t[39]=C);let T;t[40]===r?T=t[41]:(T=De(r),t[40]=r,t[41]=T);let E;t[42]===T?E=t[43]:(E=(0,X.jsx)(Z,{label:`Trace ID`,value:T}),t[42]=T,t[43]=E);let D;t[44]!==h||t[45]!==_||t[46]!==y||t[47]!==x||t[48]!==C||t[49]!==E||t[50]!==u||t[51]!==d||t[52]!==p?(D=(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3 border-y py-3`,children:[u,d,p,h,_,y,x,C,E]}),t[44]=h,t[45]=_,t[46]=y,t[47]=x,t[48]=C,t[49]=E,t[50]=u,t[51]=d,t[52]=p,t[53]=D):D=t[53];let O;t[54]===r?O=t[55]:(O=(0,X.jsx)(Ve,{item:r}),t[54]=r,t[55]=O);let k;t[56]!==n.action||t[57]!==n.family?(k=n.family===`query_action`?(0,X.jsx)(ze,{title:`Query`,children:(0,X.jsx)(We,{action:n.action})}):(0,X.jsx)(ze,{title:`Request`,children:(0,X.jsx)(Ue,{action:n.action})}),t[56]=n.action,t[57]=n.family,t[58]=k):k=t[58];let A;t[59]===n.action.sourceDescriptor?A=t[60]:(A=(0,X.jsx)(ze,{title:`Source`,children:(0,X.jsx)(He,{value:n.action.sourceDescriptor})}),t[59]=n.action.sourceDescriptor,t[60]=A);let j;t[61]===r.metrics?j=t[62]:(j=(0,X.jsx)(ze,{title:`Metrics`,children:(0,X.jsx)(Be,{maxHeightClassName:`max-h-40`,title:`Metrics`,value:r.metrics})}),t[61]=r.metrics,t[62]=j);let M=`${n.events.length} events`,N;t[63]===n.events?N=t[64]:(N=(0,X.jsx)(Ge,{events:n.events}),t[63]=n.events,t[64]=N);let P;t[65]!==M||t[66]!==N?(P=(0,X.jsx)(ze,{meta:M,title:`Event timeline`,children:N}),t[65]=M,t[66]=N,t[67]=P):P=t[67];let F=a?.decodedPayload,I;t[68]===F?I=t[69]:(I=(0,X.jsx)(Be,{title:`Command payload`,value:F}),t[68]=F,t[69]=I);let L;t[70]===n.events?L=t[71]:(L=n.events.map(Xe),t[70]=n.events,t[71]=L);let R;t[72]===L?R=t[73]:(R=(0,X.jsx)(Be,{title:`Events`,value:L}),t[72]=L,t[73]=R);let z;t[74]!==I||t[75]!==R?(z=(0,X.jsx)(ze,{title:`Raw trace`,children:(0,X.jsxs)(`div`,{className:`grid gap-3`,children:[I,R]})}),t[74]=I,t[75]=R,t[76]=z):z=t[76];let B;return t[77]!==D||t[78]!==O||t[79]!==k||t[80]!==A||t[81]!==j||t[82]!==P||t[83]!==z||t[84]!==c?(B=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[c,D,O,k,A,j,P,z]}),t[77]=D,t[78]=O,t[79]=k,t[80]=A,t[81]=j,t[82]=P,t[83]=z,t[84]=c,t[85]=B):B=t[85],B}function Xe(e){return{commandId:e.commandId,eventType:e.eventType,id:e.id,payload:e.decodedPayload,sequence:e.sequence}}function Ze(e){return e.map(e=>e.id).join(`:`)}function Qe(e){let t=(0,K.c)(28),{initialItem:n,items:r,organizationSlug:i,userId:a}=e,o;t[0]===n?o=t[1]:(o={input:{initialItem:n}},t[0]=n,t[1]=o);let[c,l]=de(_e,o),u=c.context.selectedItem,d;t[2]===c?d=t[3]:(d=c.hasTag(ge.DETAILS_VISIBLE),t[2]=c,t[3]=d);let f=d,p;t[4]!==i||t[5]!==u.family||t[6]!==u.familyActionId||t[7]!==a?(p=W(a,i,u.family,u.familyActionId),t[4]=i,t[5]=u.family,t[6]=u.familyActionId,t[7]=a,t[8]=p):p=t[8];let m;t[9]!==f||t[10]!==p?(m={...p,enabled:f},t[9]=f,t[10]=p,t[11]=m):m=t[11];let h=j(m),g=f?`grid min-h-0 gap-4 xl:grid-cols-[minmax(0,1fr)_minmax(360px,420px)]`:`grid min-h-0 gap-4`,_;t[12]===l?_=t[13]:(_=e=>l({item:e,type:q.ROW_SELECTED}),t[12]=l,t[13]=_);let v;t[14]!==f||t[15]!==r||t[16]!==u.id||t[17]!==_?(v=(0,X.jsx)(Me,{isDetailOpen:f,items:r,selectedItemId:u.id,onSelectItem:_}),t[14]=f,t[15]=r,t[16]=u.id,t[17]=_,t[18]=v):v=t[18];let y;t[19]!==h||t[20]!==f||t[21]!==u||t[22]!==l?(y=f?(0,X.jsxs)(`aside`,{className:`min-w-0 rounded-md border`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2`,children:[(0,X.jsx)(`div`,{children:(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Details`})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(z,{"aria-label":`Collapse details`,className:s({size:`icon-sm`,variant:`ghost`}),onClick:()=>l({type:q.CLOSE_DETAILS}),type:`button`,children:(0,X.jsx)(A,{size:16,stroke:2})}),(0,X.jsx)(R,{children:`Collapse details`})]})]}),(0,X.jsxs)(`div`,{className:`max-h-[calc(100vh-240px)] overflow-auto p-3`,children:[h.isPending?(0,X.jsx)(Je,{item:u}):null,h.isError?(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(Je,{item:u}),(0,X.jsxs)(k,{variant:`destructive`,children:[(0,X.jsx)(B,{className:`size-4`}),(0,X.jsx)(O,{children:`Failed to load trace detail`}),(0,X.jsx)(D,{children:h.error.message})]})]}):null,h.data?(0,X.jsx)(Ye,{detail:h.data,item:u},u.id):null]})]}):null,t[19]=h,t[20]=f,t[21]=u,t[22]=l,t[23]=y):y=t[23];let b;return t[24]!==g||t[25]!==v||t[26]!==y?(b=(0,X.jsxs)(`div`,{className:g,children:[v,y]}),t[24]=g,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function $e(e){return/[",\n\r]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function et(e){return[[`Time`,`Outcome`,`Actor`,`Source`,`Action`,`Target`,`Duration`,`Rows / Pages`,`Request ID`,`Trace ID`],...e.map(e=>[fe(e.startedAt),e.outcome,be(e),e.target.sourceKey,e.title,Ee(e),we(e),Te(e)||`n/a`,e.requestId??`n/a`,e.id])].map(e=>e.map($e).join(`,`)).join(`
|
|
2
|
+
`)}function tt(e){let t=URL.createObjectURL(new Blob([et(e)],{type:`text/csv;charset=utf-8`})),n=document.createElement(`a`);n.href=t,n.download=`audit-entries.csv`,n.click(),URL.revokeObjectURL(t)}function nt(e){let t=e.trim();return t.length>0?t:void 0}function rt(e){return{q:nt(e.q),sourceKey:nt(e.sourceKey)}}function it(e){return{q:e.q??``,sourceKey:e.sourceKey??``}}function at(e){return`${e.q??``}\u0000${e.sourceKey??``}`}function ot(e,t){let n=rt(t);return n.q!==e.q||n.sourceKey!==e.sourceKey}function st(e,t,n){return V.parse(U({...e,...rt(t),...n}))}var ct=e(t(),1);function lt(e){let t=(0,K.c)(144),{isFetching:n,itemCount:r,nextCursor:i,organizationSlug:s,projectionLag:c,search:f}=e,v=a(),y;t[0]===f?y=t[1]:(y=()=>it(f),t[0]=f,t[1]=y);let[b,x]=(0,ct.useState)(y),S;t[2]!==b||t[3]!==f?(S=ot(f,b),t[2]=b,t[3]=f,t[4]=S):S=t[4];let C=S,w,T,j,M,N,P,F,I,L,R,z,V,H,U,te,W,G,ae,oe;if(t[5]!==b||t[6]!==v||t[7]!==s||t[8]!==c||t[9]!==f){let e=re(f.family),n;t[29]!==c||t[30]!==f?(n=Ae({projectionLag:c,search:f}),t[29]=c,t[30]=f,t[31]=n):n=t[31],M=n;let r;t[32]!==b||t[33]!==v||t[34]!==s||t[35]!==f?(r=function(e){(0,ct.startTransition)(()=>{v({params:{org_slug:s},replace:!0,search:st(f,b,e),to:`/$org_slug/audit`})})},t[32]=b,t[33]=v,t[34]=s,t[35]=f,t[36]=r):r=t[36],N=r;let i;t[37]===N?i=t[38]:(i=function(e){e.preventDefault(),N({cursor:void 0})},t[37]=N,t[38]=i);let a=i,o;t[39]!==v||t[40]!==s||t[41]!==f.limit?(o=function(){x({q:``,sourceKey:``}),(0,ct.startTransition)(()=>{v({params:{org_slug:s},replace:!0,search:{limit:f.limit},to:`/$org_slug/audit`})})},t[39]=v,t[40]=s,t[41]=f.limit,t[42]=o):o=t[42],j=o,V=`min-w-0 border-b pb-4`,R=`space-y-3`,z=a,P=`grid min-w-0 gap-3 md:grid-cols-2 xl:grid-cols-[minmax(220px,1.3fr)_minmax(150px,0.7fr)_minmax(150px,0.7fr)_minmax(150px,0.7fr)]`;let l;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(pe,{htmlFor:`audit-search`,className:`text-muted-foreground text-xs font-medium`,children:`Search`}),t[43]=l):l=t[43];let u;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(E,{className:`text-muted-foreground absolute top-2.5 left-2.5 size-4`,stroke:2}),t[44]=u):u=t[44];let d;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>x(t=>({...t,q:e.target.value})),t[45]=d):d=t[45],t[46]===b.q?F=t[47]:(F=(0,X.jsxs)(`div`,{className:`min-w-0 space-y-1.5 md:col-span-2 xl:col-span-1`,children:[l,(0,X.jsxs)(`div`,{className:`relative`,children:[u,(0,X.jsx)(ie,{id:`audit-search`,className:`pl-8`,value:b.q,onChange:d,placeholder:`Actor, source, query`})]})]}),t[46]=b.q,t[47]=F);let y;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(pe,{htmlFor:`audit-source-key`,className:`text-muted-foreground text-xs font-medium`,children:`Source`}),t[48]=y):y=t[48];let S;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>x(t=>({...t,sourceKey:e.target.value})),t[49]=S):S=t[49],t[50]===b.sourceKey?I=t[51]:(I=(0,X.jsxs)(`div`,{className:`min-w-0 space-y-1.5`,children:[y,(0,X.jsx)(ie,{id:`audit-source-key`,value:b.sourceKey,onChange:S,placeholder:`Source key`})]}),t[50]=b.sourceKey,t[51]=I);let C;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(pe,{htmlFor:`audit-family`,className:`text-muted-foreground text-xs font-medium`,children:`Family`}),t[52]=C):C=t[52];let D=f.family??`all`,O;t[53]===N?O=t[54]:(O=e=>{N({cursor:void 0,family:e&&e!==`all`?e:void 0})},t[53]=N,t[54]=O);let k;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsx)(m,{id:`audit-family`,className:`w-full`,children:(0,X.jsx)(p,{})}),t[55]=k):k=t[55];let A;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsxs)(h,{children:[(0,X.jsx)(g,{value:`all`,children:`All families`}),ne.map(dt)]}),t[56]=A):A=t[56],t[57]!==D||t[58]!==O?(L=(0,X.jsxs)(`div`,{className:`min-w-0 space-y-1.5`,children:[C,(0,X.jsxs)(_,{value:D,onValueChange:O,children:[k,A]})]}),t[57]=D,t[58]=O,t[59]=L):L=t[59],ae=`min-w-0 space-y-1.5`,t[60]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,X.jsx)(pe,{htmlFor:`audit-action-name`,className:`text-muted-foreground text-xs font-medium`,children:`Action`}),t[60]=oe):oe=t[60],T=_,te=f.actionName??`all`,t[61]===N?W=t[62]:(W=e=>{N({actionName:e&&e!==`all`?e:void 0,cursor:void 0})},t[61]=N,t[62]=W),t[63]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,X.jsx)(m,{id:`audit-action-name`,className:`w-full`,children:(0,X.jsx)(p,{})}),t[63]=G):G=t[63],w=h,t[64]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,X.jsx)(g,{value:`all`,children:`All actions`}),t[64]=H):H=t[64],U=e.map(ut),t[5]=b,t[6]=v,t[7]=s,t[8]=c,t[9]=f,t[10]=w,t[11]=T,t[12]=j,t[13]=M,t[14]=N,t[15]=P,t[16]=F,t[17]=I,t[18]=L,t[19]=R,t[20]=z,t[21]=V,t[22]=H,t[23]=U,t[24]=te,t[25]=W,t[26]=G,t[27]=ae,t[28]=oe}else w=t[10],T=t[11],j=t[12],M=t[13],N=t[14],P=t[15],F=t[16],I=t[17],L=t[18],R=t[19],z=t[20],V=t[21],H=t[22],U=t[23],te=t[24],W=t[25],G=t[26],ae=t[27],oe=t[28];let se;t[65]!==w||t[66]!==H||t[67]!==U?(se=(0,X.jsxs)(w,{children:[H,U]}),t[65]=w,t[66]=H,t[67]=U,t[68]=se):se=t[68];let ce;t[69]!==T||t[70]!==se||t[71]!==te||t[72]!==W||t[73]!==G?(ce=(0,X.jsxs)(T,{value:te,onValueChange:W,children:[G,se]}),t[69]=T,t[70]=se,t[71]=te,t[72]=W,t[73]=G,t[74]=ce):ce=t[74];let le;t[75]!==ce||t[76]!==ae||t[77]!==oe?(le=(0,X.jsxs)(`div`,{className:ae,children:[oe,ce]}),t[75]=ce,t[76]=ae,t[77]=oe,t[78]=le):le=t[78];let ue;t[79]!==P||t[80]!==F||t[81]!==I||t[82]!==L||t[83]!==le?(ue=(0,X.jsxs)(`div`,{className:P,children:[F,I,L,le]}),t[79]=P,t[80]=F,t[81]=I,t[82]=L,t[83]=le,t[84]=ue):ue=t[84];let de;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,X.jsx)(pe,{className:`text-muted-foreground text-xs font-medium`,children:`Outcome`}),t[85]=de):de=t[85];let fe=f.outcome?`ghost`:`secondary`,he=!f.outcome,q;t[86]===N?q=t[87]:(q=()=>N({cursor:void 0,outcome:void 0}),t[86]=N,t[87]=q);let J;t[88]!==fe||t[89]!==he||t[90]!==q?(J=(0,X.jsx)(o,{type:`button`,variant:fe,size:`sm`,className:`min-w-0 justify-center sm:min-w-16`,"aria-pressed":he,onClick:q,children:`All`}),t[88]=fe,t[89]=he,t[90]=q,t[91]=J):J=t[91];let ge;t[92]!==N||t[93]!==f.outcome?(ge=ee.map(e=>(0,X.jsxs)(o,{type:`button`,variant:f.outcome===e?`secondary`:`ghost`,size:`sm`,className:`min-w-0 justify-center sm:min-w-24`,"aria-pressed":f.outcome===e,onClick:()=>N({cursor:void 0,outcome:e}),children:[(0,X.jsx)(`span`,{className:l(`size-1.5 rounded-full`,ye[e])}),Y(e)]},e)),t[92]=N,t[93]=f.outcome,t[94]=ge):ge=t[94];let _e;t[95]!==J||t[96]!==ge?(_e=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[de,(0,X.jsxs)(`div`,{className:`grid min-w-0 grid-cols-2 gap-1 rounded-md border p-px sm:flex sm:flex-wrap`,children:[J,ge]})]}),t[95]=J,t[96]=ge,t[97]=_e):_e=t[97];let ve=!C,be;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,X.jsx)(d,{size:16,stroke:2}),t[98]=be):be=t[98];let xe;t[99]===ve?xe=t[100]:(xe=(0,X.jsxs)(o,{type:`submit`,size:`sm`,className:`w-full sm:w-auto`,disabled:ve,children:[be,`Apply`]}),t[99]=ve,t[100]=xe);let Se;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,X.jsx)(A,{size:16,stroke:2}),t[101]=Se):Se=t[101];let Ce;t[102]===j?Ce=t[103]:(Ce=(0,X.jsxs)(o,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full sm:w-auto`,onClick:j,children:[Se,`Clear`]}),t[102]=j,t[103]=Ce);let we;t[104]!==xe||t[105]!==Ce?(we=(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 sm:flex-row`,children:[xe,Ce]}),t[104]=xe,t[105]=Ce,t[106]=we):we=t[106];let Te;t[107]!==_e||t[108]!==we?(Te=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 xl:flex-row xl:items-end xl:justify-between`,children:[_e,we]}),t[107]=_e,t[108]=we,t[109]=Te):Te=t[109];let Ee;t[110]!==R||t[111]!==z||t[112]!==ue||t[113]!==Te?(Ee=(0,X.jsxs)(`form`,{className:R,onSubmit:z,children:[ue,Te]}),t[110]=R,t[111]=z,t[112]=ue,t[113]=Te,t[114]=Ee):Ee=t[114];let De;t[115]===M?De=t[116]:(De=M?(0,X.jsxs)(k,{className:`mt-4 border-amber-300/60 bg-amber-50/80 text-amber-950`,children:[(0,X.jsx)(B,{className:`size-4`}),(0,X.jsx)(O,{children:`Audit feed is still catching up`}),(0,X.jsxs)(D,{children:[`Recent `,M,` events may not appear yet. This page will refresh while the feed catches up.`]})]}):null,t[115]=M,t[116]=De);let Oe=f.cursor?` · viewing older results`:` · newest first`,ke=C?` · apply search filters to paginate`:``,je=n?` · updating`:``,Me;t[117]!==r||t[118]!==Oe||t[119]!==ke||t[120]!==je?(Me=(0,X.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[r,` entries on this page`,Oe,ke,je]}),t[117]=r,t[118]=Oe,t[119]=ke,t[120]=je,t[121]=Me):Me=t[121];let Ne;t[122]!==N||t[123]!==f.cursor?(Ne=f.cursor?(0,X.jsxs)(o,{type:`button`,variant:`outline`,onClick:()=>N({cursor:void 0}),children:[(0,X.jsx)(me,{size:16,stroke:2}),`Newest`]}):null,t[122]=N,t[123]=f.cursor,t[124]=Ne):Ne=t[124];let Pe;t[125]!==C||t[126]!==N||t[127]!==i?(Pe=()=>{!i||C||N({cursor:i})},t[125]=C,t[126]=N,t[127]=i,t[128]=Pe):Pe=t[128];let Fe=!i||C,Ie;t[129]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,X.jsx)(u,{size:16,stroke:2}),t[129]=Ie):Ie=t[129];let Z;t[130]!==Pe||t[131]!==Fe?(Z=(0,X.jsxs)(o,{type:`button`,variant:`outline`,onClick:Pe,disabled:Fe,children:[`Older`,Ie]}),t[130]=Pe,t[131]=Fe,t[132]=Z):Z=t[132];let Le;t[133]!==Ne||t[134]!==Z?(Le=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Ne,Z]}),t[133]=Ne,t[134]=Z,t[135]=Le):Le=t[135];let Q;t[136]!==Me||t[137]!==Le?(Q=(0,X.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[Me,Le]}),t[136]=Me,t[137]=Le,t[138]=Q):Q=t[138];let $;return t[139]!==V||t[140]!==Ee||t[141]!==De||t[142]!==Q?($=(0,X.jsxs)(`section`,{className:V,children:[Ee,De,Q]}),t[139]=V,t[140]=Ee,t[141]=De,t[142]=Q,t[143]=$):$=t[143],$}function ut(e){return(0,X.jsx)(g,{value:e,children:Y(e)},e)}function dt(e){return(0,X.jsx)(g,{value:e,children:Y(e)},e)}var ft=i(`/_authenticated/$org_slug/audit`);function pt(){let e=(0,K.c)(45),{organizationSlug:t,session:n}=ft.useRouteContext(),r=ft.useSearch(),i;e[0]!==t||e[1]!==r||e[2]!==n.user.id?(i=H(n.user.id,t,r),e[0]=t,e[1]=r,e[2]=n.user.id,e[3]=i):i=e[3];let{data:a,isFetching:c,refetch:l}=M(i),u=a.items[0],d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Audit`}),e[4]=d):d=e[4];let f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=s({size:`icon`,variant:`outline`}),e[5]=f):f=e[5];let p;e[6]===l?p=e[7]:(p=()=>{l()},e[6]=l,e[7]=p);let m=c?`animate-spin`:void 0,h;e[8]===m?h=e[9]:(h=(0,X.jsx)(te,{className:m,size:16,stroke:2}),e[8]=m,e[9]=h);let g;e[10]!==c||e[11]!==p||e[12]!==h?(g=(0,X.jsx)(z,{"aria-label":`Refresh audit feed`,className:f,disabled:c,onClick:p,type:`button`,children:h}),e[10]=c,e[11]=p,e[12]=h,e[13]=g):g=e[13];let _;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(R,{children:`Refresh audit feed`}),e[14]=_):_=e[14];let v;e[15]===g?v=e[16]:(v=(0,X.jsxs)(L,{children:[g,_]}),e[15]=g,e[16]=v);let y=a.items.length===0,b;e[17]===a.items?b=e[18]:(b=()=>tt(a.items),e[17]=a.items,e[18]=b);let x;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(he,{size:16,stroke:2}),e[19]=x):x=e[19];let S;e[20]!==b||e[21]!==y?(S=(0,X.jsxs)(o,{type:`button`,variant:`outline`,size:`sm`,disabled:y,onClick:b,children:[x,`Export`]}),e[20]=b,e[21]=y,e[22]=S):S=e[22];let C;e[23]!==S||e[24]!==v?(C=(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[d,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[v,S]})]}),e[23]=S,e[24]=v,e[25]=C):C=e[25];let w;e[26]===r?w=e[27]:(w=at(r),e[26]=r,e[27]=w);let E;e[28]!==a.items.length||e[29]!==a.nextCursor||e[30]!==a.projectionLag||e[31]!==c||e[32]!==t||e[33]!==r||e[34]!==w?(E=(0,X.jsx)(lt,{isFetching:c,itemCount:a.items.length,nextCursor:a.nextCursor,organizationSlug:t,projectionLag:a.projectionLag,search:r},w),e[28]=a.items.length,e[29]=a.nextCursor,e[30]=a.projectionLag,e[31]=c,e[32]=t,e[33]=r,e[34]=w,e[35]=E):E=e[35];let D;e[36]!==a.items||e[37]!==u||e[38]!==t||e[39]!==n.user.id?(D=u===void 0?(0,X.jsx)(ce,{className:`border`,children:(0,X.jsxs)(se,{children:[(0,X.jsx)(ae,{variant:`icon`,children:(0,X.jsx)(T,{size:18,stroke:1.75})}),(0,X.jsx)(G,{children:`No audit entries matched these filters`}),(0,X.jsx)(oe,{children:`Try clearing the filters or waiting for new workflow activity in this organization.`})]})}):(0,X.jsx)(Qe,{initialItem:u,items:a.items,organizationSlug:t,userId:n.user.id},Ze(a.items)),e[36]=a.items,e[37]=u,e[38]=t,e[39]=n.user.id,e[40]=D):D=e[40];let O;return e[41]!==C||e[42]!==E||e[43]!==D?(O=(0,X.jsxs)(`div`,{className:`min-w-0 space-y-4 p-6`,children:[C,E,D]}),e[41]=C,e[42]=E,e[43]=D,e[44]=O):O=e[44],O}var mt=pt;export{mt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./api-base-url-DIb6qukm.js";import{t}from"./queryOptions-bXtOUR_h.js";import{a as n}from"./query-timing-YBkSOxxF.js";import{d as r,i,n as a}from"./schemas-EcBBwCo1.js";import{n as o}from"./api-paths-DcYkf-C_.js";var s=r({emailDeliveryMode:a([`manual-link`,`smtp`]),hasUsers:i(),publicSignupAllowed:i(),signupMode:a([`first-user`,`invite-only`])});async function c(){let t=await fetch(`${e()}${o}`,{credentials:`include`});if(!t.ok)throw Error(`Failed to load auth bootstrap state`);let n=await t.json().catch(()=>null);return s.parse(n)}function l(){return t({queryFn:c,queryKey:[`auth`,`bootstrap-state`],staleTime:n})}export{l as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e,n as t}from"./jsx-runtime-DG_AJzB_.js";import{t as n}from"./api-base-url-DIb6qukm.js";function r(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}r({FAILED_TO_CREATE_USER:`Failed to create user`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,YOU_CANNOT_BAN_YOURSELF:`You cannot ban yourself`,YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:`You are not allowed to change users role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:`You are not allowed to create users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:`You are not allowed to list users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:`You are not allowed to list users sessions`,YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:`You are not allowed to ban users`,YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:`You are not allowed to impersonate users`,YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:`You are not allowed to revoke users sessions`,YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:`You are not allowed to delete users`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:`You are not allowed to set users password`,BANNED_USER:`You have been banned from this application`,YOU_ARE_NOT_ALLOWED_TO_GET_USER:`You are not allowed to get user`,NO_DATA_TO_UPDATE:`No data to update`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:`You are not allowed to update users`,YOU_CANNOT_REMOVE_YOURSELF:`You cannot remove yourself`,YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:`You are not allowed to set a non-existent role value`,YOU_CANNOT_IMPERSONATE_ADMINS:`You cannot impersonate admins`,INVALID_ROLE_TYPE:`Invalid role type`}),r({USER_NOT_FOUND:`User not found`,FAILED_TO_CREATE_USER:`Failed to create user`,FAILED_TO_CREATE_SESSION:`Failed to create session`,FAILED_TO_UPDATE_USER:`Failed to update user`,FAILED_TO_GET_SESSION:`Failed to get session`,INVALID_PASSWORD:`Invalid password`,INVALID_EMAIL:`Invalid email`,INVALID_EMAIL_OR_PASSWORD:`Invalid email or password`,INVALID_USER:`Invalid user`,SOCIAL_ACCOUNT_ALREADY_LINKED:`Social account already linked`,PROVIDER_NOT_FOUND:`Provider not found`,INVALID_TOKEN:`Invalid token`,TOKEN_EXPIRED:`Token expired`,ID_TOKEN_NOT_SUPPORTED:`id_token not supported`,FAILED_TO_GET_USER_INFO:`Failed to get user info`,USER_EMAIL_NOT_FOUND:`User email not found`,EMAIL_NOT_VERIFIED:`Email not verified`,PASSWORD_TOO_SHORT:`Password too short`,PASSWORD_TOO_LONG:`Password too long`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,EMAIL_CAN_NOT_BE_UPDATED:`Email can not be updated`,CREDENTIAL_ACCOUNT_NOT_FOUND:`Credential account not found`,SESSION_EXPIRED:`Session expired. Re-authenticate to perform this action.`,FAILED_TO_UNLINK_LAST_ACCOUNT:`You can't unlink your last account`,ACCOUNT_NOT_FOUND:`Account not found`,USER_ALREADY_HAS_PASSWORD:`User already has a password. Provide that to delete the account.`,CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:`Cross-site navigation login blocked. This request appears to be a CSRF attack.`,VERIFICATION_EMAIL_NOT_ENABLED:`Verification email isn't enabled`,EMAIL_ALREADY_VERIFIED:`Email is already verified`,EMAIL_MISMATCH:`Email mismatch`,SESSION_NOT_FRESH:`Session is not fresh`,LINKED_ACCOUNT_ALREADY_EXISTS:`Linked account already exists`,INVALID_ORIGIN:`Invalid origin`,INVALID_CALLBACK_URL:`Invalid callbackURL`,INVALID_REDIRECT_URL:`Invalid redirectURL`,INVALID_ERROR_CALLBACK_URL:`Invalid errorCallbackURL`,INVALID_NEW_USER_CALLBACK_URL:`Invalid newUserCallbackURL`,MISSING_OR_NULL_ORIGIN:`Missing or null Origin`,CALLBACK_URL_REQUIRED:`callbackURL is required`,FAILED_TO_CREATE_VERIFICATION:`Unable to create verification`,FIELD_NOT_ALLOWED:`Field not allowed to be set`,ASYNC_VALIDATION_NOT_SUPPORTED:`Async validation is not supported`,VALIDATION_ERROR:`Validation Error`,MISSING_FIELD:`Field is required`,METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:`POST method requires deferSessionRefresh to be enabled in session config`,BODY_MUST_BE_AN_OBJECT:`Body must be an object`,PASSWORD_ALREADY_SET:`User already has a password set`});function i(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function a(e){let t=e.split(`
|
|
2
|
+
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
3
|
+
at `))}function o(e,t){class n extends e{#e;constructor(...e){if(i()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=a(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,`constructor`,{get(){return t},enumerable:!1,configurable:!0}),n}var s={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};o(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:s[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var c=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}};function l(e){return{authorize(t,n=`AND`){let r=!1;for(let[i,a]of Object.entries(t)){let t=e[i];if(!t)return{success:!1,error:`You are not allowed to access resource: ${i}`};if(Array.isArray(a))r=a.every(e=>t.includes(e));else if(typeof a==`object`){let e=a;r=e.connector===`OR`?e.actions.some(e=>t.includes(e)):e.actions.every(e=>t.includes(e))}else throw new c(`Invalid access control request`);if(r&&n===`OR`)return{success:r};if(!r&&n===`AND`)return{success:!1,error:`unauthorized to access resource "${i}"`}}return r?{success:r}:{success:!1,error:`Not authorized`}},statements:e}}function u(e){return{newRole(e){return l(e)},statements:e}}var d=u({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`impersonate-admins`,`delete`,`set-password`,`get`,`update`],session:[`list`,`revoke`,`delete`]});d.newRole({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`delete`,`set-password`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),d.newRole({user:[],session:[]}),r({INVALID_EMAIL_FORMAT:`Email was not generated in a valid format`,FAILED_TO_CREATE_USER:`Failed to create user`,COULD_NOT_CREATE_SESSION:`Could not create session`,ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:`Anonymous users cannot sign in again anonymously`,FAILED_TO_DELETE_ANONYMOUS_USER:`Failed to delete anonymous user`,USER_IS_NOT_ANONYMOUS:`User is not anonymous`,DELETE_ANONYMOUS_USER_DISABLED:`Deleting anonymous users is disabled`}),r({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`}),r({INVALID_OAUTH_CONFIGURATION:`Invalid OAuth configuration`,TOKEN_URL_NOT_FOUND:`Invalid OAuth configuration. Token URL not found.`,PROVIDER_CONFIG_NOT_FOUND:`No config found for provider`,PROVIDER_ID_REQUIRED:`Provider ID is required`,INVALID_OAUTH_CONFIG:`Invalid OAuth configuration.`,SESSION_REQUIRED:`Session is required`,ISSUER_MISMATCH:`OAuth issuer mismatch. The authorization server issuer does not match the expected value (RFC 9207).`,ISSUER_MISSING:`OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207).`}),r({INVALID_SESSION_TOKEN:`Invalid session token`});var f=r({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:`You are not allowed to create a new organization`,YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:`You have reached the maximum number of organizations`,ORGANIZATION_ALREADY_EXISTS:`Organization already exists`,ORGANIZATION_SLUG_ALREADY_TAKEN:`Organization slug already taken`,ORGANIZATION_NOT_FOUND:`Organization not found`,USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:`User is not a member of the organization`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:`You are not allowed to update this organization`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:`You are not allowed to delete this organization`,NO_ACTIVE_ORGANIZATION:`No active organization`,USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:`User is already a member of this organization`,MEMBER_NOT_FOUND:`Member not found`,ROLE_NOT_FOUND:`Role not found`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:`You are not allowed to create a new team`,TEAM_ALREADY_EXISTS:`Team already exists`,TEAM_NOT_FOUND:`Team not found`,YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:`You cannot leave the organization as the only owner`,YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:`You cannot leave the organization without an owner`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:`You are not allowed to delete this member`,YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:`You are not allowed to invite users to this organization`,USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:`User is already invited to this organization`,INVITATION_NOT_FOUND:`Invitation not found`,YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:`You are not the recipient of the invitation`,EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:`Email verification required before accepting or rejecting invitation`,YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:`You are not allowed to cancel this invitation`,INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:`Inviter is no longer a member of the organization`,YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:`You are not allowed to invite a user with this role`,FAILED_TO_RETRIEVE_INVITATION:`Failed to retrieve invitation`,YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:`You have reached the maximum number of teams`,UNABLE_TO_REMOVE_LAST_TEAM:`Unable to remove last team`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:`You are not allowed to update this member`,ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:`Organization membership limit reached`,YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:`You are not allowed to create teams in this organization`,YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:`You are not allowed to delete teams in this organization`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:`You are not allowed to update this team`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:`You are not allowed to delete this team`,INVITATION_LIMIT_REACHED:`Invitation limit reached`,TEAM_MEMBER_LIMIT_REACHED:`Team member limit reached`,USER_IS_NOT_A_MEMBER_OF_THE_TEAM:`User is not a member of the team`,YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:`You are not allowed to list the members of this team`,YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:`You do not have an active team`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:`You are not allowed to create a new member`,YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:`You are not allowed to remove a team member`,YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:`You are not allowed to access this organization as an owner`,YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:`You are not a member of this organization`,MISSING_AC_INSTANCE:`Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information`,YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:`You must be in an organization to create a role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:`You are not allowed to create a role`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:`You are not allowed to update a role`,YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:`You are not allowed to delete a role`,YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:`You are not allowed to read a role`,YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:`You are not allowed to list a role`,YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:`You are not allowed to get a role`,TOO_MANY_ROLES:`This organization has too many roles`,INVALID_RESOURCE:`The provided permission includes an invalid resource`,ROLE_NAME_IS_ALREADY_TAKEN:`That role name is already taken`,CANNOT_DELETE_A_PRE_DEFINED_ROLE:`Cannot delete a pre-defined role`,ROLE_IS_ASSIGNED_TO_MEMBERS:`Cannot delete a role that is assigned to members. Please reassign the members to a different role first`}),p=[],m=0,h=4,g=0,_=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=m+h;t<p.length;)p[t]===e?p.splice(t,h):t+=h;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){g++;let i=!p.length;for(let i of t)p.push(i,n.value,e,r);if(i){for(m=0;m<p.length;m+=h)p[m](p[m+1],p[m+2],p[m+3]);p.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},v=5,y=6,b=10,ee=(e,t,n,r)=>(e.events=e.events||{},e.events[n+b]||(e.events[n+b]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+b](),delete e.events[n+b])}),te=1e3,x=(e,t)=>ee(e,n=>{let r=t(n);r&&e.events[y].push(r)},v,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[y]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[y])t();e.events[y]=[]}},te)},()=>{e.listen=n,e.off=r}});function ne(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}var re=()=>typeof window>`u`,S=(e,t,n,r)=>{let i=_({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)}),a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){i.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1;for(let t of e)t.subscribe(async()=>{re()||(o?await a():x(i,()=>{let e=setTimeout(async()=>{o||=(await a(),!0)},0);return()=>{i.off(),t.off(),clearTimeout(e)}}))});return i},C=Symbol.for(`better-auth:broadcast-channel`),ie=()=>Math.floor(Date.now()/1e3),ae=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:ie()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function w(e=`better-auth.message`){return globalThis[C]||(globalThis[C]=new ae(e)),globalThis[C]}var T=Symbol.for(`better-auth:focus-manager`),oe=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function se(){return globalThis[T]||(globalThis[T]=new oe),globalThis[T]}var E=Symbol.for(`better-auth:online-manager`),ce=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function D(){return globalThis[E]||(globalThis[E]=new ce),globalThis[E]}var le={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},ue=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,de={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},fe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function pe(e){return e instanceof Date&&!isNaN(e.getTime())}function me(e){let t=fe.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return pe(f)?f:null}function he(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim();if(o.length>0&&o[0]===`"`&&o.endsWith(`"`)&&!o.slice(1,-1).includes(`"`))return o.slice(1,-1);let s=o.toLowerCase();if(s.length<=9&&s in de)return de[s];if(!ue.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(le).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=me(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function ge(e,t={strict:!0}){return he(e,t)}var O=()=>Math.floor(Date.now()/1e3),_e=5;function ve(e){let{sessionAtom:t,sessionSignal:n,$fetch:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={lastSync:0,lastSessionRequest:0,cachedSession:void 0},l=()=>s||D().isOnline,u=e=>{if(!l())return;if(e?.event===`storage`){c.lastSync=O(),n.set(!n.get());return}let i=t.get(),a=()=>{c.lastSessionRequest=O(),r(`/get-session`).then(async e=>{let a=e.data,o=e.error||null;if(a?.needsRefresh)try{let e=await r(`/get-session`,{method:`POST`});a=e.data,o=e.error||null}catch{}let s=a?.session&&a?.user?a:null;t.set({...i,data:s,error:o}),c.lastSync=O(),n.set(!n.get())}).catch(()=>{})};if(e?.event===`poll`){a();return}if(e?.event===`visibilitychange`){if(O()-c.lastSessionRequest<_e)return;c.lastSessionRequest=O()}if(e?.event===`visibilitychange`){a();return}(i?.data===null||i?.data===void 0)&&(c.lastSync=O(),n.set(!n.get()))},d=e=>{w().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{t.get()?.data&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=w().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=se().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=D().subscribe(e=>{e&&u({event:`visibilitychange`})})};return{init:()=>{f(),p(),m(),h(),w().setup(),se().setup(),D().setup()},cleanup:()=>{c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.lastSync=0,c.lastSessionRequest=0,c.cachedSession=void 0},triggerRefetch:u,broadcastSessionUpdate:d}}var k=Object.create(null),A=e=>({}),j=new Proxy(k,{get(e,t){return A()[t]??k[t]},has(e,t){return t in A()||t in k},set(e,t,n){let r=A(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=A(!0);return delete n[t],!0},ownKeys(){let e=A(!0);return Object.keys(e)}});function M(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return M(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return M(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return M(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return M(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return M(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return M(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return M(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});var N=1,P=4,F=8,I=24,L={eterm:P,cons25:P,console:P,cygwin:P,dtterm:P,gnome:P,hurd:P,jfbterm:P,konsole:P,kterm:P,mlterm:P,mosh:I,putty:P,st:P,"rxvt-unicode-24bit":I,terminator:I,"xterm-kitty":I},ye=new Map(Object.entries({APPVEYOR:F,BUILDKITE:F,CIRCLECI:I,DRONE:F,GITEA_ACTIONS:I,GITHUB_ACTIONS:I,GITLAB_CI:F,TRAVIS:F})),be=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function xe(){if(M(`FORCE_COLOR`)!==void 0)switch(M(`FORCE_COLOR`)){case``:case`1`:case`true`:return P;case`2`:return F;case`3`:return I;default:return N}if(M(`NODE_DISABLE_COLORS`)!==void 0&&M(`NODE_DISABLE_COLORS`)!==``||M(`NO_COLOR`)!==void 0&&M(`NO_COLOR`)!==``||M(`TERM`)===`dumb`)return N;if(M(`TMUX`))return I;if(`TF_BUILD`in j&&`AGENT_NAME`in j)return P;if(`CI`in j){for(let{0:e,1:t}of ye)if(e in j)return t;return M(`CI_NAME`)===`codeship`?F:N}if(`TEAMCITY_VERSION`in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(M(`TEAMCITY_VERSION`))===null?N:P;switch(M(`TERM_PROGRAM`)){case`iTerm.app`:return!M(`TERM_PROGRAM_VERSION`)||/^[0-2]\./.exec(M(`TERM_PROGRAM_VERSION`))!==null?F:I;case`HyperTerm`:case`MacTerm`:return I;case`Apple_Terminal`:return F}if(M(`COLORTERM`)===`truecolor`||M(`COLORTERM`)===`24bit`)return I;if(M(`TERM`)){if(/truecolor/.exec(M(`TERM`))!==null)return I;if(/^xterm-256/.exec(M(`TERM`))!==null)return F;let e=M(`TERM`).toLowerCase();if(L[e])return L[e];if(be.some(t=>t.exec(e)!==null))return P}return M(`COLORTERM`)?P:N}var R={reset:`\x1B[0m`,bright:`\x1B[1m`,dim:`\x1B[2m`,undim:`\x1B[22m`,underscore:`\x1B[4m`,blink:`\x1B[5m`,reverse:`\x1B[7m`,hidden:`\x1B[8m`,fg:{black:`\x1B[30m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,white:`\x1B[37m`},bg:{black:`\x1B[40m`,red:`\x1B[41m`,green:`\x1B[42m`,yellow:`\x1B[43m`,blue:`\x1B[44m`,magenta:`\x1B[45m`,cyan:`\x1B[46m`,white:`\x1B[47m`}},z=[`debug`,`info`,`success`,`warn`,`error`];function Se(e,t){return z.indexOf(t)>=z.indexOf(e)}var Ce={info:R.fg.blue,success:R.fg.green,warn:R.fg.yellow,error:R.fg.red,debug:R.fg.magenta},we=(e,t,n)=>{let r=new Date().toISOString();return n?`${R.dim}${r}${R.reset} ${Ce[e]}${e.toUpperCase()}${R.reset} ${R.bright}[Better Auth]:${R.reset} ${t}`:`${r} ${e.toUpperCase()} [Better Auth]: ${t}`};(e=>{let t=e?.disabled!==!0,n=e?.level??`warn`,r=e?.disableColors===void 0?xe()!==1:!e.disableColors,i=(i,a,o=[])=>{if(!t||!Se(n,i))return;let s=we(i,a,r);if(!e||typeof e.log!=`function`){i===`error`?console.error(s,...o):i===`warn`?console.warn(s,...o):console.log(s,...o);return}e.log(i===`success`?`info`:i,a,...o)};return{...Object.fromEntries(z.map(e=>[e,(...[t,...n])=>i(e,t,n)])),get level(){return n}}})();function Te(e){try{return(new URL(e).pathname.replace(/\/+$/,``)||`/`)!==`/`}catch{throw new c(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Ee(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new c(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof c?t:new c(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function B(e,t=`/api/auth`){if(Ee(e),Te(e))return e;let n=e.replace(/\/+$/,``);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function De(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Oe(e,t,n,r,i){if(e)return B(e,t);if(r!==!1){let e=j.BETTER_AUTH_URL||j.NEXT_PUBLIC_BETTER_AUTH_URL||j.PUBLIC_BETTER_AUTH_URL||j.NUXT_PUBLIC_BETTER_AUTH_URL||j.NUXT_PUBLIC_AUTH_URL||(j.BASE_URL===`/`?void 0:j.BASE_URL);if(e)return B(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&De(o,`proto`)&&De(a,`host`))try{return B(`${o}://${a}`,t)}catch{}if(n){let e=ke(n.url);if(!e)throw new c(`Could not get origin from request. Please provide a valid base URL.`);return B(e,t)}if(typeof window<`u`&&window.location)return B(window.location.origin,t)}function ke(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Ae={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};function je(e,t){let n=_(!1),r=S(n,`/get-session`,e,{method:`GET`}),i=()=>{};return x(r,()=>{let a=ve({sessionAtom:r,sessionSignal:n,$fetch:e,options:t});return a.init(),i=a.broadcastSessionUpdate,()=>{a.cleanup()}}),{session:r,$sessionSignal:n,broadcastSessionUpdate:e=>i(e)}}function V(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function H(e,t,n=`.`,r){if(!V(t))return H(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:V(a)&&V(i[t])?i[t]=H(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Me(e){return(...t)=>t.reduce((t,n)=>H(t,n,``,e),{})}var Ne=Me(),Pe=Object.defineProperty,Fe=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable,Be=(e,t,n)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||={})Re.call(t,n)&&Be(e,n,t[n]);if(Le)for(var n of Le(t))ze.call(t,n)&&Be(e,n,t[n]);return e},W=(e,t)=>Fe(e,Ie(t)),Ve=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},He=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},G=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Ue=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function We(e){if(typeof e==`number`)return new G({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new G(e);case`exponential`:return new Ue(e);default:throw Error(`Invalid retry strategy`)}}var Ge=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},Ke=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function qe(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return Ke.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function Je(e){try{return JSON.parse(e),!0}catch{return!1}}function K(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function q(e){try{return JSON.parse(e)}catch{return e}}function J(e){return typeof e==`function`}function Ye(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&J(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&J(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}async function Xe(e){let t=new Headers(e?.headers),n=await Ge(e);for(let[e,r]of Object.entries(n||{}))t.set(e,r);if(!t.has(`content-type`)){let n=Ze(e?.body);n&&t.set(`content-type`,n)}return t}function Ze(e){return K(e)?`application/json`:null}function Qe(e){if(!e?.body)return null;let t=new Headers(e?.headers);if(K(e.body)&&!t.has(`content-type`)){for(let[t,n]of Object.entries(e?.body))n instanceof Date&&(e.body[t]=n.toISOString());return JSON.stringify(e.body)}return t.has(`content-type`)&&t.get(`content-type`)===`application/x-www-form-urlencoded`&&K(e.body)?new URLSearchParams(e.body).toString():e.body}function $e(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return nt.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function et(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var tt=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function Y(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new tt(n.issues);return n.value}var nt=[`get`,`post`,`put`,`patch`,`delete`],rt=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``));let i=r.schema[e];if(i){let e=W(U({},n),{method:i.method,output:i.output});return n?.disableValidation||(e=W(U({},e),{body:i.input?await Y(i.input,n?.body):n?.body,params:i.params?await Y(i.params,n?.params):n?.params,query:i.query?await Y(i.query,n?.query):n?.query})),{url:t,options:e}}}return{url:t,options:n}}}),it=e=>{async function t(t,n){let r=W(U(U({},e),n),{plugins:[...e?.plugins||[],rt(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await X(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await X(t,r)}return t};function at(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];nt.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];o=o.replace(n,e)}}else for(let[e,t]of Object.entries(r))o=o.replace(`:${e}`,String(t));o=o.split(`/`).map(encodeURIComponent).join(`/`),o.startsWith(`/`)&&(o=o.slice(1));let l=c.toString();return l=l.length>0?`?${l}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${l}`,a):`${a}${o}${l}`}var X=async(e,t)=>{let{hooks:n,url:r,options:i}=await He(e,t),a=Ye(i),o=new AbortController,s=i.signal??o.signal,c=at(r,i),l=Qe(i),u=await Xe(i),d=$e(r,i),f=W(U({},i),{url:c,headers:u,body:l,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&(f=t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=et(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(W(U({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=qe(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??q)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await Y(f.output,r.data));for(let e of n.onSuccess)e&&await e(W(U({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??q,_=await m.text(),v=Je(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:W(U({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(W(U({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=We(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await X(e,W(U({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Ve(m.status,m.statusText,v?y:_);return{data:null,error:W(U({},y),{status:m.status,statusText:m.statusText})}},ot=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},st=(e,t)=>{let n=`credentials`in Request.prototype,r=Oe(e?.baseURL,e?.basePath,void 0,t)??ot(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=it({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?ge(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Ae],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=je(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/change-email`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=Ne(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function ct(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function lt(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function ut(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||ct(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=lt(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function dt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Z=u({organization:[`update`,`delete`],member:[`create`,`update`,`delete`],invitation:[`create`,`cancel`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),ft=Z.newRole({organization:[`update`],invitation:[`create`,`cancel`],member:[`create`,`update`,`delete`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),pt=Z.newRole({organization:[`update`,`delete`],member:[`create`,`update`,`delete`],invitation:[`create`,`cancel`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),mt=Z.newRole({organization:[],member:[],invitation:[],team:[],ac:[`read`]}),ht={admin:ft,owner:pt,member:mt},gt=(e,t)=>{if(!e.permissions)return!1;let n=e.role.split(`,`),r=e.options.creatorRole||`owner`,i=n.includes(r),a=e.allowCreatorAllPermissions||!1;if(i&&a)return!0;for(let r of n)if(t[r]?.authorize(e.permissions)?.success)return!0;return!1},_t=e=>gt(e,e.options.roles||ht),vt=e=>{let t=_(!1),n=_(!1),r=_(!1),i=_(!1),a={admin:ft,member:mt,owner:pt,...e?.roles};return{id:`organization`,$InferServerPlugin:{},getActions:(t,n,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:t=>_t({role:t.role,options:{ac:e?.ac,roles:a},permissions:t.permissions})}}),getAtoms:e=>{let a=S(t,`/organization/list`,e,{method:`GET`});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:i,activeOrganization:S([n],`/organization/get-full-organization`,e,()=>({method:`GET`})),listOrganizations:a,activeMember:S([n,r],`/organization/get-active-member`,e,{method:`GET`}),activeMemberRole:S([n,i],`/organization/get-active-member-role`,e,{method:`GET`})}},pathMethods:{"/organization/get-full-organization":`GET`,"/organization/list-user-teams":`GET`},atomListeners:[{matcher(e){return e===`/organization/create`||e===`/organization/delete`||e===`/organization/update`},signal:`$listOrg`},{matcher(e){return e.startsWith(`/organization`)},signal:`$activeOrgSignal`},{matcher(e){return e.startsWith(`/organization/set-active`)||e===`/organization/create`||e===`/organization/delete`||e===`/organization/remove-member`||e===`/organization/leave`||e===`/organization/accept-invitation`},signal:`$sessionSignal`},{matcher(e){return e.includes(`/organization/update-member-role`)||e.startsWith(`/organization/set-active`)},signal:`$activeMemberSignal`},{matcher(e){return e.includes(`/organization/update-member-role`)||e.startsWith(`/organization/set-active`)},signal:`$activeMemberRoleSignal`}],$ERROR_CODES:f}};r({INVALID_PHONE_NUMBER:`Invalid phone number`,PHONE_NUMBER_EXIST:`Phone number already exists`,PHONE_NUMBER_NOT_EXIST:`phone number isn't registered`,INVALID_PHONE_NUMBER_OR_PASSWORD:`Invalid phone number or password`,UNEXPECTED_ERROR:`Unexpected error`,OTP_NOT_FOUND:`OTP not found`,OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,PHONE_NUMBER_NOT_VERIFIED:`Phone number not verified`,PHONE_NUMBER_CANNOT_BE_UPDATED:`Phone number cannot be updated`,SEND_OTP_NOT_IMPLEMENTED:`sendOTP not implemented`,TOO_MANY_ATTEMPTS:`Too many attempts`}),r({OTP_NOT_ENABLED:`OTP not enabled`,OTP_HAS_EXPIRED:`OTP has expired`,TOTP_NOT_ENABLED:`TOTP not enabled`,TWO_FACTOR_NOT_ENABLED:`Two factor isn't enabled`,BACKUP_CODES_NOT_ENABLED:`Backup codes aren't enabled`,INVALID_BACKUP_CODE:`Invalid backup code`,INVALID_CODE:`Invalid code`,TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:`Too many attempts. Please request a new code.`,INVALID_TWO_FACTOR_COOKIE:`Invalid two factor cookie`}),r({INVALID_USERNAME_OR_PASSWORD:`Invalid username or password`,EMAIL_NOT_VERIFIED:`Email not verified`,UNEXPECTED_ERROR:`Unexpected error`,USERNAME_IS_ALREADY_TAKEN:`Username is already taken. Please try another.`,USERNAME_TOO_SHORT:`Username is too short`,USERNAME_TOO_LONG:`Username is too long`,INVALID_USERNAME:`Username is invalid`,INVALID_DISPLAY_USERNAME:`Display username is invalid`});var Q=e(t(),1);function yt(e,t={}){let n=(0,Q.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,Q.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?ne(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,Q.useSyncExternalStore)(a,o,o)}function bt(e){return`use${dt(e)}`}function xt(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=st(e),s={};for(let[e,t]of Object.entries(r))s[bt(e)]=()=>yt(t);return ut({...n,...s,$fetch:i,$store:a},i,t,r,o)}var $=xt({baseURL:n(),plugins:[vt()]}),{useSession:St}=$,{signIn:Ct}=$,{signOut:wt}=$,{signUp:Tt}=$,{organization:Et}=$;$.getSession;export{St as a,Tt as i,Ct as n,wt as r,Et 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{S as i,a,p as o,x as s,y as c}from"./createReactComponent-_L2mp4Ui.js";import{t as l}from"./utils-C8DGLIgm.js";import{Et as u}from"./getDisabledMountTransitionStyles-C0uz3iMh.js";var d=e(t()),f=d.createContext(void 0);function p(){let e=d.useContext(f);if(e===void 0)throw Error(c(13));return e}var m={imageLoadingStatus:()=>null},h=n(),g=d.forwardRef(function(e,t){let{className:n,render:r,...i}=e,[o,s]=d.useState(`idle`),c=d.useMemo(()=>({imageLoadingStatus:o}),[o]),l=d.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=a(`span`,e,{state:c,ref:t,props:i,stateAttributesMapping:m});return(0,h.jsx)(f.Provider,{value:l,children:u})});function _(e,{referrerPolicy:t,crossOrigin:n}){let[r,i]=d.useState(`idle`);return s(()=>{if(!e)return i(`error`),o;let r=!0,a=new window.Image,s=e=>()=>{r&&i(e)};return i(`loading`),a.onload=s(`loaded`),a.onerror=s(`error`),t&&(a.referrerPolicy=t),a.crossOrigin=n??null,a.src=e,()=>{r=!1}},[e,n,t]),r}var v=d.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:o,referrerPolicy:c,crossOrigin:l,...u}=e,f=p(),h=_(e.src,{referrerPolicy:c,crossOrigin:l}),g=i(e=>{o?.(e),f.setImageLoadingStatus(e)});return s(()=>{h!==`idle`&&g(h)},[h,g]),a(`img`,e,{state:d.useMemo(()=>({imageLoadingStatus:h}),[h]),ref:t,props:u,stateAttributesMapping:m,enabled:h===`loaded`})}),y=d.forwardRef(function(e,t){let{className:n,render:r,delay:i,...o}=e,{imageLoadingStatus:s}=p(),[c,l]=d.useState(i===void 0),f=u();return d.useEffect(()=>(i!==void 0&&f.start(i,()=>l(!0)),f.clear),[f,i]),a(`span`,e,{state:d.useMemo(()=>({imageLoadingStatus:s}),[s]),ref:t,props:o,stateAttributesMapping:m,enabled:s!==`loaded`&&c})}),b=r();function x(e){let t=(0,b.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=l(`size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,h.jsx)(g,{"data-slot":`avatar`,"data-size":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function S(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`rounded-full aspect-square size-full object-cover`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(v,{"data-slot":`avatar-image`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function C(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,h.jsx)(y,{"data-slot":`avatar-fallback`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{C as n,S as r,x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./compiler-runtime-DCc3R3Xn.js";import{b as t,i as n}from"./createReactComponent-_L2mp4Ui.js";import{t as r}from"./utils-C8DGLIgm.js";import{t as i}from"./useRender-CzpKCg11.js";var a=e(),o=n(`h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function s(e){let n=(0,a.c)(13),s,c,l,u,d;if(n[0]!==e){let{className:a,variant:f,render:p,...m}=e;s=p,d=f===void 0?`default`:f,u=i,c=`span`,l=t({className:r(o({className:a,variant:d}))},m),n[0]=e,n[1]=s,n[2]=c,n[3]=l,n[4]=u,n[5]=d}else s=n[1],c=n[2],l=n[3],u=n[4],d=n[5];let f;n[6]===d?f=n[7]:(f={slot:`badge`,variant:d},n[6]=d,n[7]=f);let p;return n[8]!==s||n[9]!==c||n[10]!==l||n[11]!==f?(p={defaultTagName:c,props:l,render:s,state:f},n[8]=s,n[9]=c,n[10]=l,n[11]=f,n[12]=p):p=n[12],u(p)}export{s as t};
|