autumn-js 0.1.53 → 0.1.54
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 +30 -34
- package/dist/libraries/backend/better-auth.d.ts +30 -34
- package/dist/libraries/backend/better-auth.js +322 -331
- package/dist/libraries/backend/better-auth.mjs +134 -147
- package/dist/libraries/backend/{chunk-IUUFQ3OI.mjs → chunk-EQJAZ5SS.mjs} +1 -1
- package/dist/libraries/backend/{chunk-OWJBOQNO.mjs → chunk-OCFEFXEK.mjs} +1 -1
- package/dist/libraries/backend/{chunk-NCUEPWFJ.mjs → chunk-PXKGEXEM.mjs} +7 -7
- package/dist/libraries/backend/{chunk-M3WWSFNX.mjs → chunk-RYSW6BBS.mjs} +1 -1
- package/dist/libraries/backend/{chunk-DUTH4YIQ.mjs → chunk-T52GEWE4.mjs} +197 -193
- package/dist/libraries/backend/{chunk-PLADIABP.mjs → chunk-U32IGAQR.mjs} +1 -1
- package/dist/libraries/backend/{chunk-GUY7BZZ4.mjs → chunk-Z5RWGXIJ.mjs} +1 -1
- package/dist/libraries/backend/{chunk-ZDGVHVDZ.mjs → chunk-ZNIP5BSL.mjs} +1 -1
- package/dist/libraries/backend/convex.js +196 -192
- package/dist/libraries/backend/convex.mjs +8 -8
- package/dist/libraries/backend/elysia.js +196 -192
- package/dist/libraries/backend/elysia.mjs +8 -8
- package/dist/libraries/backend/express.d.mts +1 -1
- package/dist/libraries/backend/express.d.ts +1 -1
- package/dist/libraries/backend/express.js +196 -192
- package/dist/libraries/backend/express.mjs +8 -8
- package/dist/libraries/backend/fastify.js +196 -192
- package/dist/libraries/backend/fastify.mjs +8 -8
- package/dist/libraries/backend/hono.js +196 -192
- package/dist/libraries/backend/hono.mjs +8 -8
- package/dist/libraries/backend/index.d.mts +1 -1
- package/dist/libraries/backend/index.d.ts +1 -1
- package/dist/libraries/backend/index.js +196 -192
- package/dist/libraries/backend/index.mjs +8 -8
- package/dist/libraries/backend/next.js +196 -192
- package/dist/libraries/backend/next.mjs +8 -8
- package/dist/libraries/backend/react-router.js +196 -192
- package/dist/libraries/backend/react-router.mjs +8 -8
- package/dist/libraries/backend/{referralTypes-CrOWHkir.d.ts → referralTypes-DFoyaks_.d.ts} +2 -35
- package/dist/libraries/backend/{referralTypes-DUfnhwYC.d.mts → referralTypes-DQvRryhI.d.mts} +2 -35
- package/dist/libraries/backend/remix_dep.js +196 -192
- package/dist/libraries/backend/remix_dep.mjs +8 -8
- package/dist/libraries/backend/routes/analyticsRoutes.js +175 -171
- package/dist/libraries/backend/routes/analyticsRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/backendRouter.js +196 -192
- package/dist/libraries/backend/routes/backendRouter.mjs +8 -8
- package/dist/libraries/backend/routes/entityRoutes.js +172 -168
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +172 -168
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.js +172 -168
- package/dist/libraries/backend/routes/productRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/referralRoutes.js +172 -168
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +196 -192
- package/dist/libraries/backend/supabase.mjs +8 -8
- package/dist/libraries/backend/tanstack.js +196 -192
- package/dist/libraries/backend/tanstack.mjs +8 -8
- package/dist/libraries/backend/utils/backendRes.js +172 -168
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
- package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
- package/dist/libraries/backend/utils/withAuth.js +172 -168
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +3 -3
- package/dist/libraries/react/AutumnContext.d.ts +3 -3
- package/dist/libraries/react/AutumnContext.js +183 -178
- package/dist/libraries/react/AutumnContext.mjs +4 -4
- package/dist/libraries/react/BaseAutumnProvider.d.mts +3 -3
- package/dist/libraries/react/BaseAutumnProvider.d.ts +3 -3
- package/dist/libraries/react/BaseAutumnProvider.js +345 -339
- package/dist/libraries/react/BaseAutumnProvider.mjs +9 -9
- package/dist/libraries/react/{ReactAutumnClient-DBRxtvI5.d.mts → ReactAutumnClient-Cmh9bCXD.d.mts} +14 -14
- package/dist/libraries/react/{ReactAutumnClient-CgvqoNfl.d.ts → ReactAutumnClient-DgCDKkGy.d.ts} +14 -14
- package/dist/libraries/react/ReactAutumnProvider.js +345 -339
- package/dist/libraries/react/ReactAutumnProvider.mjs +11 -11
- package/dist/libraries/react/{chunk-YJ66CCNM.mjs → chunk-2GEDBGON.mjs} +1 -1
- package/dist/libraries/react/{chunk-OCLWLKH7.mjs → chunk-2LZIBRD4.mjs} +4 -4
- package/dist/libraries/react/{chunk-XMJFBTHX.mjs → chunk-36CHQZJY.mjs} +230 -226
- package/dist/libraries/react/chunk-44B5W37R.mjs +87 -0
- package/dist/libraries/react/{chunk-OQMAGWNJ.mjs → chunk-44QHJGA6.mjs} +2 -2
- package/dist/libraries/react/{chunk-OGDFDSBE.mjs → chunk-4KLTPVNG.mjs} +6 -6
- package/dist/libraries/react/{chunk-RZVWBOKP.mjs → chunk-4QVAJKUF.mjs} +5 -5
- package/dist/libraries/react/{chunk-Y3AJHLDS.mjs → chunk-4VSQWJS4.mjs} +1 -1
- package/dist/libraries/react/{chunk-3HGWHP3P.mjs → chunk-5TLRC3ED.mjs} +2 -2
- package/dist/libraries/react/{chunk-ZOXTGPMK.mjs → chunk-BGTIKB6A.mjs} +1 -1
- package/dist/libraries/react/chunk-DBPPVPZJ.mjs +64 -0
- package/dist/libraries/react/{chunk-VFYARVJM.mjs → chunk-DNESIAHJ.mjs} +2 -2
- package/dist/libraries/react/{chunk-VMRN7YTJ.mjs → chunk-HFFUO3H4.mjs} +17 -11
- package/dist/libraries/react/{chunk-MM4LTFTB.mjs → chunk-I274Z7T2.mjs} +11 -11
- package/dist/libraries/react/{chunk-3NVSJPCH.mjs → chunk-KBQOXOZI.mjs} +1 -1
- package/dist/libraries/react/{chunk-74TUFYHU.mjs → chunk-MHAXHLX4.mjs} +7 -7
- package/dist/libraries/react/{chunk-VCTI23H4.mjs → chunk-OONW6MUW.mjs} +1 -1
- package/dist/libraries/react/{chunk-O4KFMQ34.mjs → chunk-PN7IQYUI.mjs} +1 -1
- package/dist/libraries/react/{chunk-2CIFBRPG.mjs → chunk-QEWVBDWJ.mjs} +1 -1
- package/dist/libraries/react/{chunk-ARG7A7DZ.mjs → chunk-QNMARYYM.mjs} +2 -2
- package/dist/libraries/react/{chunk-OK35S3KG.mjs → chunk-QP7QNCAD.mjs} +4 -4
- package/dist/libraries/react/{chunk-G3FR7GFT.mjs → chunk-RCAZVNHB.mjs} +2 -2
- package/dist/libraries/react/{chunk-FO7GCPGQ.mjs → chunk-RW5WXCY5.mjs} +1 -1
- package/dist/libraries/react/{chunk-GWG6ISTT.mjs → chunk-SHJ473YA.mjs} +5 -5
- package/dist/libraries/react/{chunk-XDQLJ7QR.mjs → chunk-TMTPHD2I.mjs} +1 -0
- package/dist/libraries/react/{chunk-UOCXSRR2.mjs → chunk-UO57XQQF.mjs} +19 -19
- package/dist/libraries/react/{chunk-QCGPJ5QU.mjs → chunk-XES6NX2O.mjs} +1 -1
- package/dist/libraries/react/{chunk-YGXSVTYJ.mjs → chunk-ZC2IBKQ6.mjs} +7 -6
- package/dist/libraries/react/client/ConvexAutumnClient.d.mts +5 -5
- package/dist/libraries/react/client/ConvexAutumnClient.d.ts +5 -5
- package/dist/libraries/react/client/ConvexAutumnClient.js +172 -168
- package/dist/libraries/react/client/ConvexAutumnClient.mjs +2 -2
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +3 -3
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +3 -3
- package/dist/libraries/react/client/ReactAutumnClient.js +183 -178
- package/dist/libraries/react/client/ReactAutumnClient.mjs +3 -3
- package/dist/libraries/react/client/clientAnalyticsMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientAnalyticsMethods.d.ts +6 -6
- package/dist/libraries/react/client/clientAnalyticsMethods.js +1 -0
- package/dist/libraries/react/client/clientAnalyticsMethods.mjs +1 -1
- package/dist/libraries/react/client/clientCompMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientCompMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientCusMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientCusMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientEntityMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientEntityMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientGenMethods.d.mts +2 -2
- package/dist/libraries/react/client/clientGenMethods.d.ts +2 -2
- package/dist/libraries/react/client/clientProdMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientProdMethods.d.ts +3 -3
- package/dist/libraries/react/client/clientReferralMethods.d.mts +3 -3
- package/dist/libraries/react/client/clientReferralMethods.d.ts +3 -3
- package/dist/libraries/react/client/types/clientAnalyticsTypes.d.mts +13 -37
- package/dist/libraries/react/client/types/clientAnalyticsTypes.d.ts +13 -37
- package/dist/libraries/react/client/types/clientAnalyticsTypes.js +20 -37
- package/dist/libraries/react/client/types/clientAnalyticsTypes.mjs +17 -32
- package/dist/libraries/react/client/types/clientGenTypes.js +172 -168
- package/dist/libraries/react/client/types/clientGenTypes.mjs +1 -1
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.js +424 -417
- package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +31 -31
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.js +264 -258
- package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +31 -31
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +453 -446
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +31 -31
- package/dist/libraries/react/components/ui/accordion.js +8 -8
- package/dist/libraries/react/components/ui/accordion.mjs +3 -3
- package/dist/libraries/react/components/ui/dialog.js +9 -9
- package/dist/libraries/react/components/ui/dialog.mjs +4 -4
- package/dist/libraries/react/components/ui/popover.js +12 -12
- package/dist/libraries/react/components/ui/popover.mjs +5 -5
- package/dist/libraries/react/components/ui/switch.js +4 -4
- package/dist/libraries/react/components/ui/switch.mjs +3 -3
- package/dist/libraries/react/eventTypes-5iJYcv30.d.mts +26 -0
- package/dist/libraries/react/eventTypes-5iJYcv30.d.ts +26 -0
- package/dist/libraries/react/hooks/helpers/handleCheck.d.mts +3 -3
- package/dist/libraries/react/hooks/helpers/handleCheck.d.ts +3 -3
- package/dist/libraries/react/hooks/helpers/handleCheck.js +172 -168
- package/dist/libraries/react/hooks/helpers/handleCheck.mjs +2 -2
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.mts +3 -3
- package/dist/libraries/react/hooks/helpers/useAutumnBase.d.ts +3 -3
- package/dist/libraries/react/hooks/helpers/useAutumnBase.js +172 -168
- package/dist/libraries/react/hooks/helpers/useAutumnBase.mjs +3 -3
- package/dist/libraries/react/hooks/useAggregateEvents.js +229 -205
- package/dist/libraries/react/hooks/useAggregateEvents.mjs +5 -5
- 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 +217 -204
- package/dist/libraries/react/hooks/useAnalytics.mjs +5 -5
- package/dist/libraries/react/hooks/useCustomer.d.mts +5 -5
- package/dist/libraries/react/hooks/useCustomer.d.ts +5 -5
- package/dist/libraries/react/hooks/useCustomer.js +185 -179
- package/dist/libraries/react/hooks/useCustomer.mjs +9 -9
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +5 -5
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +5 -5
- package/dist/libraries/react/hooks/useCustomerBase.js +345 -339
- package/dist/libraries/react/hooks/useCustomerBase.mjs +8 -8
- package/dist/libraries/react/hooks/useEntity.d.mts +1 -1
- package/dist/libraries/react/hooks/useEntity.d.ts +1 -1
- package/dist/libraries/react/hooks/useEntity.js +183 -178
- package/dist/libraries/react/hooks/useEntity.mjs +9 -9
- package/dist/libraries/react/hooks/useEntityBase.d.mts +3 -3
- package/dist/libraries/react/hooks/useEntityBase.d.ts +3 -3
- package/dist/libraries/react/hooks/useEntityBase.js +183 -178
- package/dist/libraries/react/hooks/useEntityBase.mjs +8 -8
- package/dist/libraries/react/hooks/useListEvents.d.mts +12 -5
- package/dist/libraries/react/hooks/useListEvents.d.ts +12 -5
- package/dist/libraries/react/hooks/useListEvents.js +256 -210
- package/dist/libraries/react/hooks/useListEvents.mjs +5 -5
- package/dist/libraries/react/hooks/usePaywall.js +183 -178
- package/dist/libraries/react/hooks/usePaywall.mjs +5 -5
- 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 +183 -178
- package/dist/libraries/react/hooks/usePricingTable.mjs +6 -6
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +3 -3
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +3 -3
- package/dist/libraries/react/hooks/usePricingTableBase.js +172 -168
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +2 -2
- package/dist/libraries/react/hooks/useProductsBase.d.mts +3 -3
- package/dist/libraries/react/hooks/useProductsBase.d.ts +3 -3
- package/dist/libraries/react/index.d.mts +262 -257
- package/dist/libraries/react/index.d.ts +262 -257
- package/dist/libraries/react/index.js +758 -688
- package/dist/libraries/react/index.mjs +777 -707
- package/dist/next/client/NextAutumnClient.d.mts +32 -32
- package/dist/next/client/NextAutumnClient.d.ts +32 -32
- package/dist/next/client/hooks/useCustomer.d.mts +1 -1
- package/dist/next/client/hooks/useCustomer.d.ts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.mts +1 -1
- package/dist/next/client/hooks/usePricingTable.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +2 -35
- package/dist/next/server/cusActions.d.ts +2 -35
- package/dist/sdk/index.d.mts +34 -51
- package/dist/sdk/index.d.ts +34 -51
- package/dist/sdk/index.js +193 -189
- package/dist/sdk/index.mjs +191 -187
- package/dist/utils/encryptUtils.js +172 -168
- package/dist/utils/encryptUtils.mjs +172 -168
- package/package.json +1 -1
- package/dist/libraries/react/chunk-AEWKNTLD.mjs +0 -48
- package/dist/libraries/react/chunk-VTZUF5OC.mjs +0 -47
- package/dist/libraries/react/eventTypes-MwzIb0X5.d.mts +0 -9
- package/dist/libraries/react/eventTypes-MwzIb0X5.d.ts +0 -9
|
@@ -25,54 +25,6 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
25
25
|
// src/styles/global.css
|
|
26
26
|
styleInject('.au-root *,\n.au-root ::before,\n.au-root ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n.au-root ::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n*:where(.au-root, .au-root *),\n:where(.au-root, .au-root *)::before,\n:where(.au-root, .au-root *)::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n border-color: #e5e7eb;\n}\n:where(.au-root, .au-root *)::before,\n:where(.au-root, .au-root *)::after {\n --tw-content: "";\n}\n.au-root {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n font-family:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n font-feature-settings: normal;\n font-variation-settings: normal;\n -webkit-tap-highlight-color: transparent;\n}\n.au-root {\n margin: 0;\n line-height: inherit;\n}\nhr:where(.au-root, .au-root *) {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n}\nabbr:where([title]):where(.au-root, .au-root *) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\nh1:where(.au-root, .au-root *),\nh2:where(.au-root, .au-root *),\nh3:where(.au-root, .au-root *),\nh4:where(.au-root, .au-root *),\nh5:where(.au-root, .au-root *),\nh6:where(.au-root, .au-root *) {\n font-size: inherit;\n font-weight: inherit;\n}\na:where(.au-root, .au-root *) {\n color: inherit;\n text-decoration: inherit;\n}\nb:where(.au-root, .au-root *),\nstrong:where(.au-root, .au-root *) {\n font-weight: bolder;\n}\ncode:where(.au-root, .au-root *),\nkbd:where(.au-root, .au-root *),\nsamp:where(.au-root, .au-root *),\npre:where(.au-root, .au-root *) {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n font-feature-settings: normal;\n font-variation-settings: normal;\n font-size: 1em;\n}\nsmall:where(.au-root, .au-root *) {\n font-size: 80%;\n}\nsub:where(.au-root, .au-root *),\nsup:where(.au-root, .au-root *) {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub:where(.au-root, .au-root *) {\n bottom: -0.25em;\n}\nsup:where(.au-root, .au-root *) {\n top: -0.5em;\n}\ntable:where(.au-root, .au-root *) {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n}\nbutton:where(.au-root, .au-root *),\ninput:where(.au-root, .au-root *),\noptgroup:where(.au-root, .au-root *),\nselect:where(.au-root, .au-root *),\ntextarea:where(.au-root, .au-root *) {\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n}\nbutton:where(.au-root, .au-root *),\nselect:where(.au-root, .au-root *) {\n text-transform: none;\n}\nbutton:where(.au-root, .au-root *),\ninput:where([type=button]):where(.au-root, .au-root *),\ninput:where([type=reset]):where(.au-root, .au-root *),\ninput:where([type=submit]):where(.au-root, .au-root *) {\n -webkit-appearance: button;\n background-color: transparent;\n background-image: none;\n}\n:-moz-focusring:where(.au-root, .au-root *) {\n outline: auto;\n}\n:-moz-ui-invalid:where(.au-root, .au-root *) {\n box-shadow: none;\n}\nprogress:where(.au-root, .au-root *) {\n vertical-align: baseline;\n}\n:where(.au-root, .au-root *) ::-webkit-inner-spin-button,\n:where(.au-root, .au-root *) ::-webkit-outer-spin-button {\n height: auto;\n}\n[type=search]:where(.au-root, .au-root *) {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n}\n:where(.au-root, .au-root *) ::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n:where(.au-root, .au-root *) ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n}\nsummary:where(.au-root, .au-root *) {\n display: list-item;\n}\nblockquote:where(.au-root, .au-root *),\ndl:where(.au-root, .au-root *),\ndd:where(.au-root, .au-root *),\nh1:where(.au-root, .au-root *),\nh2:where(.au-root, .au-root *),\nh3:where(.au-root, .au-root *),\nh4:where(.au-root, .au-root *),\nh5:where(.au-root, .au-root *),\nh6:where(.au-root, .au-root *),\nhr:where(.au-root, .au-root *),\nfigure:where(.au-root, .au-root *),\np:where(.au-root, .au-root *),\npre:where(.au-root, .au-root *) {\n margin: 0;\n}\nfieldset:where(.au-root, .au-root *) {\n margin: 0;\n padding: 0;\n}\nlegend:where(.au-root, .au-root *) {\n padding: 0;\n}\nol:where(.au-root, .au-root *),\nul:where(.au-root, .au-root *),\nmenu:where(.au-root, .au-root *) {\n list-style: none;\n margin: 0;\n padding: 0;\n}\ndialog:where(.au-root, .au-root *) {\n padding: 0;\n}\ntextarea:where(.au-root, .au-root *) {\n resize: vertical;\n}\n:where(.au-root, .au-root *) input::-moz-placeholder,\n:where(.au-root, .au-root *) textarea::-moz-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n:where(.au-root, .au-root *) input::placeholder,\n:where(.au-root, .au-root *) textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\nbutton:where(.au-root, .au-root *),\n[role=button]:where(.au-root, .au-root *) {\n cursor: pointer;\n}\n:disabled:where(.au-root, .au-root *) {\n cursor: default;\n}\nimg:where(.au-root, .au-root *),\nsvg:where(.au-root, .au-root *),\nvideo:where(.au-root, .au-root *),\ncanvas:where(.au-root, .au-root *),\naudio:where(.au-root, .au-root *),\niframe:where(.au-root, .au-root *),\nembed:where(.au-root, .au-root *),\nobject:where(.au-root, .au-root *) {\n display: block;\n vertical-align: middle;\n}\nimg:where(.au-root, .au-root *),\nvideo:where(.au-root, .au-root *) {\n max-width: 100%;\n height: auto;\n}\n[hidden]:where(:not([hidden=until-found])):where(.au-root, .au-root *) {\n display: none;\n}\n.au-root * {\n border-color: hsl(var(--au-border));\n}\n.au-root body {\n background-color: hsl(var(--au-background));\n color: hsl(var(--au-foreground));\n}\n.au-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.au-pointer-events-none {\n pointer-events: none;\n}\n.au-fixed {\n position: fixed;\n}\n.au-absolute {\n position: absolute;\n}\n.au-relative {\n position: relative;\n}\n.au-inset-0 {\n inset: 0px;\n}\n.au-left-\\[50\\%\\] {\n left: 50%;\n}\n.au-right-4 {\n right: 1rem;\n}\n.au-right-\\[-1px\\] {\n right: -1px;\n}\n.au-top-4 {\n top: 1rem;\n}\n.au-top-\\[-1px\\] {\n top: -1px;\n}\n.au-top-\\[50\\%\\] {\n top: 50%;\n}\n.au-z-50 {\n z-index: 50;\n}\n.au-z-\\[9999\\] {\n z-index: 9999;\n}\n.au-my-0 {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n.au-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.au-mb-0 {\n margin-bottom: 0px;\n}\n.au-mb-1 {\n margin-bottom: 0.25rem;\n}\n.au-mb-2 {\n margin-bottom: 0.5rem;\n}\n.au-mb-4 {\n margin-bottom: 1rem;\n}\n.au-mb-6 {\n margin-bottom: 1.5rem;\n}\n.au-mb-8 {\n margin-bottom: 2rem;\n}\n.au-mt-0\\.5 {\n margin-top: 0.125rem;\n}\n.au-mt-1 {\n margin-top: 0.25rem;\n}\n.au-mt-2 {\n margin-top: 0.5rem;\n}\n.au-mt-4 {\n margin-top: 1rem;\n}\n.au-line-clamp-2 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.au-block {\n display: block;\n}\n.au-flex {\n display: flex;\n}\n.au-inline-flex {\n display: inline-flex;\n}\n.au-grid {\n display: grid;\n}\n.\\!au-h-3 {\n height: 0.75rem !important;\n}\n.\\!au-h-4 {\n height: 1rem !important;\n}\n.\\!au-h-7 {\n height: 1.75rem !important;\n}\n.au-h-10 {\n height: 2.5rem;\n}\n.au-h-16 {\n height: 4rem;\n}\n.au-h-4 {\n height: 1rem;\n}\n.au-h-5 {\n height: 1.25rem;\n}\n.au-h-7 {\n height: 1.75rem;\n}\n.au-h-8 {\n height: 2rem;\n}\n.au-h-9 {\n height: 2.25rem;\n}\n.au-h-full {\n height: 100%;\n}\n.\\!au-w-4 {\n width: 1rem !important;\n}\n.au-w-14 {\n width: 3.5rem;\n}\n.au-w-16 {\n width: 4rem;\n}\n.au-w-4 {\n width: 1rem;\n}\n.au-w-72 {\n width: 18rem;\n}\n.au-w-80 {\n width: 20rem;\n}\n.au-w-9 {\n width: 2.25rem;\n}\n.au-w-full {\n width: 100%;\n}\n.au-min-w-0 {\n min-width: 0px;\n}\n.au-min-w-16 {\n min-width: 4rem;\n}\n.au-min-w-20 {\n min-width: 5rem;\n}\n.au-max-w-lg {\n max-width: 32rem;\n}\n.au-max-w-xl {\n max-width: 36rem;\n}\n.au-flex-1 {\n flex: 1 1 0%;\n}\n.au-flex-shrink-0 {\n flex-shrink: 0;\n}\n.au-shrink-0 {\n flex-shrink: 0;\n}\n.au-flex-grow {\n flex-grow: 1;\n}\n.au-origin-\\[--radix-popover-content-transform-origin\\] {\n transform-origin: var(--radix-popover-content-transform-origin);\n}\n.au-translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-translate-y-\\[130\\%\\] {\n --tw-translate-y: 130%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-rotate-90 {\n --tw-rotate: 90deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes au-spin {\n to {\n transform: rotate(360deg);\n }\n}\n.au-animate-spin {\n animation: au-spin 1s linear infinite;\n}\n.au-cursor-not-allowed {\n cursor: not-allowed;\n}\n.au-cursor-pointer {\n cursor: pointer;\n}\n.au-grid-cols-1 {\n grid-template-columns: repeat(1, minmax(0, 1fr));\n}\n.au-flex-col {\n flex-direction: column;\n}\n.au-flex-col-reverse {\n flex-direction: column-reverse;\n}\n.au-items-start {\n align-items: flex-start;\n}\n.au-items-end {\n align-items: flex-end;\n}\n.au-items-center {\n align-items: center;\n}\n.au-justify-end {\n justify-content: flex-end;\n}\n.au-justify-center {\n justify-content: center;\n}\n.au-justify-between {\n justify-content: space-between;\n}\n.au-gap-0 {\n gap: 0px;\n}\n.au-gap-1 {\n gap: 0.25rem;\n}\n.au-gap-2 {\n gap: 0.5rem;\n}\n.au-gap-4 {\n gap: 1rem;\n}\n.au-gap-x-4 {\n -moz-column-gap: 1rem;\n column-gap: 1rem;\n}\n.au-space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.au-space-y-1\\.5 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.375rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.375rem * var(--tw-space-y-reverse));\n}\n.au-space-y-3 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));\n}\n.au-overflow-hidden {\n overflow: hidden;\n}\n.au-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.au-whitespace-nowrap {\n white-space: nowrap;\n}\n.au-rounded-full {\n border-radius: 9999px;\n}\n.au-rounded-lg {\n border-radius: var(--au-radius);\n}\n.au-rounded-md {\n border-radius: calc(var(--au-radius) - 2px);\n}\n.au-rounded-sm {\n border-radius: calc(var(--au-radius) - 4px);\n}\n.au-rounded-bl-lg {\n border-bottom-left-radius: var(--au-radius);\n}\n.au-border {\n border-width: 1px;\n}\n.au-border-2 {\n border-width: 2px;\n}\n.au-border-y {\n border-top-width: 1px;\n border-bottom-width: 1px;\n}\n.au-border-b {\n border-bottom-width: 1px;\n}\n.au-border-b-0 {\n border-bottom-width: 0px;\n}\n.au-border-t {\n border-top-width: 1px;\n}\n.au-border-none {\n border-style: none;\n}\n.au-border-input {\n border-color: hsl(var(--au-input));\n}\n.au-border-transparent {\n border-color: transparent;\n}\n.au-border-zinc-200 {\n --tw-border-opacity: 1;\n border-color: rgb(228 228 231 / var(--tw-border-opacity, 1));\n}\n.au-bg-accent\\/80 {\n background-color: hsl(var(--au-accent) / 0.8);\n}\n.au-bg-background {\n background-color: hsl(var(--au-background));\n}\n.au-bg-black\\/40 {\n background-color: rgb(0 0 0 / 0.4);\n}\n.au-bg-destructive {\n background-color: hsl(var(--au-destructive));\n}\n.au-bg-popover {\n background-color: hsl(var(--au-popover));\n}\n.au-bg-primary {\n background-color: hsl(var(--au-primary));\n}\n.au-bg-secondary {\n background-color: hsl(var(--au-secondary));\n}\n.au-bg-secondary\\/40 {\n background-color: hsl(var(--au-secondary) / 0.4);\n}\n.au-bg-transparent {\n background-color: transparent;\n}\n.au-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.au-p-0 {\n padding: 0px;\n}\n.au-p-4 {\n padding: 1rem;\n}\n.au-p-6 {\n padding: 1.5rem;\n}\n.\\!au-py-10 {\n padding-top: 2.5rem !important;\n padding-bottom: 2.5rem !important;\n}\n.au-px-1 {\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n}\n.au-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.au-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.au-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.au-px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.au-py-0 {\n padding-top: 0px;\n padding-bottom: 0px;\n}\n.au-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n}\n.au-py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.au-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.au-py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.au-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.au-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.au-pb-2 {\n padding-bottom: 0.5rem;\n}\n.au-pb-4 {\n padding-bottom: 1rem;\n}\n.au-pl-6 {\n padding-left: 1.5rem;\n}\n.au-pr-3 {\n padding-right: 0.75rem;\n}\n.au-pt-0 {\n padding-top: 0px;\n}\n.au-pt-3 {\n padding-top: 0.75rem;\n}\n.au-pt-4 {\n padding-top: 1rem;\n}\n.au-text-left {\n text-align: left;\n}\n.au-text-center {\n text-align: center;\n}\n.au-text-end {\n text-align: end;\n}\n.au-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.au-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.au-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.au-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.au-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.au-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.au-font-bold {\n font-weight: 700;\n}\n.au-font-light {\n font-weight: 300;\n}\n.au-font-medium {\n font-weight: 500;\n}\n.au-font-normal {\n font-weight: 400;\n}\n.au-font-semibold {\n font-weight: 600;\n}\n.au-leading-none {\n line-height: 1;\n}\n.au-tracking-tight {\n letter-spacing: -0.025em;\n}\n.au-text-destructive-foreground {\n color: hsl(var(--au-destructive-foreground));\n}\n.au-text-foreground {\n color: hsl(var(--au-foreground));\n}\n.au-text-muted-foreground {\n color: hsl(var(--au-muted-foreground));\n}\n.au-text-popover-foreground {\n color: hsl(var(--au-popover-foreground));\n}\n.au-text-primary {\n color: hsl(var(--au-primary));\n}\n.au-text-primary-foreground {\n color: hsl(var(--au-primary-foreground));\n}\n.au-text-secondary-foreground {\n color: hsl(var(--au-secondary-foreground));\n}\n.au-underline-offset-4 {\n text-underline-offset: 4px;\n}\n.au-opacity-70 {\n opacity: 0.7;\n}\n.au-opacity-80 {\n opacity: 0.8;\n}\n.au-shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-inner {\n --tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n}\n.au-shadow-stone-400 {\n --tw-shadow-color: #a8a29e;\n --tw-shadow: var(--tw-shadow-colored);\n}\n.au-outline-none {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.au-ring-0 {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.au-ring-offset-background {\n --tw-ring-offset-color: hsl(var(--au-background));\n}\n.au-backdrop-blur-sm {\n --tw-backdrop-blur: blur(4px);\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);\n}\n.au-transition {\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke,\n opacity,\n box-shadow,\n transform,\n filter,\n backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-\\[color\\,box-shadow\\] {\n transition-property: color, box-shadow;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n text-decoration-color,\n fill,\n stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-opacity {\n transition-property: opacity;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-transition-transform {\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.au-duration-200 {\n transition-duration: 200ms;\n}\n.au-duration-300 {\n transition-duration: 300ms;\n}\n.au-ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n.au-duration-200 {\n animation-duration: 200ms;\n}\n.au-duration-300 {\n animation-duration: 300ms;\n}\n.au-ease-in-out {\n animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n.au-root {\n --au-background: 0 0% 100%;\n --au-foreground: 240 10% 3.9%;\n --au-card: 0 0% 100%;\n --au-card-foreground: 240 10% 3.9%;\n --au-popover: 0 0% 100%;\n --au-popover-foreground: 240 10% 3.9%;\n --au-primary: 240 5.9% 10%;\n --au-primary-foreground: 0 0% 98%;\n --au-secondary: 240 4.8% 95.9%;\n --au-secondary-foreground: 240 5.9% 10%;\n --au-muted: 240 4.8% 95.9%;\n --au-muted-foreground: 240 3.8% 46.1%;\n --au-accent: 240 4.8% 95.9%;\n --au-accent-foreground: 240 5.9% 10%;\n --au-destructive: 0 84.2% 60.2%;\n --au-destructive-foreground: 0 0% 98%;\n --au-border: 240 5.9% 90%;\n --au-input: 240 5.9% 90%;\n --au-ring: 240 10% 3.9%;\n --au-chart-1: 12 76% 61%;\n --au-chart-2: 173 58% 39%;\n --au-chart-3: 197 37% 24%;\n --au-chart-4: 43 74% 66%;\n --au-chart-5: 27 87% 67%;\n --au-radius: 0.5rem;\n --au-sidebar-background: 0 0% 98%;\n --au-sidebar-foreground: 240 5.3% 26.1%;\n --au-sidebar-primary: 240 5.9% 10%;\n --au-sidebar-primary-foreground: 0 0% 98%;\n --au-sidebar-accent: 240 4.8% 95.9%;\n --au-sidebar-accent-foreground: 240 5.9% 10%;\n --au-sidebar-border: 220 13% 91%;\n --au-sidebar-ring: 217.2 91.2% 59.8%;\n}\n.au-root.dark {\n --au-background: 240 10% 3.9%;\n --au-foreground: 0 0% 98%;\n --au-card: 240 10% 3.9%;\n --au-card-foreground: 0 0% 98%;\n --au-popover: 240 10% 3.9%;\n --au-popover-foreground: 0 0% 98%;\n --au-primary: 0 0% 98%;\n --au-primary-foreground: 240 5.9% 10%;\n --au-secondary: 240 3.7% 15.9%;\n --au-secondary-foreground: 0 0% 98%;\n --au-muted: 240 3.7% 15.9%;\n --au-muted-foreground: 240 5% 64.9%;\n --au-accent: 240 3.7% 15.9%;\n --au-accent-foreground: 0 0% 98%;\n --au-destructive: 0 62.8% 30.6%;\n --au-destructive-foreground: 0 0% 98%;\n --au-border: 240 3.7% 15.9%;\n --au-input: 240 3.7% 15.9%;\n --au-ring: 240 4.9% 83.9%;\n --au-chart-1: 220 70% 50%;\n --au-chart-2: 160 60% 45%;\n --au-chart-3: 30 80% 55%;\n --au-chart-4: 280 65% 60%;\n --au-chart-5: 340 75% 55%;\n --au-sidebar-background: 240 5.9% 10%;\n --au-sidebar-foreground: 240 4.8% 95.9%;\n --au-sidebar-primary: 224.3 76.3% 48%;\n --au-sidebar-primary-foreground: 0 0% 100%;\n --au-sidebar-accent: 240 3.7% 15.9%;\n --au-sidebar-accent-foreground: 240 4.8% 95.9%;\n --au-sidebar-border: 240 3.7% 15.9%;\n --au-sidebar-ring: 217.2 91.2% 59.8%;\n}.dark .au-root {\n --au-background: 240 10% 3.9%;\n --au-foreground: 0 0% 98%;\n --au-card: 240 10% 3.9%;\n --au-card-foreground: 0 0% 98%;\n --au-popover: 240 10% 3.9%;\n --au-popover-foreground: 0 0% 98%;\n --au-primary: 0 0% 98%;\n --au-primary-foreground: 240 5.9% 10%;\n --au-secondary: 240 3.7% 15.9%;\n --au-secondary-foreground: 0 0% 98%;\n --au-muted: 240 3.7% 15.9%;\n --au-muted-foreground: 240 5% 64.9%;\n --au-accent: 240 3.7% 15.9%;\n --au-accent-foreground: 0 0% 98%;\n --au-destructive: 0 62.8% 30.6%;\n --au-destructive-foreground: 0 0% 98%;\n --au-border: 240 3.7% 15.9%;\n --au-input: 240 3.7% 15.9%;\n --au-ring: 240 4.9% 83.9%;\n --au-chart-1: 220 70% 50%;\n --au-chart-2: 160 60% 45%;\n --au-chart-3: 30 80% 55%;\n --au-chart-4: 280 65% 60%;\n --au-chart-5: 340 75% 55%;\n --au-sidebar-background: 240 5.9% 10%;\n --au-sidebar-foreground: 240 4.8% 95.9%;\n --au-sidebar-primary: 224.3 76.3% 48%;\n --au-sidebar-primary-foreground: 0 0% 100%;\n --au-sidebar-accent: 240 3.7% 15.9%;\n --au-sidebar-accent-foreground: 240 4.8% 95.9%;\n --au-sidebar-border: 240 3.7% 15.9%;\n --au-sidebar-ring: 217.2 91.2% 59.8%;\n}\n.selection\\:au-bg-primary *::-moz-selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-bg-primary *::selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-text-primary-foreground *::-moz-selection {\n color: hsl(var(--au-primary-foreground));\n}\n.selection\\:au-text-primary-foreground *::selection {\n color: hsl(var(--au-primary-foreground));\n}\n.selection\\:au-bg-primary::-moz-selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-bg-primary::selection {\n background-color: hsl(var(--au-primary));\n}\n.selection\\:au-text-primary-foreground::-moz-selection {\n color: hsl(var(--au-primary-foreground));\n}\n.selection\\:au-text-primary-foreground::selection {\n color: hsl(var(--au-primary-foreground));\n}\n.file\\:au-inline-flex::file-selector-button {\n display: inline-flex;\n}\n.file\\:au-h-7::file-selector-button {\n height: 1.75rem;\n}\n.file\\:au-border-0::file-selector-button {\n border-width: 0px;\n}\n.file\\:au-bg-transparent::file-selector-button {\n background-color: transparent;\n}\n.file\\:au-text-sm::file-selector-button {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.file\\:au-font-medium::file-selector-button {\n font-weight: 500;\n}\n.file\\:au-text-foreground::file-selector-button {\n color: hsl(var(--au-foreground));\n}\n.placeholder\\:au-text-muted-foreground::-moz-placeholder {\n color: hsl(var(--au-muted-foreground));\n}\n.placeholder\\:au-text-muted-foreground::placeholder {\n color: hsl(var(--au-muted-foreground));\n}\n.hover\\:au-bg-accent:hover {\n background-color: hsl(var(--au-accent));\n}\n.hover\\:au-bg-destructive\\/90:hover {\n background-color: hsl(var(--au-destructive) / 0.9);\n}\n.hover\\:au-bg-primary\\/90:hover {\n background-color: hsl(var(--au-primary) / 0.9);\n}\n.hover\\:au-bg-secondary\\/80:hover {\n background-color: hsl(var(--au-secondary) / 0.8);\n}\n.hover\\:au-bg-zinc-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(244 244 245 / var(--tw-bg-opacity, 1));\n}\n.hover\\:au-text-accent-foreground:hover {\n color: hsl(var(--au-accent-foreground));\n}\n.hover\\:au-text-foreground:hover {\n color: hsl(var(--au-foreground));\n}\n.hover\\:au-underline:hover {\n text-decoration-line: underline;\n}\n.hover\\:au-opacity-100:hover {\n opacity: 1;\n}\n.hover\\:au-brightness-90:hover {\n --tw-brightness: brightness(.9);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.focus\\:au-outline-none:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus\\:\\!au-ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000) !important;\n}\n.focus\\:au-ring-2:focus {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus\\:au-ring-ring:focus {\n --tw-ring-color: hsl(var(--au-ring));\n}\n.focus\\:au-ring-offset-2:focus {\n --tw-ring-offset-width: 2px;\n}\n.focus-visible\\:au-border-ring:focus-visible {\n border-color: hsl(var(--au-ring));\n}\n.focus-visible\\:au-outline-none:focus-visible {\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.focus-visible\\:au-ring-1:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:au-ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:au-ring-\\[3px\\]:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow:\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow, 0 0 #0000);\n}\n.focus-visible\\:au-ring-ring:focus-visible {\n --tw-ring-color: hsl(var(--au-ring));\n}\n.focus-visible\\:au-ring-ring\\/50:focus-visible {\n --tw-ring-color: hsl(var(--au-ring) / 0.5);\n}\n.focus-visible\\:au-ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px;\n}\n.focus-visible\\:au-ring-offset-background:focus-visible {\n --tw-ring-offset-color: hsl(var(--au-background));\n}\n.disabled\\:au-pointer-events-none:disabled {\n pointer-events: none;\n}\n.disabled\\:au-cursor-not-allowed:disabled {\n cursor: not-allowed;\n}\n.disabled\\:au-opacity-50:disabled {\n opacity: 0.5;\n}\n.au-group:hover .group-hover\\:au-mt-0 {\n margin-top: 0px;\n}\n.au-group:hover .group-hover\\:au-translate-y-0 {\n --tw-translate-y: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.au-group:hover .group-hover\\:au-translate-y-\\[-130\\%\\] {\n --tw-translate-y: -130%;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.data-\\[state\\=checked\\]\\:au-translate-x-4[data-state=checked] {\n --tw-translate-x: 1rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.data-\\[state\\=unchecked\\]\\:au-translate-x-0[data-state=unchecked] {\n --tw-translate-x: 0px;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n@keyframes au-accordion-up {\n from {\n height: var(--radix-accordion-content-height);\n }\n to {\n height: 0;\n }\n}\n.data-\\[state\\=closed\\]\\:au-animate-accordion-up[data-state=closed] {\n animation: au-accordion-up 0.2s ease-out;\n}\n@keyframes au-accordion-down {\n from {\n height: 0;\n }\n to {\n height: var(--radix-accordion-content-height);\n }\n}\n.data-\\[state\\=open\\]\\:au-animate-accordion-down[data-state=open] {\n animation: au-accordion-down 0.2s ease-out;\n}\n.data-\\[state\\=checked\\]\\:au-bg-primary[data-state=checked] {\n background-color: hsl(var(--au-primary));\n}\n.data-\\[state\\=open\\]\\:au-bg-accent[data-state=open] {\n background-color: hsl(var(--au-accent));\n}\n.data-\\[state\\=unchecked\\]\\:au-bg-input[data-state=unchecked] {\n background-color: hsl(var(--au-input));\n}\n.data-\\[state\\=open\\]\\:au-text-muted-foreground[data-state=open] {\n color: hsl(var(--au-muted-foreground));\n}\n.data-\\[state\\=open\\]\\:au-animate-in[data-state=open] {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n.data-\\[state\\=closed\\]\\:au-animate-out[data-state=closed] {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n.data-\\[state\\=closed\\]\\:au-fade-out-0[data-state=closed] {\n --tw-exit-opacity: 0;\n}\n.data-\\[state\\=open\\]\\:au-fade-in-0[data-state=open] {\n --tw-enter-opacity: 0;\n}\n.data-\\[state\\=closed\\]\\:au-zoom-out-95[data-state=closed] {\n --tw-exit-scale: .95;\n}\n.data-\\[state\\=open\\]\\:au-zoom-in-95[data-state=open] {\n --tw-enter-scale: .95;\n}\n.data-\\[side\\=bottom\\]\\:au-slide-in-from-top-2[data-side=bottom] {\n --tw-enter-translate-y: -0.5rem;\n}\n.data-\\[side\\=left\\]\\:au-slide-in-from-right-2[data-side=left] {\n --tw-enter-translate-x: 0.5rem;\n}\n.data-\\[side\\=right\\]\\:au-slide-in-from-left-2[data-side=right] {\n --tw-enter-translate-x: -0.5rem;\n}\n.data-\\[side\\=top\\]\\:au-slide-in-from-bottom-2[data-side=top] {\n --tw-enter-translate-y: 0.5rem;\n}\n.data-\\[state\\=closed\\]\\:au-slide-out-to-left-1\\/2[data-state=closed] {\n --tw-exit-translate-x: -50%;\n}\n.data-\\[state\\=closed\\]\\:au-slide-out-to-top-\\[48\\%\\][data-state=closed] {\n --tw-exit-translate-y: -48%;\n}\n.data-\\[state\\=open\\]\\:au-slide-in-from-left-1\\/2[data-state=open] {\n --tw-enter-translate-x: -50%;\n}\n.data-\\[state\\=open\\]\\:au-slide-in-from-top-\\[48\\%\\][data-state=open] {\n --tw-enter-translate-y: -48%;\n}\n.dark\\:au-bg-input\\/30:is(.au-dark *) {\n background-color: hsl(var(--au-input) / 0.3);\n}\n.dark\\:au-shadow-zinc-800\\/80:is(.au-dark *) {\n --tw-shadow-color: rgb(39 39 42 / 0.8);\n --tw-shadow: var(--tw-shadow-colored);\n}\n@media (min-width: 640px) {\n .sm\\:au-h-7 {\n height: 1.75rem;\n }\n .sm\\:au-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .sm\\:au-flex-row {\n flex-direction: row;\n }\n .sm\\:au-items-center {\n align-items: center;\n }\n .sm\\:au-justify-end {\n justify-content: flex-end;\n }\n .sm\\:au-gap-2 {\n gap: 0.5rem;\n }\n .sm\\:au-space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n }\n .sm\\:au-rounded-lg {\n border-radius: var(--au-radius);\n }\n .sm\\:au-pb-0 {\n padding-bottom: 0px;\n }\n .sm\\:au-text-left {\n text-align: left;\n }\n}\n@media (min-width: 768px) {\n .md\\:au-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n }\n}\n@media (min-width: 1024px) {\n .lg\\:au-right-4 {\n right: 1rem;\n }\n .lg\\:au-top-4 {\n top: 1rem;\n }\n .lg\\:au-h-\\[calc\\(100\\%\\+48px\\)\\] {\n height: calc(100% + 48px);\n }\n .lg\\:au--translate-y-12 {\n --tw-translate-y: -3rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n }\n .lg\\:au--translate-y-6 {\n --tw-translate-y: -1.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n }\n .lg\\:au-translate-y-6 {\n --tw-translate-y: 1.5rem;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n }\n .lg\\:au-grid-cols-\\[repeat\\(auto-fit\\,minmax\\(200px\\,1fr\\)\\)\\] {\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n }\n .lg\\:au-rounded-full {\n border-radius: 9999px;\n }\n .lg\\:au-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem;\n }\n .lg\\:au-shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow:\n var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000),\n var(--tw-shadow);\n }\n}\n.\\[\\&\\[data-state\\=open\\]\\>svg\\]\\:au-rotate-180[data-state=open] > svg {\n --tw-rotate: 180deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.\\[\\&\\[data-state\\=open\\]_svg\\]\\:au-rotate-0[data-state=open] svg {\n --tw-rotate: 0deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.\\[\\&_svg\\]\\:au-pointer-events-none svg {\n pointer-events: none;\n}\n.\\[\\&_svg\\]\\:au-size-4 svg {\n width: 1rem;\n height: 1rem;\n}\n.\\[\\&_svg\\]\\:au-shrink-0 svg {\n flex-shrink: 0;\n}\n');
|
|
27
27
|
|
|
28
|
-
// src/libraries/react/BaseAutumnProvider.tsx
|
|
29
|
-
import { useRef } from "react";
|
|
30
|
-
import { useState as useState2 } from "react";
|
|
31
|
-
|
|
32
|
-
// src/libraries/react/hooks/helpers/useDialog.tsx
|
|
33
|
-
import { useState, useEffect } from "react";
|
|
34
|
-
var useDialog = (component) => {
|
|
35
|
-
const [dialogProps, setDialogProps] = useState(null);
|
|
36
|
-
const [dialogOpen, setDialogOpen] = useState(false);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (!dialogOpen) {
|
|
39
|
-
setTimeout(() => {
|
|
40
|
-
setDialogProps(null);
|
|
41
|
-
}, 200);
|
|
42
|
-
}
|
|
43
|
-
}, [dialogOpen]);
|
|
44
|
-
return [dialogProps, setDialogProps, dialogOpen, setDialogOpen];
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
48
|
-
import useSWR2 from "swr";
|
|
49
|
-
|
|
50
|
-
// src/sdk/error.ts
|
|
51
|
-
var AutumnError = class _AutumnError extends Error {
|
|
52
|
-
message;
|
|
53
|
-
code;
|
|
54
|
-
constructor(response) {
|
|
55
|
-
super(response.message);
|
|
56
|
-
this.message = response.message;
|
|
57
|
-
this.code = response.code;
|
|
58
|
-
}
|
|
59
|
-
static fromError(error) {
|
|
60
|
-
return new _AutumnError({
|
|
61
|
-
message: error.message || "Unknown error",
|
|
62
|
-
code: error.code || "unknown_error"
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
toString() {
|
|
66
|
-
return `${this.message} (code: ${this.code})`;
|
|
67
|
-
}
|
|
68
|
-
toJSON() {
|
|
69
|
-
return {
|
|
70
|
-
message: this.message,
|
|
71
|
-
code: this.code
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
28
|
// src/sdk/general/genMethods.ts
|
|
77
29
|
var handleCheckout = async ({
|
|
78
30
|
instance,
|
|
@@ -158,6 +110,32 @@ var buildPathWithQuery = (basePath, params) => {
|
|
|
158
110
|
return query ? `${basePath}?${query}` : basePath;
|
|
159
111
|
};
|
|
160
112
|
|
|
113
|
+
// src/sdk/error.ts
|
|
114
|
+
var AutumnError = class _AutumnError extends Error {
|
|
115
|
+
message;
|
|
116
|
+
code;
|
|
117
|
+
constructor(response) {
|
|
118
|
+
super(response.message);
|
|
119
|
+
this.message = response.message;
|
|
120
|
+
this.code = response.code;
|
|
121
|
+
}
|
|
122
|
+
static fromError(error) {
|
|
123
|
+
return new _AutumnError({
|
|
124
|
+
message: error.message || "Unknown error",
|
|
125
|
+
code: error.code || "unknown_error"
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
toString() {
|
|
129
|
+
return `${this.message} (code: ${this.code})`;
|
|
130
|
+
}
|
|
131
|
+
toJSON() {
|
|
132
|
+
return {
|
|
133
|
+
message: this.message,
|
|
134
|
+
code: this.code
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
161
139
|
// src/sdk/customers/cusMethods.ts
|
|
162
140
|
var customerMethods = (instance) => {
|
|
163
141
|
return {
|
|
@@ -782,6 +760,17 @@ var Autumn = class {
|
|
|
782
760
|
}
|
|
783
761
|
};
|
|
784
762
|
|
|
763
|
+
// src/sdk/customers/cusEnums.ts
|
|
764
|
+
import { z } from "zod/v4";
|
|
765
|
+
var CustomerExpandEnum = z.enum([
|
|
766
|
+
"invoices",
|
|
767
|
+
"rewards",
|
|
768
|
+
"trials_used",
|
|
769
|
+
"entities",
|
|
770
|
+
"referrals",
|
|
771
|
+
"payment_method"
|
|
772
|
+
]);
|
|
773
|
+
|
|
785
774
|
// src/sdk/products/prodEnums.ts
|
|
786
775
|
var ProductItemInterval = /* @__PURE__ */ ((ProductItemInterval2) => {
|
|
787
776
|
ProductItemInterval2["Minute"] = "minute";
|
|
@@ -796,17 +785,6 @@ var ProductItemInterval = /* @__PURE__ */ ((ProductItemInterval2) => {
|
|
|
796
785
|
return ProductItemInterval2;
|
|
797
786
|
})(ProductItemInterval || {});
|
|
798
787
|
|
|
799
|
-
// src/sdk/customers/cusEnums.ts
|
|
800
|
-
import { z } from "zod/v4";
|
|
801
|
-
var CustomerExpandEnum = z.enum([
|
|
802
|
-
"invoices",
|
|
803
|
-
"rewards",
|
|
804
|
-
"trials_used",
|
|
805
|
-
"entities",
|
|
806
|
-
"referrals",
|
|
807
|
-
"payment_method"
|
|
808
|
-
]);
|
|
809
|
-
|
|
810
788
|
// src/sdk/customers/cusTypes.ts
|
|
811
789
|
import { z as z2 } from "zod/v4";
|
|
812
790
|
var CoreCusFeatureSchema = z2.object({
|
|
@@ -874,80 +852,103 @@ var ListCustomersParamsSchema = z2.object({
|
|
|
874
852
|
offset: z2.number().optional()
|
|
875
853
|
});
|
|
876
854
|
|
|
877
|
-
// src/sdk/
|
|
855
|
+
// src/sdk/customers/entities/entTypes.ts
|
|
878
856
|
import { z as z3 } from "zod/v4";
|
|
879
|
-
var
|
|
880
|
-
|
|
881
|
-
feature_id: z3.string()
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
857
|
+
var EntityDataSchema = z3.object({
|
|
858
|
+
name: z3.string().optional(),
|
|
859
|
+
feature_id: z3.string()
|
|
860
|
+
});
|
|
861
|
+
var TransferProductParamsSchema = z3.object({
|
|
862
|
+
from_entity_id: z3.string(),
|
|
863
|
+
to_entity_id: z3.string(),
|
|
864
|
+
product_id: z3.string()
|
|
865
|
+
});
|
|
886
866
|
|
|
887
|
-
// src/sdk/
|
|
867
|
+
// src/sdk/general/pageTypes.ts
|
|
888
868
|
import { z as z4 } from "zod/v4";
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
|
|
869
|
+
var PagePaginationDefaults = {
|
|
870
|
+
Limit: 100,
|
|
871
|
+
MaxLimit: 1e3
|
|
872
|
+
};
|
|
873
|
+
var PagePaginationQuerySchema = z4.object({
|
|
874
|
+
offset: z4.coerce.number().int().min(0).default(0).describe("Number of items to skip"),
|
|
875
|
+
limit: z4.coerce.number().int().min(1).max(PagePaginationDefaults.MaxLimit).default(PagePaginationDefaults.Limit).describe(
|
|
876
|
+
`Number of items to return. Default ${PagePaginationDefaults.Limit}, max ${PagePaginationDefaults.MaxLimit}.`
|
|
877
|
+
)
|
|
892
878
|
});
|
|
893
|
-
var
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
879
|
+
var createPagePaginatedResponseSchema = (itemSchema) => z4.object({
|
|
880
|
+
list: z4.array(itemSchema).describe("Array of items for current page"),
|
|
881
|
+
has_more: z4.boolean().describe("Whether more results exist after this page"),
|
|
882
|
+
offset: z4.number().describe("Current offset position"),
|
|
883
|
+
limit: z4.number().describe("Limit passed in the request"),
|
|
884
|
+
total: z4.number().describe("Total number of items returned in the current page")
|
|
897
885
|
});
|
|
898
886
|
|
|
899
|
-
// src/sdk/
|
|
887
|
+
// src/sdk/events/eventTypes.ts
|
|
900
888
|
import { z as z5 } from "zod/v4";
|
|
901
|
-
var
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
var TrackParamsSchema = z5.object({
|
|
889
|
+
var QueryRangeEnum = z5.enum([
|
|
890
|
+
"24h",
|
|
891
|
+
"7d",
|
|
892
|
+
"30d",
|
|
893
|
+
"90d",
|
|
894
|
+
"last_cycle",
|
|
895
|
+
"1bc",
|
|
896
|
+
"3bc"
|
|
897
|
+
]);
|
|
898
|
+
var BinSizeEnum = z5.enum(["day", "hour"]);
|
|
899
|
+
var QueryParamsSchema = z5.object({
|
|
913
900
|
customer_id: z5.string(),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
901
|
+
feature_id: z5.string().or(z5.array(z5.string())),
|
|
902
|
+
range: QueryRangeEnum.optional(),
|
|
903
|
+
group_by: z5.string().startsWith("properties.").optional(),
|
|
904
|
+
bin_size: BinSizeEnum.optional(),
|
|
905
|
+
custom_range: z5.object({
|
|
906
|
+
start: z5.number(),
|
|
907
|
+
end: z5.number()
|
|
908
|
+
}).optional()
|
|
922
909
|
});
|
|
923
|
-
var
|
|
924
|
-
id: z5.string(),
|
|
925
|
-
code: z5.string(),
|
|
910
|
+
var EventsListParamsSchema = PagePaginationQuerySchema.extend({
|
|
926
911
|
customer_id: z5.string(),
|
|
927
|
-
feature_id: z5.string().
|
|
928
|
-
|
|
912
|
+
feature_id: z5.string().or(z5.array(z5.string())),
|
|
913
|
+
custom_range: z5.object({
|
|
914
|
+
start: z5.coerce.number().optional(),
|
|
915
|
+
end: z5.coerce.number().optional()
|
|
916
|
+
}).optional()
|
|
929
917
|
});
|
|
930
|
-
var
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
send_event: z5.boolean().optional(),
|
|
938
|
-
with_preview: z5.boolean().optional(),
|
|
939
|
-
entity_data: EntityDataSchema.optional()
|
|
918
|
+
var EventsListItemSchema = z5.object({
|
|
919
|
+
id: z5.string().describe("Event ID (KSUID)"),
|
|
920
|
+
timestamp: z5.number().describe("Event timestamp (epoch milliseconds)"),
|
|
921
|
+
feature_id: z5.string().describe("Name of the event"),
|
|
922
|
+
customer_id: z5.string().describe("Customer identifier"),
|
|
923
|
+
value: z5.number().describe("Event value/count"),
|
|
924
|
+
properties: z5.object({}).describe("Event properties (JSONB)")
|
|
940
925
|
});
|
|
926
|
+
var EventsListResponseSchema = createPagePaginatedResponseSchema(EventsListItemSchema);
|
|
941
927
|
|
|
942
|
-
// src/sdk/
|
|
928
|
+
// src/sdk/features/featureTypes.ts
|
|
943
929
|
import { z as z6 } from "zod/v4";
|
|
944
|
-
var
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
930
|
+
var FeatureType = /* @__PURE__ */ ((FeatureType2) => {
|
|
931
|
+
FeatureType2["Boolean"] = "boolean";
|
|
932
|
+
FeatureType2["SingleUse"] = "single_use";
|
|
933
|
+
FeatureType2["ContinuousUse"] = "continuous_use";
|
|
934
|
+
FeatureType2["CreditSystem"] = "credit_system";
|
|
935
|
+
return FeatureType2;
|
|
936
|
+
})(FeatureType || {});
|
|
937
|
+
var FeatureSchema = z6.object({
|
|
938
|
+
id: z6.string(),
|
|
939
|
+
name: z6.string(),
|
|
940
|
+
type: z6.enum(FeatureType),
|
|
941
|
+
display: z6.object({
|
|
942
|
+
singular: z6.string(),
|
|
943
|
+
plural: z6.string()
|
|
944
|
+
}).nullish(),
|
|
945
|
+
credit_schema: z6.array(
|
|
946
|
+
z6.object({
|
|
947
|
+
metered_feature_id: z6.string(),
|
|
948
|
+
credit_cost: z6.number()
|
|
949
|
+
})
|
|
950
|
+
).nullish(),
|
|
951
|
+
archived: z6.boolean()
|
|
951
952
|
});
|
|
952
953
|
|
|
953
954
|
// src/sdk/general/attachTypes.ts
|
|
@@ -1004,264 +1005,112 @@ var CheckoutParamsSchema = z7.object({
|
|
|
1004
1005
|
new_billing_subscription: z7.boolean().optional()
|
|
1005
1006
|
});
|
|
1006
1007
|
|
|
1007
|
-
// src/sdk/general/
|
|
1008
|
+
// src/sdk/general/checkTypes.ts
|
|
1008
1009
|
import { z as z8 } from "zod/v4";
|
|
1009
|
-
var
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
});
|
|
1017
|
-
var createCursorPaginatedResponseSchema = (itemSchema) => z8.object({
|
|
1018
|
-
list: z8.array(itemSchema),
|
|
1019
|
-
has_more: z8.boolean(),
|
|
1020
|
-
next_cursor: z8.string().nullable()
|
|
1021
|
-
});
|
|
1010
|
+
var CheckFeatureResultSchema = z8.object({
|
|
1011
|
+
allowed: z8.boolean(),
|
|
1012
|
+
feature_id: z8.string(),
|
|
1013
|
+
customer_id: z8.string(),
|
|
1014
|
+
entity_id: z8.string().optional(),
|
|
1015
|
+
required_balance: z8.number()
|
|
1016
|
+
}).extend(CoreCusFeatureSchema.shape);
|
|
1022
1017
|
|
|
1023
|
-
// src/sdk/
|
|
1018
|
+
// src/sdk/general/genTypes.ts
|
|
1024
1019
|
import { z as z9 } from "zod/v4";
|
|
1025
|
-
var
|
|
1026
|
-
"24h",
|
|
1027
|
-
"7d",
|
|
1028
|
-
"30d",
|
|
1029
|
-
"90d",
|
|
1030
|
-
"last_cycle",
|
|
1031
|
-
"1bc",
|
|
1032
|
-
"3bc"
|
|
1033
|
-
]);
|
|
1034
|
-
var BinSizeEnum = z9.enum(["day", "hour"]);
|
|
1035
|
-
var QueryParamsSchema = z9.object({
|
|
1020
|
+
var CancelParamsSchema = z9.object({
|
|
1036
1021
|
customer_id: z9.string(),
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
bin_size: BinSizeEnum.optional(),
|
|
1041
|
-
custom_range: z9.object({
|
|
1042
|
-
start: z9.number(),
|
|
1043
|
-
end: z9.number()
|
|
1044
|
-
}).optional()
|
|
1022
|
+
product_id: z9.string(),
|
|
1023
|
+
entity_id: z9.string().optional(),
|
|
1024
|
+
cancel_immediately: z9.boolean().optional()
|
|
1045
1025
|
});
|
|
1046
|
-
var
|
|
1026
|
+
var CancelResultSchema = z9.object({
|
|
1027
|
+
success: z9.boolean(),
|
|
1047
1028
|
customer_id: z9.string(),
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1029
|
+
product_id: z9.string()
|
|
1030
|
+
});
|
|
1031
|
+
var TrackParamsSchema = z9.object({
|
|
1032
|
+
customer_id: z9.string(),
|
|
1033
|
+
value: z9.number().optional(),
|
|
1034
|
+
feature_id: z9.string().optional(),
|
|
1035
|
+
event_name: z9.string().optional(),
|
|
1036
|
+
entity_id: z9.string().optional(),
|
|
1037
|
+
customer_data: z9.any().optional(),
|
|
1038
|
+
idempotency_key: z9.string().optional(),
|
|
1039
|
+
entity_data: z9.any().optional(),
|
|
1040
|
+
properties: z9.record(z9.string(), z9.any()).optional()
|
|
1041
|
+
});
|
|
1042
|
+
var TrackResultSchema = z9.object({
|
|
1043
|
+
id: z9.string(),
|
|
1044
|
+
code: z9.string(),
|
|
1045
|
+
customer_id: z9.string(),
|
|
1046
|
+
feature_id: z9.string().optional(),
|
|
1047
|
+
event_name: z9.string().optional()
|
|
1053
1048
|
});
|
|
1054
|
-
var
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1049
|
+
var CheckParamsSchema = z9.object({
|
|
1050
|
+
customer_id: z9.string(),
|
|
1051
|
+
feature_id: z9.string().optional(),
|
|
1052
|
+
product_id: z9.string().optional(),
|
|
1053
|
+
entity_id: z9.string().optional(),
|
|
1054
|
+
customer_data: z9.any().optional(),
|
|
1055
|
+
required_balance: z9.number().optional(),
|
|
1056
|
+
send_event: z9.boolean().optional(),
|
|
1057
|
+
with_preview: z9.boolean().optional(),
|
|
1058
|
+
entity_data: EntityDataSchema.optional()
|
|
1061
1059
|
});
|
|
1062
|
-
var EventListResponseSchema = createCursorPaginatedResponseSchema(EventListItemSchema);
|
|
1063
1060
|
|
|
1064
|
-
// src/sdk/
|
|
1061
|
+
// src/sdk/referrals/referralTypes.ts
|
|
1065
1062
|
import { z as z10 } from "zod/v4";
|
|
1066
|
-
var
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
var FeatureSchema = z10.object({
|
|
1074
|
-
id: z10.string(),
|
|
1075
|
-
name: z10.string(),
|
|
1076
|
-
type: z10.enum(FeatureType),
|
|
1077
|
-
display: z10.object({
|
|
1078
|
-
singular: z10.string(),
|
|
1079
|
-
plural: z10.string()
|
|
1080
|
-
}).nullish(),
|
|
1081
|
-
credit_schema: z10.array(
|
|
1082
|
-
z10.object({
|
|
1083
|
-
metered_feature_id: z10.string(),
|
|
1084
|
-
credit_cost: z10.number()
|
|
1085
|
-
})
|
|
1086
|
-
).nullish(),
|
|
1087
|
-
archived: z10.boolean()
|
|
1063
|
+
var CreateReferralCodeParamsSchema = z10.object({
|
|
1064
|
+
customer_id: z10.string(),
|
|
1065
|
+
program_id: z10.string()
|
|
1066
|
+
});
|
|
1067
|
+
var RedeemReferralCodeParamsSchema = z10.object({
|
|
1068
|
+
code: z10.string(),
|
|
1069
|
+
customer_id: z10.string()
|
|
1088
1070
|
});
|
|
1089
1071
|
|
|
1090
|
-
// src/libraries/react/hooks/
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
);
|
|
1106
|
-
if (creditSchema) {
|
|
1107
|
-
let schemaItem = creditSchema.credit_schema?.find(
|
|
1108
|
-
(c) => c.feature_id === featureId
|
|
1109
|
-
);
|
|
1110
|
-
return {
|
|
1111
|
-
cusFeature: creditSchema,
|
|
1112
|
-
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1113
|
-
};
|
|
1072
|
+
// src/libraries/react/hooks/useAggregateEvents.tsx
|
|
1073
|
+
import useSWR from "swr";
|
|
1074
|
+
|
|
1075
|
+
// src/libraries/react/errorUtils/logAuthError.ts
|
|
1076
|
+
var logAuthError = async (response) => {
|
|
1077
|
+
if (response.status === 401) {
|
|
1078
|
+
let clonedResponse = response.clone();
|
|
1079
|
+
let data = await clonedResponse.json();
|
|
1080
|
+
if (data.message.includes("Missing authorization header")) {
|
|
1081
|
+
console.error(`[Autumn] Missing authorization header.
|
|
1082
|
+
|
|
1083
|
+
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
1084
|
+
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
1085
|
+
return true;
|
|
1086
|
+
}
|
|
1114
1087
|
}
|
|
1115
|
-
return
|
|
1116
|
-
cusFeature: customer.features[featureId],
|
|
1117
|
-
requiredBalance
|
|
1118
|
-
};
|
|
1088
|
+
return false;
|
|
1119
1089
|
};
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1090
|
+
|
|
1091
|
+
// src/libraries/react/errorUtils/logFetchError.ts
|
|
1092
|
+
var logFetchError = ({
|
|
1093
|
+
method,
|
|
1094
|
+
backendUrl,
|
|
1095
|
+
path,
|
|
1096
|
+
error
|
|
1123
1097
|
}) => {
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1129
|
-
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1130
|
-
}
|
|
1131
|
-
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1132
|
-
};
|
|
1133
|
-
var handleFeatureCheck = ({
|
|
1134
|
-
customer,
|
|
1135
|
-
isEntity,
|
|
1136
|
-
params
|
|
1137
|
-
}) => {
|
|
1138
|
-
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1139
|
-
customer,
|
|
1140
|
-
featureId: params.featureId,
|
|
1141
|
-
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1142
|
-
});
|
|
1143
|
-
let allowed = getFeatureAllowed({
|
|
1144
|
-
cusFeature,
|
|
1145
|
-
requiredBalance: requiredBalance ?? 1
|
|
1146
|
-
});
|
|
1147
|
-
let result = {
|
|
1148
|
-
allowed,
|
|
1149
|
-
feature_id: cusFeature?.id ?? params.featureId,
|
|
1150
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1151
|
-
required_balance: requiredBalance,
|
|
1152
|
-
...cusFeature
|
|
1153
|
-
};
|
|
1154
|
-
if (isEntity) {
|
|
1155
|
-
result.entity_id = customer.id;
|
|
1156
|
-
}
|
|
1157
|
-
try {
|
|
1158
|
-
return CheckFeatureResultSchema.parse(result);
|
|
1159
|
-
} catch (error) {
|
|
1160
|
-
return result;
|
|
1161
|
-
}
|
|
1162
|
-
};
|
|
1163
|
-
var handleProductCheck = ({
|
|
1164
|
-
customer,
|
|
1165
|
-
isEntity,
|
|
1166
|
-
params
|
|
1167
|
-
}) => {
|
|
1168
|
-
let product = customer.products.find((p) => p.id == params.productId);
|
|
1169
|
-
let allowed = product?.status === "active" || product?.status === "trialing";
|
|
1170
|
-
let result = {
|
|
1171
|
-
allowed,
|
|
1172
|
-
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1173
|
-
product_id: params.productId
|
|
1174
|
-
};
|
|
1175
|
-
if (product) {
|
|
1176
|
-
result.status = product.status;
|
|
1177
|
-
}
|
|
1178
|
-
if (isEntity) {
|
|
1179
|
-
result.entity_id = customer.id;
|
|
1180
|
-
}
|
|
1181
|
-
return result;
|
|
1182
|
-
};
|
|
1183
|
-
var openDialog = ({
|
|
1184
|
-
result,
|
|
1185
|
-
params,
|
|
1186
|
-
context
|
|
1187
|
-
}) => {
|
|
1188
|
-
let open = result?.allowed === false && params.dialog && context;
|
|
1189
|
-
if (!open) return;
|
|
1190
|
-
const isInRenderCycle = (() => {
|
|
1191
|
-
const stack = new Error().stack || "";
|
|
1192
|
-
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1193
|
-
})();
|
|
1194
|
-
if (isInRenderCycle) {
|
|
1195
|
-
context.paywallRef.current = {
|
|
1196
|
-
component: params.dialog,
|
|
1197
|
-
open: true,
|
|
1198
|
-
props: params
|
|
1199
|
-
};
|
|
1200
|
-
} else {
|
|
1201
|
-
context.paywallDialog.setComponent(params.dialog);
|
|
1202
|
-
context.paywallDialog.setProps(params);
|
|
1203
|
-
context.paywallDialog.setOpen(true);
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
var handleCheck2 = ({
|
|
1207
|
-
customer,
|
|
1208
|
-
isEntity,
|
|
1209
|
-
params,
|
|
1210
|
-
context
|
|
1211
|
-
}) => {
|
|
1212
|
-
if (!customer) {
|
|
1213
|
-
return {
|
|
1214
|
-
data: {
|
|
1215
|
-
allowed: false,
|
|
1216
|
-
feature_id: "",
|
|
1217
|
-
customer_id: "",
|
|
1218
|
-
required_balance: 0
|
|
1219
|
-
},
|
|
1220
|
-
error: null
|
|
1221
|
-
};
|
|
1222
|
-
}
|
|
1223
|
-
if (!params.featureId && !params.productId) {
|
|
1224
|
-
throw new Error("allowed() requires either featureId or productId");
|
|
1225
|
-
}
|
|
1226
|
-
let result;
|
|
1227
|
-
if (params.featureId)
|
|
1228
|
-
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1229
|
-
if (params.productId)
|
|
1230
|
-
result = handleProductCheck({ customer, params, isEntity });
|
|
1231
|
-
return {
|
|
1232
|
-
data: result,
|
|
1233
|
-
error: null
|
|
1234
|
-
};
|
|
1235
|
-
};
|
|
1236
|
-
|
|
1237
|
-
// src/libraries/react/errorUtils/logAuthError.ts
|
|
1238
|
-
var logAuthError = async (response) => {
|
|
1239
|
-
if (response.status === 401) {
|
|
1240
|
-
let clonedResponse = response.clone();
|
|
1241
|
-
let data = await clonedResponse.json();
|
|
1242
|
-
if (data.message.includes("Missing authorization header")) {
|
|
1243
|
-
console.error(`[Autumn] Missing authorization header.
|
|
1244
|
-
|
|
1245
|
-
Use the getBearerToken prop in <AutumnProvider /> to set the authorization header.
|
|
1246
|
-
https://docs.useautumn.com/quickstart/quickstart#5-set-up-autumnprovider`);
|
|
1247
|
-
return true;
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
return false;
|
|
1098
|
+
console.error(`[Autumn] Fetch failed: ${method} ${backendUrl}${path}
|
|
1099
|
+
|
|
1100
|
+
1. Check that backendUrl in <AutumnProvider/> is correctly set.
|
|
1101
|
+
2. Check that autumnHandler is correctly registered on your backend.`);
|
|
1251
1102
|
};
|
|
1252
1103
|
|
|
1253
|
-
// src/libraries/react/
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
2. Check that autumnHandler is correctly registered on your backend.`);
|
|
1264
|
-
};
|
|
1104
|
+
// src/libraries/react/client/clientAnalyticsMethods.ts
|
|
1105
|
+
async function eventListMethod(params) {
|
|
1106
|
+
const res = await this.post(`${this.prefix}/events/list`, params);
|
|
1107
|
+
console.log("res", res);
|
|
1108
|
+
return res;
|
|
1109
|
+
}
|
|
1110
|
+
async function eventAggregateMethod(params) {
|
|
1111
|
+
const res = await this.post(`${this.prefix}/events/aggregate`, params);
|
|
1112
|
+
return res;
|
|
1113
|
+
}
|
|
1265
1114
|
|
|
1266
1115
|
// src/libraries/react/client/clientCusMethods.ts
|
|
1267
1116
|
var createCustomerMethod = async ({
|
|
@@ -1365,16 +1214,6 @@ async function redeemCode(params) {
|
|
|
1365
1214
|
return res;
|
|
1366
1215
|
}
|
|
1367
1216
|
|
|
1368
|
-
// src/libraries/react/client/clientAnalyticsMethods.ts
|
|
1369
|
-
async function eventListMethod(params) {
|
|
1370
|
-
const res = await this.post(`${this.prefix}/events/list`, params);
|
|
1371
|
-
return res;
|
|
1372
|
-
}
|
|
1373
|
-
async function eventAggregateMethod(params) {
|
|
1374
|
-
const res = await this.post(`${this.prefix}/events/aggregate`, params);
|
|
1375
|
-
return res;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
1217
|
// src/libraries/react/client/ReactAutumnClient.tsx
|
|
1379
1218
|
var AutumnClient = class {
|
|
1380
1219
|
backendUrl;
|
|
@@ -1579,49 +1418,288 @@ var AutumnClient = class {
|
|
|
1579
1418
|
aggregate: eventAggregateMethod.bind(this)
|
|
1580
1419
|
};
|
|
1581
1420
|
};
|
|
1582
|
-
|
|
1583
|
-
// src/libraries/react/AutumnContext.tsx
|
|
1584
|
-
import { createContext, useContext } from "react";
|
|
1585
|
-
var AutumnContext = createContext({
|
|
1586
|
-
initialized: false,
|
|
1587
|
-
disableDialogs: false,
|
|
1588
|
-
client: new AutumnClient({ backendUrl: "" }),
|
|
1589
|
-
paywallDialog: {
|
|
1590
|
-
props: null,
|
|
1591
|
-
setProps: () => {
|
|
1592
|
-
},
|
|
1593
|
-
open: false,
|
|
1594
|
-
setOpen: () => {
|
|
1595
|
-
},
|
|
1596
|
-
setComponent: () => {
|
|
1597
|
-
}
|
|
1598
|
-
},
|
|
1599
|
-
attachDialog: {
|
|
1600
|
-
props: null,
|
|
1601
|
-
setProps: () => {
|
|
1602
|
-
},
|
|
1603
|
-
open: false,
|
|
1604
|
-
setOpen: () => {
|
|
1605
|
-
},
|
|
1606
|
-
setComponent: () => {
|
|
1607
|
-
}
|
|
1608
|
-
},
|
|
1609
|
-
paywallRef: { current: null }
|
|
1610
|
-
});
|
|
1611
|
-
var useAutumnContext = ({
|
|
1612
|
-
AutumnContext: AutumnContext2,
|
|
1613
|
-
name,
|
|
1614
|
-
errorIfNotInitialized = true
|
|
1421
|
+
|
|
1422
|
+
// src/libraries/react/AutumnContext.tsx
|
|
1423
|
+
import { createContext, useContext } from "react";
|
|
1424
|
+
var AutumnContext = createContext({
|
|
1425
|
+
initialized: false,
|
|
1426
|
+
disableDialogs: false,
|
|
1427
|
+
client: new AutumnClient({ backendUrl: "" }),
|
|
1428
|
+
paywallDialog: {
|
|
1429
|
+
props: null,
|
|
1430
|
+
setProps: () => {
|
|
1431
|
+
},
|
|
1432
|
+
open: false,
|
|
1433
|
+
setOpen: () => {
|
|
1434
|
+
},
|
|
1435
|
+
setComponent: () => {
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
attachDialog: {
|
|
1439
|
+
props: null,
|
|
1440
|
+
setProps: () => {
|
|
1441
|
+
},
|
|
1442
|
+
open: false,
|
|
1443
|
+
setOpen: () => {
|
|
1444
|
+
},
|
|
1445
|
+
setComponent: () => {
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
paywallRef: { current: null }
|
|
1449
|
+
});
|
|
1450
|
+
var useAutumnContext = ({
|
|
1451
|
+
AutumnContext: AutumnContext2,
|
|
1452
|
+
name,
|
|
1453
|
+
errorIfNotInitialized = true
|
|
1454
|
+
}) => {
|
|
1455
|
+
const context = useContext(AutumnContext2);
|
|
1456
|
+
if (!context.initialized && errorIfNotInitialized) {
|
|
1457
|
+
throw new Error(`${name} must be used within <AutumnProvider />`);
|
|
1458
|
+
}
|
|
1459
|
+
return context;
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
// src/libraries/react/hooks/useAggregateEvents.tsx
|
|
1463
|
+
var useAggregateEvents = (params) => {
|
|
1464
|
+
const context = useAutumnContext({
|
|
1465
|
+
AutumnContext,
|
|
1466
|
+
name: "useAggregateEvents"
|
|
1467
|
+
});
|
|
1468
|
+
const client = context.client;
|
|
1469
|
+
const fetcher = async () => {
|
|
1470
|
+
const res = await client.events.aggregate(params);
|
|
1471
|
+
if (res.error) {
|
|
1472
|
+
const err = new AutumnError({
|
|
1473
|
+
message: res.error.message,
|
|
1474
|
+
code: res.error.code
|
|
1475
|
+
});
|
|
1476
|
+
err.statusCode = res.statusCode;
|
|
1477
|
+
throw err;
|
|
1478
|
+
}
|
|
1479
|
+
return res.data;
|
|
1480
|
+
};
|
|
1481
|
+
const startDate = params.customRange?.start ? new Date(params.customRange.start).toISOString().slice(0, 13) : void 0;
|
|
1482
|
+
const endDate = params.customRange?.end ? new Date(params.customRange.end).toISOString().slice(0, 13) : void 0;
|
|
1483
|
+
const { data, error, mutate } = useSWR(
|
|
1484
|
+
[
|
|
1485
|
+
"eventAggregate",
|
|
1486
|
+
params.featureId,
|
|
1487
|
+
params.groupBy,
|
|
1488
|
+
params.range,
|
|
1489
|
+
startDate,
|
|
1490
|
+
endDate,
|
|
1491
|
+
params.binSize
|
|
1492
|
+
],
|
|
1493
|
+
fetcher,
|
|
1494
|
+
{
|
|
1495
|
+
refreshInterval: 0,
|
|
1496
|
+
dedupingInterval: 2e3,
|
|
1497
|
+
revalidateOnFocus: false,
|
|
1498
|
+
revalidateOnReconnect: false,
|
|
1499
|
+
shouldRetryOnError: (error2) => error2.statusCode === 429,
|
|
1500
|
+
errorRetryCount: 3
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1503
|
+
return {
|
|
1504
|
+
list: data?.list,
|
|
1505
|
+
total: data?.total,
|
|
1506
|
+
isLoading: !error && !data,
|
|
1507
|
+
error,
|
|
1508
|
+
refetch: mutate
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
// src/libraries/react/hooks/useAnalytics.tsx
|
|
1513
|
+
import useSWR2 from "swr";
|
|
1514
|
+
var useAnalytics = (params) => {
|
|
1515
|
+
const context = useAutumnContext({
|
|
1516
|
+
AutumnContext,
|
|
1517
|
+
name: "useAnalytics"
|
|
1518
|
+
});
|
|
1519
|
+
const client = context.client;
|
|
1520
|
+
const fetcher = async () => {
|
|
1521
|
+
const res = await client.query(params);
|
|
1522
|
+
if (res.error) {
|
|
1523
|
+
const err = new AutumnError({
|
|
1524
|
+
message: res.error.message,
|
|
1525
|
+
code: res.error.code
|
|
1526
|
+
});
|
|
1527
|
+
err.statusCode = res.statusCode;
|
|
1528
|
+
throw err;
|
|
1529
|
+
}
|
|
1530
|
+
return res.data;
|
|
1531
|
+
};
|
|
1532
|
+
const { data, error, mutate } = useSWR2(
|
|
1533
|
+
["analytics", params.featureId, params.range],
|
|
1534
|
+
fetcher,
|
|
1535
|
+
{
|
|
1536
|
+
refreshInterval: 0,
|
|
1537
|
+
revalidateOnFocus: false,
|
|
1538
|
+
revalidateOnReconnect: false,
|
|
1539
|
+
shouldRetryOnError: (error2) => error2.statusCode === 429,
|
|
1540
|
+
errorRetryCount: 3
|
|
1541
|
+
}
|
|
1542
|
+
);
|
|
1543
|
+
return {
|
|
1544
|
+
data: data?.list,
|
|
1545
|
+
isLoading: !error && !data,
|
|
1546
|
+
error,
|
|
1547
|
+
refetch: mutate
|
|
1548
|
+
};
|
|
1549
|
+
};
|
|
1550
|
+
|
|
1551
|
+
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
1552
|
+
import useSWR4 from "swr";
|
|
1553
|
+
|
|
1554
|
+
// src/libraries/react/hooks/helpers/handleCheck.ts
|
|
1555
|
+
var getCusFeature = ({
|
|
1556
|
+
customer,
|
|
1557
|
+
featureId,
|
|
1558
|
+
requiredBalance = 1
|
|
1559
|
+
}) => {
|
|
1560
|
+
let cusFeature = customer.features[featureId];
|
|
1561
|
+
if (cusFeature && typeof cusFeature.balance === "number" && cusFeature.balance >= requiredBalance) {
|
|
1562
|
+
return {
|
|
1563
|
+
cusFeature,
|
|
1564
|
+
requiredBalance
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
let creditSchema = Object.values(customer.features).find(
|
|
1568
|
+
(f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId)
|
|
1569
|
+
);
|
|
1570
|
+
if (creditSchema) {
|
|
1571
|
+
let schemaItem = creditSchema.credit_schema?.find(
|
|
1572
|
+
(c) => c.feature_id === featureId
|
|
1573
|
+
);
|
|
1574
|
+
return {
|
|
1575
|
+
cusFeature: creditSchema,
|
|
1576
|
+
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
return {
|
|
1580
|
+
cusFeature: customer.features[featureId],
|
|
1581
|
+
requiredBalance
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
var getFeatureAllowed = ({
|
|
1585
|
+
cusFeature,
|
|
1586
|
+
requiredBalance
|
|
1587
|
+
}) => {
|
|
1588
|
+
if (!cusFeature) return false;
|
|
1589
|
+
if (cusFeature.type == "static") return true;
|
|
1590
|
+
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1591
|
+
if (cusFeature.usage_limit) {
|
|
1592
|
+
let extraUsage = (cusFeature.usage_limit || 0) - (cusFeature.included_usage || 0);
|
|
1593
|
+
return (cusFeature.balance || 0) + extraUsage >= requiredBalance;
|
|
1594
|
+
}
|
|
1595
|
+
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1596
|
+
};
|
|
1597
|
+
var handleFeatureCheck = ({
|
|
1598
|
+
customer,
|
|
1599
|
+
isEntity,
|
|
1600
|
+
params
|
|
1601
|
+
}) => {
|
|
1602
|
+
let { cusFeature, requiredBalance } = getCusFeature({
|
|
1603
|
+
customer,
|
|
1604
|
+
featureId: params.featureId,
|
|
1605
|
+
...params.requiredBalance ? { requiredBalance: params.requiredBalance } : {}
|
|
1606
|
+
});
|
|
1607
|
+
let allowed = getFeatureAllowed({
|
|
1608
|
+
cusFeature,
|
|
1609
|
+
requiredBalance: requiredBalance ?? 1
|
|
1610
|
+
});
|
|
1611
|
+
let result = {
|
|
1612
|
+
allowed,
|
|
1613
|
+
feature_id: cusFeature?.id ?? params.featureId,
|
|
1614
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1615
|
+
required_balance: requiredBalance,
|
|
1616
|
+
...cusFeature
|
|
1617
|
+
};
|
|
1618
|
+
if (isEntity) {
|
|
1619
|
+
result.entity_id = customer.id;
|
|
1620
|
+
}
|
|
1621
|
+
try {
|
|
1622
|
+
return CheckFeatureResultSchema.parse(result);
|
|
1623
|
+
} catch (error) {
|
|
1624
|
+
return result;
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
var handleProductCheck = ({
|
|
1628
|
+
customer,
|
|
1629
|
+
isEntity,
|
|
1630
|
+
params
|
|
1631
|
+
}) => {
|
|
1632
|
+
let product = customer.products.find((p) => p.id == params.productId);
|
|
1633
|
+
let allowed = product?.status === "active" || product?.status === "trialing";
|
|
1634
|
+
let result = {
|
|
1635
|
+
allowed,
|
|
1636
|
+
customer_id: isEntity ? customer.customer_id : customer.id,
|
|
1637
|
+
product_id: params.productId
|
|
1638
|
+
};
|
|
1639
|
+
if (product) {
|
|
1640
|
+
result.status = product.status;
|
|
1641
|
+
}
|
|
1642
|
+
if (isEntity) {
|
|
1643
|
+
result.entity_id = customer.id;
|
|
1644
|
+
}
|
|
1645
|
+
return result;
|
|
1646
|
+
};
|
|
1647
|
+
var openDialog = ({
|
|
1648
|
+
result,
|
|
1649
|
+
params,
|
|
1650
|
+
context
|
|
1651
|
+
}) => {
|
|
1652
|
+
let open = result?.allowed === false && params.dialog && context;
|
|
1653
|
+
if (!open) return;
|
|
1654
|
+
const isInRenderCycle = (() => {
|
|
1655
|
+
const stack = new Error().stack || "";
|
|
1656
|
+
return stack.includes("renderWithHooks") || stack.includes("updateFunctionComponent") || stack.includes("beginWork") || stack.includes("performUnitOfWork") || stack.includes("workLoop") || stack.includes("Component.render") || stack.includes("FunctionComponent");
|
|
1657
|
+
})();
|
|
1658
|
+
if (isInRenderCycle) {
|
|
1659
|
+
context.paywallRef.current = {
|
|
1660
|
+
component: params.dialog,
|
|
1661
|
+
open: true,
|
|
1662
|
+
props: params
|
|
1663
|
+
};
|
|
1664
|
+
} else {
|
|
1665
|
+
context.paywallDialog.setComponent(params.dialog);
|
|
1666
|
+
context.paywallDialog.setProps(params);
|
|
1667
|
+
context.paywallDialog.setOpen(true);
|
|
1668
|
+
}
|
|
1669
|
+
};
|
|
1670
|
+
var handleCheck2 = ({
|
|
1671
|
+
customer,
|
|
1672
|
+
isEntity,
|
|
1673
|
+
params,
|
|
1674
|
+
context
|
|
1615
1675
|
}) => {
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1676
|
+
if (!customer) {
|
|
1677
|
+
return {
|
|
1678
|
+
data: {
|
|
1679
|
+
allowed: false,
|
|
1680
|
+
feature_id: "",
|
|
1681
|
+
customer_id: "",
|
|
1682
|
+
required_balance: 0
|
|
1683
|
+
},
|
|
1684
|
+
error: null
|
|
1685
|
+
};
|
|
1619
1686
|
}
|
|
1620
|
-
|
|
1687
|
+
if (!params.featureId && !params.productId) {
|
|
1688
|
+
throw new Error("allowed() requires either featureId or productId");
|
|
1689
|
+
}
|
|
1690
|
+
let result;
|
|
1691
|
+
if (params.featureId)
|
|
1692
|
+
result = handleFeatureCheck({ customer, params, isEntity });
|
|
1693
|
+
if (params.productId)
|
|
1694
|
+
result = handleProductCheck({ customer, params, isEntity });
|
|
1695
|
+
return {
|
|
1696
|
+
data: result,
|
|
1697
|
+
error: null
|
|
1698
|
+
};
|
|
1621
1699
|
};
|
|
1622
1700
|
|
|
1623
1701
|
// src/libraries/react/hooks/usePricingTableBase.tsx
|
|
1624
|
-
import
|
|
1702
|
+
import useSWR3 from "swr";
|
|
1625
1703
|
var mergeProductDetails = (products, productDetails) => {
|
|
1626
1704
|
if (!products) {
|
|
1627
1705
|
return null;
|
|
@@ -1796,7 +1874,7 @@ var usePricingTableBase = ({
|
|
|
1796
1874
|
});
|
|
1797
1875
|
}
|
|
1798
1876
|
};
|
|
1799
|
-
const { data, error, mutate } =
|
|
1877
|
+
const { data, error, mutate } = useSWR3(
|
|
1800
1878
|
["pricing-table", client.backendUrl],
|
|
1801
1879
|
fetcher,
|
|
1802
1880
|
{ ...defaultSWRConfig }
|
|
@@ -2001,13 +2079,14 @@ var useCustomerBase = ({
|
|
|
2001
2079
|
error,
|
|
2002
2080
|
isLoading,
|
|
2003
2081
|
mutate
|
|
2004
|
-
} =
|
|
2082
|
+
} = useSWR4(queryKey, fetchCustomer, {
|
|
2005
2083
|
// Default to 5 minutes
|
|
2006
2084
|
fallbackData: null,
|
|
2007
2085
|
swrConfig: {
|
|
2008
2086
|
shouldRetryOnError: false,
|
|
2009
2087
|
refreshInterval: 0,
|
|
2010
|
-
...params?.swrConfig
|
|
2088
|
+
...params?.swrConfig,
|
|
2089
|
+
dedupingInterval: 2e3
|
|
2011
2090
|
}
|
|
2012
2091
|
});
|
|
2013
2092
|
const autumnFunctions = useAutumnBase({
|
|
@@ -2015,30 +2094,260 @@ var useCustomerBase = ({
|
|
|
2015
2094
|
client,
|
|
2016
2095
|
refetchCustomer: mutate
|
|
2017
2096
|
});
|
|
2018
|
-
return {
|
|
2019
|
-
customer: error ? null : customer,
|
|
2020
|
-
isLoading,
|
|
2021
|
-
error,
|
|
2022
|
-
refetch: mutate,
|
|
2023
|
-
...autumnFunctions,
|
|
2024
|
-
createEntity: client.entities.create,
|
|
2025
|
-
createReferralCode: client.referrals.createCode,
|
|
2026
|
-
redeemReferralCode: client.referrals.redeemCode,
|
|
2027
|
-
check: (params2) => {
|
|
2028
|
-
const res = handleCheck2({
|
|
2029
|
-
customer,
|
|
2030
|
-
params: params2,
|
|
2031
|
-
isEntity: false,
|
|
2032
|
-
context
|
|
2033
|
-
});
|
|
2034
|
-
openDialog({
|
|
2035
|
-
result: res.data,
|
|
2036
|
-
params: params2,
|
|
2037
|
-
context
|
|
2038
|
-
});
|
|
2039
|
-
return res;
|
|
2097
|
+
return {
|
|
2098
|
+
customer: error ? null : customer,
|
|
2099
|
+
isLoading,
|
|
2100
|
+
error,
|
|
2101
|
+
refetch: mutate,
|
|
2102
|
+
...autumnFunctions,
|
|
2103
|
+
createEntity: client.entities.create,
|
|
2104
|
+
createReferralCode: client.referrals.createCode,
|
|
2105
|
+
redeemReferralCode: client.referrals.redeemCode,
|
|
2106
|
+
check: (params2) => {
|
|
2107
|
+
const res = handleCheck2({
|
|
2108
|
+
customer,
|
|
2109
|
+
params: params2,
|
|
2110
|
+
isEntity: false,
|
|
2111
|
+
context
|
|
2112
|
+
});
|
|
2113
|
+
openDialog({
|
|
2114
|
+
result: res.data,
|
|
2115
|
+
params: params2,
|
|
2116
|
+
context
|
|
2117
|
+
});
|
|
2118
|
+
return res;
|
|
2119
|
+
}
|
|
2120
|
+
};
|
|
2121
|
+
};
|
|
2122
|
+
|
|
2123
|
+
// src/libraries/react/hooks/useCustomer.tsx
|
|
2124
|
+
var useCustomer = (params) => {
|
|
2125
|
+
return useCustomerBase({
|
|
2126
|
+
params,
|
|
2127
|
+
AutumnContext
|
|
2128
|
+
});
|
|
2129
|
+
};
|
|
2130
|
+
|
|
2131
|
+
// src/libraries/react/hooks/useEntityBase.tsx
|
|
2132
|
+
import useSWR5 from "swr";
|
|
2133
|
+
import { useContext as useContext2 } from "react";
|
|
2134
|
+
var useEntityBase = ({
|
|
2135
|
+
entityId,
|
|
2136
|
+
params,
|
|
2137
|
+
AutumnContext: AutumnContext2
|
|
2138
|
+
}) => {
|
|
2139
|
+
const { client } = useContext2(AutumnContext2);
|
|
2140
|
+
const queryKey = ["entity", entityId, params?.expand];
|
|
2141
|
+
const context = useAutumnContext({
|
|
2142
|
+
AutumnContext: AutumnContext2,
|
|
2143
|
+
name: "useEntity"
|
|
2144
|
+
});
|
|
2145
|
+
const fetchEntity = async () => {
|
|
2146
|
+
if (!entityId) {
|
|
2147
|
+
return null;
|
|
2148
|
+
}
|
|
2149
|
+
const { data: data2, error: error2 } = await client.entities.get(entityId, params);
|
|
2150
|
+
if (error2) {
|
|
2151
|
+
throw error2;
|
|
2152
|
+
}
|
|
2153
|
+
if (!data2) {
|
|
2154
|
+
return null;
|
|
2155
|
+
}
|
|
2156
|
+
return data2;
|
|
2157
|
+
};
|
|
2158
|
+
const { data, error, isLoading, mutate } = useSWR5(queryKey, fetchEntity, {
|
|
2159
|
+
fallbackData: null,
|
|
2160
|
+
shouldRetryOnError: false,
|
|
2161
|
+
onErrorRetry: (error2, key, config) => {
|
|
2162
|
+
if (error2.code == "entity_not_found") {
|
|
2163
|
+
return false;
|
|
2164
|
+
}
|
|
2165
|
+
return true;
|
|
2166
|
+
}
|
|
2167
|
+
});
|
|
2168
|
+
const {
|
|
2169
|
+
attach: attachAutumn,
|
|
2170
|
+
cancel: cancelAutumn,
|
|
2171
|
+
track: trackAutumn
|
|
2172
|
+
} = useAutumnBase({ context, client });
|
|
2173
|
+
const check = (params2) => {
|
|
2174
|
+
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
2175
|
+
openDialog({
|
|
2176
|
+
result: result.data,
|
|
2177
|
+
params: params2,
|
|
2178
|
+
context
|
|
2179
|
+
});
|
|
2180
|
+
return result;
|
|
2181
|
+
};
|
|
2182
|
+
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2183
|
+
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2184
|
+
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2185
|
+
if (!entityId) {
|
|
2186
|
+
return {
|
|
2187
|
+
entity: null,
|
|
2188
|
+
isLoading: false,
|
|
2189
|
+
error: null,
|
|
2190
|
+
refetch: mutate,
|
|
2191
|
+
check,
|
|
2192
|
+
attach,
|
|
2193
|
+
cancel,
|
|
2194
|
+
track
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
2197
|
+
return {
|
|
2198
|
+
entity: error ? null : data,
|
|
2199
|
+
isLoading,
|
|
2200
|
+
error,
|
|
2201
|
+
refetch: mutate,
|
|
2202
|
+
check,
|
|
2203
|
+
attach,
|
|
2204
|
+
cancel,
|
|
2205
|
+
track
|
|
2206
|
+
};
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2209
|
+
// src/libraries/react/hooks/useEntity.tsx
|
|
2210
|
+
var useEntity = (entityId, params) => {
|
|
2211
|
+
return useEntityBase({ AutumnContext, entityId, params });
|
|
2212
|
+
};
|
|
2213
|
+
|
|
2214
|
+
// src/libraries/react/hooks/useListEvents.tsx
|
|
2215
|
+
import { useCallback, useState } from "react";
|
|
2216
|
+
import useSWR6 from "swr";
|
|
2217
|
+
var useListEvents = (params) => {
|
|
2218
|
+
const context = useAutumnContext({
|
|
2219
|
+
AutumnContext,
|
|
2220
|
+
name: "useListEvents"
|
|
2221
|
+
});
|
|
2222
|
+
const client = context.client;
|
|
2223
|
+
const limit = params.limit ?? 100;
|
|
2224
|
+
const [page, setPage] = useState(0);
|
|
2225
|
+
const startDate = params.customRange?.start ? new Date(params.customRange.start).toISOString().slice(0, 13) : void 0;
|
|
2226
|
+
const endDate = params.customRange?.end ? new Date(params.customRange.end).toISOString().slice(0, 13) : void 0;
|
|
2227
|
+
const offset4 = page * limit;
|
|
2228
|
+
const fetcher = async () => {
|
|
2229
|
+
const res = await client.events.list({
|
|
2230
|
+
...params,
|
|
2231
|
+
offset: offset4,
|
|
2232
|
+
limit
|
|
2233
|
+
});
|
|
2234
|
+
if (res.error) {
|
|
2235
|
+
const err = new AutumnError({
|
|
2236
|
+
message: res.error.message,
|
|
2237
|
+
code: res.error.code
|
|
2238
|
+
});
|
|
2239
|
+
err.statusCode = res.statusCode;
|
|
2240
|
+
throw err;
|
|
2241
|
+
}
|
|
2242
|
+
return res.data;
|
|
2243
|
+
};
|
|
2244
|
+
const { data, error, mutate, isLoading } = useSWR6(
|
|
2245
|
+
["eventList", params.featureId, startDate, endDate, offset4, limit],
|
|
2246
|
+
fetcher,
|
|
2247
|
+
{
|
|
2248
|
+
dedupingInterval: 2e3,
|
|
2249
|
+
revalidateOnFocus: false,
|
|
2250
|
+
revalidateOnReconnect: false,
|
|
2251
|
+
shouldRetryOnError: (error2) => error2.statusCode === 429,
|
|
2252
|
+
errorRetryCount: 3
|
|
2253
|
+
}
|
|
2254
|
+
);
|
|
2255
|
+
const hasMore = data?.has_more ?? false;
|
|
2256
|
+
const hasPrevious = page > 0;
|
|
2257
|
+
const nextPage = useCallback(() => {
|
|
2258
|
+
if (hasMore) {
|
|
2259
|
+
setPage((p) => p + 1);
|
|
2260
|
+
}
|
|
2261
|
+
}, [hasMore]);
|
|
2262
|
+
const prevPage = useCallback(() => {
|
|
2263
|
+
if (hasPrevious) {
|
|
2264
|
+
setPage((p) => p - 1);
|
|
2265
|
+
}
|
|
2266
|
+
}, [hasPrevious]);
|
|
2267
|
+
const goToPage = useCallback((pageNum) => {
|
|
2268
|
+
setPage(Math.max(0, pageNum));
|
|
2269
|
+
}, []);
|
|
2270
|
+
const resetPagination = useCallback(() => {
|
|
2271
|
+
setPage(0);
|
|
2272
|
+
}, []);
|
|
2273
|
+
return {
|
|
2274
|
+
list: data?.list,
|
|
2275
|
+
hasMore,
|
|
2276
|
+
hasPrevious,
|
|
2277
|
+
page,
|
|
2278
|
+
isLoading,
|
|
2279
|
+
error,
|
|
2280
|
+
refetch: mutate,
|
|
2281
|
+
nextPage,
|
|
2282
|
+
prevPage,
|
|
2283
|
+
goToPage,
|
|
2284
|
+
resetPagination
|
|
2285
|
+
};
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
// src/libraries/react/hooks/usePaywall.tsx
|
|
2289
|
+
import useSWR7 from "swr";
|
|
2290
|
+
var usePaywall = ({
|
|
2291
|
+
featureId,
|
|
2292
|
+
entityId
|
|
2293
|
+
}) => {
|
|
2294
|
+
const context = useAutumnContext({
|
|
2295
|
+
AutumnContext,
|
|
2296
|
+
name: "usePaywall"
|
|
2297
|
+
});
|
|
2298
|
+
const enabled = !!featureId && !!context;
|
|
2299
|
+
const fetcher = async () => {
|
|
2300
|
+
if (!featureId) {
|
|
2301
|
+
return { preview: void 0 };
|
|
2302
|
+
}
|
|
2303
|
+
const { data: data2, error: error2 } = await context.client.check({
|
|
2304
|
+
featureId,
|
|
2305
|
+
withPreview: true
|
|
2306
|
+
});
|
|
2307
|
+
if (error2) throw error2;
|
|
2308
|
+
return data2;
|
|
2309
|
+
};
|
|
2310
|
+
const queryKey = [`check`, featureId, entityId];
|
|
2311
|
+
const { data, error, isLoading } = useSWR7(queryKey, fetcher, {
|
|
2312
|
+
refreshInterval: 0,
|
|
2313
|
+
enabled
|
|
2314
|
+
});
|
|
2315
|
+
return {
|
|
2316
|
+
data: data?.preview,
|
|
2317
|
+
error,
|
|
2318
|
+
isLoading
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2322
|
+
// src/libraries/react/hooks/usePricingTable.tsx
|
|
2323
|
+
var usePricingTable = (params) => {
|
|
2324
|
+
const context = useAutumnContext({
|
|
2325
|
+
AutumnContext,
|
|
2326
|
+
name: "usePricingTable"
|
|
2327
|
+
});
|
|
2328
|
+
return usePricingTableBase({
|
|
2329
|
+
client: context.client,
|
|
2330
|
+
params
|
|
2331
|
+
});
|
|
2332
|
+
};
|
|
2333
|
+
|
|
2334
|
+
// src/libraries/react/BaseAutumnProvider.tsx
|
|
2335
|
+
import { useRef } from "react";
|
|
2336
|
+
import { useState as useState3 } from "react";
|
|
2337
|
+
|
|
2338
|
+
// src/libraries/react/hooks/helpers/useDialog.tsx
|
|
2339
|
+
import { useState as useState2, useEffect } from "react";
|
|
2340
|
+
var useDialog = (component) => {
|
|
2341
|
+
const [dialogProps, setDialogProps] = useState2(null);
|
|
2342
|
+
const [dialogOpen, setDialogOpen] = useState2(false);
|
|
2343
|
+
useEffect(() => {
|
|
2344
|
+
if (!dialogOpen) {
|
|
2345
|
+
setTimeout(() => {
|
|
2346
|
+
setDialogProps(null);
|
|
2347
|
+
}, 200);
|
|
2040
2348
|
}
|
|
2041
|
-
};
|
|
2349
|
+
}, [dialogOpen]);
|
|
2350
|
+
return [dialogProps, setDialogProps, dialogOpen, setDialogOpen];
|
|
2042
2351
|
};
|
|
2043
2352
|
|
|
2044
2353
|
// src/libraries/react/BaseAutumnProvider.tsx
|
|
@@ -2048,7 +2357,7 @@ function BaseAutumnProvider({
|
|
|
2048
2357
|
children,
|
|
2049
2358
|
AutumnContext: AutumnContext2
|
|
2050
2359
|
}) {
|
|
2051
|
-
const [components, setComponents] =
|
|
2360
|
+
const [components, setComponents] = useState3({});
|
|
2052
2361
|
const [paywallProps, setPaywallProps, paywallOpen, setPaywallOpen] = useDialog(components.paywallDialog);
|
|
2053
2362
|
const [
|
|
2054
2363
|
productChangeProps,
|
|
@@ -2058,7 +2367,7 @@ function BaseAutumnProvider({
|
|
|
2058
2367
|
] = useDialog(components.productChangeDialog);
|
|
2059
2368
|
useCustomerBase({ client, params: { errorOnNotFound: false } });
|
|
2060
2369
|
const paywallRef = useRef(null);
|
|
2061
|
-
const [refresh, setRefresh] =
|
|
2370
|
+
const [refresh, setRefresh] = useState3(0);
|
|
2062
2371
|
return /* @__PURE__ */ jsxs(
|
|
2063
2372
|
AutumnContext2.Provider,
|
|
2064
2373
|
{
|
|
@@ -2511,246 +2820,7 @@ var ReactAutumnProvider = ({
|
|
|
2511
2820
|
return /* @__PURE__ */ jsx2(BaseAutumnProvider, { client, AutumnContext, children });
|
|
2512
2821
|
};
|
|
2513
2822
|
|
|
2514
|
-
//
|
|
2515
|
-
var useCustomer = (params) => {
|
|
2516
|
-
return useCustomerBase({
|
|
2517
|
-
params,
|
|
2518
|
-
AutumnContext
|
|
2519
|
-
});
|
|
2520
|
-
};
|
|
2521
|
-
|
|
2522
|
-
// src/libraries/react/hooks/usePricingTable.tsx
|
|
2523
|
-
var usePricingTable = (params) => {
|
|
2524
|
-
const context = useAutumnContext({
|
|
2525
|
-
AutumnContext,
|
|
2526
|
-
name: "usePricingTable"
|
|
2527
|
-
});
|
|
2528
|
-
return usePricingTableBase({
|
|
2529
|
-
client: context.client,
|
|
2530
|
-
params
|
|
2531
|
-
});
|
|
2532
|
-
};
|
|
2533
|
-
|
|
2534
|
-
// src/libraries/react/hooks/useEntityBase.tsx
|
|
2535
|
-
import useSWR3 from "swr";
|
|
2536
|
-
import { useContext as useContext2 } from "react";
|
|
2537
|
-
var useEntityBase = ({
|
|
2538
|
-
entityId,
|
|
2539
|
-
params,
|
|
2540
|
-
AutumnContext: AutumnContext2
|
|
2541
|
-
}) => {
|
|
2542
|
-
const { client } = useContext2(AutumnContext2);
|
|
2543
|
-
const queryKey = ["entity", entityId, params?.expand];
|
|
2544
|
-
const context = useAutumnContext({
|
|
2545
|
-
AutumnContext: AutumnContext2,
|
|
2546
|
-
name: "useEntity"
|
|
2547
|
-
});
|
|
2548
|
-
const fetchEntity = async () => {
|
|
2549
|
-
if (!entityId) {
|
|
2550
|
-
return null;
|
|
2551
|
-
}
|
|
2552
|
-
const { data: data2, error: error2 } = await client.entities.get(entityId, params);
|
|
2553
|
-
if (error2) {
|
|
2554
|
-
throw error2;
|
|
2555
|
-
}
|
|
2556
|
-
if (!data2) {
|
|
2557
|
-
return null;
|
|
2558
|
-
}
|
|
2559
|
-
return data2;
|
|
2560
|
-
};
|
|
2561
|
-
const { data, error, isLoading, mutate } = useSWR3(queryKey, fetchEntity, {
|
|
2562
|
-
fallbackData: null,
|
|
2563
|
-
shouldRetryOnError: false,
|
|
2564
|
-
onErrorRetry: (error2, key, config) => {
|
|
2565
|
-
if (error2.code == "entity_not_found") {
|
|
2566
|
-
return false;
|
|
2567
|
-
}
|
|
2568
|
-
return true;
|
|
2569
|
-
}
|
|
2570
|
-
});
|
|
2571
|
-
const {
|
|
2572
|
-
attach: attachAutumn,
|
|
2573
|
-
cancel: cancelAutumn,
|
|
2574
|
-
track: trackAutumn
|
|
2575
|
-
} = useAutumnBase({ context, client });
|
|
2576
|
-
const check = (params2) => {
|
|
2577
|
-
const result = handleCheck2({ customer: data, params: params2, isEntity: true });
|
|
2578
|
-
openDialog({
|
|
2579
|
-
result: result.data,
|
|
2580
|
-
params: params2,
|
|
2581
|
-
context
|
|
2582
|
-
});
|
|
2583
|
-
return result;
|
|
2584
|
-
};
|
|
2585
|
-
const attach = (params2) => attachAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2586
|
-
const cancel = (params2) => cancelAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2587
|
-
const track = (params2) => trackAutumn({ ...params2, entityId: entityId || void 0 });
|
|
2588
|
-
if (!entityId) {
|
|
2589
|
-
return {
|
|
2590
|
-
entity: null,
|
|
2591
|
-
isLoading: false,
|
|
2592
|
-
error: null,
|
|
2593
|
-
refetch: mutate,
|
|
2594
|
-
check,
|
|
2595
|
-
attach,
|
|
2596
|
-
cancel,
|
|
2597
|
-
track
|
|
2598
|
-
};
|
|
2599
|
-
}
|
|
2600
|
-
return {
|
|
2601
|
-
entity: error ? null : data,
|
|
2602
|
-
isLoading,
|
|
2603
|
-
error,
|
|
2604
|
-
refetch: mutate,
|
|
2605
|
-
check,
|
|
2606
|
-
attach,
|
|
2607
|
-
cancel,
|
|
2608
|
-
track
|
|
2609
|
-
};
|
|
2610
|
-
};
|
|
2611
|
-
|
|
2612
|
-
// src/libraries/react/hooks/useEntity.tsx
|
|
2613
|
-
var useEntity = (entityId, params) => {
|
|
2614
|
-
return useEntityBase({ AutumnContext, entityId, params });
|
|
2615
|
-
};
|
|
2616
|
-
|
|
2617
|
-
// src/libraries/react/hooks/useAnalytics.tsx
|
|
2618
|
-
import useSWR4 from "swr";
|
|
2619
|
-
var useAnalytics = (params) => {
|
|
2620
|
-
const context = useAutumnContext({
|
|
2621
|
-
AutumnContext,
|
|
2622
|
-
name: "useAnalytics"
|
|
2623
|
-
});
|
|
2624
|
-
const client = context.client;
|
|
2625
|
-
const fetcher = async () => {
|
|
2626
|
-
try {
|
|
2627
|
-
const { data: data2, error: error2 } = await client.query(params);
|
|
2628
|
-
if (error2) throw error2;
|
|
2629
|
-
return data2;
|
|
2630
|
-
} catch (error2) {
|
|
2631
|
-
throw new AutumnError({
|
|
2632
|
-
message: "Failed to fetch analytics",
|
|
2633
|
-
code: "fetch_analytics_failed"
|
|
2634
|
-
});
|
|
2635
|
-
}
|
|
2636
|
-
};
|
|
2637
|
-
const { data, error, mutate } = useSWR4(
|
|
2638
|
-
["analytics", params.featureId, params.range],
|
|
2639
|
-
fetcher,
|
|
2640
|
-
{ refreshInterval: 0 }
|
|
2641
|
-
);
|
|
2642
|
-
return {
|
|
2643
|
-
data: data?.list,
|
|
2644
|
-
isLoading: !error && !data,
|
|
2645
|
-
error,
|
|
2646
|
-
refetch: mutate
|
|
2647
|
-
};
|
|
2648
|
-
};
|
|
2649
|
-
|
|
2650
|
-
// src/libraries/react/hooks/usePaywall.tsx
|
|
2651
|
-
import useSWR5 from "swr";
|
|
2652
|
-
var usePaywall = ({
|
|
2653
|
-
featureId,
|
|
2654
|
-
entityId
|
|
2655
|
-
}) => {
|
|
2656
|
-
const context = useAutumnContext({
|
|
2657
|
-
AutumnContext,
|
|
2658
|
-
name: "usePaywall"
|
|
2659
|
-
});
|
|
2660
|
-
const enabled = !!featureId && !!context;
|
|
2661
|
-
const fetcher = async () => {
|
|
2662
|
-
if (!featureId) {
|
|
2663
|
-
return { preview: void 0 };
|
|
2664
|
-
}
|
|
2665
|
-
const { data: data2, error: error2 } = await context.client.check({
|
|
2666
|
-
featureId,
|
|
2667
|
-
withPreview: true
|
|
2668
|
-
});
|
|
2669
|
-
if (error2) throw error2;
|
|
2670
|
-
return data2;
|
|
2671
|
-
};
|
|
2672
|
-
const queryKey = [`check`, featureId, entityId];
|
|
2673
|
-
const { data, error, isLoading } = useSWR5(queryKey, fetcher, {
|
|
2674
|
-
refreshInterval: 0,
|
|
2675
|
-
enabled
|
|
2676
|
-
});
|
|
2677
|
-
return {
|
|
2678
|
-
data: data?.preview,
|
|
2679
|
-
error,
|
|
2680
|
-
isLoading
|
|
2681
|
-
};
|
|
2682
|
-
};
|
|
2683
|
-
|
|
2684
|
-
// src/libraries/react/hooks/useListEvents.tsx
|
|
2685
|
-
import useSWR6 from "swr";
|
|
2686
|
-
var useListEvents = (params) => {
|
|
2687
|
-
const context = useAutumnContext({
|
|
2688
|
-
AutumnContext,
|
|
2689
|
-
name: "useListEvents"
|
|
2690
|
-
});
|
|
2691
|
-
const client = context.client;
|
|
2692
|
-
const fetcher = async () => {
|
|
2693
|
-
try {
|
|
2694
|
-
const { data: data2, error: error2 } = await client.events.list(params);
|
|
2695
|
-
if (error2) throw error2;
|
|
2696
|
-
return data2;
|
|
2697
|
-
} catch (error2) {
|
|
2698
|
-
throw new AutumnError({
|
|
2699
|
-
message: "Failed to fetch event list",
|
|
2700
|
-
code: "fetch_event_list_failed"
|
|
2701
|
-
});
|
|
2702
|
-
}
|
|
2703
|
-
};
|
|
2704
|
-
const { data, error, mutate } = useSWR6(
|
|
2705
|
-
["eventList", params.customer_id, params.feature_id, params.time_range],
|
|
2706
|
-
fetcher,
|
|
2707
|
-
{ refreshInterval: 0 }
|
|
2708
|
-
);
|
|
2709
|
-
return {
|
|
2710
|
-
list: data?.list,
|
|
2711
|
-
hasMore: data?.has_more,
|
|
2712
|
-
nextCursor: data?.next_cursor,
|
|
2713
|
-
isLoading: !error && !data,
|
|
2714
|
-
error,
|
|
2715
|
-
refetch: mutate
|
|
2716
|
-
};
|
|
2717
|
-
};
|
|
2718
|
-
|
|
2719
|
-
// src/libraries/react/hooks/useAggregateEvents.tsx
|
|
2720
|
-
import useSWR7 from "swr";
|
|
2721
|
-
var useAggregateEvents = (params) => {
|
|
2722
|
-
const context = useAutumnContext({
|
|
2723
|
-
AutumnContext,
|
|
2724
|
-
name: "useAggregateEvents"
|
|
2725
|
-
});
|
|
2726
|
-
const client = context.client;
|
|
2727
|
-
const fetcher = async () => {
|
|
2728
|
-
try {
|
|
2729
|
-
const { data: data2, error: error2 } = await client.events.aggregate(params);
|
|
2730
|
-
if (error2) throw error2;
|
|
2731
|
-
return data2;
|
|
2732
|
-
} catch (error2) {
|
|
2733
|
-
throw new AutumnError({
|
|
2734
|
-
message: "Failed to fetch event aggregation",
|
|
2735
|
-
code: "fetch_event_aggregation_failed"
|
|
2736
|
-
});
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
const { data, error, mutate } = useSWR7(
|
|
2740
|
-
["eventAggregate", params.customer_id, params.feature_id, params.range, params.bin_size],
|
|
2741
|
-
fetcher,
|
|
2742
|
-
{ refreshInterval: 0 }
|
|
2743
|
-
);
|
|
2744
|
-
return {
|
|
2745
|
-
list: data?.list,
|
|
2746
|
-
total: data?.total,
|
|
2747
|
-
isLoading: !error && !data,
|
|
2748
|
-
error,
|
|
2749
|
-
refetch: mutate
|
|
2750
|
-
};
|
|
2751
|
-
};
|
|
2752
|
-
|
|
2753
|
-
// ../node_modules/.pnpm/@radix-ui+react-accordion@1.2.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+r_88fa064b3d5df5119586fe1472472636/node_modules/@radix-ui/react-accordion/dist/index.mjs
|
|
2823
|
+
// ../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
|
|
2754
2824
|
import React13 from "react";
|
|
2755
2825
|
|
|
2756
2826
|
// ../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
|
|
@@ -2830,7 +2900,7 @@ function composeContextScopes(...scopes) {
|
|
|
2830
2900
|
return createScope;
|
|
2831
2901
|
}
|
|
2832
2902
|
|
|
2833
|
-
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
2903
|
+
// ../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
|
|
2834
2904
|
import React5 from "react";
|
|
2835
2905
|
|
|
2836
2906
|
// ../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
|
|
@@ -2957,7 +3027,7 @@ function getElementRef(element) {
|
|
|
2957
3027
|
return element.props.ref || element.ref;
|
|
2958
3028
|
}
|
|
2959
3029
|
|
|
2960
|
-
// ../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3030
|
+
// ../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
|
|
2961
3031
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
2962
3032
|
import React22 from "react";
|
|
2963
3033
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
@@ -3110,7 +3180,7 @@ function isFunction(value) {
|
|
|
3110
3180
|
}
|
|
3111
3181
|
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
3112
3182
|
|
|
3113
|
-
// ../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3183
|
+
// ../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
|
|
3114
3184
|
import * as React8 from "react";
|
|
3115
3185
|
import * as ReactDOM from "react-dom";
|
|
3116
3186
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
@@ -3150,10 +3220,10 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
3150
3220
|
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
3151
3221
|
}
|
|
3152
3222
|
|
|
3153
|
-
// ../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.11_@types+react-dom@19.1.9_@types+react@19.1.10__@
|
|
3223
|
+
// ../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
|
|
3154
3224
|
import * as React11 from "react";
|
|
3155
3225
|
|
|
3156
|
-
// ../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3226
|
+
// ../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
|
|
3157
3227
|
import * as React24 from "react";
|
|
3158
3228
|
import * as React9 from "react";
|
|
3159
3229
|
function useStateMachine(initialState, machine) {
|
|
@@ -3291,7 +3361,7 @@ function useId(deterministicId) {
|
|
|
3291
3361
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
3292
3362
|
}
|
|
3293
3363
|
|
|
3294
|
-
// ../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.11_@types+react-dom@19.1.9_@types+react@19.1.10__@
|
|
3364
|
+
// ../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
|
|
3295
3365
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
3296
3366
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
3297
3367
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
@@ -3435,7 +3505,7 @@ function useDirection(localDir) {
|
|
|
3435
3505
|
return localDir || globalDir || "ltr";
|
|
3436
3506
|
}
|
|
3437
3507
|
|
|
3438
|
-
// ../node_modules/.pnpm/@radix-ui+react-accordion@1.2.11_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
3508
|
+
// ../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
|
|
3439
3509
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
3440
3510
|
var ACCORDION_NAME = "Accordion";
|
|
3441
3511
|
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
@@ -3834,7 +3904,7 @@ var __iconNode3 = [
|
|
|
3834
3904
|
var X = createLucideIcon("x", __iconNode3);
|
|
3835
3905
|
|
|
3836
3906
|
// src/libraries/react/components/checkout-dialog/checkout-dialog-synced.tsx
|
|
3837
|
-
import { useEffect as useEffect19, useState as
|
|
3907
|
+
import { useEffect as useEffect19, useState as useState18 } from "react";
|
|
3838
3908
|
|
|
3839
3909
|
// src/libraries/react/components/ui/accordion.tsx
|
|
3840
3910
|
import * as React14 from "react";
|
|
@@ -6493,10 +6563,10 @@ Button.displayName = "Button";
|
|
|
6493
6563
|
// src/libraries/react/components/ui/dialog.tsx
|
|
6494
6564
|
import * as React33 from "react";
|
|
6495
6565
|
|
|
6496
|
-
// ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
6566
|
+
// ../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
|
|
6497
6567
|
import * as React32 from "react";
|
|
6498
6568
|
|
|
6499
|
-
// ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.9_@types+react@19.1.
|
|
6569
|
+
// ../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
|
|
6500
6570
|
import * as React18 from "react";
|
|
6501
6571
|
|
|
6502
6572
|
// ../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
|
|
@@ -6524,7 +6594,7 @@ function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.docum
|
|
|
6524
6594
|
}, [onEscapeKeyDown, ownerDocument]);
|
|
6525
6595
|
}
|
|
6526
6596
|
|
|
6527
|
-
// ../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.9_@types+react@19.1.
|
|
6597
|
+
// ../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
|
|
6528
6598
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
6529
6599
|
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
6530
6600
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
@@ -6729,7 +6799,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
6729
6799
|
}
|
|
6730
6800
|
}
|
|
6731
6801
|
|
|
6732
|
-
// ../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
6802
|
+
// ../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
|
|
6733
6803
|
import * as React19 from "react";
|
|
6734
6804
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
6735
6805
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
@@ -6933,7 +7003,7 @@ function removeLinks(items) {
|
|
|
6933
7003
|
return items.filter((item) => item.tagName !== "A");
|
|
6934
7004
|
}
|
|
6935
7005
|
|
|
6936
|
-
// ../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
7006
|
+
// ../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
|
|
6937
7007
|
import * as React20 from "react";
|
|
6938
7008
|
import ReactDOM2 from "react-dom";
|
|
6939
7009
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
@@ -7030,9 +7100,9 @@ function assignRef(ref, value) {
|
|
|
7030
7100
|
}
|
|
7031
7101
|
|
|
7032
7102
|
// ../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
|
|
7033
|
-
import { useState as
|
|
7103
|
+
import { useState as useState11 } from "react";
|
|
7034
7104
|
function useCallbackRef2(initialValue, callback) {
|
|
7035
|
-
var ref =
|
|
7105
|
+
var ref = useState11(function() {
|
|
7036
7106
|
return {
|
|
7037
7107
|
// value
|
|
7038
7108
|
value: initialValue,
|
|
@@ -7810,7 +7880,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
|
7810
7880
|
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
7811
7881
|
};
|
|
7812
7882
|
|
|
7813
|
-
// ../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
7883
|
+
// ../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
|
|
7814
7884
|
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
7815
7885
|
var DIALOG_NAME = "Dialog";
|
|
7816
7886
|
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
@@ -8231,10 +8301,10 @@ Input.displayName = "Input";
|
|
|
8231
8301
|
// src/libraries/react/components/ui/popover.tsx
|
|
8232
8302
|
import * as React40 from "react";
|
|
8233
8303
|
|
|
8234
|
-
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
8304
|
+
// ../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
|
|
8235
8305
|
import * as React39 from "react";
|
|
8236
8306
|
|
|
8237
|
-
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
8307
|
+
// ../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
|
|
8238
8308
|
import * as React38 from "react";
|
|
8239
8309
|
|
|
8240
8310
|
// ../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
@@ -10119,7 +10189,7 @@ var arrow3 = (options, deps) => ({
|
|
|
10119
10189
|
options: [options, deps]
|
|
10120
10190
|
});
|
|
10121
10191
|
|
|
10122
|
-
// ../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+react@
|
|
10192
|
+
// ../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
|
|
10123
10193
|
import * as React36 from "react";
|
|
10124
10194
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
10125
10195
|
var NAME = "Arrow";
|
|
@@ -10178,7 +10248,7 @@ function useSize(element) {
|
|
|
10178
10248
|
return size4;
|
|
10179
10249
|
}
|
|
10180
10250
|
|
|
10181
|
-
// ../node_modules/.pnpm/@radix-ui+react-popper@1.2.7_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
10251
|
+
// ../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
|
|
10182
10252
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
10183
10253
|
var POPPER_NAME = "Popper";
|
|
10184
10254
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
@@ -10445,7 +10515,7 @@ var Anchor = PopperAnchor;
|
|
|
10445
10515
|
var Content4 = PopperContent;
|
|
10446
10516
|
var Arrow2 = PopperArrow;
|
|
10447
10517
|
|
|
10448
|
-
// ../node_modules/.pnpm/@radix-ui+react-popover@1.1.14_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
10518
|
+
// ../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
|
|
10449
10519
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
10450
10520
|
var POPOVER_NAME = "Popover";
|
|
10451
10521
|
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
@@ -10909,13 +10979,13 @@ var formatCurrency = ({
|
|
|
10909
10979
|
};
|
|
10910
10980
|
function CheckoutDialog(params) {
|
|
10911
10981
|
const { attach } = useCustomer();
|
|
10912
|
-
const [checkoutResult, setCheckoutResult] =
|
|
10982
|
+
const [checkoutResult, setCheckoutResult] = useState18(params?.checkoutResult);
|
|
10913
10983
|
useEffect19(() => {
|
|
10914
10984
|
if (params.checkoutResult) {
|
|
10915
10985
|
setCheckoutResult(params.checkoutResult);
|
|
10916
10986
|
}
|
|
10917
10987
|
}, [params.checkoutResult]);
|
|
10918
|
-
const [loading, setLoading] =
|
|
10988
|
+
const [loading, setLoading] = useState18(false);
|
|
10919
10989
|
if (!checkoutResult) {
|
|
10920
10990
|
return /* @__PURE__ */ jsx24(Fragment6, {});
|
|
10921
10991
|
}
|
|
@@ -11090,12 +11160,12 @@ var PrepaidItem = ({
|
|
|
11090
11160
|
setCheckoutResult
|
|
11091
11161
|
}) => {
|
|
11092
11162
|
const { quantity = 0, billing_units: billingUnits = 1 } = item;
|
|
11093
|
-
const [quantityInput, setQuantityInput] =
|
|
11163
|
+
const [quantityInput, setQuantityInput] = useState18(
|
|
11094
11164
|
(quantity / billingUnits).toString()
|
|
11095
11165
|
);
|
|
11096
11166
|
const { checkout } = useCustomer();
|
|
11097
|
-
const [loading, setLoading] =
|
|
11098
|
-
const [open, setOpen] =
|
|
11167
|
+
const [loading, setLoading] = useState18(false);
|
|
11168
|
+
const [open, setOpen] = useState18(false);
|
|
11099
11169
|
const scenario = checkoutResult.product.scenario;
|
|
11100
11170
|
const handleSave = async () => {
|
|
11101
11171
|
setLoading(true);
|
|
@@ -11282,12 +11352,12 @@ function PaywallDialog(params) {
|
|
|
11282
11352
|
|
|
11283
11353
|
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
11284
11354
|
import React44 from "react";
|
|
11285
|
-
import { createContext as createContext5, useContext as useContext6, useState as
|
|
11355
|
+
import { createContext as createContext5, useContext as useContext6, useState as useState20 } from "react";
|
|
11286
11356
|
|
|
11287
11357
|
// src/libraries/react/components/ui/switch.tsx
|
|
11288
11358
|
import * as React43 from "react";
|
|
11289
11359
|
|
|
11290
|
-
// ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
11360
|
+
// ../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
|
|
11291
11361
|
import * as React42 from "react";
|
|
11292
11362
|
|
|
11293
11363
|
// ../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
|
|
@@ -11303,7 +11373,7 @@ function usePrevious(value) {
|
|
|
11303
11373
|
}, [value]);
|
|
11304
11374
|
}
|
|
11305
11375
|
|
|
11306
|
-
// ../node_modules/.pnpm/@radix-ui+react-switch@1.2.5_@types+react-dom@19.1.9_@types+react@19.1.10__@types+
|
|
11376
|
+
// ../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
|
|
11307
11377
|
import { jsx as jsx26, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
11308
11378
|
var SWITCH_NAME = "Switch";
|
|
11309
11379
|
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
@@ -11561,7 +11631,7 @@ function PricingTable({
|
|
|
11561
11631
|
productDetails
|
|
11562
11632
|
}) {
|
|
11563
11633
|
const { customer, checkout } = useCustomer({ errorOnNotFound: false });
|
|
11564
|
-
const [isAnnual, setIsAnnual] =
|
|
11634
|
+
const [isAnnual, setIsAnnual] = useState20(false);
|
|
11565
11635
|
const { products, isLoading, error } = usePricingTable({ productDetails });
|
|
11566
11636
|
if (isLoading) {
|
|
11567
11637
|
return /* @__PURE__ */ jsx29("div", { style: loadingStyles, children: /* @__PURE__ */ jsx29(LoaderCircle, { style: spinnerStyles }) });
|
|
@@ -11792,7 +11862,7 @@ var PricingFeatureList = ({
|
|
|
11792
11862
|
] });
|
|
11793
11863
|
};
|
|
11794
11864
|
var PricingCardButton = React44.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
|
|
11795
|
-
const [loading, setLoading] =
|
|
11865
|
+
const [loading, setLoading] = useState20(false);
|
|
11796
11866
|
const handleClick = async (e) => {
|
|
11797
11867
|
setLoading(true);
|
|
11798
11868
|
try {
|