autumn-js 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/libraries/backend/better-auth.js +2 -3
  2. package/dist/libraries/backend/better-auth.mjs +2 -2
  3. package/dist/libraries/backend/{chunk-PO4EL4BW.mjs → chunk-PSF6JXUI.mjs} +2 -3
  4. package/dist/libraries/backend/{chunk-4MEEJLXG.mjs → chunk-THVB3SV5.mjs} +1 -1
  5. package/dist/libraries/backend/convex.js +2 -3
  6. package/dist/libraries/backend/convex.mjs +2 -2
  7. package/dist/libraries/backend/elysia.js +2 -3
  8. package/dist/libraries/backend/elysia.mjs +2 -2
  9. package/dist/libraries/backend/express.js +2 -3
  10. package/dist/libraries/backend/express.mjs +2 -2
  11. package/dist/libraries/backend/fastify.js +2 -3
  12. package/dist/libraries/backend/fastify.mjs +2 -2
  13. package/dist/libraries/backend/hono.js +2 -3
  14. package/dist/libraries/backend/hono.mjs +2 -2
  15. package/dist/libraries/backend/index.js +2 -3
  16. package/dist/libraries/backend/index.mjs +2 -2
  17. package/dist/libraries/backend/next.js +2 -3
  18. package/dist/libraries/backend/next.mjs +2 -2
  19. package/dist/libraries/backend/react-router.js +2 -3
  20. package/dist/libraries/backend/react-router.mjs +2 -2
  21. package/dist/libraries/backend/remix_dep.js +2 -3
  22. package/dist/libraries/backend/remix_dep.mjs +2 -2
  23. package/dist/libraries/backend/routes/backendRouter.js +2 -3
  24. package/dist/libraries/backend/routes/backendRouter.mjs +2 -2
  25. package/dist/libraries/backend/routes/genRoutes.js +2 -3
  26. package/dist/libraries/backend/routes/genRoutes.mjs +1 -1
  27. package/dist/libraries/backend/supabase.js +2 -3
  28. package/dist/libraries/backend/supabase.mjs +2 -2
  29. package/dist/libraries/backend/tanstack.js +2 -3
  30. package/dist/libraries/backend/tanstack.mjs +2 -2
  31. package/dist/libraries/react/AutumnContext.mjs +6 -6
  32. package/dist/libraries/react/BaseAutumnProvider.mjs +8 -8
  33. package/dist/libraries/react/ReactAutumnProvider.mjs +9 -9
  34. package/dist/libraries/react/{chunk-Q7LVAQ5K.mjs → chunk-4NGP3RFL.mjs} +2 -2
  35. package/dist/libraries/react/{chunk-HN7ULWIM.mjs → chunk-4PV64IOC.mjs} +1 -1
  36. package/dist/libraries/react/{chunk-7T7IOMAA.mjs → chunk-77G4WAU5.mjs} +2 -2
  37. package/dist/libraries/react/{chunk-5TLRC3ED.mjs → chunk-AHIEANFE.mjs} +17 -17
  38. package/dist/libraries/react/{chunk-QEWVBDWJ.mjs → chunk-ATGLJHUN.mjs} +1 -1
  39. package/dist/libraries/react/{chunk-C3G5RW3Q.mjs → chunk-BQ24GX2A.mjs} +6 -6
  40. package/dist/libraries/react/{chunk-MHAXHLX4.mjs → chunk-BTKKRVC2.mjs} +3 -3
  41. package/dist/libraries/react/{chunk-RNIUZGWU.mjs → chunk-CXAFFVZ3.mjs} +1 -1
  42. package/dist/libraries/react/{chunk-4KLTPVNG.mjs → chunk-FAG5HHVM.mjs} +2 -2
  43. package/dist/libraries/react/{chunk-4YM2QKRI.mjs → chunk-FBM7UWCQ.mjs} +1 -1
  44. package/dist/libraries/react/{chunk-4QVAJKUF.mjs → chunk-HNWWFCOW.mjs} +1 -1
  45. package/dist/libraries/react/{chunk-7FMBA5I4.mjs → chunk-KNA6HOEN.mjs} +1 -1
  46. package/dist/libraries/react/{chunk-2LZIBRD4.mjs → chunk-NPPSXTRQ.mjs} +2 -2
  47. package/dist/libraries/react/{chunk-FW7AQFVX.mjs → chunk-QRGKGYAH.mjs} +1 -1
  48. package/dist/libraries/react/{chunk-YKJYGNXR.mjs → chunk-RZ3KIQZR.mjs} +1 -1
  49. package/dist/libraries/react/{chunk-WSX7HWKQ.mjs → chunk-SD3N4EVB.mjs} +1 -1
  50. package/dist/libraries/react/{chunk-P4GHLIEZ.mjs → chunk-ZPF6PPB3.mjs} +433 -431
  51. package/dist/libraries/react/{chunk-FL4H464X.mjs → chunk-ZZCVA7KR.mjs} +3 -3
  52. package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -5
  53. package/dist/libraries/react/components/checkout-dialog/checkout-dialog-synced.mjs +27 -27
  54. package/dist/libraries/react/components/paywall-dialog/paywall-dialog-synced.mjs +27 -27
  55. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +27 -27
  56. package/dist/libraries/react/components/ui/accordion.mjs +3 -3
  57. package/dist/libraries/react/components/ui/dialog.mjs +4 -4
  58. package/dist/libraries/react/components/ui/popover.mjs +5 -5
  59. package/dist/libraries/react/components/ui/switch.mjs +3 -3
  60. package/dist/libraries/react/hooks/useAnalytics.mjs +7 -7
  61. package/dist/libraries/react/hooks/useCustomer.mjs +8 -8
  62. package/dist/libraries/react/hooks/useCustomerBase.mjs +7 -7
  63. package/dist/libraries/react/hooks/useEntity.mjs +8 -8
  64. package/dist/libraries/react/hooks/useEntityBase.mjs +7 -7
  65. package/dist/libraries/react/hooks/usePaywall.mjs +7 -7
  66. package/dist/libraries/react/hooks/usePricingTable.mjs +7 -7
  67. package/package.json +1 -1
  68. package/dist/libraries/react/{chunk-2GEDBGON.mjs → chunk-4XU63W7I.mjs} +11 -11
  69. package/dist/libraries/react/{chunk-5OBFJVZC.mjs → chunk-AUS7R5BB.mjs} +12 -12
