@cimplify/sdk 0.54.0 → 0.55.0

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 (43) hide show
  1. package/dist/advanced.d.mts +1 -1
  2. package/dist/advanced.d.ts +1 -1
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{chunk-EJUKGJTZ.js → chunk-6W3AH4QW.js} +2 -2
  6. package/dist/{chunk-NEK7CVE2.mjs → chunk-F4WS3OIF.mjs} +1 -1
  7. package/dist/{chunk-B3Y4C4A7.mjs → chunk-I4IXPQIX.mjs} +7 -4
  8. package/dist/{chunk-YJLOOC3L.js → chunk-JGBDWEPJ.js} +7 -4
  9. package/dist/chunk-JYPLT56O.js +272 -0
  10. package/dist/{chunk-IJ32BXKZ.js → chunk-MW7ICTVK.js} +35 -35
  11. package/dist/{chunk-6QZQQRBB.mjs → chunk-SQ7U3BWY.mjs} +1 -1
  12. package/dist/chunk-XYI4NXWG.mjs +259 -0
  13. package/dist/{client-D1Gknspz.d.mts → client-Bhvlelij.d.mts} +1 -1
  14. package/dist/{client-Bj2apl_y.d.mts → client-DKg-5OWu.d.mts} +16 -1
  15. package/dist/{client-306peWZ0.d.ts → client-Dfg_hmkP.d.ts} +16 -1
  16. package/dist/{client-C2bKMy5g.d.ts → client-DlGJqSDd.d.ts} +1 -1
  17. package/dist/index.d.mts +18 -3
  18. package/dist/index.d.ts +18 -3
  19. package/dist/index.js +160 -72
  20. package/dist/index.mjs +91 -3
  21. package/dist/react.d.mts +52 -5
  22. package/dist/react.d.ts +52 -5
  23. package/dist/react.js +592 -512
  24. package/dist/react.mjs +136 -58
  25. package/dist/server.d.mts +43 -3
  26. package/dist/server.d.ts +43 -3
  27. package/dist/server.js +170 -3
  28. package/dist/server.mjs +163 -3
  29. package/dist/{ads-C2c2Aald.d.mts → sign-in-TL01-awQ.d.mts} +17 -1
  30. package/dist/{ads-C2c2Aald.d.ts → sign-in-TL01-awQ.d.ts} +17 -1
  31. package/dist/styles.css +1 -1
  32. package/dist/testing/suite.d.mts +2 -2
  33. package/dist/testing/suite.d.ts +2 -2
  34. package/dist/testing/suite.js +22 -22
  35. package/dist/testing/suite.mjs +3 -3
  36. package/dist/testing.d.mts +2 -2
  37. package/dist/testing.d.ts +2 -2
  38. package/dist/testing.js +78 -78
  39. package/dist/testing.mjs +4 -4
  40. package/package.json +2 -1
  41. package/registry/account.json +1 -1
  42. package/dist/chunk-MN4PNKJA.js +0 -129
  43. package/dist/chunk-NRDRVZ62.mjs +0 -119
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkEJUKGJTZ_js = require('../chunk-EJUKGJTZ.js');
3
+ var chunk6W3AH4QW_js = require('../chunk-6W3AH4QW.js');
4
4
  require('../chunk-HCZTBWU4.js');
5
- require('../chunk-IJ32BXKZ.js');
6
- require('../chunk-YJLOOC3L.js');
5
+ require('../chunk-MW7ICTVK.js');
6
+ require('../chunk-JGBDWEPJ.js');
7
7
  require('../chunk-7Y2O3E4D.js');
8
8
  require('../chunk-XA3ZNR75.js');
9
9
  require('../chunk-OWW5GUSB.js');
