autumn-js 0.1.33 → 0.1.35
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/dist/libraries/backend/better-auth.d.mts +221 -310
- package/dist/libraries/backend/better-auth.d.ts +221 -310
- package/dist/libraries/backend/better-auth.js +421 -148
- package/dist/libraries/backend/better-auth.mjs +250 -100
- package/dist/libraries/backend/{chunk-66ZEIO2W.mjs → chunk-35N7BIAE.mjs} +45 -1
- package/dist/libraries/backend/{chunk-OF427U7W.mjs → chunk-4MEEJLXG.mjs} +6 -6
- package/dist/libraries/backend/{chunk-FELIWCJB.mjs → chunk-LOSIWWM2.mjs} +1 -1
- package/dist/libraries/backend/{chunk-7HOB6NAU.mjs → chunk-MHIUO3ST.mjs} +1 -1
- package/dist/libraries/backend/{chunk-NTBLGION.mjs → chunk-PO4EL4BW.mjs} +9 -27
- package/dist/libraries/backend/{chunk-CVD6CEVQ.mjs → chunk-QOJMX7ML.mjs} +25 -31
- package/dist/libraries/backend/chunk-SRJD6EXQ.mjs +104 -0
- package/dist/libraries/backend/{chunk-3XTIAF27.mjs → chunk-USQ76FYI.mjs} +1 -1
- package/dist/libraries/backend/convex.js +84 -58
- package/dist/libraries/backend/convex.mjs +7 -7
- package/dist/libraries/backend/elysia.js +85 -77
- package/dist/libraries/backend/elysia.mjs +10 -28
- package/dist/libraries/backend/express.d.mts +1 -2
- package/dist/libraries/backend/express.d.ts +1 -2
- package/dist/libraries/backend/express.js +84 -58
- package/dist/libraries/backend/express.mjs +7 -7
- package/dist/libraries/backend/fastify.js +84 -58
- package/dist/libraries/backend/fastify.mjs +7 -7
- package/dist/libraries/backend/hono.js +85 -59
- package/dist/libraries/backend/hono.mjs +8 -8
- package/dist/libraries/backend/index.d.mts +1 -2
- package/dist/libraries/backend/index.d.ts +1 -2
- package/dist/libraries/backend/index.js +84 -58
- package/dist/libraries/backend/index.mjs +7 -7
- package/dist/libraries/backend/next.js +84 -58
- package/dist/libraries/backend/next.mjs +7 -7
- package/dist/libraries/backend/react-router.js +84 -58
- package/dist/libraries/backend/react-router.mjs +7 -7
- package/dist/libraries/backend/{referralTypes-DebIXtFw.d.ts → referralTypes-8cxTmxXS.d.ts} +49 -15
- package/dist/libraries/backend/{referralTypes-8bo5DSdv.d.mts → referralTypes-BXNyy9z2.d.mts} +49 -15
- package/dist/libraries/backend/remix_dep.js +84 -58
- package/dist/libraries/backend/remix_dep.mjs +7 -7
- package/dist/libraries/backend/routes/backendRouter.js +84 -58
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -7
- package/dist/libraries/backend/routes/entityRoutes.js +76 -32
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +89 -63
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +76 -32
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +76 -32
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +84 -58
- package/dist/libraries/backend/supabase.mjs +7 -7
- package/dist/libraries/backend/tanstack.js +84 -58
- package/dist/libraries/backend/tanstack.mjs +7 -7
- package/dist/libraries/backend/utils/backendRes.js +33 -32
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/betterAuth/middlewares.d.mts +26 -0
- package/dist/libraries/backend/utils/betterAuth/middlewares.d.ts +26 -0
- package/dist/libraries/backend/utils/betterAuth/middlewares.js +130 -0
- package/dist/libraries/backend/utils/betterAuth/middlewares.mjs +10 -0
- package/dist/libraries/backend/utils/betterAuth/types.d.mts +18 -0
- package/dist/libraries/backend/utils/betterAuth/types.d.ts +18 -0
- package/dist/libraries/backend/utils/betterAuth/types.js +18 -0
- package/dist/libraries/backend/utils/betterAuth/types.mjs +0 -0
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -2
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -2
- package/dist/libraries/backend/utils/withAuth.js +76 -32
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +7 -9
- package/dist/libraries/react/AutumnContext.d.ts +7 -9
- package/dist/libraries/react/AutumnContext.js +64 -96
- package/dist/libraries/react/AutumnContext.mjs +6 -8
- package/dist/libraries/react/BaseAutumnProvider.d.mts +7 -9
- package/dist/libraries/react/BaseAutumnProvider.d.ts +7 -9
- package/dist/libraries/react/BaseAutumnProvider.js +233 -269
- package/dist/libraries/react/BaseAutumnProvider.mjs +11 -13
- package/dist/libraries/react/{ReactAutumnClient-DEHKGBDi.d.ts → ReactAutumnClient-DkAcY1X2.d.ts} +32 -37
- package/dist/libraries/react/{ReactAutumnClient-Zj0UGjxH.d.mts → ReactAutumnClient-DuYr1i4C.d.mts} +32 -37
- package/dist/libraries/react/ReactAutumnProvider.d.mts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.d.ts +2 -2
- package/dist/libraries/react/ReactAutumnProvider.js +233 -278
- package/dist/libraries/react/ReactAutumnProvider.mjs +13 -15
- package/dist/libraries/react/{attachTypes-DVF4f7Hw.d.ts → attachTypes-CKp1KMwX.d.ts} +1 -1
- package/dist/libraries/react/{attachTypes-DJIr5ldB.d.mts → attachTypes-DbuZWzAP.d.mts} +1 -1
- package/dist/libraries/react/{chunk-VYUFW3OD.mjs → chunk-4YM2QKRI.mjs} +5 -9
- package/dist/libraries/react/{chunk-NRR6GSHG.mjs → chunk-5LRBYZUD.mjs} +1 -1
- package/dist/libraries/react/{chunk-2RQO56D3.mjs → chunk-5OBFJVZC.mjs} +19 -19
- package/dist/libraries/react/{chunk-JNFJ3VBI.mjs → chunk-7FMBA5I4.mjs} +2 -2
- package/dist/libraries/react/{chunk-566O6I3M.mjs → chunk-7T7IOMAA.mjs} +2 -2
- package/dist/libraries/react/{chunk-LC75KITX.mjs → chunk-7YNNQGHZ.mjs} +1 -1
- package/dist/libraries/react/{chunk-TL3Q72GK.mjs → chunk-AUZMXLNB.mjs} +1 -1
- package/dist/libraries/react/{chunk-KUHUEZ4E.mjs → chunk-FL4H464X.mjs} +4 -4
- package/dist/libraries/react/{chunk-RHWRL643.mjs → chunk-FW7AQFVX.mjs} +1 -1
- package/dist/libraries/react/{chunk-HWQFNAOP.mjs → chunk-HN7ULWIM.mjs} +1 -1
- package/dist/libraries/react/chunk-LS2RW6JG.mjs +51 -0
- package/dist/libraries/react/{chunk-ZF2HUCN6.mjs → chunk-OYBOLAL5.mjs} +2 -7
- package/dist/libraries/react/{chunk-23P5IQNT.mjs → chunk-P4GHLIEZ.mjs} +19 -19
- package/dist/libraries/react/{chunk-4U4KMWWI.mjs → chunk-Q7LVAQ5K.mjs} +2 -2
- package/dist/libraries/react/{chunk-DIHJNBEP.mjs → chunk-RNIUZGWU.mjs} +2 -2
- package/dist/libraries/react/{chunk-QRCWNK2T.mjs → chunk-SFOIZTAS.mjs} +24 -23
- package/dist/libraries/react/{chunk-ZV4RPZTM.mjs → chunk-SUENW2KS.mjs} +2 -7
- package/dist/libraries/react/{chunk-RMDNPM6H.mjs → chunk-WSX7HWKQ.mjs} +4 -3
- package/dist/libraries/react/{chunk-ICJTAVNU.mjs → chunk-YKJYGNXR.mjs} +1 -1
- package/dist/libraries/react/{chunk-XIBQRZXG.mjs → chunk-ZVGPT54A.mjs} +1 -10
- package/dist/libraries/react/client/ConvexAutumnClient.d.mts +7 -13
- package/dist/libraries/react/client/ConvexAutumnClient.d.ts +7 -13
- package/dist/libraries/react/client/ConvexAutumnClient.js +33 -41
- package/dist/libraries/react/client/ConvexAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -8
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -8
- package/dist/libraries/react/client/ReactAutumnClient.js +64 -96
- package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -7
- package/dist/libraries/react/client/clientCompMethods.d.mts +25 -9
- package/dist/libraries/react/client/clientCompMethods.d.ts +25 -9
- package/dist/libraries/react/client/clientCompMethods.mjs +6 -3
- package/dist/libraries/react/client/clientCusMethods.d.mts +7 -9
- package/dist/libraries/react/client/clientCusMethods.d.ts +7 -9
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -7
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -7
- package/dist/libraries/react/client/clientEntityMethods.js +2 -25
- package/dist/libraries/react/client/clientEntityMethods.mjs +1 -2
- package/dist/libraries/react/client/clientGenMethods.d.mts +8 -9
- package/dist/libraries/react/client/clientGenMethods.d.ts +8 -9
- package/dist/libraries/react/client/clientGenMethods.js +12 -40
- package/dist/libraries/react/client/clientGenMethods.mjs +1 -2
- package/dist/libraries/react/client/clientProdMethods.d.mts +7 -9
- package/dist/libraries/react/client/clientProdMethods.d.ts +7 -9
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -8
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -8
- package/dist/libraries/react/client/clientReferralMethods.js +2 -27
- package/dist/libraries/react/client/clientReferralMethods.mjs +1 -2
- package/dist/libraries/react/client/types/clientEntTypes.d.mts +18 -13
- package/dist/libraries/react/client/types/clientEntTypes.d.ts +18 -13
- package/dist/libraries/react/client/types/clientEntTypes.js +28 -0
- package/dist/libraries/react/client/types/clientEntTypes.mjs +20 -0
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +12 -10
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +12 -10
- package/dist/libraries/react/client/types/clientGenTypes.js +70 -56
- package/dist/libraries/react/client/types/clientGenTypes.mjs +12 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.d.ts +2 -2
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +317 -353
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +26 -28
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.mts +2 -2
- package/dist/libraries/react/components/checkout-dialog/lib/checkout-content.d.ts +2 -2
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.mts +1 -1
- package/dist/libraries/react/components/paywall-dialog/lib/paywall-content.d.ts +1 -1
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +113 -146
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +26 -28
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -1
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +516 -552
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +26 -28
- package/dist/libraries/react/components/ui/accordion.d.mts +10 -4
- package/dist/libraries/react/components/ui/accordion.d.ts +10 -4
- package/dist/libraries/react/components/ui/dialog.d.mts +15 -7
- package/dist/libraries/react/components/ui/dialog.d.ts +15 -7
- package/dist/libraries/react/components/ui/popover.d.mts +6 -4
- package/dist/libraries/react/components/ui/popover.d.ts +6 -4
- package/dist/libraries/react/components/ui/popover.mjs +2 -2
- package/dist/libraries/react/components/ui/switch.d.mts +3 -1
- package/dist/libraries/react/components/ui/switch.d.ts +3 -1
- package/dist/libraries/react/{cusTypes-CEb_KwPo.d.ts → cusTypes-D3QQXjif.d.ts} +1 -1
- package/dist/libraries/react/{cusTypes-DynqPCZH.d.mts → cusTypes-RU0fmR-t.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-DjasDDYh.d.mts → entTypes-35x0LnYH.d.mts} +1 -1
- package/dist/libraries/react/{entTypes--Y-4T20Y.d.ts → entTypes-n2T2wpRx.d.ts} +1 -1
- package/dist/libraries/react/{genTypes-VKn7hoqQ.d.mts → genTypes-B5_6Pu_4.d.mts} +1 -1
- package/dist/libraries/react/{genTypes-BjHbcZ7E.d.ts → genTypes-CY6GNiAn.d.ts} +1 -1
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +6 -7
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +6 -7
- package/dist/libraries/react/hooks/helpers/handleCheck.js +33 -32
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +6 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +6 -7
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +33 -32
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAnalytics.d.mts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.d.ts +2 -2
- package/dist/libraries/react/hooks/useAnalytics.js +64 -96
- package/dist/libraries/react/hooks/useAnalytics.mjs +7 -9
- package/dist/libraries/react/hooks/useCustomer.d.mts +10 -10
- package/dist/libraries/react/hooks/useCustomer.d.ts +10 -10
- package/dist/libraries/react/hooks/useCustomer.js +213 -249
- package/dist/libraries/react/hooks/useCustomer.mjs +11 -13
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +10 -10
- package/dist/libraries/react/hooks/useCustomerBase.js +229 -265
- package/dist/libraries/react/hooks/useCustomerBase.mjs +10 -12
- package/dist/libraries/react/hooks/useEntity.d.mts +4 -4
- package/dist/libraries/react/hooks/useEntity.d.ts +4 -4
- package/dist/libraries/react/hooks/useEntity.js +65 -96
- package/dist/libraries/react/hooks/useEntity.mjs +11 -13
- package/dist/libraries/react/hooks/useEntityBase.d.mts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.d.ts +6 -6
- package/dist/libraries/react/hooks/useEntityBase.js +65 -96
- package/dist/libraries/react/hooks/useEntityBase.mjs +10 -12
- package/dist/libraries/react/hooks/usePaywall.d.mts +1 -1
- package/dist/libraries/react/hooks/usePaywall.d.ts +1 -1
- package/dist/libraries/react/hooks/usePaywall.js +64 -96
- package/dist/libraries/react/hooks/usePaywall.mjs +7 -9
- package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -1
- package/dist/libraries/react/hooks/usePricingTable.js +64 -96
- package/dist/libraries/react/hooks/usePricingTable.mjs +8 -10
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +6 -8
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +6 -8
- package/dist/libraries/react/hooks/usePricingTableBase.js +33 -32
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +6 -8
- package/dist/libraries/react/hooks/useProductsBase.d.ts +6 -8
- package/dist/libraries/react/hooks/useProductsBase.js +2 -1
- package/dist/libraries/react/hooks/useProductsBase.mjs +2 -1
- package/dist/libraries/react/index.d.mts +62 -58
- package/dist/libraries/react/index.d.ts +62 -58
- package/dist/libraries/react/index.js +521 -565
- package/dist/libraries/react/index.mjs +484 -528
- package/dist/libraries/react/{prodTypes-C8xRoBP7.d.ts → prodTypes-C4aZSZfO.d.mts} +1 -1
- package/dist/libraries/react/{prodTypes-C8xRoBP7.d.mts → prodTypes-C4aZSZfO.d.ts} +1 -1
- package/dist/next/client/NextAutumnClient.d.mts +31 -34
- package/dist/next/client/NextAutumnClient.d.ts +31 -34
- package/dist/next/client/NextAutumnProvider.d.mts +2 -2
- package/dist/next/client/NextAutumnProvider.d.ts +2 -2
- package/dist/next/client/{clientAttachTypes-BqwjCML1.d.ts → clientAttachTypes-BtZh00uu.d.ts} +12 -10
- package/dist/next/client/{clientAttachTypes-9AXt1E5H.d.mts → clientAttachTypes-yOuJqDWt.d.mts} +12 -10
- package/dist/next/client/{clientEntTypes-CnQkrPEG.d.mts → clientEntTypes-Bsi7ciUF.d.ts} +12 -10
- package/dist/next/client/{clientEntTypes-BhQWlwSW.d.ts → clientEntTypes-aLfa3lyP.d.mts} +12 -10
- package/dist/next/client/clientUtils.d.mts +3 -3
- package/dist/next/client/clientUtils.d.ts +3 -3
- package/dist/next/client/{cusTypes-5W4JVk2C.d.ts → cusTypes-B-rJwpui.d.ts} +2 -2
- package/dist/next/client/{cusTypes-Cb9Peq72.d.mts → cusTypes-CXjHwB-c.d.mts} +2 -2
- package/dist/next/client/{entTypes-R0fGEyG8.d.mts → entTypes-BkN-Puru.d.mts} +1 -1
- package/dist/next/client/{entTypes-B2gnYOgY.d.ts → entTypes-DjKFS-Zk.d.ts} +1 -1
- package/dist/next/client/hooks/useAutumn.d.mts +3 -3
- package/dist/next/client/hooks/useAutumn.d.ts +3 -3
- package/dist/next/client/hooks/useCustomer.d.mts +6 -6
- package/dist/next/client/hooks/useCustomer.d.ts +6 -6
- package/dist/next/client/hooks/useEntity.d.mts +4 -4
- package/dist/next/client/hooks/useEntity.d.ts +4 -4
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/client/{prodTypes-BC--Np0p.d.mts → prodTypes-B_VMILpU.d.mts} +1 -1
- package/dist/next/client/{prodTypes-BC--Np0p.d.ts → prodTypes-B_VMILpU.d.ts} +1 -1
- package/dist/next/client/types.d.mts +3 -3
- package/dist/next/client/types.d.ts +3 -3
- package/dist/next/server/cusActions.d.mts +59 -23
- package/dist/next/server/cusActions.d.ts +59 -23
- package/dist/next/server/cusActions.js +3 -3
- package/dist/next/server/cusActions.mjs +3 -3
- package/dist/next/server/genActions.js +5 -5
- package/dist/next/server/genActions.mjs +5 -5
- package/dist/sdk/index.d.mts +53 -16
- package/dist/sdk/index.d.ts +53 -16
- package/dist/sdk/index.js +32 -16
- package/dist/sdk/index.mjs +32 -16
- package/dist/utils/encryptUtils.js +33 -32
- package/dist/utils/encryptUtils.mjs +24 -23
- package/dist/utils/toSnakeCase.d.mts +5 -1
- package/dist/utils/toSnakeCase.d.ts +5 -1
- package/dist/utils/toSnakeCase.js +25 -6
- package/dist/utils/toSnakeCase.mjs +25 -6
- package/package.json +1 -1
- package/dist/libraries/react/chunk-KQT5G3HT.mjs +0 -27
- package/dist/libraries/react/chunk-VTGR7VVK.mjs +0 -12
- package/dist/libraries/react/chunk-YQHZT73Z.mjs +0 -59
- package/dist/libraries/react/utils/toSnakeCase.d.mts +0 -3
- package/dist/libraries/react/utils/toSnakeCase.d.ts +0 -3
- package/dist/libraries/react/utils/toSnakeCase.js +0 -50
- package/dist/libraries/react/utils/toSnakeCase.mjs +0 -8
- package/dist/libraries/react/{chunk-I274Z7T2.mjs → chunk-C3G5RW3Q.mjs} +3 -3
|
@@ -42,34 +42,17 @@ __export(pricing_table_synced_exports, {
|
|
|
42
42
|
usePricingTableContext: () => usePricingTableContext
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(pricing_table_synced_exports);
|
|
45
|
-
var
|
|
45
|
+
var import_react14 = __toESM(require("react"));
|
|
46
46
|
|
|
47
47
|
// src/libraries/react/BaseAutumnProvider.tsx
|
|
48
|
+
var import_react3 = require("react");
|
|
48
49
|
var import_react4 = require("react");
|
|
49
|
-
var import_react5 = require("react");
|
|
50
50
|
|
|
51
51
|
// src/libraries/react/hooks/helpers/useDialog.tsx
|
|
52
52
|
var import_react = require("react");
|
|
53
53
|
|
|
54
54
|
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
55
55
|
var import_swr2 = __toESM(require("swr"));
|
|
56
|
-
var import_react3 = require("react");
|
|
57
|
-
|
|
58
|
-
// src/libraries/react/errorUtils/logAuthError.ts
|
|
59
|
-
var logAuthError = async (response) => {
|
|
60
|
-
if (response.status === 401) {
|
|
61
|
-
let clonedResponse = response.clone();
|
|
62
|
-
let data = await clonedResponse.json();
|
|
63
|
-
if (data.message.includes("Missing authorization header")) {
|
|
64
|
-
console.error(`[Autumn] Missing authorization header.
|
|
65
|
-
|
|
66
|
-
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
67
|
-
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return false;
|
|
72
|
-
};
|
|
73
56
|
|
|
74
57
|
// src/sdk/error.ts
|
|
75
58
|
var AutumnError = class _AutumnError extends Error {
|
|
@@ -306,7 +289,8 @@ var productMethods = (instance) => {
|
|
|
306
289
|
return {
|
|
307
290
|
get: (id) => staticWrapper(getProduct, instance, { id }),
|
|
308
291
|
create: (params) => staticWrapper(createProduct, instance, { params }),
|
|
309
|
-
list: (params) => staticWrapper(listProducts, instance, { params })
|
|
292
|
+
list: (params) => staticWrapper(listProducts, instance, { params }),
|
|
293
|
+
delete: (id) => staticWrapper(deleteProduct, instance, { id })
|
|
310
294
|
};
|
|
311
295
|
};
|
|
312
296
|
var listProducts = async ({
|
|
@@ -340,6 +324,14 @@ var createProduct = async ({
|
|
|
340
324
|
}) => {
|
|
341
325
|
return instance.post("/products", params);
|
|
342
326
|
};
|
|
327
|
+
var deleteProduct = async ({
|
|
328
|
+
instance,
|
|
329
|
+
id,
|
|
330
|
+
params
|
|
331
|
+
}) => {
|
|
332
|
+
const path = buildPathWithQuery(`/products/${id}`, params);
|
|
333
|
+
return instance.delete(path);
|
|
334
|
+
};
|
|
343
335
|
|
|
344
336
|
// src/sdk/referrals/referralMethods.ts
|
|
345
337
|
var referralMethods = (instance) => {
|
|
@@ -376,14 +368,6 @@ var toContainerResult = async ({
|
|
|
376
368
|
}
|
|
377
369
|
} catch (error2) {
|
|
378
370
|
throw error2;
|
|
379
|
-
return {
|
|
380
|
-
data: null,
|
|
381
|
-
error: new AutumnError({
|
|
382
|
-
message: "Failed to parse JSON response from Autumn",
|
|
383
|
-
code: "internal_error"
|
|
384
|
-
}),
|
|
385
|
-
statusCode: response.status
|
|
386
|
-
};
|
|
387
371
|
}
|
|
388
372
|
return {
|
|
389
373
|
data: null,
|
|
@@ -395,7 +379,7 @@ var toContainerResult = async ({
|
|
|
395
379
|
};
|
|
396
380
|
}
|
|
397
381
|
try {
|
|
398
|
-
|
|
382
|
+
const data = await response.json();
|
|
399
383
|
return {
|
|
400
384
|
data,
|
|
401
385
|
error: null,
|
|
@@ -403,14 +387,6 @@ var toContainerResult = async ({
|
|
|
403
387
|
};
|
|
404
388
|
} catch (error) {
|
|
405
389
|
throw error;
|
|
406
|
-
return {
|
|
407
|
-
data: null,
|
|
408
|
-
error: new AutumnError({
|
|
409
|
-
message: "Failed to parse Autumn API response",
|
|
410
|
-
code: "internal_error"
|
|
411
|
-
}),
|
|
412
|
-
statusCode: response?.status
|
|
413
|
-
};
|
|
414
390
|
}
|
|
415
391
|
};
|
|
416
392
|
|
|
@@ -454,7 +430,8 @@ var logger = {
|
|
|
454
430
|
// src/sdk/features/featureMethods.ts
|
|
455
431
|
var featureMethods = (instance) => {
|
|
456
432
|
return {
|
|
457
|
-
list: () => staticWrapper(listFeatures, instance, {})
|
|
433
|
+
list: () => staticWrapper(listFeatures, instance, {}),
|
|
434
|
+
get: (id) => staticWrapper(getFeature, instance, { id })
|
|
458
435
|
};
|
|
459
436
|
};
|
|
460
437
|
var listFeatures = async ({
|
|
@@ -476,6 +453,12 @@ var listFeatures = async ({
|
|
|
476
453
|
}
|
|
477
454
|
return instance.get(path);
|
|
478
455
|
};
|
|
456
|
+
var getFeature = async ({
|
|
457
|
+
instance,
|
|
458
|
+
id
|
|
459
|
+
}) => {
|
|
460
|
+
return instance.get(`/features/${id}`);
|
|
461
|
+
};
|
|
479
462
|
|
|
480
463
|
// src/sdk/client.ts
|
|
481
464
|
var LATEST_API_VERSION = "1.2";
|
|
@@ -993,7 +976,7 @@ var CheckoutParamsSchema = import_v47.z.object({
|
|
|
993
976
|
});
|
|
994
977
|
|
|
995
978
|
// src/sdk/features/featureTypes.ts
|
|
996
|
-
var
|
|
979
|
+
var import_v48 = require("zod/v4");
|
|
997
980
|
var FeatureType = /* @__PURE__ */ ((FeatureType2) => {
|
|
998
981
|
FeatureType2["Boolean"] = "boolean";
|
|
999
982
|
FeatureType2["SingleUse"] = "single_use";
|
|
@@ -1001,22 +984,186 @@ var FeatureType = /* @__PURE__ */ ((FeatureType2) => {
|
|
|
1001
984
|
FeatureType2["CreditSystem"] = "credit_system";
|
|
1002
985
|
return FeatureType2;
|
|
1003
986
|
})(FeatureType || {});
|
|
1004
|
-
var FeatureSchema =
|
|
1005
|
-
id:
|
|
1006
|
-
name:
|
|
1007
|
-
type:
|
|
1008
|
-
display:
|
|
1009
|
-
singular:
|
|
1010
|
-
plural:
|
|
987
|
+
var FeatureSchema = import_v48.z.object({
|
|
988
|
+
id: import_v48.z.string(),
|
|
989
|
+
name: import_v48.z.string(),
|
|
990
|
+
type: import_v48.z.enum(FeatureType),
|
|
991
|
+
display: import_v48.z.object({
|
|
992
|
+
singular: import_v48.z.string(),
|
|
993
|
+
plural: import_v48.z.string()
|
|
1011
994
|
}).nullish(),
|
|
1012
|
-
credit_schema:
|
|
1013
|
-
|
|
1014
|
-
metered_feature_id:
|
|
1015
|
-
credit_cost:
|
|
995
|
+
credit_schema: import_v48.z.array(
|
|
996
|
+
import_v48.z.object({
|
|
997
|
+
metered_feature_id: import_v48.z.string(),
|
|
998
|
+
credit_cost: import_v48.z.number()
|
|
1016
999
|
})
|
|
1017
|
-
).nullish()
|
|
1000
|
+
).nullish(),
|
|
1001
|
+
archived: import_v48.z.boolean()
|
|
1018
1002
|
});
|
|
1019
1003
|
|
|
1004
|
+
// src/libraries/react/hooks/helpers/handleCheck.ts
|
|
1005
|
+
var getCusFeature = ({
|
|
1006
|
+
customer,
|
|
1007
|
+
featureId,
|
|
1008
|
+
requiredBalance = 1
|
|
1009
|
+
}) => {
|
|
1010
|
+
let cusFeature = customer.features[featureId];
|
|
1011
|
+
if (cusFeature && typeof cusFeature.balance === "number" && cusFeature.balance >= requiredBalance) {
|
|
1012
|
+
return {
|
|
1013
|
+
cusFeature,
|
|
1014
|
+
requiredBalance
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
let creditSchema = Object.values(customer.features).find(
|
|
1018
|
+
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
1019
|
+
);
|
|
1020
|
+
if (creditSchema) {
|
|
1021
|
+
let schemaItem = creditSchema.credit_schema?.find(
|
|
1022
|
+
(c) => c.feature_id === featureId
|
|
1023
|
+
);
|
|
1024
|
+
return {
|
|
1025
|
+
cusFeature: creditSchema,
|
|
1026
|
+
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
return {
|
|
1030
|
+
cusFeature: customer.features[featureId],
|
|
1031
|
+
requiredBalance
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
var getFeatureAllowed = ({
|
|
1035
|
+
cusFeature,
|
|
1036
|
+
requiredBalance
|
|
1037
|
+
}) => {
|
|
1038
|
+
if (!cusFeature) return false;
|
|
1039
|
+
if (cusFeature.type == "static") return true;
|
|
1040
|
+
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1041
|
+
if (cusFeature.usage_limit) {
|
|
1042
|
+
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1043
|
+
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1044
|
+
}
|
|
1045
|
+
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1046
|
+
};
|
|
1047
|
+
var handleFeatureCheck = ({
|
|
1048
|
+
customer,
|
|
1049
|
+
isEntity,
|
|
1050
|
+
params
|
|
1051
|
+
}) => {
|
|
1052
|
+
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1053
|
+
customer,
|
|
1054
|
+
featureId: params.featureId,
|
|
1055
|
+
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1056
|
+
});
|
|
1057
|
+
let allowed = getFeatureAllowed({
|
|
1058
|
+
cusFeature,
|
|
1059
|
+
requiredBalance: requiredBalance ?? 1
|
|
1060
|
+
});
|
|
1061
|
+
let result = {
|
|
1062
|
+
allowed,
|
|
1063
|
+
feature_id: cusFeature?.id ?? params.featureId,
|
|
1064
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1065
|
+
required_balance: requiredBalance,
|
|
1066
|
+
...cusFeature
|
|
1067
|
+
};
|
|
1068
|
+
if (isEntity) {
|
|
1069
|
+
result.entity_id = customer.id;
|
|
1070
|
+
}
|
|
1071
|
+
try {
|
|
1072
|
+
return CheckFeatureResultSchema.parse(result);
|
|
1073
|
+
} catch (error) {
|
|
1074
|
+
return result;
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
var handleProductCheck = ({
|
|
1078
|
+
customer,
|
|
1079
|
+
isEntity,
|
|
1080
|
+
params
|
|
1081
|
+
}) => {
|
|
1082
|
+
let product = customer.products.find((p) => p.id == params.productId);
|
|
1083
|
+
let allowed = product?.status === "active";
|
|
1084
|
+
let result = {
|
|
1085
|
+
allowed,
|
|
1086
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1087
|
+
product_id: params.productId
|
|
1088
|
+
};
|
|
1089
|
+
if (product) {
|
|
1090
|
+
result.status = product.status;
|
|
1091
|
+
}
|
|
1092
|
+
if (isEntity) {
|
|
1093
|
+
result.entity_id = customer.id;
|
|
1094
|
+
}
|
|
1095
|
+
return result;
|
|
1096
|
+
};
|
|
1097
|
+
var openDialog = ({
|
|
1098
|
+
result,
|
|
1099
|
+
params,
|
|
1100
|
+
context
|
|
1101
|
+
}) => {
|
|
1102
|
+
let open = result?.allowed === false && params.dialog && context;
|
|
1103
|
+
if (!open) return;
|
|
1104
|
+
const isInRenderCycle = (() => {
|
|
1105
|
+
const stack = new Error().stack || "";
|
|
1106
|
+
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1107
|
+
})();
|
|
1108
|
+
if (isInRenderCycle) {
|
|
1109
|
+
context.paywallRef.current = {
|
|
1110
|
+
component: params.dialog,
|
|
1111
|
+
open: true,
|
|
1112
|
+
props: params
|
|
1113
|
+
};
|
|
1114
|
+
} else {
|
|
1115
|
+
context.paywallDialog.setComponent(params.dialog);
|
|
1116
|
+
context.paywallDialog.setProps(params);
|
|
1117
|
+
context.paywallDialog.setOpen(true);
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
var handleCheck2 = ({
|
|
1121
|
+
customer,
|
|
1122
|
+
isEntity,
|
|
1123
|
+
params,
|
|
1124
|
+
context
|
|
1125
|
+
}) => {
|
|
1126
|
+
if (!customer) {
|
|
1127
|
+
return {
|
|
1128
|
+
data: {
|
|
1129
|
+
allowed: false,
|
|
1130
|
+
feature_id: "",
|
|
1131
|
+
customer_id: "",
|
|
1132
|
+
required_balance: 0
|
|
1133
|
+
},
|
|
1134
|
+
error: null
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
if (!params.featureId && !params.productId) {
|
|
1138
|
+
throw new Error("allowed() requires either featureId or productId");
|
|
1139
|
+
}
|
|
1140
|
+
let result;
|
|
1141
|
+
if (params.featureId)
|
|
1142
|
+
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1143
|
+
if (params.productId)
|
|
1144
|
+
result = handleProductCheck({ customer, params, isEntity });
|
|
1145
|
+
return {
|
|
1146
|
+
data: result,
|
|
1147
|
+
error: null
|
|
1148
|
+
};
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
// src/libraries/react/errorUtils/logAuthError.ts
|
|
1152
|
+
var logAuthError = async (response) => {
|
|
1153
|
+
if (response.status === 401) {
|
|
1154
|
+
let clonedResponse = response.clone();
|
|
1155
|
+
let data = await clonedResponse.json();
|
|
1156
|
+
if (data.message.includes("Missing authorization header")) {
|
|
1157
|
+
console.error(`[Autumn] Missing authorization header.
|
|
1158
|
+
|
|
1159
|
+
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
1160
|
+
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
1161
|
+
return true;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return false;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1020
1167
|
// src/libraries/react/errorUtils/logFetchError.ts
|
|
1021
1168
|
var logFetchError = ({
|
|
1022
1169
|
method,
|
|
@@ -1030,12 +1177,6 @@ var logFetchError = ({
|
|
|
1030
1177
|
2. Check that autumnHandler is correctly registered on your backend.`);
|
|
1031
1178
|
};
|
|
1032
1179
|
|
|
1033
|
-
// src/libraries/react/client/clientCompMethods.ts
|
|
1034
|
-
async function getPricingTableMethod() {
|
|
1035
|
-
const res = await this.get(`${this.prefix}/components/pricing_table`);
|
|
1036
|
-
return res;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
1180
|
// src/libraries/react/client/clientCusMethods.ts
|
|
1040
1181
|
var createCustomerMethod = async ({
|
|
1041
1182
|
client,
|
|
@@ -1045,27 +1186,6 @@ var createCustomerMethod = async ({
|
|
|
1045
1186
|
return result;
|
|
1046
1187
|
};
|
|
1047
1188
|
|
|
1048
|
-
// src/libraries/react/utils/toSnakeCase.ts
|
|
1049
|
-
function stringToSnakeCase(str) {
|
|
1050
|
-
return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[-\s]+/g, "_").toLowerCase();
|
|
1051
|
-
}
|
|
1052
|
-
var toSnakeCase = (obj, excludeKeys) => {
|
|
1053
|
-
if (Array.isArray(obj)) {
|
|
1054
|
-
return obj.map((item) => toSnakeCase(item, excludeKeys));
|
|
1055
|
-
} else if (obj !== null && typeof obj === "object") {
|
|
1056
|
-
return Object.fromEntries(
|
|
1057
|
-
Object.entries(obj).map(([key, value]) => {
|
|
1058
|
-
const snakeKey = stringToSnakeCase(key);
|
|
1059
|
-
if (excludeKeys && excludeKeys.includes(key)) {
|
|
1060
|
-
return [snakeKey, value];
|
|
1061
|
-
}
|
|
1062
|
-
return [snakeKey, toSnakeCase(value, excludeKeys)];
|
|
1063
|
-
})
|
|
1064
|
-
);
|
|
1065
|
-
}
|
|
1066
|
-
return obj;
|
|
1067
|
-
};
|
|
1068
|
-
|
|
1069
1189
|
// src/utils/entityUtils.tsx
|
|
1070
1190
|
var getEntityExpandStr = (expand) => {
|
|
1071
1191
|
if (!expand) {
|
|
@@ -1076,13 +1196,11 @@ var getEntityExpandStr = (expand) => {
|
|
|
1076
1196
|
|
|
1077
1197
|
// src/libraries/react/client/clientEntityMethods.ts
|
|
1078
1198
|
async function createEntityMethod(params) {
|
|
1079
|
-
|
|
1080
|
-
const res = await this.post(`${this.prefix}/entities`, snakeParams);
|
|
1199
|
+
const res = await this.post(`${this.prefix}/entities`, params);
|
|
1081
1200
|
return res;
|
|
1082
1201
|
}
|
|
1083
1202
|
async function getEntityMethod(entityId, params) {
|
|
1084
|
-
|
|
1085
|
-
let expand = getEntityExpandStr(params?.expand);
|
|
1203
|
+
const expand = getEntityExpandStr(params?.expand);
|
|
1086
1204
|
const res = await this.get(`${this.prefix}/entities/${entityId}?${expand}`);
|
|
1087
1205
|
return res;
|
|
1088
1206
|
}
|
|
@@ -1093,44 +1211,39 @@ async function deleteEntityMethod(entityId) {
|
|
|
1093
1211
|
|
|
1094
1212
|
// src/libraries/react/client/clientGenMethods.ts
|
|
1095
1213
|
async function checkoutMethod(params) {
|
|
1096
|
-
|
|
1097
|
-
const res = await this.post(`${this.prefix}/checkout`, snakeParams);
|
|
1214
|
+
const res = await this.post(`${this.prefix}/checkout`, params);
|
|
1098
1215
|
return res;
|
|
1099
1216
|
}
|
|
1100
1217
|
async function attachMethod(params) {
|
|
1101
|
-
|
|
1102
|
-
const res = await this.post(`${this.prefix}/attach`, snakeParams);
|
|
1218
|
+
const res = await this.post(`${this.prefix}/attach`, params);
|
|
1103
1219
|
return res;
|
|
1104
1220
|
}
|
|
1105
1221
|
async function setupPaymentMethod(params) {
|
|
1106
|
-
|
|
1107
|
-
const res = await this.post(`${this.prefix}/setup_payment`, snakeParams);
|
|
1222
|
+
const res = await this.post(`${this.prefix}/setup_payment`, params);
|
|
1108
1223
|
return res;
|
|
1109
1224
|
}
|
|
1110
1225
|
async function cancelMethod(params) {
|
|
1111
|
-
|
|
1112
|
-
const res = await this.post(`${this.prefix}/cancel`, snakeParams);
|
|
1226
|
+
const res = await this.post(`${this.prefix}/cancel`, params);
|
|
1113
1227
|
return res;
|
|
1114
1228
|
}
|
|
1115
1229
|
async function checkMethod(params) {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1230
|
+
const noDialogParams = {
|
|
1231
|
+
...params,
|
|
1232
|
+
dialog: void 0
|
|
1233
|
+
};
|
|
1234
|
+
const res = await this.post(`${this.prefix}/check`, noDialogParams);
|
|
1119
1235
|
return res;
|
|
1120
1236
|
}
|
|
1121
1237
|
async function trackMethod(params) {
|
|
1122
|
-
|
|
1123
|
-
const res = await this.post(`${this.prefix}/track`, snakeParams);
|
|
1238
|
+
const res = await this.post(`${this.prefix}/track`, params);
|
|
1124
1239
|
return res;
|
|
1125
1240
|
}
|
|
1126
1241
|
async function openBillingPortalMethod(params) {
|
|
1127
|
-
|
|
1128
|
-
const res = await this.post(`${this.prefix}/billing_portal`, snakeParams);
|
|
1242
|
+
const res = await this.post(`${this.prefix}/billing_portal`, params || {});
|
|
1129
1243
|
return res;
|
|
1130
1244
|
}
|
|
1131
1245
|
async function queryMethod(params) {
|
|
1132
|
-
|
|
1133
|
-
const res = await this.post(`${this.prefix}/query`, snakeParams);
|
|
1246
|
+
const res = await this.post(`${this.prefix}/query`, params);
|
|
1134
1247
|
return res;
|
|
1135
1248
|
}
|
|
1136
1249
|
|
|
@@ -1142,13 +1255,11 @@ async function listProductsMethod() {
|
|
|
1142
1255
|
|
|
1143
1256
|
// src/libraries/react/client/clientReferralMethods.ts
|
|
1144
1257
|
async function createCode(params) {
|
|
1145
|
-
|
|
1146
|
-
const res = await this.post(`${this.prefix}/referrals/code`, snakeParams);
|
|
1258
|
+
const res = await this.post(`${this.prefix}/referrals/code`, params);
|
|
1147
1259
|
return res;
|
|
1148
1260
|
}
|
|
1149
1261
|
async function redeemCode(params) {
|
|
1150
|
-
|
|
1151
|
-
const res = await this.post(`${this.prefix}/referrals/redeem`, snakeParams);
|
|
1262
|
+
const res = await this.post(`${this.prefix}/referrals/redeem`, params);
|
|
1152
1263
|
return res;
|
|
1153
1264
|
}
|
|
1154
1265
|
|
|
@@ -1159,7 +1270,9 @@ var AutumnClient = class {
|
|
|
1159
1270
|
customerData;
|
|
1160
1271
|
includeCredentials;
|
|
1161
1272
|
prefix;
|
|
1273
|
+
camelCase;
|
|
1162
1274
|
headers;
|
|
1275
|
+
framework;
|
|
1163
1276
|
constructor({
|
|
1164
1277
|
backendUrl,
|
|
1165
1278
|
getBearerToken,
|
|
@@ -1173,11 +1286,15 @@ var AutumnClient = class {
|
|
|
1173
1286
|
this.customerData = customerData;
|
|
1174
1287
|
this.includeCredentials = includeCredentials;
|
|
1175
1288
|
this.prefix = "/api/autumn";
|
|
1289
|
+
let camelCase = false;
|
|
1176
1290
|
if (betterAuthUrl) {
|
|
1177
1291
|
this.prefix = "/api/auth/autumn";
|
|
1178
1292
|
this.backendUrl = betterAuthUrl;
|
|
1293
|
+
camelCase = true;
|
|
1179
1294
|
}
|
|
1180
1295
|
this.headers = headers;
|
|
1296
|
+
if (betterAuthUrl) camelCase = true;
|
|
1297
|
+
this.camelCase = camelCase;
|
|
1181
1298
|
}
|
|
1182
1299
|
/**
|
|
1183
1300
|
* Detects if the backend supports CORS credentials by making an OPTIONS request
|
|
@@ -1195,7 +1312,7 @@ var AutumnClient = class {
|
|
|
1195
1312
|
body: JSON.stringify({})
|
|
1196
1313
|
});
|
|
1197
1314
|
return { valid: true, includeCredentials: true };
|
|
1198
|
-
} catch (
|
|
1315
|
+
} catch (_) {
|
|
1199
1316
|
try {
|
|
1200
1317
|
await fetch(testEndpoint, {
|
|
1201
1318
|
method: "POST",
|
|
@@ -1204,7 +1321,7 @@ var AutumnClient = class {
|
|
|
1204
1321
|
body: JSON.stringify({})
|
|
1205
1322
|
});
|
|
1206
1323
|
return { valid: true, includeCredentials: false };
|
|
1207
|
-
} catch (
|
|
1324
|
+
} catch (_2) {
|
|
1208
1325
|
return { valid: false, includeCredentials: void 0 };
|
|
1209
1326
|
}
|
|
1210
1327
|
}
|
|
@@ -1241,9 +1358,9 @@ var AutumnClient = class {
|
|
|
1241
1358
|
};
|
|
1242
1359
|
if (this.getBearerToken) {
|
|
1243
1360
|
try {
|
|
1244
|
-
|
|
1361
|
+
const token = await this.getBearerToken();
|
|
1245
1362
|
headers.Authorization = `Bearer ${token}`;
|
|
1246
|
-
} catch (
|
|
1363
|
+
} catch (_) {
|
|
1247
1364
|
console.error(`Failed to call getToken() in AutumnProvider`);
|
|
1248
1365
|
}
|
|
1249
1366
|
}
|
|
@@ -1257,15 +1374,15 @@ var AutumnClient = class {
|
|
|
1257
1374
|
method,
|
|
1258
1375
|
body
|
|
1259
1376
|
}) {
|
|
1260
|
-
body = method === "POST" ?
|
|
1377
|
+
body = method === "POST" ? {
|
|
1261
1378
|
...body,
|
|
1262
|
-
customer_data: this.customerData || void 0
|
|
1263
|
-
}
|
|
1379
|
+
[this.camelCase ? "customerData" : "customer_data"]: this.customerData || void 0
|
|
1380
|
+
} : void 0;
|
|
1264
1381
|
const includeCredentials = await this.shouldIncludeCredentials();
|
|
1265
1382
|
try {
|
|
1266
1383
|
const response = await fetch(`${this.backendUrl}${path}`, {
|
|
1267
1384
|
method,
|
|
1268
|
-
body,
|
|
1385
|
+
body: body ? JSON.stringify(body) : void 0,
|
|
1269
1386
|
headers: await this.getHeaders(),
|
|
1270
1387
|
credentials: includeCredentials ? "include" : "omit"
|
|
1271
1388
|
});
|
|
@@ -1285,7 +1402,7 @@ var AutumnClient = class {
|
|
|
1285
1402
|
return {
|
|
1286
1403
|
data: null,
|
|
1287
1404
|
error: new AutumnError({
|
|
1288
|
-
message: error.message,
|
|
1405
|
+
message: error instanceof Error ? error.message : JSON.stringify(error),
|
|
1289
1406
|
code: "fetch_failed"
|
|
1290
1407
|
})
|
|
1291
1408
|
};
|
|
@@ -1316,9 +1433,6 @@ var AutumnClient = class {
|
|
|
1316
1433
|
params
|
|
1317
1434
|
});
|
|
1318
1435
|
}
|
|
1319
|
-
async getPricingTable() {
|
|
1320
|
-
return await getPricingTableMethod.bind(this)();
|
|
1321
|
-
}
|
|
1322
1436
|
attach = attachMethod.bind(this);
|
|
1323
1437
|
checkout = checkoutMethod.bind(this);
|
|
1324
1438
|
cancel = cancelMethod.bind(this);
|
|
@@ -1726,153 +1840,6 @@ var useAutumnBase = ({
|
|
|
1726
1840
|
};
|
|
1727
1841
|
};
|
|
1728
1842
|
|
|
1729
|
-
// src/libraries/react/hooks/helpers/handleCheck.ts
|
|
1730
|
-
var getCusFeature = ({
|
|
1731
|
-
customer,
|
|
1732
|
-
featureId,
|
|
1733
|
-
requiredBalance = 1
|
|
1734
|
-
}) => {
|
|
1735
|
-
let cusFeature = customer.features[featureId];
|
|
1736
|
-
if (cusFeature && typeof cusFeature.balance === "number" && cusFeature.balance >= requiredBalance) {
|
|
1737
|
-
return {
|
|
1738
|
-
cusFeature,
|
|
1739
|
-
requiredBalance
|
|
1740
|
-
};
|
|
1741
|
-
}
|
|
1742
|
-
let creditSchema = Object.values(customer.features).find(
|
|
1743
|
-
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
1744
|
-
);
|
|
1745
|
-
if (creditSchema) {
|
|
1746
|
-
let schemaItem = creditSchema.credit_schema?.find(
|
|
1747
|
-
(c) => c.feature_id === featureId
|
|
1748
|
-
);
|
|
1749
|
-
return {
|
|
1750
|
-
cusFeature: creditSchema,
|
|
1751
|
-
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1752
|
-
};
|
|
1753
|
-
}
|
|
1754
|
-
return {
|
|
1755
|
-
cusFeature: customer.features[featureId],
|
|
1756
|
-
requiredBalance
|
|
1757
|
-
};
|
|
1758
|
-
};
|
|
1759
|
-
var getFeatureAllowed = ({
|
|
1760
|
-
cusFeature,
|
|
1761
|
-
requiredBalance
|
|
1762
|
-
}) => {
|
|
1763
|
-
if (!cusFeature) return false;
|
|
1764
|
-
if (cusFeature.type == "static") return true;
|
|
1765
|
-
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1766
|
-
if (cusFeature.usage_limit) {
|
|
1767
|
-
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1768
|
-
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1769
|
-
}
|
|
1770
|
-
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1771
|
-
};
|
|
1772
|
-
var handleFeatureCheck = ({
|
|
1773
|
-
customer,
|
|
1774
|
-
isEntity,
|
|
1775
|
-
params
|
|
1776
|
-
}) => {
|
|
1777
|
-
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1778
|
-
customer,
|
|
1779
|
-
featureId: params.featureId,
|
|
1780
|
-
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1781
|
-
});
|
|
1782
|
-
let allowed = getFeatureAllowed({
|
|
1783
|
-
cusFeature,
|
|
1784
|
-
requiredBalance: requiredBalance ?? 1
|
|
1785
|
-
});
|
|
1786
|
-
let result = {
|
|
1787
|
-
allowed,
|
|
1788
|
-
feature_id: cusFeature?.id ?? params.featureId,
|
|
1789
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1790
|
-
required_balance: requiredBalance,
|
|
1791
|
-
...cusFeature
|
|
1792
|
-
};
|
|
1793
|
-
if (isEntity) {
|
|
1794
|
-
result.entity_id = customer.id;
|
|
1795
|
-
}
|
|
1796
|
-
try {
|
|
1797
|
-
return CheckFeatureResultSchema.parse(result);
|
|
1798
|
-
} catch (error) {
|
|
1799
|
-
return result;
|
|
1800
|
-
}
|
|
1801
|
-
};
|
|
1802
|
-
var handleProductCheck = ({
|
|
1803
|
-
customer,
|
|
1804
|
-
isEntity,
|
|
1805
|
-
params
|
|
1806
|
-
}) => {
|
|
1807
|
-
let product = customer.products.find((p) => p.id == params.productId);
|
|
1808
|
-
let allowed = product?.status === "active";
|
|
1809
|
-
let result = {
|
|
1810
|
-
allowed,
|
|
1811
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1812
|
-
product_id: params.productId
|
|
1813
|
-
};
|
|
1814
|
-
if (product) {
|
|
1815
|
-
result.status = product.status;
|
|
1816
|
-
}
|
|
1817
|
-
if (isEntity) {
|
|
1818
|
-
result.entity_id = customer.id;
|
|
1819
|
-
}
|
|
1820
|
-
return result;
|
|
1821
|
-
};
|
|
1822
|
-
var openDialog = ({
|
|
1823
|
-
result,
|
|
1824
|
-
params,
|
|
1825
|
-
context
|
|
1826
|
-
}) => {
|
|
1827
|
-
let open = result?.allowed === false && params.dialog && context;
|
|
1828
|
-
if (!open) return;
|
|
1829
|
-
const isInRenderCycle = (() => {
|
|
1830
|
-
const stack = new Error().stack || "";
|
|
1831
|
-
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1832
|
-
})();
|
|
1833
|
-
if (isInRenderCycle) {
|
|
1834
|
-
context.paywallRef.current = {
|
|
1835
|
-
component: params.dialog,
|
|
1836
|
-
open: true,
|
|
1837
|
-
props: params
|
|
1838
|
-
};
|
|
1839
|
-
} else {
|
|
1840
|
-
context.paywallDialog.setComponent(params.dialog);
|
|
1841
|
-
context.paywallDialog.setProps(params);
|
|
1842
|
-
context.paywallDialog.setOpen(true);
|
|
1843
|
-
}
|
|
1844
|
-
};
|
|
1845
|
-
var handleCheck2 = ({
|
|
1846
|
-
customer,
|
|
1847
|
-
isEntity,
|
|
1848
|
-
params,
|
|
1849
|
-
context
|
|
1850
|
-
}) => {
|
|
1851
|
-
if (!customer) {
|
|
1852
|
-
return {
|
|
1853
|
-
data: {
|
|
1854
|
-
allowed: false,
|
|
1855
|
-
feature_id: "",
|
|
1856
|
-
customer_id: "",
|
|
1857
|
-
required_balance: 0
|
|
1858
|
-
},
|
|
1859
|
-
error: null
|
|
1860
|
-
};
|
|
1861
|
-
}
|
|
1862
|
-
if (!params.featureId && !params.productId) {
|
|
1863
|
-
throw new Error("allowed() requires either featureId or productId");
|
|
1864
|
-
}
|
|
1865
|
-
let result;
|
|
1866
|
-
if (params.featureId)
|
|
1867
|
-
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1868
|
-
if (params.productId)
|
|
1869
|
-
result = handleProductCheck({ customer, params, isEntity });
|
|
1870
|
-
return {
|
|
1871
|
-
data: result,
|
|
1872
|
-
error: null
|
|
1873
|
-
};
|
|
1874
|
-
};
|
|
1875
|
-
|
|
1876
1843
|
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
1877
1844
|
var useCustomerBase = ({
|
|
1878
1845
|
params,
|
|
@@ -1889,7 +1856,7 @@ var useCustomerBase = ({
|
|
|
1889
1856
|
if (!client) {
|
|
1890
1857
|
client = context.client;
|
|
1891
1858
|
}
|
|
1892
|
-
|
|
1859
|
+
const baseUrl = client?.backendUrl || "";
|
|
1893
1860
|
const queryKey = ["customer", baseUrl, params?.expand];
|
|
1894
1861
|
const fetchCustomer = async () => {
|
|
1895
1862
|
const { data, error: error2 } = await client.createCustomer({
|
|
@@ -1910,11 +1877,10 @@ var useCustomerBase = ({
|
|
|
1910
1877
|
isLoading,
|
|
1911
1878
|
mutate
|
|
1912
1879
|
} = (0, import_swr2.default)(queryKey, fetchCustomer, {
|
|
1913
|
-
fallbackData: null,
|
|
1914
1880
|
// Default to 5 minutes
|
|
1881
|
+
fallbackData: null,
|
|
1915
1882
|
swrConfig: {
|
|
1916
1883
|
shouldRetryOnError: false,
|
|
1917
|
-
// refreshInterval: 1000 * 60 * 5,
|
|
1918
1884
|
refreshInterval: 0,
|
|
1919
1885
|
...params?.swrConfig
|
|
1920
1886
|
}
|
|
@@ -1924,8 +1890,6 @@ var useCustomerBase = ({
|
|
|
1924
1890
|
client,
|
|
1925
1891
|
refetchCustomer: mutate
|
|
1926
1892
|
});
|
|
1927
|
-
(0, import_react3.useEffect)(() => {
|
|
1928
|
-
}, [context?.paywallRef.current]);
|
|
1929
1893
|
return {
|
|
1930
1894
|
customer: error ? null : customer,
|
|
1931
1895
|
isLoading,
|
|
@@ -1980,7 +1944,7 @@ var usePricingTable = (params) => {
|
|
|
1980
1944
|
|
|
1981
1945
|
// src/libraries/react/hooks/useEntityBase.tsx
|
|
1982
1946
|
var import_swr3 = __toESM(require("swr"));
|
|
1983
|
-
var
|
|
1947
|
+
var import_react5 = require("react");
|
|
1984
1948
|
|
|
1985
1949
|
// src/libraries/react/hooks/useAnalytics.tsx
|
|
1986
1950
|
var import_swr4 = __toESM(require("swr"));
|
|
@@ -1989,21 +1953,21 @@ var import_swr4 = __toESM(require("swr"));
|
|
|
1989
1953
|
var import_swr5 = __toESM(require("swr"));
|
|
1990
1954
|
|
|
1991
1955
|
// ../node_modules/.pnpm/@radix-ui+react-accordion@1.2.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@1_rikqbnzk4rayqkcryhydcdufbu/node_modules/@radix-ui/react-accordion/dist/index.mjs
|
|
1992
|
-
var
|
|
1956
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
1993
1957
|
|
|
1994
1958
|
// ../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
1995
|
-
var
|
|
1959
|
+
var React2 = __toESM(require("react"), 1);
|
|
1996
1960
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1997
1961
|
function createContext22(rootComponentName, defaultContext) {
|
|
1998
|
-
const Context =
|
|
1962
|
+
const Context = React2.createContext(defaultContext);
|
|
1999
1963
|
const Provider = (props) => {
|
|
2000
1964
|
const { children, ...context } = props;
|
|
2001
|
-
const value =
|
|
1965
|
+
const value = React2.useMemo(() => context, Object.values(context));
|
|
2002
1966
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Context.Provider, { value, children });
|
|
2003
1967
|
};
|
|
2004
1968
|
Provider.displayName = rootComponentName + "Provider";
|
|
2005
1969
|
function useContext22(consumerName) {
|
|
2006
|
-
const context =
|
|
1970
|
+
const context = React2.useContext(Context);
|
|
2007
1971
|
if (context) return context;
|
|
2008
1972
|
if (defaultContext !== void 0) return defaultContext;
|
|
2009
1973
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2013,19 +1977,19 @@ function createContext22(rootComponentName, defaultContext) {
|
|
|
2013
1977
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
2014
1978
|
let defaultContexts = [];
|
|
2015
1979
|
function createContext32(rootComponentName, defaultContext) {
|
|
2016
|
-
const BaseContext =
|
|
1980
|
+
const BaseContext = React2.createContext(defaultContext);
|
|
2017
1981
|
const index2 = defaultContexts.length;
|
|
2018
1982
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
2019
1983
|
const Provider = (props) => {
|
|
2020
1984
|
const { scope, children, ...context } = props;
|
|
2021
1985
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
2022
|
-
const value =
|
|
1986
|
+
const value = React2.useMemo(() => context, Object.values(context));
|
|
2023
1987
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Context.Provider, { value, children });
|
|
2024
1988
|
};
|
|
2025
1989
|
Provider.displayName = rootComponentName + "Provider";
|
|
2026
1990
|
function useContext22(consumerName, scope) {
|
|
2027
1991
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
2028
|
-
const context =
|
|
1992
|
+
const context = React2.useContext(Context);
|
|
2029
1993
|
if (context) return context;
|
|
2030
1994
|
if (defaultContext !== void 0) return defaultContext;
|
|
2031
1995
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -2034,11 +1998,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
2034
1998
|
}
|
|
2035
1999
|
const createScope = () => {
|
|
2036
2000
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2037
|
-
return
|
|
2001
|
+
return React2.createContext(defaultContext);
|
|
2038
2002
|
});
|
|
2039
2003
|
return function useScope(scope) {
|
|
2040
2004
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
2041
|
-
return
|
|
2005
|
+
return React2.useMemo(
|
|
2042
2006
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
2043
2007
|
[scope, contexts]
|
|
2044
2008
|
);
|
|
@@ -2061,7 +2025,7 @@ function composeContextScopes(...scopes) {
|
|
|
2061
2025
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
2062
2026
|
return { ...nextScopes2, ...currentScope };
|
|
2063
2027
|
}, {});
|
|
2064
|
-
return
|
|
2028
|
+
return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2065
2029
|
};
|
|
2066
2030
|
};
|
|
2067
2031
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -2069,10 +2033,10 @@ function composeContextScopes(...scopes) {
|
|
|
2069
2033
|
}
|
|
2070
2034
|
|
|
2071
2035
|
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@1_fj4gprouy7cllhpzda3tfrvhzi/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2072
|
-
var
|
|
2036
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
2073
2037
|
|
|
2074
2038
|
// ../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
2075
|
-
var
|
|
2039
|
+
var React3 = __toESM(require("react"), 1);
|
|
2076
2040
|
function setRef(ref, value) {
|
|
2077
2041
|
if (typeof ref === "function") {
|
|
2078
2042
|
return ref(value);
|
|
@@ -2105,30 +2069,30 @@ function composeRefs(...refs) {
|
|
|
2105
2069
|
};
|
|
2106
2070
|
}
|
|
2107
2071
|
function useComposedRefs(...refs) {
|
|
2108
|
-
return
|
|
2072
|
+
return React3.useCallback(composeRefs(...refs), refs);
|
|
2109
2073
|
}
|
|
2110
2074
|
|
|
2111
2075
|
// ../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2112
|
-
var
|
|
2076
|
+
var React4 = __toESM(require("react"), 1);
|
|
2113
2077
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2114
2078
|
// @__NO_SIDE_EFFECTS__
|
|
2115
2079
|
function createSlot(ownerName) {
|
|
2116
2080
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
2117
|
-
const Slot22 =
|
|
2081
|
+
const Slot22 = React4.forwardRef((props, forwardedRef) => {
|
|
2118
2082
|
const { children, ...slotProps } = props;
|
|
2119
|
-
const childrenArray =
|
|
2083
|
+
const childrenArray = React4.Children.toArray(children);
|
|
2120
2084
|
const slottable = childrenArray.find(isSlottable);
|
|
2121
2085
|
if (slottable) {
|
|
2122
2086
|
const newElement = slottable.props.children;
|
|
2123
2087
|
const newChildren = childrenArray.map((child) => {
|
|
2124
2088
|
if (child === slottable) {
|
|
2125
|
-
if (
|
|
2126
|
-
return
|
|
2089
|
+
if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
|
|
2090
|
+
return React4.isValidElement(newElement) ? newElement.props.children : null;
|
|
2127
2091
|
} else {
|
|
2128
2092
|
return child;
|
|
2129
2093
|
}
|
|
2130
2094
|
});
|
|
2131
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
2095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
|
|
2132
2096
|
}
|
|
2133
2097
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
2134
2098
|
});
|
|
@@ -2138,24 +2102,24 @@ function createSlot(ownerName) {
|
|
|
2138
2102
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
2139
2103
|
// @__NO_SIDE_EFFECTS__
|
|
2140
2104
|
function createSlotClone(ownerName) {
|
|
2141
|
-
const SlotClone =
|
|
2105
|
+
const SlotClone = React4.forwardRef((props, forwardedRef) => {
|
|
2142
2106
|
const { children, ...slotProps } = props;
|
|
2143
|
-
if (
|
|
2107
|
+
if (React4.isValidElement(children)) {
|
|
2144
2108
|
const childrenRef = getElementRef(children);
|
|
2145
2109
|
const props2 = mergeProps(slotProps, children.props);
|
|
2146
|
-
if (children.type !==
|
|
2110
|
+
if (children.type !== React4.Fragment) {
|
|
2147
2111
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
2148
2112
|
}
|
|
2149
|
-
return
|
|
2113
|
+
return React4.cloneElement(children, props2);
|
|
2150
2114
|
}
|
|
2151
|
-
return
|
|
2115
|
+
return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
|
|
2152
2116
|
});
|
|
2153
2117
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
2154
2118
|
return SlotClone;
|
|
2155
2119
|
}
|
|
2156
2120
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
2157
2121
|
function isSlottable(child) {
|
|
2158
|
-
return
|
|
2122
|
+
return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2159
2123
|
}
|
|
2160
2124
|
function mergeProps(slotProps, childProps) {
|
|
2161
2125
|
const overrideProps = { ...childProps };
|
|
@@ -2197,7 +2161,7 @@ function getElementRef(element) {
|
|
|
2197
2161
|
|
|
2198
2162
|
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@1_fj4gprouy7cllhpzda3tfrvhzi/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2199
2163
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2200
|
-
var
|
|
2164
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
2201
2165
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2202
2166
|
function createCollection(name) {
|
|
2203
2167
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
@@ -2208,14 +2172,14 @@ function createCollection(name) {
|
|
|
2208
2172
|
);
|
|
2209
2173
|
const CollectionProvider = (props) => {
|
|
2210
2174
|
const { scope, children } = props;
|
|
2211
|
-
const ref =
|
|
2212
|
-
const itemMap =
|
|
2175
|
+
const ref = import_react6.default.useRef(null);
|
|
2176
|
+
const itemMap = import_react6.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
2213
2177
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
2214
2178
|
};
|
|
2215
2179
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2216
2180
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2217
2181
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
2218
|
-
const CollectionSlot =
|
|
2182
|
+
const CollectionSlot = import_react6.default.forwardRef(
|
|
2219
2183
|
(props, forwardedRef) => {
|
|
2220
2184
|
const { scope, children } = props;
|
|
2221
2185
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -2227,13 +2191,13 @@ function createCollection(name) {
|
|
|
2227
2191
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2228
2192
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2229
2193
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
2230
|
-
const CollectionItemSlot =
|
|
2194
|
+
const CollectionItemSlot = import_react6.default.forwardRef(
|
|
2231
2195
|
(props, forwardedRef) => {
|
|
2232
2196
|
const { scope, children, ...itemData } = props;
|
|
2233
|
-
const ref =
|
|
2197
|
+
const ref = import_react6.default.useRef(null);
|
|
2234
2198
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2235
2199
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2236
|
-
|
|
2200
|
+
import_react6.default.useEffect(() => {
|
|
2237
2201
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
2238
2202
|
return () => void context.itemMap.delete(ref);
|
|
2239
2203
|
});
|
|
@@ -2243,7 +2207,7 @@ function createCollection(name) {
|
|
|
2243
2207
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
2244
2208
|
function useCollection2(scope) {
|
|
2245
2209
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2246
|
-
const getItems =
|
|
2210
|
+
const getItems = import_react6.default.useCallback(() => {
|
|
2247
2211
|
const collectionNode = context.collectionRef.current;
|
|
2248
2212
|
if (!collectionNode) return [];
|
|
2249
2213
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -2273,16 +2237,16 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
2273
2237
|
}
|
|
2274
2238
|
|
|
2275
2239
|
// ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2276
|
-
var
|
|
2240
|
+
var React7 = __toESM(require("react"), 1);
|
|
2277
2241
|
|
|
2278
2242
|
// ../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
2279
|
-
var
|
|
2280
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
2243
|
+
var React6 = __toESM(require("react"), 1);
|
|
2244
|
+
var useLayoutEffect2 = globalThis?.document ? React6.useLayoutEffect : () => {
|
|
2281
2245
|
};
|
|
2282
2246
|
|
|
2283
2247
|
// ../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2284
2248
|
var React23 = __toESM(require("react"), 1);
|
|
2285
|
-
var useInsertionEffect =
|
|
2249
|
+
var useInsertionEffect = React7[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
2286
2250
|
function useControllableState({
|
|
2287
2251
|
prop,
|
|
2288
2252
|
defaultProp,
|
|
@@ -2297,8 +2261,8 @@ function useControllableState({
|
|
|
2297
2261
|
const isControlled = prop !== void 0;
|
|
2298
2262
|
const value = isControlled ? prop : uncontrolledProp;
|
|
2299
2263
|
if (true) {
|
|
2300
|
-
const isControlledRef =
|
|
2301
|
-
|
|
2264
|
+
const isControlledRef = React7.useRef(prop !== void 0);
|
|
2265
|
+
React7.useEffect(() => {
|
|
2302
2266
|
const wasControlled = isControlledRef.current;
|
|
2303
2267
|
if (wasControlled !== isControlled) {
|
|
2304
2268
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -2310,7 +2274,7 @@ function useControllableState({
|
|
|
2310
2274
|
isControlledRef.current = isControlled;
|
|
2311
2275
|
}, [isControlled, caller]);
|
|
2312
2276
|
}
|
|
2313
|
-
const setValue =
|
|
2277
|
+
const setValue = React7.useCallback(
|
|
2314
2278
|
(nextValue) => {
|
|
2315
2279
|
if (isControlled) {
|
|
2316
2280
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -2329,13 +2293,13 @@ function useUncontrolledState({
|
|
|
2329
2293
|
defaultProp,
|
|
2330
2294
|
onChange
|
|
2331
2295
|
}) {
|
|
2332
|
-
const [value, setValue] =
|
|
2333
|
-
const prevValueRef =
|
|
2334
|
-
const onChangeRef =
|
|
2296
|
+
const [value, setValue] = React7.useState(defaultProp);
|
|
2297
|
+
const prevValueRef = React7.useRef(value);
|
|
2298
|
+
const onChangeRef = React7.useRef(onChange);
|
|
2335
2299
|
useInsertionEffect(() => {
|
|
2336
2300
|
onChangeRef.current = onChange;
|
|
2337
2301
|
}, [onChange]);
|
|
2338
|
-
|
|
2302
|
+
React7.useEffect(() => {
|
|
2339
2303
|
if (prevValueRef.current !== value) {
|
|
2340
2304
|
onChangeRef.current?.(value);
|
|
2341
2305
|
prevValueRef.current = value;
|
|
@@ -2349,7 +2313,7 @@ function isFunction(value) {
|
|
|
2349
2313
|
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
2350
2314
|
|
|
2351
2315
|
// ../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19_xx37pthzbhildnk4zsozp4vigu/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2352
|
-
var
|
|
2316
|
+
var React8 = __toESM(require("react"), 1);
|
|
2353
2317
|
var ReactDOM = __toESM(require("react-dom"), 1);
|
|
2354
2318
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2355
2319
|
var NODES = [
|
|
@@ -2373,7 +2337,7 @@ var NODES = [
|
|
|
2373
2337
|
];
|
|
2374
2338
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
2375
2339
|
const Slot4 = createSlot(`Primitive.${node}`);
|
|
2376
|
-
const Node2 =
|
|
2340
|
+
const Node2 = React8.forwardRef((props, forwardedRef) => {
|
|
2377
2341
|
const { asChild, ...primitiveProps } = props;
|
|
2378
2342
|
const Comp = asChild ? Slot4 : node;
|
|
2379
2343
|
if (typeof window !== "undefined") {
|
|
@@ -2389,13 +2353,13 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
2389
2353
|
}
|
|
2390
2354
|
|
|
2391
2355
|
// ../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react_62ff4xakccgppayw3kaahenns4/node_modules/@radix-ui/react-collapsible/dist/index.mjs
|
|
2392
|
-
var
|
|
2356
|
+
var React11 = __toESM(require("react"), 1);
|
|
2393
2357
|
|
|
2394
2358
|
// ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19._m54kvncv6il6p2flbkd4qzvije/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
2395
2359
|
var React24 = __toESM(require("react"), 1);
|
|
2396
|
-
var
|
|
2360
|
+
var React9 = __toESM(require("react"), 1);
|
|
2397
2361
|
function useStateMachine(initialState, machine) {
|
|
2398
|
-
return
|
|
2362
|
+
return React9.useReducer((state, event) => {
|
|
2399
2363
|
const nextState = machine[state][event];
|
|
2400
2364
|
return nextState ?? state;
|
|
2401
2365
|
}, initialState);
|
|
@@ -2518,11 +2482,11 @@ function getElementRef2(element) {
|
|
|
2518
2482
|
}
|
|
2519
2483
|
|
|
2520
2484
|
// ../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
2521
|
-
var
|
|
2522
|
-
var useReactId =
|
|
2485
|
+
var React10 = __toESM(require("react"), 1);
|
|
2486
|
+
var useReactId = React10[" useId ".trim().toString()] || (() => void 0);
|
|
2523
2487
|
var count = 0;
|
|
2524
2488
|
function useId(deterministicId) {
|
|
2525
|
-
const [id, setId] =
|
|
2489
|
+
const [id, setId] = React10.useState(useReactId());
|
|
2526
2490
|
useLayoutEffect2(() => {
|
|
2527
2491
|
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
2528
2492
|
}, [deterministicId]);
|
|
@@ -2534,7 +2498,7 @@ var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
|
2534
2498
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
2535
2499
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
2536
2500
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
2537
|
-
var Collapsible =
|
|
2501
|
+
var Collapsible = React11.forwardRef(
|
|
2538
2502
|
(props, forwardedRef) => {
|
|
2539
2503
|
const {
|
|
2540
2504
|
__scopeCollapsible,
|
|
@@ -2557,7 +2521,7 @@ var Collapsible = React12.forwardRef(
|
|
|
2557
2521
|
disabled,
|
|
2558
2522
|
contentId: useId(),
|
|
2559
2523
|
open,
|
|
2560
|
-
onOpenToggle:
|
|
2524
|
+
onOpenToggle: React11.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
2561
2525
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2562
2526
|
Primitive.div,
|
|
2563
2527
|
{
|
|
@@ -2573,7 +2537,7 @@ var Collapsible = React12.forwardRef(
|
|
|
2573
2537
|
);
|
|
2574
2538
|
Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
2575
2539
|
var TRIGGER_NAME = "CollapsibleTrigger";
|
|
2576
|
-
var CollapsibleTrigger =
|
|
2540
|
+
var CollapsibleTrigger = React11.forwardRef(
|
|
2577
2541
|
(props, forwardedRef) => {
|
|
2578
2542
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
2579
2543
|
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
@@ -2595,7 +2559,7 @@ var CollapsibleTrigger = React12.forwardRef(
|
|
|
2595
2559
|
);
|
|
2596
2560
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
2597
2561
|
var CONTENT_NAME = "CollapsibleContent";
|
|
2598
|
-
var CollapsibleContent =
|
|
2562
|
+
var CollapsibleContent = React11.forwardRef(
|
|
2599
2563
|
(props, forwardedRef) => {
|
|
2600
2564
|
const { forceMount, ...contentProps } = props;
|
|
2601
2565
|
const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);
|
|
@@ -2603,20 +2567,20 @@ var CollapsibleContent = React12.forwardRef(
|
|
|
2603
2567
|
}
|
|
2604
2568
|
);
|
|
2605
2569
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
2606
|
-
var CollapsibleContentImpl =
|
|
2570
|
+
var CollapsibleContentImpl = React11.forwardRef((props, forwardedRef) => {
|
|
2607
2571
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
2608
2572
|
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
2609
|
-
const [isPresent, setIsPresent] =
|
|
2610
|
-
const ref =
|
|
2573
|
+
const [isPresent, setIsPresent] = React11.useState(present);
|
|
2574
|
+
const ref = React11.useRef(null);
|
|
2611
2575
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2612
|
-
const heightRef =
|
|
2576
|
+
const heightRef = React11.useRef(0);
|
|
2613
2577
|
const height = heightRef.current;
|
|
2614
|
-
const widthRef =
|
|
2578
|
+
const widthRef = React11.useRef(0);
|
|
2615
2579
|
const width = widthRef.current;
|
|
2616
2580
|
const isOpen = context.open || isPresent;
|
|
2617
|
-
const isMountAnimationPreventedRef =
|
|
2618
|
-
const originalStylesRef =
|
|
2619
|
-
|
|
2581
|
+
const isMountAnimationPreventedRef = React11.useRef(isOpen);
|
|
2582
|
+
const originalStylesRef = React11.useRef(void 0);
|
|
2583
|
+
React11.useEffect(() => {
|
|
2620
2584
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
2621
2585
|
return () => cancelAnimationFrame(rAF);
|
|
2622
2586
|
}, []);
|
|
@@ -2665,11 +2629,11 @@ var Trigger = CollapsibleTrigger;
|
|
|
2665
2629
|
var Content = CollapsibleContent;
|
|
2666
2630
|
|
|
2667
2631
|
// ../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
2668
|
-
var
|
|
2632
|
+
var React12 = __toESM(require("react"), 1);
|
|
2669
2633
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2670
|
-
var DirectionContext =
|
|
2634
|
+
var DirectionContext = React12.createContext(void 0);
|
|
2671
2635
|
function useDirection(localDir) {
|
|
2672
|
-
const globalDir =
|
|
2636
|
+
const globalDir = React12.useContext(DirectionContext);
|
|
2673
2637
|
return localDir || globalDir || "ltr";
|
|
2674
2638
|
}
|
|
2675
2639
|
|
|
@@ -2683,7 +2647,7 @@ var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDIO
|
|
|
2683
2647
|
createCollapsibleScope
|
|
2684
2648
|
]);
|
|
2685
2649
|
var useCollapsibleScope = createCollapsibleScope();
|
|
2686
|
-
var Accordion =
|
|
2650
|
+
var Accordion = import_react8.default.forwardRef(
|
|
2687
2651
|
(props, forwardedRef) => {
|
|
2688
2652
|
const { type, ...accordionProps } = props;
|
|
2689
2653
|
const singleProps = accordionProps;
|
|
@@ -2697,7 +2661,7 @@ var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccor
|
|
|
2697
2661
|
ACCORDION_NAME,
|
|
2698
2662
|
{ collapsible: false }
|
|
2699
2663
|
);
|
|
2700
|
-
var AccordionImplSingle =
|
|
2664
|
+
var AccordionImplSingle = import_react8.default.forwardRef(
|
|
2701
2665
|
(props, forwardedRef) => {
|
|
2702
2666
|
const {
|
|
2703
2667
|
value: valueProp,
|
|
@@ -2717,15 +2681,15 @@ var AccordionImplSingle = import_react9.default.forwardRef(
|
|
|
2717
2681
|
AccordionValueProvider,
|
|
2718
2682
|
{
|
|
2719
2683
|
scope: props.__scopeAccordion,
|
|
2720
|
-
value:
|
|
2684
|
+
value: import_react8.default.useMemo(() => value ? [value] : [], [value]),
|
|
2721
2685
|
onItemOpen: setValue,
|
|
2722
|
-
onItemClose:
|
|
2686
|
+
onItemClose: import_react8.default.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
2723
2687
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
2724
2688
|
}
|
|
2725
2689
|
);
|
|
2726
2690
|
}
|
|
2727
2691
|
);
|
|
2728
|
-
var AccordionImplMultiple =
|
|
2692
|
+
var AccordionImplMultiple = import_react8.default.forwardRef((props, forwardedRef) => {
|
|
2729
2693
|
const {
|
|
2730
2694
|
value: valueProp,
|
|
2731
2695
|
defaultValue,
|
|
@@ -2739,11 +2703,11 @@ var AccordionImplMultiple = import_react9.default.forwardRef((props, forwardedRe
|
|
|
2739
2703
|
onChange: onValueChange,
|
|
2740
2704
|
caller: ACCORDION_NAME
|
|
2741
2705
|
});
|
|
2742
|
-
const handleItemOpen =
|
|
2706
|
+
const handleItemOpen = import_react8.default.useCallback(
|
|
2743
2707
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
2744
2708
|
[setValue]
|
|
2745
2709
|
);
|
|
2746
|
-
const handleItemClose =
|
|
2710
|
+
const handleItemClose = import_react8.default.useCallback(
|
|
2747
2711
|
(itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
|
|
2748
2712
|
[setValue]
|
|
2749
2713
|
);
|
|
@@ -2759,10 +2723,10 @@ var AccordionImplMultiple = import_react9.default.forwardRef((props, forwardedRe
|
|
|
2759
2723
|
);
|
|
2760
2724
|
});
|
|
2761
2725
|
var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
|
|
2762
|
-
var AccordionImpl =
|
|
2726
|
+
var AccordionImpl = import_react8.default.forwardRef(
|
|
2763
2727
|
(props, forwardedRef) => {
|
|
2764
2728
|
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
|
2765
|
-
const accordionRef =
|
|
2729
|
+
const accordionRef = import_react8.default.useRef(null);
|
|
2766
2730
|
const composedRefs = useComposedRefs(accordionRef, forwardedRef);
|
|
2767
2731
|
const getItems = useCollection(__scopeAccordion);
|
|
2768
2732
|
const direction = useDirection(dir);
|
|
@@ -2851,7 +2815,7 @@ var AccordionImpl = import_react9.default.forwardRef(
|
|
|
2851
2815
|
);
|
|
2852
2816
|
var ITEM_NAME = "AccordionItem";
|
|
2853
2817
|
var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);
|
|
2854
|
-
var AccordionItem =
|
|
2818
|
+
var AccordionItem = import_react8.default.forwardRef(
|
|
2855
2819
|
(props, forwardedRef) => {
|
|
2856
2820
|
const { __scopeAccordion, value, ...accordionItemProps } = props;
|
|
2857
2821
|
const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);
|
|
@@ -2892,7 +2856,7 @@ var AccordionItem = import_react9.default.forwardRef(
|
|
|
2892
2856
|
);
|
|
2893
2857
|
AccordionItem.displayName = ITEM_NAME;
|
|
2894
2858
|
var HEADER_NAME = "AccordionHeader";
|
|
2895
|
-
var AccordionHeader =
|
|
2859
|
+
var AccordionHeader = import_react8.default.forwardRef(
|
|
2896
2860
|
(props, forwardedRef) => {
|
|
2897
2861
|
const { __scopeAccordion, ...headerProps } = props;
|
|
2898
2862
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -2911,7 +2875,7 @@ var AccordionHeader = import_react9.default.forwardRef(
|
|
|
2911
2875
|
);
|
|
2912
2876
|
AccordionHeader.displayName = HEADER_NAME;
|
|
2913
2877
|
var TRIGGER_NAME2 = "AccordionTrigger";
|
|
2914
|
-
var AccordionTrigger =
|
|
2878
|
+
var AccordionTrigger = import_react8.default.forwardRef(
|
|
2915
2879
|
(props, forwardedRef) => {
|
|
2916
2880
|
const { __scopeAccordion, ...triggerProps } = props;
|
|
2917
2881
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -2933,7 +2897,7 @@ var AccordionTrigger = import_react9.default.forwardRef(
|
|
|
2933
2897
|
);
|
|
2934
2898
|
AccordionTrigger.displayName = TRIGGER_NAME2;
|
|
2935
2899
|
var CONTENT_NAME2 = "AccordionContent";
|
|
2936
|
-
var AccordionContent =
|
|
2900
|
+
var AccordionContent = import_react8.default.forwardRef(
|
|
2937
2901
|
(props, forwardedRef) => {
|
|
2938
2902
|
const { __scopeAccordion, ...contentProps } = props;
|
|
2939
2903
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
@@ -2968,7 +2932,7 @@ var Trigger2 = AccordionTrigger;
|
|
|
2968
2932
|
var Content2 = AccordionContent;
|
|
2969
2933
|
|
|
2970
2934
|
// src/libraries/react/components/checkout-dialog/checkout-dialog-synced.tsx
|
|
2971
|
-
var
|
|
2935
|
+
var import_react13 = require("react");
|
|
2972
2936
|
|
|
2973
2937
|
// ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
2974
2938
|
function r(e) {
|
|
@@ -5496,7 +5460,7 @@ function cn(...inputs) {
|
|
|
5496
5460
|
}
|
|
5497
5461
|
|
|
5498
5462
|
// src/libraries/react/components/ui/button.tsx
|
|
5499
|
-
var
|
|
5463
|
+
var React14 = __toESM(require("react"));
|
|
5500
5464
|
|
|
5501
5465
|
// ../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
5502
5466
|
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
@@ -5567,7 +5531,7 @@ var buttonVariants = cva(
|
|
|
5567
5531
|
}
|
|
5568
5532
|
}
|
|
5569
5533
|
);
|
|
5570
|
-
var Button =
|
|
5534
|
+
var Button = React14.forwardRef(
|
|
5571
5535
|
({ className, variant, size: size4, asChild = false, ...props }, ref) => {
|
|
5572
5536
|
const Comp = asChild ? Slot : "button";
|
|
5573
5537
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -5583,29 +5547,29 @@ var Button = React15.forwardRef(
|
|
|
5583
5547
|
Button.displayName = "Button";
|
|
5584
5548
|
|
|
5585
5549
|
// src/libraries/react/components/ui/dialog.tsx
|
|
5586
|
-
var
|
|
5550
|
+
var React32 = __toESM(require("react"));
|
|
5587
5551
|
|
|
5588
5552
|
// ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1_7xipnhxsrwjfttlgycirhttgoi/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
5589
|
-
var
|
|
5553
|
+
var React31 = __toESM(require("react"), 1);
|
|
5590
5554
|
|
|
5591
5555
|
// ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.9_@types+react@19.1.10__@types_recfemx4gbocxquotpq6g6r6si/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
5592
|
-
var
|
|
5556
|
+
var React17 = __toESM(require("react"), 1);
|
|
5593
5557
|
|
|
5594
5558
|
// ../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
5595
|
-
var
|
|
5559
|
+
var React15 = __toESM(require("react"), 1);
|
|
5596
5560
|
function useCallbackRef(callback) {
|
|
5597
|
-
const callbackRef =
|
|
5598
|
-
|
|
5561
|
+
const callbackRef = React15.useRef(callback);
|
|
5562
|
+
React15.useEffect(() => {
|
|
5599
5563
|
callbackRef.current = callback;
|
|
5600
5564
|
});
|
|
5601
|
-
return
|
|
5565
|
+
return React15.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
5602
5566
|
}
|
|
5603
5567
|
|
|
5604
5568
|
// ../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
5605
|
-
var
|
|
5569
|
+
var React16 = __toESM(require("react"), 1);
|
|
5606
5570
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
5607
5571
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
5608
|
-
|
|
5572
|
+
React16.useEffect(() => {
|
|
5609
5573
|
const handleKeyDown = (event) => {
|
|
5610
5574
|
if (event.key === "Escape") {
|
|
5611
5575
|
onEscapeKeyDown(event);
|
|
@@ -5623,12 +5587,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
5623
5587
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
5624
5588
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
5625
5589
|
var originalBodyPointerEvents;
|
|
5626
|
-
var DismissableLayerContext =
|
|
5590
|
+
var DismissableLayerContext = React17.createContext({
|
|
5627
5591
|
layers: /* @__PURE__ */ new Set(),
|
|
5628
5592
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
5629
5593
|
branches: /* @__PURE__ */ new Set()
|
|
5630
5594
|
});
|
|
5631
|
-
var DismissableLayer =
|
|
5595
|
+
var DismissableLayer = React17.forwardRef(
|
|
5632
5596
|
(props, forwardedRef) => {
|
|
5633
5597
|
const {
|
|
5634
5598
|
disableOutsidePointerEvents = false,
|
|
@@ -5639,10 +5603,10 @@ var DismissableLayer = React18.forwardRef(
|
|
|
5639
5603
|
onDismiss,
|
|
5640
5604
|
...layerProps
|
|
5641
5605
|
} = props;
|
|
5642
|
-
const context =
|
|
5643
|
-
const [node, setNode] =
|
|
5606
|
+
const context = React17.useContext(DismissableLayerContext);
|
|
5607
|
+
const [node, setNode] = React17.useState(null);
|
|
5644
5608
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
5645
|
-
const [, force] =
|
|
5609
|
+
const [, force] = React17.useState({});
|
|
5646
5610
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
5647
5611
|
const layers = Array.from(context.layers);
|
|
5648
5612
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -5675,7 +5639,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
5675
5639
|
onDismiss();
|
|
5676
5640
|
}
|
|
5677
5641
|
}, ownerDocument);
|
|
5678
|
-
|
|
5642
|
+
React17.useEffect(() => {
|
|
5679
5643
|
if (!node) return;
|
|
5680
5644
|
if (disableOutsidePointerEvents) {
|
|
5681
5645
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -5692,7 +5656,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
5692
5656
|
}
|
|
5693
5657
|
};
|
|
5694
5658
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
5695
|
-
|
|
5659
|
+
React17.useEffect(() => {
|
|
5696
5660
|
return () => {
|
|
5697
5661
|
if (!node) return;
|
|
5698
5662
|
context.layers.delete(node);
|
|
@@ -5700,7 +5664,7 @@ var DismissableLayer = React18.forwardRef(
|
|
|
5700
5664
|
dispatchUpdate();
|
|
5701
5665
|
};
|
|
5702
5666
|
}, [node, context]);
|
|
5703
|
-
|
|
5667
|
+
React17.useEffect(() => {
|
|
5704
5668
|
const handleUpdate = () => force({});
|
|
5705
5669
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
5706
5670
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -5726,11 +5690,11 @@ var DismissableLayer = React18.forwardRef(
|
|
|
5726
5690
|
);
|
|
5727
5691
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
5728
5692
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
5729
|
-
var DismissableLayerBranch =
|
|
5730
|
-
const context =
|
|
5731
|
-
const ref =
|
|
5693
|
+
var DismissableLayerBranch = React17.forwardRef((props, forwardedRef) => {
|
|
5694
|
+
const context = React17.useContext(DismissableLayerContext);
|
|
5695
|
+
const ref = React17.useRef(null);
|
|
5732
5696
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
5733
|
-
|
|
5697
|
+
React17.useEffect(() => {
|
|
5734
5698
|
const node = ref.current;
|
|
5735
5699
|
if (node) {
|
|
5736
5700
|
context.branches.add(node);
|
|
@@ -5744,10 +5708,10 @@ var DismissableLayerBranch = React18.forwardRef((props, forwardedRef) => {
|
|
|
5744
5708
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
5745
5709
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
5746
5710
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
5747
|
-
const isPointerInsideReactTreeRef =
|
|
5748
|
-
const handleClickRef =
|
|
5711
|
+
const isPointerInsideReactTreeRef = React17.useRef(false);
|
|
5712
|
+
const handleClickRef = React17.useRef(() => {
|
|
5749
5713
|
});
|
|
5750
|
-
|
|
5714
|
+
React17.useEffect(() => {
|
|
5751
5715
|
const handlePointerDown = (event) => {
|
|
5752
5716
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
5753
5717
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -5788,8 +5752,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
5788
5752
|
}
|
|
5789
5753
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
5790
5754
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
5791
|
-
const isFocusInsideReactTreeRef =
|
|
5792
|
-
|
|
5755
|
+
const isFocusInsideReactTreeRef = React17.useRef(false);
|
|
5756
|
+
React17.useEffect(() => {
|
|
5793
5757
|
const handleFocus = (event) => {
|
|
5794
5758
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
5795
5759
|
const eventDetail = { originalEvent: event };
|
|
@@ -5822,13 +5786,13 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
5822
5786
|
}
|
|
5823
5787
|
|
|
5824
5788
|
// ../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@_a6spdpnjpgxlsfsxwjh6tjh7gm/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
5825
|
-
var
|
|
5789
|
+
var React18 = __toESM(require("react"), 1);
|
|
5826
5790
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
5827
5791
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
5828
5792
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
5829
5793
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
5830
5794
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
5831
|
-
var FocusScope =
|
|
5795
|
+
var FocusScope = React18.forwardRef((props, forwardedRef) => {
|
|
5832
5796
|
const {
|
|
5833
5797
|
loop = false,
|
|
5834
5798
|
trapped = false,
|
|
@@ -5836,12 +5800,12 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
5836
5800
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
5837
5801
|
...scopeProps
|
|
5838
5802
|
} = props;
|
|
5839
|
-
const [container, setContainer] =
|
|
5803
|
+
const [container, setContainer] = React18.useState(null);
|
|
5840
5804
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
5841
5805
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
5842
|
-
const lastFocusedElementRef =
|
|
5806
|
+
const lastFocusedElementRef = React18.useRef(null);
|
|
5843
5807
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
5844
|
-
const focusScope =
|
|
5808
|
+
const focusScope = React18.useRef({
|
|
5845
5809
|
paused: false,
|
|
5846
5810
|
pause() {
|
|
5847
5811
|
this.paused = true;
|
|
@@ -5850,7 +5814,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
5850
5814
|
this.paused = false;
|
|
5851
5815
|
}
|
|
5852
5816
|
}).current;
|
|
5853
|
-
|
|
5817
|
+
React18.useEffect(() => {
|
|
5854
5818
|
if (trapped) {
|
|
5855
5819
|
let handleFocusIn2 = function(event) {
|
|
5856
5820
|
if (focusScope.paused || !container) return;
|
|
@@ -5886,7 +5850,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
5886
5850
|
};
|
|
5887
5851
|
}
|
|
5888
5852
|
}, [trapped, container, focusScope.paused]);
|
|
5889
|
-
|
|
5853
|
+
React18.useEffect(() => {
|
|
5890
5854
|
if (container) {
|
|
5891
5855
|
focusScopesStack.add(focusScope);
|
|
5892
5856
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -5917,7 +5881,7 @@ var FocusScope = React19.forwardRef((props, forwardedRef) => {
|
|
|
5917
5881
|
};
|
|
5918
5882
|
}
|
|
5919
5883
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
5920
|
-
const handleKeyDown =
|
|
5884
|
+
const handleKeyDown = React18.useCallback(
|
|
5921
5885
|
(event) => {
|
|
5922
5886
|
if (!loop && !trapped) return;
|
|
5923
5887
|
if (focusScope.paused) return;
|
|
@@ -6026,13 +5990,13 @@ function removeLinks(items) {
|
|
|
6026
5990
|
}
|
|
6027
5991
|
|
|
6028
5992
|
// ../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1._o5qf2sukaqjy2xztyed32jp6ia/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
6029
|
-
var
|
|
5993
|
+
var React19 = __toESM(require("react"), 1);
|
|
6030
5994
|
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
6031
5995
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6032
5996
|
var PORTAL_NAME = "Portal";
|
|
6033
|
-
var Portal =
|
|
5997
|
+
var Portal = React19.forwardRef((props, forwardedRef) => {
|
|
6034
5998
|
const { container: containerProp, ...portalProps } = props;
|
|
6035
|
-
const [mounted, setMounted] =
|
|
5999
|
+
const [mounted, setMounted] = React19.useState(false);
|
|
6036
6000
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6037
6001
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6038
6002
|
return container ? import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
@@ -6040,10 +6004,10 @@ var Portal = React20.forwardRef((props, forwardedRef) => {
|
|
|
6040
6004
|
Portal.displayName = PORTAL_NAME;
|
|
6041
6005
|
|
|
6042
6006
|
// ../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
6043
|
-
var
|
|
6007
|
+
var React20 = __toESM(require("react"), 1);
|
|
6044
6008
|
var count2 = 0;
|
|
6045
6009
|
function useFocusGuards() {
|
|
6046
|
-
|
|
6010
|
+
React20.useEffect(() => {
|
|
6047
6011
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
6048
6012
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
6049
6013
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -6100,10 +6064,10 @@ function __spreadArray(to, from, pack) {
|
|
|
6100
6064
|
}
|
|
6101
6065
|
|
|
6102
6066
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
6103
|
-
var
|
|
6067
|
+
var React30 = __toESM(require("react"));
|
|
6104
6068
|
|
|
6105
6069
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
6106
|
-
var
|
|
6070
|
+
var React26 = __toESM(require("react"));
|
|
6107
6071
|
|
|
6108
6072
|
// ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
6109
6073
|
var zeroRightClassName = "right-scroll-bar-position";
|
|
@@ -6122,9 +6086,9 @@ function assignRef(ref, value) {
|
|
|
6122
6086
|
}
|
|
6123
6087
|
|
|
6124
6088
|
// ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.10_react@19.1.1/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
6125
|
-
var
|
|
6089
|
+
var import_react9 = require("react");
|
|
6126
6090
|
function useCallbackRef2(initialValue, callback) {
|
|
6127
|
-
var ref = (0,
|
|
6091
|
+
var ref = (0, import_react9.useState)(function() {
|
|
6128
6092
|
return {
|
|
6129
6093
|
// value
|
|
6130
6094
|
value: initialValue,
|
|
@@ -6150,8 +6114,8 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6150
6114
|
}
|
|
6151
6115
|
|
|
6152
6116
|
// ../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.10_react@19.1.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
6153
|
-
var
|
|
6154
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
6117
|
+
var React21 = __toESM(require("react"));
|
|
6118
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React21.useLayoutEffect : React21.useEffect;
|
|
6155
6119
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6156
6120
|
function useMergeRefs(refs, defaultValue) {
|
|
6157
6121
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -6268,7 +6232,7 @@ function createSidecarMedium(options) {
|
|
|
6268
6232
|
}
|
|
6269
6233
|
|
|
6270
6234
|
// ../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.10_react@19.1.1/node_modules/use-sidecar/dist/es2015/exports.js
|
|
6271
|
-
var
|
|
6235
|
+
var React25 = __toESM(require("react"));
|
|
6272
6236
|
var SideCar = function(_a) {
|
|
6273
6237
|
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
6274
6238
|
if (!sideCar) {
|
|
@@ -6278,7 +6242,7 @@ var SideCar = function(_a) {
|
|
|
6278
6242
|
if (!Target) {
|
|
6279
6243
|
throw new Error("Sidecar medium not found");
|
|
6280
6244
|
}
|
|
6281
|
-
return
|
|
6245
|
+
return React25.createElement(Target, __assign({}, rest));
|
|
6282
6246
|
};
|
|
6283
6247
|
SideCar.isSideCarExport = true;
|
|
6284
6248
|
function exportSidecar(medium, exported) {
|
|
@@ -6293,9 +6257,9 @@ var effectCar = createSidecarMedium();
|
|
|
6293
6257
|
var nothing = function() {
|
|
6294
6258
|
return;
|
|
6295
6259
|
};
|
|
6296
|
-
var RemoveScroll =
|
|
6297
|
-
var ref =
|
|
6298
|
-
var _a =
|
|
6260
|
+
var RemoveScroll = React26.forwardRef(function(props, parentRef) {
|
|
6261
|
+
var ref = React26.useRef(null);
|
|
6262
|
+
var _a = React26.useState({
|
|
6299
6263
|
onScrollCapture: nothing,
|
|
6300
6264
|
onWheelCapture: nothing,
|
|
6301
6265
|
onTouchMoveCapture: nothing
|
|
@@ -6304,11 +6268,11 @@ var RemoveScroll = React27.forwardRef(function(props, parentRef) {
|
|
|
6304
6268
|
var SideCar2 = sideCar;
|
|
6305
6269
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
6306
6270
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
6307
|
-
return
|
|
6308
|
-
|
|
6271
|
+
return React26.createElement(
|
|
6272
|
+
React26.Fragment,
|
|
6309
6273
|
null,
|
|
6310
|
-
enabled &&
|
|
6311
|
-
forwardProps ?
|
|
6274
|
+
enabled && React26.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
6275
|
+
forwardProps ? React26.cloneElement(React26.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React26.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
6312
6276
|
);
|
|
6313
6277
|
});
|
|
6314
6278
|
RemoveScroll.defaultProps = {
|
|
@@ -6322,13 +6286,13 @@ RemoveScroll.classNames = {
|
|
|
6322
6286
|
};
|
|
6323
6287
|
|
|
6324
6288
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
6325
|
-
var
|
|
6289
|
+
var React29 = __toESM(require("react"));
|
|
6326
6290
|
|
|
6327
6291
|
// ../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
6328
|
-
var
|
|
6292
|
+
var React28 = __toESM(require("react"));
|
|
6329
6293
|
|
|
6330
6294
|
// ../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.10_react@19.1.1/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
6331
|
-
var
|
|
6295
|
+
var React27 = __toESM(require("react"));
|
|
6332
6296
|
|
|
6333
6297
|
// ../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
6334
6298
|
var currentNonce;
|
|
@@ -6392,7 +6356,7 @@ var stylesheetSingleton = function() {
|
|
|
6392
6356
|
var styleHookSingleton = function() {
|
|
6393
6357
|
var sheet = stylesheetSingleton();
|
|
6394
6358
|
return function(styles, isDynamic) {
|
|
6395
|
-
|
|
6359
|
+
React27.useEffect(function() {
|
|
6396
6360
|
sheet.add(styles);
|
|
6397
6361
|
return function() {
|
|
6398
6362
|
sheet.remove();
|
|
@@ -6466,7 +6430,7 @@ var getCurrentUseCounter = function() {
|
|
|
6466
6430
|
return isFinite(counter) ? counter : 0;
|
|
6467
6431
|
};
|
|
6468
6432
|
var useLockAttribute = function() {
|
|
6469
|
-
|
|
6433
|
+
React28.useEffect(function() {
|
|
6470
6434
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
6471
6435
|
return function() {
|
|
6472
6436
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -6481,10 +6445,10 @@ var useLockAttribute = function() {
|
|
|
6481
6445
|
var RemoveScrollBar = function(_a) {
|
|
6482
6446
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
6483
6447
|
useLockAttribute();
|
|
6484
|
-
var gap =
|
|
6448
|
+
var gap = React28.useMemo(function() {
|
|
6485
6449
|
return getGapWidth(gapMode);
|
|
6486
6450
|
}, [gapMode]);
|
|
6487
|
-
return
|
|
6451
|
+
return React28.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
6488
6452
|
};
|
|
6489
6453
|
|
|
6490
6454
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -6625,16 +6589,16 @@ var generateStyle = function(id) {
|
|
|
6625
6589
|
var idCounter = 0;
|
|
6626
6590
|
var lockStack = [];
|
|
6627
6591
|
function RemoveScrollSideCar(props) {
|
|
6628
|
-
var shouldPreventQueue =
|
|
6629
|
-
var touchStartRef =
|
|
6630
|
-
var activeAxis =
|
|
6631
|
-
var id =
|
|
6632
|
-
var Style2 =
|
|
6633
|
-
var lastProps =
|
|
6634
|
-
|
|
6592
|
+
var shouldPreventQueue = React29.useRef([]);
|
|
6593
|
+
var touchStartRef = React29.useRef([0, 0]);
|
|
6594
|
+
var activeAxis = React29.useRef();
|
|
6595
|
+
var id = React29.useState(idCounter++)[0];
|
|
6596
|
+
var Style2 = React29.useState(styleSingleton)[0];
|
|
6597
|
+
var lastProps = React29.useRef(props);
|
|
6598
|
+
React29.useEffect(function() {
|
|
6635
6599
|
lastProps.current = props;
|
|
6636
6600
|
}, [props]);
|
|
6637
|
-
|
|
6601
|
+
React29.useEffect(function() {
|
|
6638
6602
|
if (props.inert) {
|
|
6639
6603
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
6640
6604
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
@@ -6650,7 +6614,7 @@ function RemoveScrollSideCar(props) {
|
|
|
6650
6614
|
}
|
|
6651
6615
|
return;
|
|
6652
6616
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
6653
|
-
var shouldCancelEvent =
|
|
6617
|
+
var shouldCancelEvent = React29.useCallback(function(event, parent) {
|
|
6654
6618
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
6655
6619
|
return !lastProps.current.allowPinchZoom;
|
|
6656
6620
|
}
|
|
@@ -6686,7 +6650,7 @@ function RemoveScrollSideCar(props) {
|
|
|
6686
6650
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
6687
6651
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
6688
6652
|
}, []);
|
|
6689
|
-
var shouldPrevent =
|
|
6653
|
+
var shouldPrevent = React29.useCallback(function(_event) {
|
|
6690
6654
|
var event = _event;
|
|
6691
6655
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
6692
6656
|
return;
|
|
@@ -6713,7 +6677,7 @@ function RemoveScrollSideCar(props) {
|
|
|
6713
6677
|
}
|
|
6714
6678
|
}
|
|
6715
6679
|
}, []);
|
|
6716
|
-
var shouldCancel =
|
|
6680
|
+
var shouldCancel = React29.useCallback(function(name, delta, target, should) {
|
|
6717
6681
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
6718
6682
|
shouldPreventQueue.current.push(event);
|
|
6719
6683
|
setTimeout(function() {
|
|
@@ -6722,17 +6686,17 @@ function RemoveScrollSideCar(props) {
|
|
|
6722
6686
|
});
|
|
6723
6687
|
}, 1);
|
|
6724
6688
|
}, []);
|
|
6725
|
-
var scrollTouchStart =
|
|
6689
|
+
var scrollTouchStart = React29.useCallback(function(event) {
|
|
6726
6690
|
touchStartRef.current = getTouchXY(event);
|
|
6727
6691
|
activeAxis.current = void 0;
|
|
6728
6692
|
}, []);
|
|
6729
|
-
var scrollWheel =
|
|
6693
|
+
var scrollWheel = React29.useCallback(function(event) {
|
|
6730
6694
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
6731
6695
|
}, []);
|
|
6732
|
-
var scrollTouchMove =
|
|
6696
|
+
var scrollTouchMove = React29.useCallback(function(event) {
|
|
6733
6697
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
6734
6698
|
}, []);
|
|
6735
|
-
|
|
6699
|
+
React29.useEffect(function() {
|
|
6736
6700
|
lockStack.push(Style2);
|
|
6737
6701
|
props.setCallbacks({
|
|
6738
6702
|
onScrollCapture: scrollWheel,
|
|
@@ -6752,11 +6716,11 @@ function RemoveScrollSideCar(props) {
|
|
|
6752
6716
|
};
|
|
6753
6717
|
}, []);
|
|
6754
6718
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
6755
|
-
return
|
|
6756
|
-
|
|
6719
|
+
return React29.createElement(
|
|
6720
|
+
React29.Fragment,
|
|
6757
6721
|
null,
|
|
6758
|
-
inert ?
|
|
6759
|
-
removeScrollBar ?
|
|
6722
|
+
inert ? React29.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
6723
|
+
removeScrollBar ? React29.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
6760
6724
|
);
|
|
6761
6725
|
}
|
|
6762
6726
|
function getOutermostShadowParent(node) {
|
|
@@ -6775,8 +6739,8 @@ function getOutermostShadowParent(node) {
|
|
|
6775
6739
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
6776
6740
|
|
|
6777
6741
|
// ../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.10_react@19.1.1/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
6778
|
-
var ReactRemoveScroll =
|
|
6779
|
-
return
|
|
6742
|
+
var ReactRemoveScroll = React30.forwardRef(function(props, ref) {
|
|
6743
|
+
return React30.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
6780
6744
|
});
|
|
6781
6745
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
6782
6746
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -6916,8 +6880,8 @@ var Dialog = (props) => {
|
|
|
6916
6880
|
onOpenChange,
|
|
6917
6881
|
modal = true
|
|
6918
6882
|
} = props;
|
|
6919
|
-
const triggerRef =
|
|
6920
|
-
const contentRef =
|
|
6883
|
+
const triggerRef = React31.useRef(null);
|
|
6884
|
+
const contentRef = React31.useRef(null);
|
|
6921
6885
|
const [open, setOpen] = useControllableState({
|
|
6922
6886
|
prop: openProp,
|
|
6923
6887
|
defaultProp: defaultOpen ?? false,
|
|
@@ -6935,7 +6899,7 @@ var Dialog = (props) => {
|
|
|
6935
6899
|
descriptionId: useId(),
|
|
6936
6900
|
open,
|
|
6937
6901
|
onOpenChange: setOpen,
|
|
6938
|
-
onOpenToggle:
|
|
6902
|
+
onOpenToggle: React31.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
6939
6903
|
modal,
|
|
6940
6904
|
children
|
|
6941
6905
|
}
|
|
@@ -6943,7 +6907,7 @@ var Dialog = (props) => {
|
|
|
6943
6907
|
};
|
|
6944
6908
|
Dialog.displayName = DIALOG_NAME;
|
|
6945
6909
|
var TRIGGER_NAME3 = "DialogTrigger";
|
|
6946
|
-
var DialogTrigger =
|
|
6910
|
+
var DialogTrigger = React31.forwardRef(
|
|
6947
6911
|
(props, forwardedRef) => {
|
|
6948
6912
|
const { __scopeDialog, ...triggerProps } = props;
|
|
6949
6913
|
const context = useDialogContext(TRIGGER_NAME3, __scopeDialog);
|
|
@@ -6971,11 +6935,11 @@ var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
|
|
|
6971
6935
|
var DialogPortal = (props) => {
|
|
6972
6936
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
6973
6937
|
const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
|
|
6974
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children:
|
|
6938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React31.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Portal, { asChild: true, container, children: child }) })) });
|
|
6975
6939
|
};
|
|
6976
6940
|
DialogPortal.displayName = PORTAL_NAME2;
|
|
6977
6941
|
var OVERLAY_NAME = "DialogOverlay";
|
|
6978
|
-
var DialogOverlay =
|
|
6942
|
+
var DialogOverlay = React31.forwardRef(
|
|
6979
6943
|
(props, forwardedRef) => {
|
|
6980
6944
|
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
6981
6945
|
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
@@ -6985,7 +6949,7 @@ var DialogOverlay = React32.forwardRef(
|
|
|
6985
6949
|
);
|
|
6986
6950
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
6987
6951
|
var Slot2 = createSlot("DialogOverlay.RemoveScroll");
|
|
6988
|
-
var DialogOverlayImpl =
|
|
6952
|
+
var DialogOverlayImpl = React31.forwardRef(
|
|
6989
6953
|
(props, forwardedRef) => {
|
|
6990
6954
|
const { __scopeDialog, ...overlayProps } = props;
|
|
6991
6955
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
@@ -7005,7 +6969,7 @@ var DialogOverlayImpl = React32.forwardRef(
|
|
|
7005
6969
|
}
|
|
7006
6970
|
);
|
|
7007
6971
|
var CONTENT_NAME3 = "DialogContent";
|
|
7008
|
-
var DialogContent =
|
|
6972
|
+
var DialogContent = React31.forwardRef(
|
|
7009
6973
|
(props, forwardedRef) => {
|
|
7010
6974
|
const portalContext = usePortalContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7011
6975
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7014,12 +6978,12 @@ var DialogContent = React32.forwardRef(
|
|
|
7014
6978
|
}
|
|
7015
6979
|
);
|
|
7016
6980
|
DialogContent.displayName = CONTENT_NAME3;
|
|
7017
|
-
var DialogContentModal =
|
|
6981
|
+
var DialogContentModal = React31.forwardRef(
|
|
7018
6982
|
(props, forwardedRef) => {
|
|
7019
6983
|
const context = useDialogContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7020
|
-
const contentRef =
|
|
6984
|
+
const contentRef = React31.useRef(null);
|
|
7021
6985
|
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
7022
|
-
|
|
6986
|
+
React31.useEffect(() => {
|
|
7023
6987
|
const content = contentRef.current;
|
|
7024
6988
|
if (content) return hideOthers(content);
|
|
7025
6989
|
}, []);
|
|
@@ -7048,11 +7012,11 @@ var DialogContentModal = React32.forwardRef(
|
|
|
7048
7012
|
);
|
|
7049
7013
|
}
|
|
7050
7014
|
);
|
|
7051
|
-
var DialogContentNonModal =
|
|
7015
|
+
var DialogContentNonModal = React31.forwardRef(
|
|
7052
7016
|
(props, forwardedRef) => {
|
|
7053
7017
|
const context = useDialogContext(CONTENT_NAME3, props.__scopeDialog);
|
|
7054
|
-
const hasInteractedOutsideRef =
|
|
7055
|
-
const hasPointerDownOutsideRef =
|
|
7018
|
+
const hasInteractedOutsideRef = React31.useRef(false);
|
|
7019
|
+
const hasPointerDownOutsideRef = React31.useRef(false);
|
|
7056
7020
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
7057
7021
|
DialogContentImpl,
|
|
7058
7022
|
{
|
|
@@ -7088,11 +7052,11 @@ var DialogContentNonModal = React32.forwardRef(
|
|
|
7088
7052
|
);
|
|
7089
7053
|
}
|
|
7090
7054
|
);
|
|
7091
|
-
var DialogContentImpl =
|
|
7055
|
+
var DialogContentImpl = React31.forwardRef(
|
|
7092
7056
|
(props, forwardedRef) => {
|
|
7093
7057
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
7094
7058
|
const context = useDialogContext(CONTENT_NAME3, __scopeDialog);
|
|
7095
|
-
const contentRef =
|
|
7059
|
+
const contentRef = React31.useRef(null);
|
|
7096
7060
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
7097
7061
|
useFocusGuards();
|
|
7098
7062
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
@@ -7127,7 +7091,7 @@ var DialogContentImpl = React32.forwardRef(
|
|
|
7127
7091
|
}
|
|
7128
7092
|
);
|
|
7129
7093
|
var TITLE_NAME = "DialogTitle";
|
|
7130
|
-
var DialogTitle =
|
|
7094
|
+
var DialogTitle = React31.forwardRef(
|
|
7131
7095
|
(props, forwardedRef) => {
|
|
7132
7096
|
const { __scopeDialog, ...titleProps } = props;
|
|
7133
7097
|
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
@@ -7136,7 +7100,7 @@ var DialogTitle = React32.forwardRef(
|
|
|
7136
7100
|
);
|
|
7137
7101
|
DialogTitle.displayName = TITLE_NAME;
|
|
7138
7102
|
var DESCRIPTION_NAME = "DialogDescription";
|
|
7139
|
-
var DialogDescription =
|
|
7103
|
+
var DialogDescription = React31.forwardRef(
|
|
7140
7104
|
(props, forwardedRef) => {
|
|
7141
7105
|
const { __scopeDialog, ...descriptionProps } = props;
|
|
7142
7106
|
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
@@ -7145,7 +7109,7 @@ var DialogDescription = React32.forwardRef(
|
|
|
7145
7109
|
);
|
|
7146
7110
|
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
7147
7111
|
var CLOSE_NAME = "DialogClose";
|
|
7148
|
-
var DialogClose =
|
|
7112
|
+
var DialogClose = React31.forwardRef(
|
|
7149
7113
|
(props, forwardedRef) => {
|
|
7150
7114
|
const { __scopeDialog, ...closeProps } = props;
|
|
7151
7115
|
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
@@ -7177,7 +7141,7 @@ var TitleWarning = ({ titleId }) => {
|
|
|
7177
7141
|
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
7178
7142
|
|
|
7179
7143
|
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
7180
|
-
|
|
7144
|
+
React31.useEffect(() => {
|
|
7181
7145
|
if (titleId) {
|
|
7182
7146
|
const hasTitle = document.getElementById(titleId);
|
|
7183
7147
|
if (!hasTitle) console.error(MESSAGE);
|
|
@@ -7189,7 +7153,7 @@ var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
|
7189
7153
|
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
7190
7154
|
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
7191
7155
|
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
7192
|
-
|
|
7156
|
+
React31.useEffect(() => {
|
|
7193
7157
|
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
7194
7158
|
if (descriptionId && describedById) {
|
|
7195
7159
|
const hasDescription = document.getElementById(descriptionId);
|
|
@@ -7207,7 +7171,7 @@ var Description = DialogDescription;
|
|
|
7207
7171
|
var Close = DialogClose;
|
|
7208
7172
|
|
|
7209
7173
|
// ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
7210
|
-
var
|
|
7174
|
+
var import_react11 = require("react");
|
|
7211
7175
|
|
|
7212
7176
|
// ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
7213
7177
|
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -7231,7 +7195,7 @@ var hasA11yProp = (props) => {
|
|
|
7231
7195
|
};
|
|
7232
7196
|
|
|
7233
7197
|
// ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
7234
|
-
var
|
|
7198
|
+
var import_react10 = require("react");
|
|
7235
7199
|
|
|
7236
7200
|
// ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
7237
7201
|
var defaultAttributes = {
|
|
@@ -7247,7 +7211,7 @@ var defaultAttributes = {
|
|
|
7247
7211
|
};
|
|
7248
7212
|
|
|
7249
7213
|
// ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
7250
|
-
var Icon = (0,
|
|
7214
|
+
var Icon = (0, import_react10.forwardRef)(
|
|
7251
7215
|
({
|
|
7252
7216
|
color = "currentColor",
|
|
7253
7217
|
size: size4 = 24,
|
|
@@ -7257,7 +7221,7 @@ var Icon = (0, import_react11.forwardRef)(
|
|
|
7257
7221
|
children,
|
|
7258
7222
|
iconNode,
|
|
7259
7223
|
...rest
|
|
7260
|
-
}, ref) => (0,
|
|
7224
|
+
}, ref) => (0, import_react10.createElement)(
|
|
7261
7225
|
"svg",
|
|
7262
7226
|
{
|
|
7263
7227
|
ref,
|
|
@@ -7271,7 +7235,7 @@ var Icon = (0, import_react11.forwardRef)(
|
|
|
7271
7235
|
...rest
|
|
7272
7236
|
},
|
|
7273
7237
|
[
|
|
7274
|
-
...iconNode.map(([tag, attrs]) => (0,
|
|
7238
|
+
...iconNode.map(([tag, attrs]) => (0, import_react10.createElement)(tag, attrs)),
|
|
7275
7239
|
...Array.isArray(children) ? children : [children]
|
|
7276
7240
|
]
|
|
7277
7241
|
)
|
|
@@ -7279,8 +7243,8 @@ var Icon = (0, import_react11.forwardRef)(
|
|
|
7279
7243
|
|
|
7280
7244
|
// ../node_modules/.pnpm/lucide-react@0.523.0_react@19.1.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
7281
7245
|
var createLucideIcon = (iconName, iconNode) => {
|
|
7282
|
-
const Component = (0,
|
|
7283
|
-
({ className, ...props }, ref) => (0,
|
|
7246
|
+
const Component = (0, import_react11.forwardRef)(
|
|
7247
|
+
({ className, ...props }, ref) => (0, import_react11.createElement)(Icon, {
|
|
7284
7248
|
ref,
|
|
7285
7249
|
iconNode,
|
|
7286
7250
|
className: mergeClasses(
|
|
@@ -7319,7 +7283,7 @@ var DialogPortal2 = ({
|
|
|
7319
7283
|
}) => {
|
|
7320
7284
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Portal2, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "au-root", children }) });
|
|
7321
7285
|
};
|
|
7322
|
-
var DialogOverlay2 =
|
|
7286
|
+
var DialogOverlay2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
7323
7287
|
Overlay,
|
|
7324
7288
|
{
|
|
7325
7289
|
ref,
|
|
@@ -7331,7 +7295,7 @@ var DialogOverlay2 = React33.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
7331
7295
|
}
|
|
7332
7296
|
));
|
|
7333
7297
|
DialogOverlay2.displayName = Overlay.displayName;
|
|
7334
|
-
var DialogContent2 =
|
|
7298
|
+
var DialogContent2 = React32.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(DialogPortal2, { children: [
|
|
7335
7299
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DialogOverlay2, {}),
|
|
7336
7300
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
7337
7301
|
Content3,
|
|
@@ -7381,7 +7345,7 @@ var DialogFooter = ({
|
|
|
7381
7345
|
}
|
|
7382
7346
|
);
|
|
7383
7347
|
DialogFooter.displayName = "DialogFooter";
|
|
7384
|
-
var DialogTitle2 =
|
|
7348
|
+
var DialogTitle2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
7385
7349
|
Title,
|
|
7386
7350
|
{
|
|
7387
7351
|
ref,
|
|
@@ -7393,7 +7357,7 @@ var DialogTitle2 = React33.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
7393
7357
|
}
|
|
7394
7358
|
));
|
|
7395
7359
|
DialogTitle2.displayName = Title.displayName;
|
|
7396
|
-
var DialogDescription2 =
|
|
7360
|
+
var DialogDescription2 = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
7397
7361
|
Description,
|
|
7398
7362
|
{
|
|
7399
7363
|
ref,
|
|
@@ -7556,10 +7520,10 @@ var getCheckoutContent = (checkoutResult) => {
|
|
|
7556
7520
|
};
|
|
7557
7521
|
|
|
7558
7522
|
// src/libraries/react/components/ui/accordion.tsx
|
|
7559
|
-
var
|
|
7523
|
+
var React33 = __toESM(require("react"));
|
|
7560
7524
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
7561
7525
|
var Accordion2 = Root2;
|
|
7562
|
-
var AccordionItem2 =
|
|
7526
|
+
var AccordionItem2 = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7563
7527
|
Item,
|
|
7564
7528
|
{
|
|
7565
7529
|
ref,
|
|
@@ -7568,7 +7532,7 @@ var AccordionItem2 = React34.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
7568
7532
|
}
|
|
7569
7533
|
));
|
|
7570
7534
|
AccordionItem2.displayName = "AccordionItem";
|
|
7571
|
-
var AccordionTrigger2 =
|
|
7535
|
+
var AccordionTrigger2 = React33.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Header, { className: "au-flex", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
7572
7536
|
Trigger2,
|
|
7573
7537
|
{
|
|
7574
7538
|
ref,
|
|
@@ -7584,7 +7548,7 @@ var AccordionTrigger2 = React34.forwardRef(({ className, children, ...props }, r
|
|
|
7584
7548
|
}
|
|
7585
7549
|
) }));
|
|
7586
7550
|
AccordionTrigger2.displayName = Trigger2.displayName;
|
|
7587
|
-
var AccordionContent2 =
|
|
7551
|
+
var AccordionContent2 = React33.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
7588
7552
|
Content2,
|
|
7589
7553
|
{
|
|
7590
7554
|
ref,
|
|
@@ -7596,13 +7560,13 @@ var AccordionContent2 = React34.forwardRef(({ className, children, ...props }, r
|
|
|
7596
7560
|
AccordionContent2.displayName = Content2.displayName;
|
|
7597
7561
|
|
|
7598
7562
|
// src/libraries/react/components/ui/popover.tsx
|
|
7599
|
-
var
|
|
7563
|
+
var React39 = __toESM(require("react"));
|
|
7600
7564
|
|
|
7601
7565
|
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19._2d5qzp46jobjymz4ef7wsko3em/node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
7602
|
-
var
|
|
7566
|
+
var React38 = __toESM(require("react"), 1);
|
|
7603
7567
|
|
|
7604
7568
|
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1._rx2bw5lpqtxi7ji4o3uo2rsuda/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
7605
|
-
var
|
|
7569
|
+
var React37 = __toESM(require("react"), 1);
|
|
7606
7570
|
|
|
7607
7571
|
// ../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
7608
7572
|
var sides = ["top", "right", "bottom", "left"];
|
|
@@ -9203,13 +9167,13 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
9203
9167
|
};
|
|
9204
9168
|
|
|
9205
9169
|
// ../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
9206
|
-
var
|
|
9207
|
-
var
|
|
9170
|
+
var React34 = __toESM(require("react"), 1);
|
|
9171
|
+
var import_react12 = require("react");
|
|
9208
9172
|
var ReactDOM3 = __toESM(require("react-dom"), 1);
|
|
9209
9173
|
var isClient = typeof document !== "undefined";
|
|
9210
9174
|
var noop = function noop2() {
|
|
9211
9175
|
};
|
|
9212
|
-
var index = isClient ?
|
|
9176
|
+
var index = isClient ? import_react12.useLayoutEffect : noop;
|
|
9213
9177
|
function deepEqual(a, b) {
|
|
9214
9178
|
if (a === b) {
|
|
9215
9179
|
return true;
|
|
@@ -9269,7 +9233,7 @@ function roundByDPR(element, value) {
|
|
|
9269
9233
|
return Math.round(value * dpr) / dpr;
|
|
9270
9234
|
}
|
|
9271
9235
|
function useLatestRef(value) {
|
|
9272
|
-
const ref =
|
|
9236
|
+
const ref = React34.useRef(value);
|
|
9273
9237
|
index(() => {
|
|
9274
9238
|
ref.current = value;
|
|
9275
9239
|
});
|
|
@@ -9292,7 +9256,7 @@ function useFloating(options) {
|
|
|
9292
9256
|
whileElementsMounted,
|
|
9293
9257
|
open
|
|
9294
9258
|
} = options;
|
|
9295
|
-
const [data, setData] =
|
|
9259
|
+
const [data, setData] = React34.useState({
|
|
9296
9260
|
x: 0,
|
|
9297
9261
|
y: 0,
|
|
9298
9262
|
strategy,
|
|
@@ -9300,19 +9264,19 @@ function useFloating(options) {
|
|
|
9300
9264
|
middlewareData: {},
|
|
9301
9265
|
isPositioned: false
|
|
9302
9266
|
});
|
|
9303
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
9267
|
+
const [latestMiddleware, setLatestMiddleware] = React34.useState(middleware);
|
|
9304
9268
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
9305
9269
|
setLatestMiddleware(middleware);
|
|
9306
9270
|
}
|
|
9307
|
-
const [_reference, _setReference] =
|
|
9308
|
-
const [_floating, _setFloating] =
|
|
9309
|
-
const setReference =
|
|
9271
|
+
const [_reference, _setReference] = React34.useState(null);
|
|
9272
|
+
const [_floating, _setFloating] = React34.useState(null);
|
|
9273
|
+
const setReference = React34.useCallback((node) => {
|
|
9310
9274
|
if (node !== referenceRef.current) {
|
|
9311
9275
|
referenceRef.current = node;
|
|
9312
9276
|
_setReference(node);
|
|
9313
9277
|
}
|
|
9314
9278
|
}, []);
|
|
9315
|
-
const setFloating =
|
|
9279
|
+
const setFloating = React34.useCallback((node) => {
|
|
9316
9280
|
if (node !== floatingRef.current) {
|
|
9317
9281
|
floatingRef.current = node;
|
|
9318
9282
|
_setFloating(node);
|
|
@@ -9320,14 +9284,14 @@ function useFloating(options) {
|
|
|
9320
9284
|
}, []);
|
|
9321
9285
|
const referenceEl = externalReference || _reference;
|
|
9322
9286
|
const floatingEl = externalFloating || _floating;
|
|
9323
|
-
const referenceRef =
|
|
9324
|
-
const floatingRef =
|
|
9325
|
-
const dataRef =
|
|
9287
|
+
const referenceRef = React34.useRef(null);
|
|
9288
|
+
const floatingRef = React34.useRef(null);
|
|
9289
|
+
const dataRef = React34.useRef(data);
|
|
9326
9290
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
9327
9291
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
9328
9292
|
const platformRef = useLatestRef(platform2);
|
|
9329
9293
|
const openRef = useLatestRef(open);
|
|
9330
|
-
const update =
|
|
9294
|
+
const update = React34.useCallback(() => {
|
|
9331
9295
|
if (!referenceRef.current || !floatingRef.current) {
|
|
9332
9296
|
return;
|
|
9333
9297
|
}
|
|
@@ -9365,7 +9329,7 @@ function useFloating(options) {
|
|
|
9365
9329
|
}));
|
|
9366
9330
|
}
|
|
9367
9331
|
}, [open]);
|
|
9368
|
-
const isMountedRef =
|
|
9332
|
+
const isMountedRef = React34.useRef(false);
|
|
9369
9333
|
index(() => {
|
|
9370
9334
|
isMountedRef.current = true;
|
|
9371
9335
|
return () => {
|
|
@@ -9382,17 +9346,17 @@ function useFloating(options) {
|
|
|
9382
9346
|
update();
|
|
9383
9347
|
}
|
|
9384
9348
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
9385
|
-
const refs =
|
|
9349
|
+
const refs = React34.useMemo(() => ({
|
|
9386
9350
|
reference: referenceRef,
|
|
9387
9351
|
floating: floatingRef,
|
|
9388
9352
|
setReference,
|
|
9389
9353
|
setFloating
|
|
9390
9354
|
}), [setReference, setFloating]);
|
|
9391
|
-
const elements =
|
|
9355
|
+
const elements = React34.useMemo(() => ({
|
|
9392
9356
|
reference: referenceEl,
|
|
9393
9357
|
floating: floatingEl
|
|
9394
9358
|
}), [referenceEl, floatingEl]);
|
|
9395
|
-
const floatingStyles =
|
|
9359
|
+
const floatingStyles = React34.useMemo(() => {
|
|
9396
9360
|
const initialStyles = {
|
|
9397
9361
|
position: strategy,
|
|
9398
9362
|
left: 0,
|
|
@@ -9418,7 +9382,7 @@ function useFloating(options) {
|
|
|
9418
9382
|
top: y
|
|
9419
9383
|
};
|
|
9420
9384
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
9421
|
-
return
|
|
9385
|
+
return React34.useMemo(() => ({
|
|
9422
9386
|
...data,
|
|
9423
9387
|
update,
|
|
9424
9388
|
refs,
|
|
@@ -9487,10 +9451,10 @@ var arrow3 = (options, deps) => ({
|
|
|
9487
9451
|
});
|
|
9488
9452
|
|
|
9489
9453
|
// ../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1.1_7w5nl47bqckuaclutkvv5v7iie/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
9490
|
-
var
|
|
9454
|
+
var React35 = __toESM(require("react"), 1);
|
|
9491
9455
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
9492
9456
|
var NAME = "Arrow";
|
|
9493
|
-
var Arrow =
|
|
9457
|
+
var Arrow = React35.forwardRef((props, forwardedRef) => {
|
|
9494
9458
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
9495
9459
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
9496
9460
|
Primitive.svg,
|
|
@@ -9509,9 +9473,9 @@ Arrow.displayName = NAME;
|
|
|
9509
9473
|
var Root4 = Arrow;
|
|
9510
9474
|
|
|
9511
9475
|
// ../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
9512
|
-
var
|
|
9476
|
+
var React36 = __toESM(require("react"), 1);
|
|
9513
9477
|
function useSize(element) {
|
|
9514
|
-
const [size4, setSize] =
|
|
9478
|
+
const [size4, setSize] = React36.useState(void 0);
|
|
9515
9479
|
useLayoutEffect2(() => {
|
|
9516
9480
|
if (element) {
|
|
9517
9481
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -9552,18 +9516,18 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
9552
9516
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
9553
9517
|
var Popper = (props) => {
|
|
9554
9518
|
const { __scopePopper, children } = props;
|
|
9555
|
-
const [anchor, setAnchor] =
|
|
9519
|
+
const [anchor, setAnchor] = React37.useState(null);
|
|
9556
9520
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
9557
9521
|
};
|
|
9558
9522
|
Popper.displayName = POPPER_NAME;
|
|
9559
9523
|
var ANCHOR_NAME = "PopperAnchor";
|
|
9560
|
-
var PopperAnchor =
|
|
9524
|
+
var PopperAnchor = React37.forwardRef(
|
|
9561
9525
|
(props, forwardedRef) => {
|
|
9562
9526
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
9563
9527
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
9564
|
-
const ref =
|
|
9528
|
+
const ref = React37.useRef(null);
|
|
9565
9529
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
9566
|
-
|
|
9530
|
+
React37.useEffect(() => {
|
|
9567
9531
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
9568
9532
|
});
|
|
9569
9533
|
return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
@@ -9572,7 +9536,7 @@ var PopperAnchor = React38.forwardRef(
|
|
|
9572
9536
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
9573
9537
|
var CONTENT_NAME4 = "PopperContent";
|
|
9574
9538
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME4);
|
|
9575
|
-
var PopperContent =
|
|
9539
|
+
var PopperContent = React37.forwardRef(
|
|
9576
9540
|
(props, forwardedRef) => {
|
|
9577
9541
|
const {
|
|
9578
9542
|
__scopePopper,
|
|
@@ -9591,9 +9555,9 @@ var PopperContent = React38.forwardRef(
|
|
|
9591
9555
|
...contentProps
|
|
9592
9556
|
} = props;
|
|
9593
9557
|
const context = usePopperContext(CONTENT_NAME4, __scopePopper);
|
|
9594
|
-
const [content, setContent] =
|
|
9558
|
+
const [content, setContent] = React37.useState(null);
|
|
9595
9559
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9596
|
-
const [arrow4, setArrow] =
|
|
9560
|
+
const [arrow4, setArrow] = React37.useState(null);
|
|
9597
9561
|
const arrowSize = useSize(arrow4);
|
|
9598
9562
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
9599
9563
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -9655,7 +9619,7 @@ var PopperContent = React38.forwardRef(
|
|
|
9655
9619
|
const arrowX = middlewareData.arrow?.x;
|
|
9656
9620
|
const arrowY = middlewareData.arrow?.y;
|
|
9657
9621
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
9658
|
-
const [contentZIndex, setContentZIndex] =
|
|
9622
|
+
const [contentZIndex, setContentZIndex] = React37.useState();
|
|
9659
9623
|
useLayoutEffect2(() => {
|
|
9660
9624
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
9661
9625
|
}, [content]);
|
|
@@ -9721,7 +9685,7 @@ var OPPOSITE_SIDE = {
|
|
|
9721
9685
|
bottom: "top",
|
|
9722
9686
|
left: "right"
|
|
9723
9687
|
};
|
|
9724
|
-
var PopperArrow =
|
|
9688
|
+
var PopperArrow = React37.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
9725
9689
|
const { __scopePopper, ...arrowProps } = props;
|
|
9726
9690
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
9727
9691
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -9830,8 +9794,8 @@ var Popover = (props) => {
|
|
|
9830
9794
|
modal = false
|
|
9831
9795
|
} = props;
|
|
9832
9796
|
const popperScope = usePopperScope(__scopePopover);
|
|
9833
|
-
const triggerRef =
|
|
9834
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
9797
|
+
const triggerRef = React38.useRef(null);
|
|
9798
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React38.useState(false);
|
|
9835
9799
|
const [open, setOpen] = useControllableState({
|
|
9836
9800
|
prop: openProp,
|
|
9837
9801
|
defaultProp: defaultOpen ?? false,
|
|
@@ -9846,10 +9810,10 @@ var Popover = (props) => {
|
|
|
9846
9810
|
triggerRef,
|
|
9847
9811
|
open,
|
|
9848
9812
|
onOpenChange: setOpen,
|
|
9849
|
-
onOpenToggle:
|
|
9813
|
+
onOpenToggle: React38.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
9850
9814
|
hasCustomAnchor,
|
|
9851
|
-
onCustomAnchorAdd:
|
|
9852
|
-
onCustomAnchorRemove:
|
|
9815
|
+
onCustomAnchorAdd: React38.useCallback(() => setHasCustomAnchor(true), []),
|
|
9816
|
+
onCustomAnchorRemove: React38.useCallback(() => setHasCustomAnchor(false), []),
|
|
9853
9817
|
modal,
|
|
9854
9818
|
children
|
|
9855
9819
|
}
|
|
@@ -9857,13 +9821,13 @@ var Popover = (props) => {
|
|
|
9857
9821
|
};
|
|
9858
9822
|
Popover.displayName = POPOVER_NAME;
|
|
9859
9823
|
var ANCHOR_NAME2 = "PopoverAnchor";
|
|
9860
|
-
var PopoverAnchor =
|
|
9824
|
+
var PopoverAnchor = React38.forwardRef(
|
|
9861
9825
|
(props, forwardedRef) => {
|
|
9862
9826
|
const { __scopePopover, ...anchorProps } = props;
|
|
9863
9827
|
const context = usePopoverContext(ANCHOR_NAME2, __scopePopover);
|
|
9864
9828
|
const popperScope = usePopperScope(__scopePopover);
|
|
9865
9829
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
9866
|
-
|
|
9830
|
+
React38.useEffect(() => {
|
|
9867
9831
|
onCustomAnchorAdd();
|
|
9868
9832
|
return () => onCustomAnchorRemove();
|
|
9869
9833
|
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
@@ -9872,7 +9836,7 @@ var PopoverAnchor = React39.forwardRef(
|
|
|
9872
9836
|
);
|
|
9873
9837
|
PopoverAnchor.displayName = ANCHOR_NAME2;
|
|
9874
9838
|
var TRIGGER_NAME4 = "PopoverTrigger";
|
|
9875
|
-
var PopoverTrigger =
|
|
9839
|
+
var PopoverTrigger = React38.forwardRef(
|
|
9876
9840
|
(props, forwardedRef) => {
|
|
9877
9841
|
const { __scopePopover, ...triggerProps } = props;
|
|
9878
9842
|
const context = usePopoverContext(TRIGGER_NAME4, __scopePopover);
|
|
@@ -9906,7 +9870,7 @@ var PopoverPortal = (props) => {
|
|
|
9906
9870
|
};
|
|
9907
9871
|
PopoverPortal.displayName = PORTAL_NAME3;
|
|
9908
9872
|
var CONTENT_NAME5 = "PopoverContent";
|
|
9909
|
-
var PopoverContent =
|
|
9873
|
+
var PopoverContent = React38.forwardRef(
|
|
9910
9874
|
(props, forwardedRef) => {
|
|
9911
9875
|
const portalContext = usePortalContext2(CONTENT_NAME5, props.__scopePopover);
|
|
9912
9876
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -9916,13 +9880,13 @@ var PopoverContent = React39.forwardRef(
|
|
|
9916
9880
|
);
|
|
9917
9881
|
PopoverContent.displayName = CONTENT_NAME5;
|
|
9918
9882
|
var Slot3 = createSlot("PopoverContent.RemoveScroll");
|
|
9919
|
-
var PopoverContentModal =
|
|
9883
|
+
var PopoverContentModal = React38.forwardRef(
|
|
9920
9884
|
(props, forwardedRef) => {
|
|
9921
9885
|
const context = usePopoverContext(CONTENT_NAME5, props.__scopePopover);
|
|
9922
|
-
const contentRef =
|
|
9886
|
+
const contentRef = React38.useRef(null);
|
|
9923
9887
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
9924
|
-
const isRightClickOutsideRef =
|
|
9925
|
-
|
|
9888
|
+
const isRightClickOutsideRef = React38.useRef(false);
|
|
9889
|
+
React38.useEffect(() => {
|
|
9926
9890
|
const content = contentRef.current;
|
|
9927
9891
|
if (content) return hideOthers(content);
|
|
9928
9892
|
}, []);
|
|
@@ -9956,11 +9920,11 @@ var PopoverContentModal = React39.forwardRef(
|
|
|
9956
9920
|
) });
|
|
9957
9921
|
}
|
|
9958
9922
|
);
|
|
9959
|
-
var PopoverContentNonModal =
|
|
9923
|
+
var PopoverContentNonModal = React38.forwardRef(
|
|
9960
9924
|
(props, forwardedRef) => {
|
|
9961
9925
|
const context = usePopoverContext(CONTENT_NAME5, props.__scopePopover);
|
|
9962
|
-
const hasInteractedOutsideRef =
|
|
9963
|
-
const hasPointerDownOutsideRef =
|
|
9926
|
+
const hasInteractedOutsideRef = React38.useRef(false);
|
|
9927
|
+
const hasPointerDownOutsideRef = React38.useRef(false);
|
|
9964
9928
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
9965
9929
|
PopoverContentImpl,
|
|
9966
9930
|
{
|
|
@@ -9996,7 +9960,7 @@ var PopoverContentNonModal = React39.forwardRef(
|
|
|
9996
9960
|
);
|
|
9997
9961
|
}
|
|
9998
9962
|
);
|
|
9999
|
-
var PopoverContentImpl =
|
|
9963
|
+
var PopoverContentImpl = React38.forwardRef(
|
|
10000
9964
|
(props, forwardedRef) => {
|
|
10001
9965
|
const {
|
|
10002
9966
|
__scopePopover,
|
|
@@ -10060,7 +10024,7 @@ var PopoverContentImpl = React39.forwardRef(
|
|
|
10060
10024
|
}
|
|
10061
10025
|
);
|
|
10062
10026
|
var CLOSE_NAME2 = "PopoverClose";
|
|
10063
|
-
var PopoverClose =
|
|
10027
|
+
var PopoverClose = React38.forwardRef(
|
|
10064
10028
|
(props, forwardedRef) => {
|
|
10065
10029
|
const { __scopePopover, ...closeProps } = props;
|
|
10066
10030
|
const context = usePopoverContext(CLOSE_NAME2, __scopePopover);
|
|
@@ -10077,7 +10041,7 @@ var PopoverClose = React39.forwardRef(
|
|
|
10077
10041
|
);
|
|
10078
10042
|
PopoverClose.displayName = CLOSE_NAME2;
|
|
10079
10043
|
var ARROW_NAME2 = "PopoverArrow";
|
|
10080
|
-
var PopoverArrow =
|
|
10044
|
+
var PopoverArrow = React38.forwardRef(
|
|
10081
10045
|
(props, forwardedRef) => {
|
|
10082
10046
|
const { __scopePopover, ...arrowProps } = props;
|
|
10083
10047
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -10096,7 +10060,7 @@ var Content22 = PopoverContent;
|
|
|
10096
10060
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
10097
10061
|
var Popover2 = Root23;
|
|
10098
10062
|
var PopoverTrigger2 = Trigger4;
|
|
10099
|
-
var PopoverContent2 =
|
|
10063
|
+
var PopoverContent2 = React39.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10100
10064
|
Content22,
|
|
10101
10065
|
{
|
|
10102
10066
|
ref,
|
|
@@ -10112,9 +10076,9 @@ var PopoverContent2 = React40.forwardRef(({ className, align = "center", sideOff
|
|
|
10112
10076
|
PopoverContent2.displayName = Content22.displayName;
|
|
10113
10077
|
|
|
10114
10078
|
// src/libraries/react/components/ui/input.tsx
|
|
10115
|
-
var
|
|
10079
|
+
var React40 = __toESM(require("react"));
|
|
10116
10080
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
10117
|
-
var Input =
|
|
10081
|
+
var Input = React40.forwardRef(
|
|
10118
10082
|
({ className, type, onClick, ...props }, ref) => {
|
|
10119
10083
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10120
10084
|
"input",
|
|
@@ -10145,13 +10109,13 @@ var formatCurrency = ({
|
|
|
10145
10109
|
};
|
|
10146
10110
|
function CheckoutDialog(params) {
|
|
10147
10111
|
const { attach } = useCustomer();
|
|
10148
|
-
const [checkoutResult, setCheckoutResult] = (0,
|
|
10149
|
-
(0,
|
|
10112
|
+
const [checkoutResult, setCheckoutResult] = (0, import_react13.useState)(params?.checkoutResult);
|
|
10113
|
+
(0, import_react13.useEffect)(() => {
|
|
10150
10114
|
if (params.checkoutResult) {
|
|
10151
10115
|
setCheckoutResult(params.checkoutResult);
|
|
10152
10116
|
}
|
|
10153
10117
|
}, [params.checkoutResult]);
|
|
10154
|
-
const [loading, setLoading] = (0,
|
|
10118
|
+
const [loading, setLoading] = (0, import_react13.useState)(false);
|
|
10155
10119
|
if (!checkoutResult) {
|
|
10156
10120
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {});
|
|
10157
10121
|
}
|
|
@@ -10326,12 +10290,12 @@ var PrepaidItem = ({
|
|
|
10326
10290
|
setCheckoutResult
|
|
10327
10291
|
}) => {
|
|
10328
10292
|
const { quantity = 0, billing_units: billingUnits = 1 } = item;
|
|
10329
|
-
const [quantityInput, setQuantityInput] = (0,
|
|
10293
|
+
const [quantityInput, setQuantityInput] = (0, import_react13.useState)(
|
|
10330
10294
|
(quantity / billingUnits).toString()
|
|
10331
10295
|
);
|
|
10332
10296
|
const { checkout } = useCustomer();
|
|
10333
|
-
const [loading, setLoading] = (0,
|
|
10334
|
-
const [open, setOpen] = (0,
|
|
10297
|
+
const [loading, setLoading] = (0, import_react13.useState)(false);
|
|
10298
|
+
const [open, setOpen] = (0, import_react13.useState)(false);
|
|
10335
10299
|
const scenario = checkoutResult.product.scenario;
|
|
10336
10300
|
const handleSave = async () => {
|
|
10337
10301
|
setLoading(true);
|
|
@@ -10439,19 +10403,19 @@ var PrepaidItem = ({
|
|
|
10439
10403
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
10440
10404
|
|
|
10441
10405
|
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
10442
|
-
var
|
|
10406
|
+
var import_react15 = require("react");
|
|
10443
10407
|
|
|
10444
10408
|
// src/libraries/react/components/ui/switch.tsx
|
|
10445
|
-
var
|
|
10409
|
+
var React44 = __toESM(require("react"));
|
|
10446
10410
|
|
|
10447
10411
|
// ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@19.1._mh2w7rehnd5adfujfuln6l4w5m/node_modules/@radix-ui/react-switch/dist/index.mjs
|
|
10448
|
-
var
|
|
10412
|
+
var React43 = __toESM(require("react"), 1);
|
|
10449
10413
|
|
|
10450
10414
|
// ../node_modules/.pnpm/@radix-ui+react-use-previous@1.1.1_@types+react@19.1.10_react@19.1.1/node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
10451
|
-
var
|
|
10415
|
+
var React42 = __toESM(require("react"), 1);
|
|
10452
10416
|
function usePrevious(value) {
|
|
10453
|
-
const ref =
|
|
10454
|
-
return
|
|
10417
|
+
const ref = React42.useRef({ value, previous: value });
|
|
10418
|
+
return React42.useMemo(() => {
|
|
10455
10419
|
if (ref.current.value !== value) {
|
|
10456
10420
|
ref.current.previous = ref.current.value;
|
|
10457
10421
|
ref.current.value = value;
|
|
@@ -10465,7 +10429,7 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
|
10465
10429
|
var SWITCH_NAME = "Switch";
|
|
10466
10430
|
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
10467
10431
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
10468
|
-
var Switch =
|
|
10432
|
+
var Switch = React43.forwardRef(
|
|
10469
10433
|
(props, forwardedRef) => {
|
|
10470
10434
|
const {
|
|
10471
10435
|
__scopeSwitch,
|
|
@@ -10479,9 +10443,9 @@ var Switch = React44.forwardRef(
|
|
|
10479
10443
|
form,
|
|
10480
10444
|
...switchProps
|
|
10481
10445
|
} = props;
|
|
10482
|
-
const [button, setButton] =
|
|
10446
|
+
const [button, setButton] = React43.useState(null);
|
|
10483
10447
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
10484
|
-
const hasConsumerStoppedPropagationRef =
|
|
10448
|
+
const hasConsumerStoppedPropagationRef = React43.useRef(false);
|
|
10485
10449
|
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
10486
10450
|
const [checked, setChecked] = useControllableState({
|
|
10487
10451
|
prop: checkedProp,
|
|
@@ -10531,7 +10495,7 @@ var Switch = React44.forwardRef(
|
|
|
10531
10495
|
);
|
|
10532
10496
|
Switch.displayName = SWITCH_NAME;
|
|
10533
10497
|
var THUMB_NAME = "SwitchThumb";
|
|
10534
|
-
var SwitchThumb =
|
|
10498
|
+
var SwitchThumb = React43.forwardRef(
|
|
10535
10499
|
(props, forwardedRef) => {
|
|
10536
10500
|
const { __scopeSwitch, ...thumbProps } = props;
|
|
10537
10501
|
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
@@ -10548,7 +10512,7 @@ var SwitchThumb = React44.forwardRef(
|
|
|
10548
10512
|
);
|
|
10549
10513
|
SwitchThumb.displayName = THUMB_NAME;
|
|
10550
10514
|
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
|
10551
|
-
var SwitchBubbleInput =
|
|
10515
|
+
var SwitchBubbleInput = React43.forwardRef(
|
|
10552
10516
|
({
|
|
10553
10517
|
__scopeSwitch,
|
|
10554
10518
|
control,
|
|
@@ -10556,11 +10520,11 @@ var SwitchBubbleInput = React44.forwardRef(
|
|
|
10556
10520
|
bubbles = true,
|
|
10557
10521
|
...props
|
|
10558
10522
|
}, forwardedRef) => {
|
|
10559
|
-
const ref =
|
|
10523
|
+
const ref = React43.useRef(null);
|
|
10560
10524
|
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
10561
10525
|
const prevChecked = usePrevious(checked);
|
|
10562
10526
|
const controlSize = useSize(control);
|
|
10563
|
-
|
|
10527
|
+
React43.useEffect(() => {
|
|
10564
10528
|
const input = ref.current;
|
|
10565
10529
|
if (!input) return;
|
|
10566
10530
|
const inputProto = window.HTMLInputElement.prototype;
|
|
@@ -10605,7 +10569,7 @@ var Thumb = SwitchThumb;
|
|
|
10605
10569
|
|
|
10606
10570
|
// src/libraries/react/components/ui/switch.tsx
|
|
10607
10571
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10608
|
-
var Switch2 =
|
|
10572
|
+
var Switch2 = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
10609
10573
|
Root5,
|
|
10610
10574
|
{
|
|
10611
10575
|
className: cn(
|
|
@@ -10718,7 +10682,7 @@ function PricingTable({
|
|
|
10718
10682
|
productDetails
|
|
10719
10683
|
}) {
|
|
10720
10684
|
const { customer, checkout } = useCustomer({ errorOnNotFound: false });
|
|
10721
|
-
const [isAnnual, setIsAnnual] = (0,
|
|
10685
|
+
const [isAnnual, setIsAnnual] = (0, import_react15.useState)(false);
|
|
10722
10686
|
const { products, isLoading, error } = usePricingTable({ productDetails });
|
|
10723
10687
|
if (isLoading) {
|
|
10724
10688
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { style: loadingStyles, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LoaderCircle, { style: spinnerStyles }) });
|
|
@@ -10775,7 +10739,7 @@ function PricingTable({
|
|
|
10775
10739
|
}
|
|
10776
10740
|
) });
|
|
10777
10741
|
}
|
|
10778
|
-
var PricingTableContext = (0,
|
|
10742
|
+
var PricingTableContext = (0, import_react15.createContext)({
|
|
10779
10743
|
isAnnualToggle: false,
|
|
10780
10744
|
setIsAnnualToggle: () => {
|
|
10781
10745
|
},
|
|
@@ -10783,7 +10747,7 @@ var PricingTableContext = (0, import_react16.createContext)({
|
|
|
10783
10747
|
showFeatures: true
|
|
10784
10748
|
});
|
|
10785
10749
|
var usePricingTableContext = (componentName) => {
|
|
10786
|
-
const context = (0,
|
|
10750
|
+
const context = (0, import_react15.useContext)(PricingTableContext);
|
|
10787
10751
|
if (context === void 0) {
|
|
10788
10752
|
throw new Error(`${componentName} must be used within <PricingTable />`);
|
|
10789
10753
|
}
|
|
@@ -10948,8 +10912,8 @@ var PricingFeatureList = ({
|
|
|
10948
10912
|
)) })
|
|
10949
10913
|
] });
|
|
10950
10914
|
};
|
|
10951
|
-
var PricingCardButton =
|
|
10952
|
-
const [loading, setLoading] = (0,
|
|
10915
|
+
var PricingCardButton = import_react14.default.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
|
|
10916
|
+
const [loading, setLoading] = (0, import_react15.useState)(false);
|
|
10953
10917
|
const handleClick = async (e) => {
|
|
10954
10918
|
setLoading(true);
|
|
10955
10919
|
try {
|