@@ -3,465 +3,155 @@
3
3
  import {
4
4
  getPricingTableContent
5
5
  } from "./chunk-URQMBRFZ.mjs";
6
- import {
7
- Button
8
- } from "./chunk-SWSFJTEQ.mjs";
9
- import {
10
- Dialog,
11
- DialogContent,
12
- DialogFooter,
13
- DialogTitle
14
- } from "./chunk-MHAXHLX4.mjs";
15
- import {
16
- Input
17
- } from "./chunk-GUM4HIGI.mjs";
18
6
  import {
19
7
  Popover,
20
8
  PopoverContent,
21
9
  PopoverTrigger
22
- } from "./chunk-C3G5RW3Q.mjs";
10
+ } from "./chunk-BQ24GX2A.mjs";
23
11
  import {
24
12
  Switch
25
- } from "./chunk-2LZIBRD4.mjs";
26
- import {
27
- getCheckoutContent
28
- } from "./chunk-BLM4DAAR.mjs";
13
+ } from "./chunk-NPPSXTRQ.mjs";
29
14
  import {
30
15
  getPaywallContent
31
16
  } from "./chunk-I5ZGIAIX.mjs";
17
+ import {
18
+ getCheckoutContent
19
+ } from "./chunk-BLM4DAAR.mjs";
32
20
  import {
33
21
  Accordion,
34
22
  AccordionContent,
35
23
  AccordionItem,
36
24
  Header,
37
25
  Trigger2
38
- } from "./chunk-4KLTPVNG.mjs";
26
+ } from "./chunk-FAG5HHVM.mjs";
27
+ import {
28
+ Button
29
+ } from "./chunk-SWSFJTEQ.mjs";
30
+ import {
31
+ Dialog,
32
+ DialogContent,
33
+ DialogFooter,
34
+ DialogTitle
35
+ } from "./chunk-BTKKRVC2.mjs";
39
36
  import {
40
37
  ArrowRight,
41
38
  ChevronDown,
42
39
  LoaderCircle
43
40
  } from "./chunk-2OHJ6PS6.mjs";
44
41
  import {
45
- usePaywall
46
- } from "./chunk-HN7ULWIM.mjs";
47
- import {
48
- usePricingTable
49
- } from "./chunk-7FMBA5I4.mjs";
42
+ Input
43
+ } from "./chunk-GUM4HIGI.mjs";
50
44
  import {
51
45
  loadingStyles,
52
46
  spinnerStyles
53
47
  } from "./chunk-WVKYZYFT.mjs";
48
+ import {
49
+ useCustomer
50
+ } from "./chunk-4NGP3RFL.mjs";
51
+ import {
52
+ usePaywall
53
+ } from "./chunk-4PV64IOC.mjs";
54
+ import {
55
+ usePricingTable
56
+ } from "./chunk-KNA6HOEN.mjs";
54
57
  import {
55
58
  cn
56
59
  } from "./chunk-4J6OC4ZQ.mjs";
57
- import {
58
- useCustomer
59
- } from "./chunk-Q7LVAQ5K.mjs";
60
60
 
61
61
  // src/libraries/react/components/checkout-dialog/checkout-dialog-synced.tsx
62
- import { useEffect, useState } from "react";
62
+ import { useEffect, useState as useState2 } from "react";
63
+
64
+ // src/libraries/react/components/paywall-dialog/paywall-dialog-synced.tsx
63
65
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
64
- var formatCurrency = ({
65
- amount,
66
- currency
67
- }) => {
68
- return new Intl.NumberFormat("en-US", {
69
- style: "currency",
70
- currency
71
- }).format(amount);
72
- };
73
- function CheckoutDialog(params) {
74
- const { attach } = useCustomer();
75
- const [checkoutResult, setCheckoutResult] = useState(params?.checkoutResult);
76
- useEffect(() => {
77
- if (params.checkoutResult) {
78
- setCheckoutResult(params.checkoutResult);
79
- }
80
- }, [params.checkoutResult]);
81
- const [loading, setLoading] = useState(false);
82
- if (!checkoutResult) {
66
+ function PaywallDialog(params) {
67
+ const { data: preview } = usePaywall({
68
+ featureId: params?.featureId,
69
+ entityId: params?.entityId
70
+ });
71
+ if (!params || !preview) {
83
72
  return /* @__PURE__ */ jsx(Fragment, {});
84
73
  }
85
74
  const { open, setOpen } = params;
86
- const { title, message } = getCheckoutContent(checkoutResult);
87
- const isFree = checkoutResult?.product.properties?.is_free;
88
- const isPaid = isFree === false;
89
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-text-sm", children: [
90
- /* @__PURE__ */ jsx(DialogTitle, { className: "au-px-6 au-mb-1", children: title }),
91
- /* @__PURE__ */ jsx("div", { className: "au-px-6 au-mt-1 au-mb-4 au-text-muted-foreground", children: message }),
92
- isPaid && checkoutResult && /* @__PURE__ */ jsx(
93
- PriceInformation,
94
- {
95
- checkoutResult,
96
- setCheckoutResult
97
- }
98
- ),
99
- /* @__PURE__ */ jsx(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-pl-6 au-pr-3 au-bg-secondary au-border-t au-shadow-inner", children: /* @__PURE__ */ jsx(
75
+ const { title, message } = getPaywallContent(preview);
76
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-overflow-hidden au-text-sm", children: [
77
+ /* @__PURE__ */ jsx(DialogTitle, { className: cn("au-font-bold au-text-xl au-px-6"), children: title }),
78
+ /* @__PURE__ */ jsx("div", { className: "au-px-6 au-my-2", children: message }),
79
+ /* @__PURE__ */ jsx(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-mt-4 au-pl-6 au-pr-3 au-bg-secondary au-border-t", children: /* @__PURE__ */ jsx(
100
80
  Button,
101
81
  {
102
82
  size: "sm",
83
+ className: "au-font-medium au-shadow au-transition au-min-w-20",
103
84
  onClick: async () => {
104
- setLoading(true);
105
- const options = checkoutResult.options.map((option) => {
106
- return {
107
- featureId: option.feature_id,
108
- quantity: option.quantity
109
- };
110
- });
111
- await attach({
112
- productId: checkoutResult.product.id,
113
- ...params.checkoutParams || {},
114
- options
115
- });
116
85
  setOpen(false);
117
- setLoading(false);
118
86
  },
119
- disabled: loading,
120
- className: "au-min-w-16 au-flex au-items-center au-gap-2",
121
- children: loading ? /* @__PURE__ */ jsx(LoaderCircle, { className: "au-w-4 au-h-4 au-animate-spin" }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("span", { className: "au-whitespace-nowrap au-flex au-gap-1", children: "Confirm" }) })
87
+ children: "Confirm"
122
88
  }
123
89
  ) })
124
90
  ] }) });