@@ -20,11 +20,11 @@ var PLACEHOLDER_PHRASES = [
20
20
  function createBrandSuite(opts) {
21
21
  vitest.describe(opts.label ?? "brand schema", () => {
22
22
  vitest.it("conforms to the Cimplify brand contract", () => {
23
- vitest.expect(() => chunkEJUKGJTZ_js.assertBrand(opts.brand)).not.toThrow();
23
+ vitest.expect(() => chunk6W3AH4QW_js.assertBrand(opts.brand)).not.toThrow();
24
24
  });
25
25
  vitest.it("declares a known mock seed", () => {
26
26
  const b = opts.brand;
27
- vitest.expect(chunkEJUKGJTZ_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
27
+ vitest.expect(chunk6W3AH4QW_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
28
28
  });
29
29
  vitest.it("has no placeholder copy left in", () => {
30
30
  const offenders = [];
@@ -56,7 +56,7 @@ ${msg}`);
56
56
  vitest.expect(b.mock?.businessId).toMatch(/^bus_/);
57
57
  });
58
58
  vitest.it("zod-parses cleanly", () => {
59
- const result = chunkEJUKGJTZ_js.BrandSchema.safeParse(opts.brand);
59
+ const result = chunk6W3AH4QW_js.BrandSchema.safeParse(opts.brand);
60
60
  if (!result.success) {
61
61
  throw new Error(
62
62
  "Brand schema violations:\n" + result.error.issues.map((i) => ` \u2022 brand.${i.path.join(".")}: ${i.message}`).join("\n")
@@ -71,23 +71,23 @@ function createCartFlowSuite(opts = {}) {
71
71
  vitest.describe(opts.label ?? "cart flow against in-process mock", () => {
72
72
  let h;
73
73
  vitest.beforeEach(() => {
74
- h = chunkEJUKGJTZ_js.createTestClient(opts);
74
+ h = chunk6W3AH4QW_js.createTestClient(opts);
75
75
  });
76
76
  vitest.afterEach(() => h.dispose());
77
77
  vitest.it("starts with an empty cart matching the canonical shape", async () => {
78
78
  const res = await h.client.cart.get();
79
79
  vitest.expect(res.ok).toBe(true);
80
80
  if (!res.ok) return;
81
- vitest.expect(() => chunkEJUKGJTZ_js.assertCart(res.value)).not.toThrow();
81
+ vitest.expect(() => chunk6W3AH4QW_js.assertCart(res.value)).not.toThrow();
82
82
  vitest.expect(res.value.items).toHaveLength(0);
83
83
  });
84
84
  vitest.it("adds the first product, persists it, and returns a shape-valid cart", async () => {
85
- const { product, variantId } = await chunkEJUKGJTZ_js.fixtures.addFirstProduct(h.client);
85
+ const { product, variantId } = await chunk6W3AH4QW_js.fixtures.addFirstProduct(h.client);
86
86
  vitest.expect(product.id).toBeTruthy();
87
87
  const get = await h.client.cart.get();
88
88
  vitest.expect(get.ok).toBe(true);
89
89
  if (!get.ok) return;
90
- vitest.expect(() => chunkEJUKGJTZ_js.assertCart(get.value)).not.toThrow();
90
+ vitest.expect(() => chunk6W3AH4QW_js.assertCart(get.value)).not.toThrow();
91
91
  vitest.expect(get.value.items).toHaveLength(1);
92
92
  vitest.expect(get.value.items[0]?.item_id).toBe(product.id);
93
93
  if (variantId) {
@@ -98,8 +98,8 @@ function createCartFlowSuite(opts = {}) {
98
98
  vitest.expect(parseFloat(String(get.value.pricing.subtotal))).toBeGreaterThan(0);
99
99
  });
100
100
  vitest.it("dedupes by line_key when adding the same product twice", async () => {
101
- await chunkEJUKGJTZ_js.fixtures.addFirstProduct(h.client);
102
- await chunkEJUKGJTZ_js.fixtures.addFirstProduct(h.client);
101
+ await chunk6W3AH4QW_js.fixtures.addFirstProduct(h.client);
102
+ await chunk6W3AH4QW_js.fixtures.addFirstProduct(h.client);
103
103
  const res = await h.client.cart.get();
104
104
  vitest.expect(res.ok).toBe(true);
105
105
  if (!res.ok) return;
@@ -107,7 +107,7 @@ function createCartFlowSuite(opts = {}) {
107
107
  vitest.expect(res.value.items[0]?.quantity).toBe(2);
108
108
  });
109
109
  vitest.it("removes items and zeroes the subtotal", async () => {
110
- await chunkEJUKGJTZ_js.fixtures.addFirstProduct(h.client);
110
+ await chunk6W3AH4QW_js.fixtures.addFirstProduct(h.client);
111
111
  const before = await h.client.cart.get();
112
112
  if (!before.ok) throw before.error;
113
113
  const itemId = before.value.items[0]?.id;
@@ -133,28 +133,28 @@ function createContractSuite(opts = {}) {
133
133
  vitest.describe(opts.label ?? "SDK \u2194 mock contract", () => {
134
134
  let h;
135
135
  vitest.beforeEach(() => {
136
- h = chunkEJUKGJTZ_js.createTestClient(opts);
136
+ h = chunk6W3AH4QW_js.createTestClient(opts);
137
137
  });
138
138
  vitest.afterEach(() => h.dispose());
139
139
  vitest.it("AddItemPayload schema accepts a minimal valid body", () => {
140
- const result = chunkEJUKGJTZ_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
140
+ const result = chunk6W3AH4QW_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
141
141
  vitest.expect(result.success).toBe(true);
142
142
  });
143
143
  vitest.it("AddItemPayload schema rejects negative quantity", () => {
144
- const result = chunkEJUKGJTZ_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
144
+ const result = chunk6W3AH4QW_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
145
145
  vitest.expect(result.success).toBe(false);
146
146
  });
147
147
  vitest.it("AddItemPayload schema rejects empty item_id", () => {
148
- const result = chunkEJUKGJTZ_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
148
+ const result = chunk6W3AH4QW_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
149
149
  vitest.expect(result.success).toBe(false);
150
150
  });
151
151
  vitest.it("Cart line items returned by the mock match CartItemSchema", async () => {
152
- const { product } = await chunkEJUKGJTZ_js.fixtures.addFirstProduct(h.client);
152
+ const { product } = await chunk6W3AH4QW_js.fixtures.addFirstProduct(h.client);
153
153
  const get = await h.client.cart.get();
154
154
  if (!get.ok) throw get.error;
155
155
  vitest.expect(get.value.items.length).toBeGreaterThan(0);
156
156
  for (const item of get.value.items) {
157
- const result = chunkEJUKGJTZ_js.CartItemSchema.safeParse(item);
157
+ const result = chunk6W3AH4QW_js.CartItemSchema.safeParse(item);
158
158
  if (!result.success) {
159
159
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
160
160
  throw new Error(`Cart item shape mismatch for ${product.name}:
@@ -164,19 +164,19 @@ ${issues}`);
164
164
  }
165
165
  });
166
166
  vitest.it("CheckoutResponse from the mock includes bill_token", async () => {
167
- await chunkEJUKGJTZ_js.fixtures.addFirstProduct(h.client);
167
+ await chunk6W3AH4QW_js.fixtures.addFirstProduct(h.client);
168
168
  const cartRes = await h.client.cart.get();
169
169
  if (!cartRes.ok) throw cartRes.error;
170
170
  const checkout = await h.client.checkout.process({
171
171
  cart_id: cartRes.value.id,
172
- customer: chunkEJUKGJTZ_js.fixtures.customer(),
172
+ customer: chunk6W3AH4QW_js.fixtures.customer(),
173
173
  order_type: "delivery",
174
174
  payment_method: "mobile_money",
175
175
  mobile_money_details: { phone_number: "+233244000000", provider: "mtn" }
176
176
  });
177
177
  vitest.expect(checkout.ok).toBe(true);
178
178
  if (!checkout.ok) return;
179
- const result = chunkEJUKGJTZ_js.CheckoutResponseSchema.safeParse(checkout.value);
179
+ const result = chunk6W3AH4QW_js.CheckoutResponseSchema.safeParse(checkout.value);
180
180
  if (!result.success) {
181
181
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
182
182
  throw new Error(`CheckoutResponse shape mismatch:
@@ -1,7 +1,7 @@
1
- import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-NEK7CVE2.mjs';
1
+ import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-F4WS3OIF.mjs';
2
2
  import '../chunk-3G4QCENX.mjs';
3
- import '../chunk-6QZQQRBB.mjs';
4
- import '../chunk-B3Y4C4A7.mjs';
3
+ import '../chunk-SQ7U3BWY.mjs';
4
+ import '../chunk-I4IXPQIX.mjs';
5
5
  import '../chunk-TD3AY34U.mjs';
6
6
  import '../chunk-AMZXALF6.mjs';
7
7
  import '../chunk-3G6RQLXK.mjs';
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { $ZodType } from 'zod/v4/core';
3
- export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-D1Gknspz.mjs';
4
- import './client-Bj2apl_y.mjs';
3
+ export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-Bhvlelij.mjs';
4
+ import './client-DKg-5OWu.mjs';
5
5
  import './product-B_kS4Oxa.mjs';
6
6
  import './payment-DVS7ZUEp.mjs';
7
7
  import './server-D8rwqZQ6.mjs';
package/dist/testing.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { $ZodType } from 'zod/v4/core';
3
- export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-C2bKMy5g.js';
4
- import './client-306peWZ0.js';
3
+ export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-DlGJqSDd.js';
4
+ import './client-Dfg_hmkP.js';
5
5
  import './product-B_kS4Oxa.js';
6
6
  import './payment-sn-yGL7v.js';
7
7
  import './server-BQzz921M.js';
package/dist/testing.js CHANGED
@@ -1,29 +1,29 @@
1
1
  'use strict';
2
2
 
3
- var chunkEJUKGJTZ_js = require('./chunk-EJUKGJTZ.js');
3
+ var chunk6W3AH4QW_js = require('./chunk-6W3AH4QW.js');
4
4
  require('./chunk-HCZTBWU4.js');
5
- require('./chunk-IJ32BXKZ.js');
6
- require('./chunk-YJLOOC3L.js');
5
+ require('./chunk-MW7ICTVK.js');
6
+ require('./chunk-JGBDWEPJ.js');
7
7
  require('./chunk-7Y2O3E4D.js');
8
8
  require('./chunk-XA3ZNR75.js');
9
9
  require('./chunk-OWW5GUSB.js');
10
10
  var zod = require('zod');
11
11
 
12
12
  var PUBLIC_SCHEMAS = {
13
- Brand: chunkEJUKGJTZ_js.BrandSchema,
14
- AddItemPayload: chunkEJUKGJTZ_js.AddItemPayloadSchema,
15
- Cart: chunkEJUKGJTZ_js.CartSchema,
16
- CartItem: chunkEJUKGJTZ_js.CartItemSchema,
17
- CartPricing: chunkEJUKGJTZ_js.CartPricingSchema,
18
- CheckoutBody: chunkEJUKGJTZ_js.CheckoutBodySchema,
19
- CheckoutResponse: chunkEJUKGJTZ_js.CheckoutResponseSchema,
20
- VariantInfo: chunkEJUKGJTZ_js.VariantInfoSchema
13
+ Brand: chunk6W3AH4QW_js.BrandSchema,
14
+ AddItemPayload: chunk6W3AH4QW_js.AddItemPayloadSchema,
15
+ Cart: chunk6W3AH4QW_js.CartSchema,
16
+ CartItem: chunk6W3AH4QW_js.CartItemSchema,
17
+ CartPricing: chunk6W3AH4QW_js.CartPricingSchema,
18
+ CheckoutBody: chunk6W3AH4QW_js.CheckoutBodySchema,
19
+ CheckoutResponse: chunk6W3AH4QW_js.CheckoutResponseSchema,
20
+ VariantInfo: chunk6W3AH4QW_js.VariantInfoSchema
21
21
  };
22
22
  function exportJsonSchemas() {
23
23
  const out = {};
24
24
  for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
25
- const meta = chunkEJUKGJTZ_js.cimplifyRegistry.get(schema);
26
- const json = zod.z.toJSONSchema(schema, { metadata: chunkEJUKGJTZ_js.cimplifyRegistry });
25
+ const meta = chunk6W3AH4QW_js.cimplifyRegistry.get(schema);
26
+ const json = zod.z.toJSONSchema(schema, { metadata: chunk6W3AH4QW_js.cimplifyRegistry });
27
27
  if (meta) {
28
28
  json.$id = meta.id;
29
29
  json["x-cimplify-version"] = meta.version;
@@ -35,16 +35,16 @@ function exportJsonSchemas() {
35
35
  function listRegisteredSchemas() {
36
36
  const entries = [];
37
37
  for (const schema of [
38
- chunkEJUKGJTZ_js.BrandSchema,
39
- chunkEJUKGJTZ_js.AddItemPayloadSchema,
40
- chunkEJUKGJTZ_js.CartSchema,
41
- chunkEJUKGJTZ_js.CartItemSchema,
42
- chunkEJUKGJTZ_js.CartPricingSchema,
43
- chunkEJUKGJTZ_js.CheckoutBodySchema,
44
- chunkEJUKGJTZ_js.CheckoutResponseSchema,
45
- chunkEJUKGJTZ_js.VariantInfoSchema
38
+ chunk6W3AH4QW_js.BrandSchema,
39
+ chunk6W3AH4QW_js.AddItemPayloadSchema,
40
+ chunk6W3AH4QW_js.CartSchema,
41
+ chunk6W3AH4QW_js.CartItemSchema,
42
+ chunk6W3AH4QW_js.CartPricingSchema,
43
+ chunk6W3AH4QW_js.CheckoutBodySchema,
44
+ chunk6W3AH4QW_js.CheckoutResponseSchema,
45
+ chunk6W3AH4QW_js.VariantInfoSchema
46
46
  ]) {
47
- const meta = chunkEJUKGJTZ_js.cimplifyRegistry.get(schema);
47
+ const meta = chunk6W3AH4QW_js.cimplifyRegistry.get(schema);
48
48
  if (meta) entries.push({ schema, meta });
49
49
  }
50
50
  return entries;
@@ -52,227 +52,227 @@ function listRegisteredSchemas() {
52
52
 
53
53
  Object.defineProperty(exports, "AddItemPayloadSchema", {
54
54
  enumerable: true,
55
- get: function () { return chunkEJUKGJTZ_js.AddItemPayloadSchema; }
55
+ get: function () { return chunk6W3AH4QW_js.AddItemPayloadSchema; }
56
56
  });
57
57
  Object.defineProperty(exports, "AddOnDetailsSchema", {
58
58
  enumerable: true,
59
- get: function () { return chunkEJUKGJTZ_js.AddOnDetailsSchema; }
59
+ get: function () { return chunk6W3AH4QW_js.AddOnDetailsSchema; }
60
60
  });
61
61
  Object.defineProperty(exports, "AddOnGroupDetailsSchema", {
62
62
  enumerable: true,
63
- get: function () { return chunkEJUKGJTZ_js.AddOnGroupDetailsSchema; }
63
+ get: function () { return chunk6W3AH4QW_js.AddOnGroupDetailsSchema; }
64
64
  });
65
65
  Object.defineProperty(exports, "AddOnInDetailsSchema", {
66
66
  enumerable: true,
67
- get: function () { return chunkEJUKGJTZ_js.AddOnInDetailsSchema; }
67
+ get: function () { return chunk6W3AH4QW_js.AddOnInDetailsSchema; }
68
68
  });
69
69
  Object.defineProperty(exports, "AddOnOptionDetailsSchema", {
70
70
  enumerable: true,
71
- get: function () { return chunkEJUKGJTZ_js.AddOnOptionDetailsSchema; }
71
+ get: function () { return chunk6W3AH4QW_js.AddOnOptionDetailsSchema; }
72
72
  });
73
73
  Object.defineProperty(exports, "AuthorizationTypeSchema", {
74
74
  enumerable: true,
75
- get: function () { return chunkEJUKGJTZ_js.AuthorizationTypeSchema; }
75
+ get: function () { return chunk6W3AH4QW_js.AuthorizationTypeSchema; }
76
76
  });
77
77
  Object.defineProperty(exports, "BrandContactSchema", {
78
78
  enumerable: true,
79
- get: function () { return chunkEJUKGJTZ_js.BrandContactSchema; }
79
+ get: function () { return chunk6W3AH4QW_js.BrandContactSchema; }
80
80
  });
81
81
  Object.defineProperty(exports, "BrandFaqSchema", {
82
82
  enumerable: true,
83
- get: function () { return chunkEJUKGJTZ_js.BrandFaqSchema; }
83
+ get: function () { return chunk6W3AH4QW_js.BrandFaqSchema; }
84
84
  });
85
85
  Object.defineProperty(exports, "BrandHeroSchema", {
86
86
  enumerable: true,
87
- get: function () { return chunkEJUKGJTZ_js.BrandHeroSchema; }
87
+ get: function () { return chunk6W3AH4QW_js.BrandHeroSchema; }
88
88
  });
89
89
  Object.defineProperty(exports, "BrandNavLinkSchema", {
90
90
  enumerable: true,
91
- get: function () { return chunkEJUKGJTZ_js.BrandNavLinkSchema; }
91
+ get: function () { return chunk6W3AH4QW_js.BrandNavLinkSchema; }
92
92
  });
93
93
  Object.defineProperty(exports, "BrandPolicyPageSchema", {
94
94
  enumerable: true,
95
- get: function () { return chunkEJUKGJTZ_js.BrandPolicyPageSchema; }
95
+ get: function () { return chunk6W3AH4QW_js.BrandPolicyPageSchema; }
96
96
  });
97
97
  Object.defineProperty(exports, "BrandPolicySectionSchema", {
98
98
  enumerable: true,
99
- get: function () { return chunkEJUKGJTZ_js.BrandPolicySectionSchema; }
99
+ get: function () { return chunk6W3AH4QW_js.BrandPolicySectionSchema; }
100
100
  });
101
101
  Object.defineProperty(exports, "BrandSchema", {
102
102
  enumerable: true,
103
- get: function () { return chunkEJUKGJTZ_js.BrandSchema; }
103
+ get: function () { return chunk6W3AH4QW_js.BrandSchema; }
104
104
  });
105
105
  Object.defineProperty(exports, "BrandSocialSchema", {
106
106
  enumerable: true,
107
- get: function () { return chunkEJUKGJTZ_js.BrandSocialSchema; }
107
+ get: function () { return chunk6W3AH4QW_js.BrandSocialSchema; }
108
108
  });
109
109
  Object.defineProperty(exports, "BundleResolvedSchema", {
110
110
  enumerable: true,
111
- get: function () { return chunkEJUKGJTZ_js.BundleResolvedSchema; }
111
+ get: function () { return chunk6W3AH4QW_js.BundleResolvedSchema; }
112
112
  });
113
113
  Object.defineProperty(exports, "BundleSelectionInputSchema", {
114
114
  enumerable: true,
115
- get: function () { return chunkEJUKGJTZ_js.BundleSelectionInputSchema; }
115
+ get: function () { return chunk6W3AH4QW_js.BundleSelectionInputSchema; }
116
116
  });
117
117
  Object.defineProperty(exports, "CartItemSchema", {
118
118
  enumerable: true,
119
- get: function () { return chunkEJUKGJTZ_js.CartItemSchema; }
119
+ get: function () { return chunk6W3AH4QW_js.CartItemSchema; }
120
120
  });
121
121
  Object.defineProperty(exports, "CartPricingSchema", {
122
122
  enumerable: true,
123
- get: function () { return chunkEJUKGJTZ_js.CartPricingSchema; }
123
+ get: function () { return chunk6W3AH4QW_js.CartPricingSchema; }
124
124
  });
125
125
  Object.defineProperty(exports, "CartSchema", {
126
126
  enumerable: true,
127
- get: function () { return chunkEJUKGJTZ_js.CartSchema; }
127
+ get: function () { return chunk6W3AH4QW_js.CartSchema; }
128
128
  });
129
129
  Object.defineProperty(exports, "CheckoutBodySchema", {
130
130
  enumerable: true,
131
- get: function () { return chunkEJUKGJTZ_js.CheckoutBodySchema; }
131
+ get: function () { return chunk6W3AH4QW_js.CheckoutBodySchema; }
132
132
  });
133
133
  Object.defineProperty(exports, "CheckoutCustomerSchema", {
134
134
  enumerable: true,
135
- get: function () { return chunkEJUKGJTZ_js.CheckoutCustomerSchema; }
135
+ get: function () { return chunk6W3AH4QW_js.CheckoutCustomerSchema; }
136
136
  });
137
137
  Object.defineProperty(exports, "CheckoutResponseSchema", {
138
138
  enumerable: true,
139
- get: function () { return chunkEJUKGJTZ_js.CheckoutResponseSchema; }
139
+ get: function () { return chunk6W3AH4QW_js.CheckoutResponseSchema; }
140
140
  });
141
141
  Object.defineProperty(exports, "ChosenPriceSchema", {
142
142
  enumerable: true,
143
- get: function () { return chunkEJUKGJTZ_js.ChosenPriceSchema; }
143
+ get: function () { return chunk6W3AH4QW_js.ChosenPriceSchema; }
144
144
  });
145
145
  Object.defineProperty(exports, "CompositeResolvedSchema", {
146
146
  enumerable: true,
147
- get: function () { return chunkEJUKGJTZ_js.CompositeResolvedSchema; }
147
+ get: function () { return chunk6W3AH4QW_js.CompositeResolvedSchema; }
148
148
  });
149
149
  Object.defineProperty(exports, "CompositeSelectionInputSchema", {
150
150
  enumerable: true,
151
- get: function () { return chunkEJUKGJTZ_js.CompositeSelectionInputSchema; }
151
+ get: function () { return chunk6W3AH4QW_js.CompositeSelectionInputSchema; }
152
152
  });
153
153
  Object.defineProperty(exports, "CountryCodeSchema", {
154
154
  enumerable: true,
155
- get: function () { return chunkEJUKGJTZ_js.CountryCodeSchema; }
155
+ get: function () { return chunk6W3AH4QW_js.CountryCodeSchema; }
156
156
  });
157
157
  Object.defineProperty(exports, "CurrencyCodeSchema", {
158
158
  enumerable: true,
159
- get: function () { return chunkEJUKGJTZ_js.CurrencyCodeSchema; }
159
+ get: function () { return chunk6W3AH4QW_js.CurrencyCodeSchema; }
160
160
  });
161
161
  Object.defineProperty(exports, "CustomerInputValueSchema", {
162
162
  enumerable: true,
163
- get: function () { return chunkEJUKGJTZ_js.CustomerInputValueSchema; }
163
+ get: function () { return chunk6W3AH4QW_js.CustomerInputValueSchema; }
164
164
  });
165
165
  Object.defineProperty(exports, "DiscountDetailsSchema", {
166
166
  enumerable: true,
167
- get: function () { return chunkEJUKGJTZ_js.DiscountDetailsSchema; }
167
+ get: function () { return chunk6W3AH4QW_js.DiscountDetailsSchema; }
168
168
  });
169
169
  Object.defineProperty(exports, "IsoDateTimeSchema", {
170
170
  enumerable: true,
171
- get: function () { return chunkEJUKGJTZ_js.IsoDateTimeSchema; }
171
+ get: function () { return chunk6W3AH4QW_js.IsoDateTimeSchema; }
172
172
  });
173
173
  Object.defineProperty(exports, "LineTypeSchema", {
174
174
  enumerable: true,
175
- get: function () { return chunkEJUKGJTZ_js.LineTypeSchema; }
175
+ get: function () { return chunk6W3AH4QW_js.LineTypeSchema; }
176
176
  });
177
177
  Object.defineProperty(exports, "LocaleSchema", {
178
178
  enumerable: true,
179
- get: function () { return chunkEJUKGJTZ_js.LocaleSchema; }
179
+ get: function () { return chunk6W3AH4QW_js.LocaleSchema; }
180
180
  });
181
181
  Object.defineProperty(exports, "MoneyLooseSchema", {
182
182
  enumerable: true,
183
- get: function () { return chunkEJUKGJTZ_js.MoneyLooseSchema; }
183
+ get: function () { return chunk6W3AH4QW_js.MoneyLooseSchema; }
184
184
  });
185
185
  Object.defineProperty(exports, "MoneySchema", {
186
186
  enumerable: true,
187
- get: function () { return chunkEJUKGJTZ_js.MoneySchema; }
187
+ get: function () { return chunk6W3AH4QW_js.MoneySchema; }
188
188
  });
189
189
  Object.defineProperty(exports, "NextActionSchema", {
190
190
  enumerable: true,
191
- get: function () { return chunkEJUKGJTZ_js.NextActionSchema; }
191
+ get: function () { return chunk6W3AH4QW_js.NextActionSchema; }
192
192
  });
193
193
  Object.defineProperty(exports, "PhoneE164Schema", {
194
194
  enumerable: true,
195
- get: function () { return chunkEJUKGJTZ_js.PhoneE164Schema; }
195
+ get: function () { return chunk6W3AH4QW_js.PhoneE164Schema; }
196
196
  });
197
197
  Object.defineProperty(exports, "ProductTypeSchema", {
198
198
  enumerable: true,
199
- get: function () { return chunkEJUKGJTZ_js.ProductTypeSchema; }
199
+ get: function () { return chunk6W3AH4QW_js.ProductTypeSchema; }
200
200
  });
201
201
  Object.defineProperty(exports, "SchemaViolationError", {
202
202
  enumerable: true,
203
- get: function () { return chunkEJUKGJTZ_js.SchemaViolationError; }
203
+ get: function () { return chunk6W3AH4QW_js.SchemaViolationError; }
204
204
  });
205
205
  Object.defineProperty(exports, "SeedNameSchema", {
206
206
  enumerable: true,
207
- get: function () { return chunkEJUKGJTZ_js.SeedNameSchema; }
207
+ get: function () { return chunk6W3AH4QW_js.SeedNameSchema; }
208
208
  });
209
209
  Object.defineProperty(exports, "SelectedAddOnOptionSchema", {
210
210
  enumerable: true,
211
- get: function () { return chunkEJUKGJTZ_js.SelectedAddOnOptionSchema; }
211
+ get: function () { return chunk6W3AH4QW_js.SelectedAddOnOptionSchema; }
212
212
  });
213
213
  Object.defineProperty(exports, "ServiceStatusSchema", {
214
214
  enumerable: true,
215
- get: function () { return chunkEJUKGJTZ_js.ServiceStatusSchema; }
215
+ get: function () { return chunk6W3AH4QW_js.ServiceStatusSchema; }
216
216
  });
217
217
  Object.defineProperty(exports, "TimestampSchema", {
218
218
  enumerable: true,
219
- get: function () { return chunkEJUKGJTZ_js.TimestampSchema; }
219
+ get: function () { return chunk6W3AH4QW_js.TimestampSchema; }
220
220
  });
221
221
  Object.defineProperty(exports, "VariantDetailsSchema", {
222
222
  enumerable: true,
223
- get: function () { return chunkEJUKGJTZ_js.VariantDetailsSchema; }
223
+ get: function () { return chunk6W3AH4QW_js.VariantDetailsSchema; }
224
224
  });
225
225
  Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
226
226
  enumerable: true,
227
- get: function () { return chunkEJUKGJTZ_js.VariantDisplayAttributeSchema; }
227
+ get: function () { return chunk6W3AH4QW_js.VariantDisplayAttributeSchema; }
228
228
  });
229
229
  Object.defineProperty(exports, "VariantInfoSchema", {
230
230
  enumerable: true,
231
- get: function () { return chunkEJUKGJTZ_js.VariantInfoSchema; }
231
+ get: function () { return chunk6W3AH4QW_js.VariantInfoSchema; }
232
232
  });
233
233
  Object.defineProperty(exports, "assertAddItemPayload", {
234
234
  enumerable: true,
235
- get: function () { return chunkEJUKGJTZ_js.assertAddItemPayload; }
235
+ get: function () { return chunk6W3AH4QW_js.assertAddItemPayload; }
236
236
  });
237
237
  Object.defineProperty(exports, "assertBrand", {
238
238
  enumerable: true,
239
- get: function () { return chunkEJUKGJTZ_js.assertBrand; }
239
+ get: function () { return chunk6W3AH4QW_js.assertBrand; }
240
240
  });
241
241
  Object.defineProperty(exports, "assertCart", {
242
242
  enumerable: true,
243
- get: function () { return chunkEJUKGJTZ_js.assertCart; }
243
+ get: function () { return chunk6W3AH4QW_js.assertCart; }
244
244
  });
245
245
  Object.defineProperty(exports, "assertCartItem", {
246
246
  enumerable: true,
247
- get: function () { return chunkEJUKGJTZ_js.assertCartItem; }
247
+ get: function () { return chunk6W3AH4QW_js.assertCartItem; }
248
248
  });
249
249
  Object.defineProperty(exports, "assertCheckoutBody", {
250
250
  enumerable: true,
251
- get: function () { return chunkEJUKGJTZ_js.assertCheckoutBody; }
251
+ get: function () { return chunk6W3AH4QW_js.assertCheckoutBody; }
252
252
  });
253
253
  Object.defineProperty(exports, "assertCheckoutResponse", {
254
254
  enumerable: true,
255
- get: function () { return chunkEJUKGJTZ_js.assertCheckoutResponse; }
255
+ get: function () { return chunk6W3AH4QW_js.assertCheckoutResponse; }
256
256
  });
257
257
  Object.defineProperty(exports, "cimplifyRegistry", {
258
258
  enumerable: true,
259
- get: function () { return chunkEJUKGJTZ_js.cimplifyRegistry; }
259
+ get: function () { return chunk6W3AH4QW_js.cimplifyRegistry; }
260
260
  });
261
261
  Object.defineProperty(exports, "createTestClient", {
262
262
  enumerable: true,
263
- get: function () { return chunkEJUKGJTZ_js.createTestClient; }
263
+ get: function () { return chunk6W3AH4QW_js.createTestClient; }
264
264
  });
265
265
  Object.defineProperty(exports, "fixtures", {
266
266
  enumerable: true,
267
- get: function () { return chunkEJUKGJTZ_js.fixtures; }
267
+ get: function () { return chunk6W3AH4QW_js.fixtures; }
268
268
  });
269
269
  Object.defineProperty(exports, "makeAssertion", {
270
270
  enumerable: true,
271
- get: function () { return chunkEJUKGJTZ_js.makeAssertion; }
271
+ get: function () { return chunk6W3AH4QW_js.makeAssertion; }
272
272
  });
273
273
  Object.defineProperty(exports, "registerSchema", {
274
274
  enumerable: true,
275
- get: function () { return chunkEJUKGJTZ_js.registerSchema; }
275
+ get: function () { return chunk6W3AH4QW_js.registerSchema; }
276
276
  });
277
277
  exports.exportJsonSchemas = exportJsonSchemas;
278
278
  exports.listRegisteredSchemas = listRegisteredSchemas;
package/dist/testing.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-NEK7CVE2.mjs';
2
- export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-NEK7CVE2.mjs';
1
+ import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-F4WS3OIF.mjs';
2
+ export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-F4WS3OIF.mjs';
3
3
  import './chunk-3G4QCENX.mjs';
4
- import './chunk-6QZQQRBB.mjs';
5
- import './chunk-B3Y4C4A7.mjs';
4
+ import './chunk-SQ7U3BWY.mjs';
5
+ import './chunk-I4IXPQIX.mjs';
6
6
  import './chunk-TD3AY34U.mjs';
7
7
  import './chunk-AMZXALF6.mjs';
8
8
  import './chunk-3G6RQLXK.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.54.0",
3
+ "version": "0.55.0",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -148,6 +148,7 @@
148
148
  "@base-ui/react": "^1.4.1",
149
149
  "clsx": "^2.1.1",
150
150
  "date-fns": "^4.1.0",
151
+ "jose": "^6.2.3",
151
152
  "libphonenumber-js": "1.12.41",
152
153
  "react-day-picker": "^9.14.0",
153
154
  "tailwind-merge": "^3.5.0",
@@ -9,7 +9,7 @@
9
9
  "files": [
10
10
  {
11
11
  "path": "account.tsx",
12
- "content": "\"use client\";\n\nimport React, { useEffect, useRef, useState, useMemo } from \"react\";\nimport type { CimplifyClient } from \"../client\";\nimport { useOptionalCimplify } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CimplifyAccountProps {\n /** CimplifyClient instance. Falls back to provider context. */\n client?: CimplifyClient;\n /** Override the Link base URL. */\n linkUrl?: string;\n /** Initial section to show: \"dashboard\" | \"orders\" | \"addresses\" | \"payment-methods\" | \"sessions\" | \"settings\". */\n section?: string;\n /** Appearance variables — passed to Link for theming. */\n appearance?: {\n theme?: \"light\" | \"dark\";\n variables?: {\n primaryColor?: string;\n fontFamily?: string;\n borderRadius?: string;\n };\n };\n /** Called when the user logs out from the account portal. */\n onLogout?: () => void;\n /** Additional CSS class for the container. */\n className?: string;\n}\n\nconst DEFAULT_LINK_URL = \"https://link.cimplify.io\";\n\nexport function CimplifyAccount({\n client: clientProp,\n linkUrl,\n section,\n appearance,\n onLogout,\n className,\n}: CimplifyAccountProps): React.ReactElement {\n const context = useOptionalCimplify();\n const client = clientProp ?? context?.client;\n const resolvedLinkUrl = linkUrl || DEFAULT_LINK_URL;\n\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const [height, setHeight] = useState(400);\n const [isReady, setIsReady] = useState(false);\n\n const iframeSrc = useMemo(() => {\n const path = section ? `/elements/account/${section}` : \"/elements/account\";\n const url = new URL(path, resolvedLinkUrl);\n if (client) {\n const businessId = client.getBusinessId?.() ?? \"\";\n if (businessId) url.searchParams.set(\"businessId\", businessId);\n }\n return url.toString();\n }, [resolvedLinkUrl, section, client]);\n\n // Listen for messages from the iframe\n useEffect(() => {\n function handleMessage(event: MessageEvent) {\n if (!event.data || typeof event.data !== \"object\") return;\n\n // Only accept messages from our iframe\n if (iframeRef.current?.contentWindow && event.source !== iframeRef.current.contentWindow) {\n return;\n }\n\n switch (event.data.type) {\n case \"ready\":\n setIsReady(true);\n if (typeof event.data.height === \"number\") {\n setHeight(event.data.height);\n }\n // Send init with token + appearance\n sendInit();\n break;\n\n case \"height_change\":\n if (typeof event.data.height === \"number\") {\n setHeight(event.data.height);\n }\n break;\n\n case \"logout_complete\":\n onLogout?.();\n break;\n }\n }\n\n window.addEventListener(\"message\", handleMessage);\n return () => window.removeEventListener(\"message\", handleMessage);\n }, [appearance, client, onLogout]);\n\n function sendInit() {\n const contentWindow = iframeRef.current?.contentWindow;\n if (!contentWindow) return;\n\n const token = client?.getAccessToken?.();\n contentWindow.postMessage(\n {\n type: \"init\",\n token: token ?? undefined,\n appearance: appearance ?? undefined,\n },\n resolvedLinkUrl,\n );\n }\n\n return (\n <div\n data-cimplify-account\n className={cn(\"relative overflow-hidden\", className)}\n >\n {!isReady && (\n <div className=\"flex items-center justify-center py-16\">\n <div className=\"w-6 h-6 border-2 border-border border-t-foreground rounded-full animate-spin\" />\n </div>\n )}\n <iframe\n ref={iframeRef}\n src={iframeSrc}\n style={{\n border: \"none\",\n width: \"100%\",\n height: `${height}px`,\n display: isReady ? \"block\" : \"none\",\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n allow=\"geolocation\"\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox\"\n />\n </div>\n );\n}\n"
12
+ "content": "\"use client\";\n\nimport React, { useEffect, useRef, useState, useMemo } from \"react\";\nimport type { CimplifyClient } from \"../client\";\nimport { useOptionalCimplify } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CimplifyAccountProps {\n /** CimplifyClient instance. Falls back to provider context. */\n client?: CimplifyClient;\n /** Override the Link base URL. */\n linkUrl?: string;\n /** Initial section to show: \"dashboard\" | \"orders\" | \"addresses\" | \"payment-methods\" | \"sessions\" | \"settings\". */\n section?: string;\n /**\n * Per-merchant scope for the embedded account widget. When set, the\n * widget filters orders/subs/sessions to this business and hides\n * cross-merchant surfaces. Defaults to the client's configured\n * business ID so storefronts get scoping for free.\n */\n businessId?: string;\n /**\n * Display name of the embedding merchant — shown in the widget's\n * scoping footer (\"Showing your account with Acme Threads only.\").\n * Optional but recommended for trust signal.\n */\n merchantName?: string;\n /** Appearance variables — passed to Link for theming. */\n appearance?: {\n theme?: \"light\" | \"dark\";\n variables?: {\n primaryColor?: string;\n fontFamily?: string;\n borderRadius?: string;\n };\n };\n /** Called when the user logs out from the account portal. */\n onLogout?: () => void;\n /** Additional CSS class for the container. */\n className?: string;\n}\n\nconst DEFAULT_LINK_URL = \"https://link.cimplify.io\";\n\nexport function CimplifyAccount({\n client: clientProp,\n linkUrl,\n section,\n businessId: businessIdProp,\n merchantName,\n appearance,\n onLogout,\n className,\n}: CimplifyAccountProps): React.ReactElement {\n const context = useOptionalCimplify();\n const client = clientProp ?? context?.client;\n const resolvedLinkUrl = linkUrl || DEFAULT_LINK_URL;\n const resolvedBusinessId = businessIdProp || client?.getBusinessId?.() || \"\";\n\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const [height, setHeight] = useState(400);\n const [isReady, setIsReady] = useState(false);\n\n const iframeSrc = useMemo(() => {\n const path = section ? `/elements/account/${section}` : \"/elements/account\";\n const url = new URL(path, resolvedLinkUrl);\n if (resolvedBusinessId) url.searchParams.set(\"businessId\", resolvedBusinessId);\n return url.toString();\n }, [resolvedLinkUrl, section, resolvedBusinessId]);\n\n // Listen for messages from the iframe\n useEffect(() => {\n function handleMessage(event: MessageEvent) {\n if (!event.data || typeof event.data !== \"object\") return;\n\n // Only accept messages from our iframe\n if (iframeRef.current?.contentWindow && event.source !== iframeRef.current.contentWindow) {\n return;\n }\n\n switch (event.data.type) {\n case \"ready\":\n setIsReady(true);\n if (typeof event.data.height === \"number\") {\n setHeight(event.data.height);\n }\n // Send init with token + appearance\n sendInit();\n break;\n\n case \"height_change\":\n if (typeof event.data.height === \"number\") {\n setHeight(event.data.height);\n }\n break;\n\n case \"logout_complete\":\n onLogout?.();\n break;\n }\n }\n\n window.addEventListener(\"message\", handleMessage);\n return () => window.removeEventListener(\"message\", handleMessage);\n }, [appearance, client, onLogout]);\n\n function sendInit() {\n const contentWindow = iframeRef.current?.contentWindow;\n if (!contentWindow) return;\n\n const token = client?.getAccessToken?.();\n contentWindow.postMessage(\n {\n type: \"init\",\n token: token ?? undefined,\n appearance: appearance ?? undefined,\n businessId: resolvedBusinessId || undefined,\n merchantName: merchantName ?? undefined,\n },\n resolvedLinkUrl,\n );\n }\n\n return (\n <div\n data-cimplify-account\n className={cn(\"relative overflow-hidden\", className)}\n >\n {!isReady && (\n <div className=\"flex items-center justify-center py-16\">\n <div className=\"w-6 h-6 border-2 border-border border-t-foreground rounded-full animate-spin\" />\n </div>\n )}\n <iframe\n ref={iframeRef}\n src={iframeSrc}\n style={{\n border: \"none\",\n width: \"100%\",\n height: `${height}px`,\n display: isReady ? \"block\" : \"none\",\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n allow=\"geolocation\"\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox\"\n />\n </div>\n );\n}\n"
13
13
  }
14
14
  ]
15
15
  }