125
91
  }
126
- function PriceInformation({
127
- checkoutResult,
128
- setCheckoutResult
92
+
93
+ // src/libraries/react/components/pricing-table/pricing-table-synced.tsx
94
+ import React from "react";
95
+ import { createContext, useContext, useState } from "react";
96
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
97
+ function PricingTable({
98
+ productDetails
129
99
  }) {
130
- return /* @__PURE__ */ jsxs("div", { className: "au-px-6 au-mb-4 au-flex au-flex-col au-gap-4", children: [
131
- /* @__PURE__ */ jsx(
132
- ProductItems,
133
- {
134
- checkoutResult,
135
- setCheckoutResult
136
- }
137
- ),
138
- /* @__PURE__ */ jsxs("div", { className: "au-flex au-flex-col au-gap-2", children: [
139
- checkoutResult?.has_prorations && checkoutResult.lines.length > 0 && /* @__PURE__ */ jsx(CheckoutLines, { checkoutResult }),
140
- /* @__PURE__ */ jsx(DueAmounts, { checkoutResult })
141
- ] })
142
- ] });
143
- }
144
- function DueAmounts({ checkoutResult }) {
145
- const { next_cycle, product } = checkoutResult;
146
- const nextCycleAtStr = next_cycle ? new Date(next_cycle.starts_at).toLocaleDateString() : void 0;
147
- const hasUsagePrice = product.items.some(
148
- (item) => item.usage_model === "pay_per_use"
100
+ const { customer, checkout } = useCustomer({ errorOnNotFound: false });
101
+ const [isAnnual, setIsAnnual] = useState(false);
102
+ const { products, isLoading, error } = usePricingTable({ productDetails });
103
+ if (isLoading) {
104
+ return /* @__PURE__ */ jsx2("div", { style: loadingStyles, children: /* @__PURE__ */ jsx2(LoaderCircle, { style: spinnerStyles }) });
105
+ }
106
+ if (error) {
107
+ return /* @__PURE__ */ jsx2("div", { children: " Something went wrong..." });
108
+ }
109
+ const intervals = Array.from(
110
+ new Set(
111
+ products?.map((p) => p.properties?.interval_group).filter((i) => !!i)
112
+ )
149
113
  );
150
- const showNextCycle = next_cycle && next_cycle.total !== checkoutResult.total;
151
- return /* @__PURE__ */ jsxs("div", { className: "au-flex au-flex-col au-gap-1", children: [
152
- /* @__PURE__ */ jsxs("div", { className: "au-flex au-justify-between", children: [
153
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "au-font-medium au-text-md", children: "Total due today" }) }),
154
- /* @__PURE__ */ jsx("p", { className: "au-font-medium au-text-md", children: formatCurrency({
155
- amount: checkoutResult?.total,
156
- currency: checkoutResult?.currency
157
- }) })
158
- ] }),
159
- showNextCycle && /* @__PURE__ */ jsxs("div", { className: "au-flex au-justify-between au-text-muted-foreground", children: [
160
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("p", { className: "au-text-md", children: [
161
- "Due next cycle (",
162
- nextCycleAtStr,
163
- ")"
164
- ] }) }),
165
- /* @__PURE__ */ jsxs("p", { className: "au-text-md", children: [
166
- formatCurrency({
167
- amount: next_cycle.total,
168
- currency: checkoutResult?.currency
169
- }),
170
- hasUsagePrice && /* @__PURE__ */ jsx("span", { children: " + usage prices" })
171
- ] })
172
- ] })
173
- ] });
174
- }
175
- function ProductItems({
176
- checkoutResult,
177
- setCheckoutResult
178
- }) {
179
- const isUpdateQuantity = checkoutResult?.product.scenario === "active" && checkoutResult.product.properties.updateable;
180
- const isOneOff = checkoutResult?.product.properties.is_one_off;
181
- return /* @__PURE__ */ jsxs("div", { className: "au-flex au-flex-col au-gap-2", children: [
182
- /* @__PURE__ */ jsx("p", { className: "au-text-sm au-font-medium", children: "Price" }),
183
- checkoutResult?.product.items.filter((item) => item.type !== "feature").map((item, index) => {
184
- if (item.usage_model == "prepaid") {
185
- return /* @__PURE__ */ jsx(
186
- PrepaidItem,
187
- {
188
- item,
189
- checkoutResult,
190
- setCheckoutResult
191
- },
192
- index
193
- );
194
- }
195
- if (isUpdateQuantity) {
196
- return null;
114
+ const multiInterval = intervals.length > 1;
115
+ const intervalFilter = (product) => {
116
+ if (!product.properties?.interval_group) {
117
+ return true;
118
+ }
119
+ if (multiInterval) {
120
+ if (isAnnual) {
121
+ return product.properties?.interval_group === "year";
122
+ } else {
123
+ return product.properties?.interval_group === "month";
197
124
  }
198
- return /* @__PURE__ */ jsxs("div", { className: "au-flex au-justify-between", children: [
199
- /* @__PURE__ */ jsx("p", { className: "au-text-muted-foreground", children: item.feature ? item.feature.name : isOneOff ? "Price" : "Subscription" }),
200
- /* @__PURE__ */ jsxs("p", { children: [
201
- item.display?.primary_text,
202
- " ",
203
- item.display?.secondary_text
204
- ] })
205
- ] }, index);
206
- })
207
- ] });
208
- }
209
- function CheckoutLines({ checkoutResult }) {
210
- return /* @__PURE__ */ jsx(Accordion, { type: "single", collapsible: true, children: /* @__PURE__ */ jsxs(AccordionItem, { value: "total", className: "au-border-b-0", children: [
211
- /* @__PURE__ */ jsx(CustomAccordionTrigger, { className: "au-justify-between au-w-full au-my-0 au-py-0 au-border-none", children: /* @__PURE__ */ jsxs("div", { className: "au-cursor-pointer au-flex au-items-center au-gap-1 au-w-full au-justify-end", children: [
212
- /* @__PURE__ */ jsx("p", { className: "au-font-light au-text-muted-foreground", children: "View details" }),
213
- /* @__PURE__ */ jsx(
214
- ChevronDown,
215
- {
216
- className: "au-text-muted-foreground au-mt-0.5 au-rotate-90 au-transition-transform au-duration-200 au-ease-in-out",
217
- size: 14
218
- }
219
- )
220
- ] }) }),
221
- /* @__PURE__ */ jsx(AccordionContent, { className: "au-mt-2 au-mb-0 au-pb-2 au-flex au-flex-col au-gap-2", children: checkoutResult?.lines.filter((line) => line.amount != 0).map((line, index) => {
222
- return /* @__PURE__ */ jsxs("div", { className: "au-flex au-justify-between", children: [
223
- /* @__PURE__ */ jsx("p", { className: "au-text-muted-foreground", children: line.description }),
224
- /* @__PURE__ */ jsx("p", { className: "au-text-muted-foreground", children: new Intl.NumberFormat("en-US", {
225
- style: "currency",
226
- currency: checkoutResult?.currency
227
- }).format(line.amount) })
228
- ] }, index);
229
- }) })
230
- ] }) });
231
- }
232
- function CustomAccordionTrigger({
233
- className,
234
- children,
235
- ...props
236
- }) {
237
- return /* @__PURE__ */ jsx(Header, { className: "au-flex", children: /* @__PURE__ */ jsx(
238
- Trigger2,
125
+ }
126
+ return true;
127
+ };
128
+ return /* @__PURE__ */ jsx2("div", { className: cn("au-root"), children: products && /* @__PURE__ */ jsx2(
129
+ PricingTableContainer,
239
130
  {
240
- "data-slot": "accordion-trigger",
241
- className: cn(
242
- "focus-visible:au-border-ring focus-visible:au-ring-ring/50 au-flex au-flex-1 au-items-start au-justify-between au-gap-4 au-rounded-md au-py-4 au-text-left au-text-sm au-font-medium au-transition-all au-outline-none focus-visible:au-ring-[3px] disabled:au-pointer-events-none disabled:au-opacity-50 [&[data-state=open]_svg]:au-rotate-0",
243
- className
244
- ),
245
- ...props,
246
- children
247
- }
248
- ) });
249
- }
250
- var PrepaidItem = ({
251
- item,
252
- checkoutResult,
253
- setCheckoutResult
254
- }) => {
255
- const { quantity = 0, billing_units: billingUnits = 1 } = item;
256
- const [quantityInput, setQuantityInput] = useState(
257
- (quantity / billingUnits).toString()
258
- );
259
- const { checkout } = useCustomer();
260
- const [loading, setLoading] = useState(false);
261
- const [open, setOpen] = useState(false);
262
- const scenario = checkoutResult.product.scenario;
263
- const handleSave = async () => {
264
- setLoading(true);
265
- try {
266
- const newOptions = checkoutResult.options.filter((option) => option.feature_id !== item.feature_id).map((option) => {
267
- return {
268
- featureId: option.feature_id,
269
- quantity: option.quantity
270
- };
271
- });
272
- newOptions.push({
273
- featureId: item.feature_id,
274
- quantity: Number(quantityInput) * billingUnits
275
- });
276
- const { data, error } = await checkout({
277
- productId: checkoutResult.product.id,
278
- options: newOptions,
279
- dialog: CheckoutDialog
280
- });
281
- if (error) {
282
- console.error(error);
283
- return;
284
- }
285
- setCheckoutResult(data);
286
- } catch (error) {
287
- console.error(error);
288
- } finally {
289
- setLoading(false);
290
- setOpen(false);
291
- }
292
- };
293
- const disableSelection = scenario === "renew";
294
- return /* @__PURE__ */ jsxs("div", { className: "au-flex au-justify-between au-gap-2", children: [
295
- /* @__PURE__ */ jsxs("div", { className: "au-flex au-gap-2 au-items-start", children: [
296
- /* @__PURE__ */ jsx("p", { className: "au-text-muted-foreground au-whitespace-nowrap", children: item.feature?.name }),
297
- /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
298
- /* @__PURE__ */ jsxs(
299
- PopoverTrigger,
300
- {
301
- className: cn(
302
- "au-text-muted-foreground au-text-xs au-px-1 au-py-0.5 au-rounded-md au-flex au-items-center au-gap-1 au-bg-accent/80 au-shrink-0",
303
- disableSelection !== true && "hover:au-bg-accent hover:au-text-foreground"
304
- ),
305
- disabled: disableSelection,
306
- children: [
307
- "Qty: ",
308
- quantity,
309
- /* @__PURE__ */ jsx(ChevronDown, { size: 12 })
310
- ]
311
- }
312
- ),
313
- /* @__PURE__ */ jsxs(
314
- PopoverContent,
315
- {
316
- align: "start",
317
- className: "au-w-80 au-text-sm au-p-4 au-pt-3 au-flex au-flex-col au-gap-4",
318
- children: [
319
- /* @__PURE__ */ jsxs("div", { className: "au-flex au-flex-col au-gap-1", children: [
320
- /* @__PURE__ */ jsx("p", { className: "au-text-sm au-font-medium", children: item.feature?.name }),
321
- /* @__PURE__ */ jsxs("p", { className: "au-text-muted-foreground", children: [
322
- item.display?.primary_text,
323
- " ",
324
- item.display?.secondary_text
325
- ] })
326
- ] }),
327
- /* @__PURE__ */ jsxs("div", { className: "au-flex au-justify-between au-items-end", children: [
328
- /* @__PURE__ */ jsxs("div", { className: "au-flex au-gap-2 au-items-center", children: [
329
- /* @__PURE__ */ jsx(
330
- Input,
331
- {
332
- className: "au-h-7 au-w-16 focus:!au-ring-2",
333
- value: quantityInput,
334
- onChange: (e) => setQuantityInput(e.target.value)
335
- }
336
- ),
337
- /* @__PURE__ */ jsxs("p", { className: "au-text-muted-foreground", children: [
338
- billingUnits > 1 && `x ${billingUnits} `,
339
- item.feature?.name
340
- ] })
341
- ] }),
342
- /* @__PURE__ */ jsx(
343
- Button,
344
- {
345
- onClick: handleSave,
346
- className: "au-w-14 !au-h-7 au-text-sm au-items-center au-bg-white au-text-foreground au-shadow-sm au-border au-border-zinc-200 hover:au-bg-zinc-100",
347
- disabled: loading,
348
- children: loading ? /* @__PURE__ */ jsx(LoaderCircle, { className: "au-text-muted-foreground au-animate-spin !au-w-4 !au-h-4" }) : "Save"
349
- }
350
- )
351
- ] })
352
- ]
353
- }
354
- )
355
- ] })
356
- ] }),
357
- /* @__PURE__ */ jsxs("p", { className: "au-text-end", children: [
358
- item.display?.primary_text,
359
- " ",
360
- item.display?.secondary_text
361
- ] })
362
- ] });
363
- };
364
- var PriceItem = ({
365
- children,
366
- className,
367
- ...props
368
- }) => {
369
- return /* @__PURE__ */ jsx(
370
- "div",
371
- {
372
- className: cn(
373
- "au-flex au-flex-col au-pb-4 sm:au-pb-0 au-gap-1 sm:au-flex-row au-justify-between sm:au-h-7 sm:au-gap-2 sm:au-items-center",
374
- className
375
- ),
376
- ...props,
377
- children
378
- }
379
- );
380
- };
381
- var PricingDialogButton = ({
382
- children,
383
- size,
384
- onClick,
385
- disabled,
386
- className
387
- }) => {
388
- return /* @__PURE__ */ jsxs(
389
- Button,
390
- {
391
- onClick,
392
- disabled,
393
- size,
394
- className: cn(className, "au-shadow-sm au-shadow-stone-400"),
395
- children: [
396
- children,
397
- /* @__PURE__ */ jsx(ArrowRight, { className: "!au-h-3" })
398
- ]
399
- }
400
- );
401
- };
402
-
403
- // src/libraries/react/components/pricing-table/pricing-table-synced.tsx
404
- import React2 from "react";
405
- import { createContext, useContext, useState as useState2 } from "react";
406
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
407
- function PricingTable({
408
- productDetails
409
- }) {
410
- const { customer, checkout } = useCustomer({ errorOnNotFound: false });
411
- const [isAnnual, setIsAnnual] = useState2(false);
412
- const { products, isLoading, error } = usePricingTable({ productDetails });
413
- if (isLoading) {
414
- return /* @__PURE__ */ jsx2("div", { style: loadingStyles, children: /* @__PURE__ */ jsx2(LoaderCircle, { style: spinnerStyles }) });
415
- }
416
- if (error) {
417
- return /* @__PURE__ */ jsx2("div", { children: " Something went wrong..." });
418
- }
419
- const intervals = Array.from(
420
- new Set(
421
- products?.map((p) => p.properties?.interval_group).filter((i) => !!i)
422
- )
423
- );
424
- const multiInterval = intervals.length > 1;
425
- const intervalFilter = (product) => {
426
- if (!product.properties?.interval_group) {
427
- return true;
428
- }
429
- if (multiInterval) {
430
- if (isAnnual) {
431
- return product.properties?.interval_group === "year";
432
- } else {
433
- return product.properties?.interval_group === "month";
434
- }
435
- }
436
- return true;
437
- };
438
- return /* @__PURE__ */ jsx2("div", { className: cn("au-root"), children: products && /* @__PURE__ */ jsx2(
439
- PricingTableContainer,
440
- {
441
- products,
442
- isAnnualToggle: isAnnual,
443
- setIsAnnualToggle: setIsAnnual,
444
- multiInterval,
445
- children: products.filter(intervalFilter).map((product, index) => /* @__PURE__ */ jsx2(
446
- PricingCard,
447
- {
448
- productId: product.id,
449
- buttonProps: {
450
- disabled: product.scenario === "active" && !product.properties.updateable || product.scenario === "scheduled",
451
- onClick: async () => {
452
- if (product.id && customer) {
453
- await checkout({
454
- productId: product.id,
455
- dialog: CheckoutDialog
456
- });
457
- } else if (product.display?.button_url) {
458
- window.open(product.display?.button_url, "_blank");
459
- }
460
- }
461
- }
462
- },
463
- index
464
- ))
131
+ products,
132
+ isAnnualToggle: isAnnual,
133
+ setIsAnnualToggle: setIsAnnual,
134
+ multiInterval,
135
+ children: products.filter(intervalFilter).map((product, index) => /* @__PURE__ */ jsx2(
136
+ PricingCard,
137
+ {
138
+ productId: product.id,
139
+ buttonProps: {
140
+ disabled: product.scenario === "active" && !product.properties.updateable || product.scenario === "scheduled",
141
+ onClick: async () => {
142
+ if (product.id && customer) {
143
+ await checkout({
144
+ productId: product.id,
145
+ dialog: CheckoutDialog
146
+ });
147
+ } else if (product.display?.button_url) {
148
+ window.open(product.display?.button_url, "_blank");
149
+ }
150
+ }
151
+ }
152
+ },
153
+ index
154
+ ))
465
155
  }
466
156
  ) });
467
157
  }
@@ -638,8 +328,8 @@ var PricingFeatureList = ({
638
328
  )) })
639
329
  ] });
640
330
  };
641
- var PricingCardButton = React2.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
642
- const [loading, setLoading] = useState2(false);
331
+ var PricingCardButton = React.forwardRef(({ recommended, children, className, onClick, ...props }, ref) => {
332
+ const [loading, setLoading] = useState(false);
643
333
  const handleClick = async (e) => {
644
334
  setLoading(true);
645
335
  try {
@@ -697,37 +387,351 @@ var RecommendedBadge = ({ recommended }) => {
697
387
  return /* @__PURE__ */ jsx2("div", { className: "au-bg-secondary au-absolute au-border au-text-muted-foreground au-text-sm au-font-medium lg:au-rounded-full au-px-3 lg:au-py-0.5 lg:au-top-4 lg:au-right-4 au-top-[-1px] au-right-[-1px] au-rounded-bl-lg", children: recommended });
698
388
  };
699
389
 
700
- // src/libraries/react/components/paywall-dialog/paywall-dialog-synced.tsx
390
+ // src/libraries/react/components/checkout-dialog/checkout-dialog-synced.tsx
701
391
  import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
702
- function PaywallDialog(params) {
703
- const { data: preview } = usePaywall({
704
- featureId: params?.featureId,
705
- entityId: params?.entityId
706
- });
707
- if (!params || !preview) {
392
+ var formatCurrency = ({
393
+ amount,
394
+ currency
395
+ }) => {
396
+ return new Intl.NumberFormat("en-US", {
397
+ style: "currency",
398
+ currency
399
+ }).format(amount);
400
+ };
401
+ function CheckoutDialog(params) {
402
+ const { attach } = useCustomer();
403
+ const [checkoutResult, setCheckoutResult] = useState2(params?.checkoutResult);
404
+ useEffect(() => {
405
+ if (params.checkoutResult) {
406
+ setCheckoutResult(params.checkoutResult);
407
+ }
408
+ }, [params.checkoutResult]);
409
+ const [loading, setLoading] = useState2(false);
410
+ if (!checkoutResult) {
708
411
  return /* @__PURE__ */ jsx3(Fragment3, {});
709
412
  }
710
413
  const { open, setOpen } = params;
711
- const { title, message } = getPaywallContent(preview);
712
- return /* @__PURE__ */ jsx3(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-overflow-hidden au-text-sm", children: [
713
- /* @__PURE__ */ jsx3(DialogTitle, { className: cn("au-font-bold au-text-xl au-px-6"), children: title }),
714
- /* @__PURE__ */ jsx3("div", { className: "au-px-6 au-my-2", children: message }),
715
- /* @__PURE__ */ jsx3(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-mt-4 au-pl-6 au-pr-3 au-bg-secondary au-border-t", children: /* @__PURE__ */ jsx3(
414
+ const { title, message } = getCheckoutContent(checkoutResult);
415
+ const isFree = checkoutResult?.product.properties?.is_free;
416
+ const isPaid = isFree === false;
417
+ return /* @__PURE__ */ jsx3(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs3(DialogContent, { className: "au-p-0 au-pt-4 au-gap-0 au-text-foreground au-text-sm", children: [
418
+ /* @__PURE__ */ jsx3(DialogTitle, { className: "au-px-6 au-mb-1", children: title }),
419
+ /* @__PURE__ */ jsx3("div", { className: "au-px-6 au-mt-1 au-mb-4 au-text-muted-foreground", children: message }),
420
+ isPaid && checkoutResult && /* @__PURE__ */ jsx3(
421
+ PriceInformation,
422
+ {
423
+ checkoutResult,
424
+ setCheckoutResult
425
+ }
426
+ ),
427
+ /* @__PURE__ */ jsx3(DialogFooter, { className: "au-flex au-flex-col sm:au-flex-row au-justify-between au-gap-x-4 au-py-2 au-pl-6 au-pr-3 au-bg-secondary au-border-t au-shadow-inner", children: /* @__PURE__ */ jsx3(
716
428
  Button,
717
429
  {
718
430
  size: "sm",
719
- className: "au-font-medium au-shadow au-transition au-min-w-20",
720
431
  onClick: async () => {
432
+ setLoading(true);
433
+ const options = checkoutResult.options.map((option) => {
434
+ return {
435
+ featureId: option.feature_id,
436
+ quantity: option.quantity
437
+ };
438
+ });
439
+ await attach({
440
+ productId: checkoutResult.product.id,
441
+ ...params.checkoutParams || {},
442
+ options
443
+ });
721
444
  setOpen(false);
445
+ setLoading(false);
722
446
  },
723
- children: "Confirm"
447
+ disabled: loading,
448
+ className: "au-min-w-16 au-flex au-items-center au-gap-2",
449
+ children: loading ? /* @__PURE__ */ jsx3(LoaderCircle, { className: "au-w-4 au-h-4 au-animate-spin" }) : /* @__PURE__ */ jsx3(Fragment3, { children: /* @__PURE__ */ jsx3("span", { className: "au-whitespace-nowrap au-flex au-gap-1", children: "Confirm" }) })
724
450
  }
725
451
  ) })
726
452
  ] }) });
727
453
  }
454
+ function PriceInformation({
455
+ checkoutResult,
456
+ setCheckoutResult
457
+ }) {
458
+ return /* @__PURE__ */ jsxs3("div", { className: "au-px-6 au-mb-4 au-flex au-flex-col au-gap-4", children: [
459
+ /* @__PURE__ */ jsx3(
460
+ ProductItems,
461
+ {
462
+ checkoutResult,
463
+ setCheckoutResult
464
+ }
465
+ ),
466
+ /* @__PURE__ */ jsxs3("div", { className: "au-flex au-flex-col au-gap-2", children: [
467
+ checkoutResult?.has_prorations && checkoutResult.lines.length > 0 && /* @__PURE__ */ jsx3(CheckoutLines, { checkoutResult }),
468
+ /* @__PURE__ */ jsx3(DueAmounts, { checkoutResult })
469
+ ] })
470
+ ] });
471
+ }
472
+ function DueAmounts({ checkoutResult }) {
473
+ const { next_cycle, product } = checkoutResult;
474
+ const nextCycleAtStr = next_cycle ? new Date(next_cycle.starts_at).toLocaleDateString() : void 0;
475
+ const hasUsagePrice = product.items.some(
476
+ (item) => item.usage_model === "pay_per_use"
477
+ );
478
+ const showNextCycle = next_cycle && next_cycle.total !== checkoutResult.total;
479
+ return /* @__PURE__ */ jsxs3("div", { className: "au-flex au-flex-col au-gap-1", children: [
480
+ /* @__PURE__ */ jsxs3("div", { className: "au-flex au-justify-between", children: [
481
+ /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3("p", { className: "au-font-medium au-text-md", children: "Total due today" }) }),
482
+ /* @__PURE__ */ jsx3("p", { className: "au-font-medium au-text-md", children: formatCurrency({
483
+ amount: checkoutResult?.total,
484
+ currency: checkoutResult?.currency
485
+ }) })
486
+ ] }),
487
+ showNextCycle && /* @__PURE__ */ jsxs3("div", { className: "au-flex au-justify-between au-text-muted-foreground", children: [
488
+ /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsxs3("p", { className: "au-text-md", children: [
489
+ "Due next cycle (",
490
+ nextCycleAtStr,
491
+ ")"
492
+ ] }) }),
493
+ /* @__PURE__ */ jsxs3("p", { className: "au-text-md", children: [
494
+ formatCurrency({
495
+ amount: next_cycle.total,
496
+ currency: checkoutResult?.currency
497
+ }),
498
+ hasUsagePrice && /* @__PURE__ */ jsx3("span", { children: " + usage prices" })
499
+ ] })
500
+ ] })
501
+ ] });
502
+ }
503
+ function ProductItems({
504
+ checkoutResult,
505
+ setCheckoutResult
506
+ }) {
507
+ const isUpdateQuantity = checkoutResult?.product.scenario === "active" && checkoutResult.product.properties.updateable;
508
+ const isOneOff = checkoutResult?.product.properties.is_one_off;
509
+ return /* @__PURE__ */ jsxs3("div", { className: "au-flex au-flex-col au-gap-2", children: [
510
+ /* @__PURE__ */ jsx3("p", { className: "au-text-sm au-font-medium", children: "Price" }),
511
+ checkoutResult?.product.items.filter((item) => item.type !== "feature").map((item, index) => {
512
+ if (item.usage_model == "prepaid") {
513
+ return /* @__PURE__ */ jsx3(
514
+ PrepaidItem,
515
+ {
516
+ item,
517
+ checkoutResult,
518
+ setCheckoutResult
519
+ },
520
+ index
521
+ );
522
+ }
523
+ if (isUpdateQuantity) {
524
+ return null;
525
+ }
526
+ return /* @__PURE__ */ jsxs3("div", { className: "au-flex au-justify-between", children: [
527
+ /* @__PURE__ */ jsx3("p", { className: "au-text-muted-foreground", children: item.feature ? item.feature.name : isOneOff ? "Price" : "Subscription" }),
528
+ /* @__PURE__ */ jsxs3("p", { children: [
529
+ item.display?.primary_text,
530
+ " ",
531
+ item.display?.secondary_text
532
+ ] })
533
+ ] }, index);
534
+ })
535
+ ] });
536
+ }
537
+ function CheckoutLines({ checkoutResult }) {
538
+ return /* @__PURE__ */ jsx3(Accordion, { type: "single", collapsible: true, children: /* @__PURE__ */ jsxs3(AccordionItem, { value: "total", className: "au-border-b-0", children: [
539
+ /* @__PURE__ */ jsx3(CustomAccordionTrigger, { className: "au-justify-between au-w-full au-my-0 au-py-0 au-border-none", children: /* @__PURE__ */ jsxs3("div", { className: "au-cursor-pointer au-flex au-items-center au-gap-1 au-w-full au-justify-end", children: [
540
+ /* @__PURE__ */ jsx3("p", { className: "au-font-light au-text-muted-foreground", children: "View details" }),
541
+ /* @__PURE__ */ jsx3(
542
+ ChevronDown,
543
+ {
544
+ className: "au-text-muted-foreground au-mt-0.5 au-rotate-90 au-transition-transform au-duration-200 au-ease-in-out",
545
+ size: 14
546
+ }
547
+ )
548
+ ] }) }),
549
+ /* @__PURE__ */ jsx3(AccordionContent, { className: "au-mt-2 au-mb-0 au-pb-2 au-flex au-flex-col au-gap-2", children: checkoutResult?.lines.filter((line) => line.amount != 0).map((line, index) => {
550
+ return /* @__PURE__ */ jsxs3("div", { className: "au-flex au-justify-between", children: [
551
+ /* @__PURE__ */ jsx3("p", { className: "au-text-muted-foreground", children: line.description }),
552
+ /* @__PURE__ */ jsx3("p", { className: "au-text-muted-foreground", children: new Intl.NumberFormat("en-US", {
553
+ style: "currency",
554
+ currency: checkoutResult?.currency
555
+ }).format(line.amount) })
556
+ ] }, index);
557
+ }) })
558
+ ] }) });
559
+ }
560
+ function CustomAccordionTrigger({
561
+ className,
562
+ children,
563
+ ...props
564
+ }) {
565
+ return /* @__PURE__ */ jsx3(Header, { className: "au-flex", children: /* @__PURE__ */ jsx3(
566
+ Trigger2,
567
+ {
568
+ "data-slot": "accordion-trigger",
569
+ className: cn(
570
+ "focus-visible:au-border-ring focus-visible:au-ring-ring/50 au-flex au-flex-1 au-items-start au-justify-between au-gap-4 au-rounded-md au-py-4 au-text-left au-text-sm au-font-medium au-transition-all au-outline-none focus-visible:au-ring-[3px] disabled:au-pointer-events-none disabled:au-opacity-50 [&[data-state=open]_svg]:au-rotate-0",
571
+ className
572
+ ),
573
+ ...props,
574
+ children
575
+ }
576
+ ) });
577
+ }
578
+ var PrepaidItem = ({
579
+ item,
580
+ checkoutResult,
581
+ setCheckoutResult
582
+ }) => {
583
+ const { quantity = 0, billing_units: billingUnits = 1 } = item;
584
+ const [quantityInput, setQuantityInput] = useState2(
585
+ (quantity / billingUnits).toString()
586
+ );
587
+ const { checkout } = useCustomer();
588
+ const [loading, setLoading] = useState2(false);
589
+ const [open, setOpen] = useState2(false);
590
+ const scenario = checkoutResult.product.scenario;
591
+ const handleSave = async () => {
592
+ setLoading(true);
593
+ try {
594
+ const newOptions = checkoutResult.options.filter((option) => option.feature_id !== item.feature_id).map((option) => {
595
+ return {
596
+ featureId: option.feature_id,
597
+ quantity: option.quantity
598
+ };
599
+ });
600
+ newOptions.push({
601
+ featureId: item.feature_id,
602
+ quantity: Number(quantityInput) * billingUnits
603
+ });
604
+ const { data, error } = await checkout({
605
+ productId: checkoutResult.product.id,
606
+ options: newOptions,
607
+ dialog: CheckoutDialog
608
+ });
609
+ if (error) {
610
+ console.error(error);
611
+ return;
612
+ }
613
+ setCheckoutResult(data);
614
+ } catch (error) {
615
+ console.error(error);
616
+ } finally {
617
+ setLoading(false);
618
+ setOpen(false);
619
+ }
620
+ };
621
+ const disableSelection = scenario === "renew";
622
+ return /* @__PURE__ */ jsxs3("div", { className: "au-flex au-justify-between au-gap-2", children: [
623
+ /* @__PURE__ */ jsxs3("div", { className: "au-flex au-gap-2 au-items-start", children: [
624
+ /* @__PURE__ */ jsx3("p", { className: "au-text-muted-foreground au-whitespace-nowrap", children: item.feature?.name }),
625
+ /* @__PURE__ */ jsxs3(Popover, { open, onOpenChange: setOpen, children: [
626
+ /* @__PURE__ */ jsxs3(
627
+ PopoverTrigger,
628
+ {
629
+ className: cn(
630
+ "au-text-muted-foreground au-text-xs au-px-1 au-py-0.5 au-rounded-md au-flex au-items-center au-gap-1 au-bg-accent/80 au-shrink-0",
631
+ disableSelection !== true && "hover:au-bg-accent hover:au-text-foreground"
632
+ ),
633
+ disabled: disableSelection,
634
+ children: [
635
+ "Qty: ",
636
+ quantity,
637
+ /* @__PURE__ */ jsx3(ChevronDown, { size: 12 })
638
+ ]
639
+ }
640
+ ),
641
+ /* @__PURE__ */ jsxs3(
642
+ PopoverContent,
643
+ {
644
+ align: "start",
645
+ className: "au-w-80 au-text-sm au-p-4 au-pt-3 au-flex au-flex-col au-gap-4",
646
+ children: [
647
+ /* @__PURE__ */ jsxs3("div", { className: "au-flex au-flex-col au-gap-1", children: [
648
+ /* @__PURE__ */ jsx3("p", { className: "au-text-sm au-font-medium", children: item.feature?.name }),
649
+ /* @__PURE__ */ jsxs3("p", { className: "au-text-muted-foreground", children: [
650
+ item.display?.primary_text,
651
+ " ",
652
+ item.display?.secondary_text
653
+ ] })
654
+ ] }),
655
+ /* @__PURE__ */ jsxs3("div", { className: "au-flex au-justify-between au-items-end", children: [
656
+ /* @__PURE__ */ jsxs3("div", { className: "au-flex au-gap-2 au-items-center", children: [
657
+ /* @__PURE__ */ jsx3(
658
+ Input,
659
+ {
660
+ className: "au-h-7 au-w-16 focus:!au-ring-2",
661
+ value: quantityInput,
662
+ onChange: (e) => setQuantityInput(e.target.value)
663
+ }
664
+ ),
665
+ /* @__PURE__ */ jsxs3("p", { className: "au-text-muted-foreground", children: [
666
+ billingUnits > 1 && `x ${billingUnits} `,
667
+ item.feature?.name
668
+ ] })
669
+ ] }),
670
+ /* @__PURE__ */ jsx3(
671
+ Button,
672
+ {
673
+ onClick: handleSave,
674
+ className: "au-w-14 !au-h-7 au-text-sm au-items-center au-bg-white au-text-foreground au-shadow-sm au-border au-border-zinc-200 hover:au-bg-zinc-100",
675
+ disabled: loading,
676
+ children: loading ? /* @__PURE__ */ jsx3(LoaderCircle, { className: "au-text-muted-foreground au-animate-spin !au-w-4 !au-h-4" }) : "Save"
677
+ }
678
+ )
679
+ ] })
680
+ ]
681
+ }
682
+ )
683
+ ] })
684
+ ] }),
685
+ /* @__PURE__ */ jsxs3("p", { className: "au-text-end", children: [
686
+ item.display?.primary_text,
687
+ " ",
688
+ item.display?.secondary_text
689
+ ] })
690
+ ] });
691
+ };
692
+ var PriceItem = ({
693
+ children,
694
+ className,
695
+ ...props
696
+ }) => {
697
+ return /* @__PURE__ */ jsx3(
698
+ "div",
699
+ {
700
+ className: cn(
701
+ "au-flex au-flex-col au-pb-4 sm:au-pb-0 au-gap-1 sm:au-flex-row au-justify-between sm:au-h-7 sm:au-gap-2 sm:au-items-center",
702
+ className
703
+ ),
704
+ ...props,
705
+ children
706
+ }
707
+ );
708
+ };
709
+ var PricingDialogButton = ({
710
+ children,
711
+ size,
712
+ onClick,
713
+ disabled,
714
+ className
715
+ }) => {
716
+ return /* @__PURE__ */ jsxs3(
717
+ Button,
718
+ {
719
+ onClick,
720
+ disabled,
721
+ size,
722
+ className: cn(className, "au-shadow-sm au-shadow-stone-400"),
723
+ children: [
724
+ children,
725
+ /* @__PURE__ */ jsx3(ArrowRight, { className: "!au-h-3" })
726
+ ]
727
+ }
728
+ );
729
+ };
728
730
 
729
731
  export {
730
- PaywallDialog,
732
+ CheckoutDialog,
733
+ PriceItem,
734
+ PricingDialogButton,
731
735
  PricingTable,
732
736
  usePricingTableContext,
733
737
  PricingTableContainer,
@@ -736,7 +740,5 @@ export {
736
740
  PricingCardButton,
737
741
  AnnualSwitch,
738
742
  RecommendedBadge,
739
- CheckoutDialog,
740
- PriceItem,
741
- PricingDialogButton
743
+ PaywallDialog
742
744
  };