@rebuy/rebuy 3.41.0 → 3.43.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.
- package/dist/index.cjs +971 -787
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +971 -787
- package/dist/pricing/index.cjs +58 -1
- package/dist/pricing/index.d.ts +2 -0
- package/dist/pricing/index.mjs +58 -1
- package/dist/pricing/postPurchaseDisplayFacts.d.ts +36 -0
- package/dist/pricing/postPurchaseDisplayPrice.d.ts +8 -0
- package/dist/pricing/postPurchaseReduction.d.ts +17 -0
- package/dist/schema/checkout-and-beyond/constants.cjs +4 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +4 -0
- package/dist/schema/checkout-and-beyond/index.cjs +388 -374
- package/dist/schema/checkout-and-beyond/index.mjs +388 -374
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/postPurchaseAdmission.d.ts +33 -0
- package/dist/schema/postPurchaseDisplayPrice.d.ts +31 -0
- package/dist/schema/postPurchaseFollowups.d.ts +47 -0
- package/dist/schema/postPurchaseHealth.d.ts +5 -0
- package/dist/schema/postPurchasePlanCatalog.d.ts +2 -0
- package/dist/schema/postPurchaseProduct.d.ts +2 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +62 -0
- package/dist/schema/postPurchaseProductView.d.ts +65 -0
- package/dist/schema/postPurchaseRecovery.d.ts +47 -0
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +2 -0
- package/dist/schema/postPurchaseUpgrade.d.ts +117 -0
- package/dist/schema/widget-data.cjs +452 -441
- package/dist/schema/widget-data.mjs +452 -441
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +14 -0
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/imageThumbnails.d.ts +13 -0
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +1 -0
- package/dist/server/index.cjs +1721 -1419
- package/dist/server/index.mjs +1707 -1405
- package/dist/server/postPurchasePlanCatalog.d.ts +4 -1
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +57 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +53 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +53 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +159 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +53 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +1 -0
- package/dist/server/selectPostPurchaseChoice.d.ts +1 -0
- package/dist/transforms/index.cjs +980 -581
- package/dist/transforms/index.mjs +980 -581
- package/dist/transforms/postPurchase/convertProductInformation.d.ts +6 -2
- package/dist/transforms/postPurchase/productCardControls.d.ts +7 -0
- package/dist/transforms/postPurchase/productCardCosts.d.ts +3 -0
- package/dist/transforms/postPurchase/productCardPricing.d.ts +3 -0
- package/dist/transforms/postPurchase/productCardRows.d.ts +63 -0
- package/dist/transforms/postPurchase/productCardSettings.d.ts +103 -0
- package/dist/transforms/postPurchase/types.d.ts +2 -2
- package/dist/transforms/productCard/earnedText.d.ts +25 -0
- package/dist/transforms/productCard/priceText.d.ts +2 -0
- package/dist/transforms/productCard/quantitySection.d.ts +28 -0
- package/dist/transforms/productCard/subscriptionToggle.d.ts +18 -0
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ __export(widgetData_exports, {
|
|
|
24
24
|
extensionWidgetTypes: () => extensionWidgetTypes
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(widgetData_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_zod32 = require("zod");
|
|
28
28
|
|
|
29
29
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
30
30
|
var import_zod = require("zod");
|
|
@@ -203,6 +203,8 @@ var variableTypes = ["boolean", "number", "text"];
|
|
|
203
203
|
var VariableType = freezeEnum(variableTypes);
|
|
204
204
|
var variantModes = ["multiple", "single"];
|
|
205
205
|
var VariantMode = freezeEnum(variantModes);
|
|
206
|
+
var variantsModes = [...variantModes, "productGroup"];
|
|
207
|
+
var VariantsMode = freezeEnum(variantsModes);
|
|
206
208
|
var variantSelectors = ["menu", "radio", "button"];
|
|
207
209
|
var VariantSelector = freezeEnum(variantSelectors);
|
|
208
210
|
var verticalAlignments = ["top", "middle", "bottom"];
|
|
@@ -292,17 +294,17 @@ var CheckoutExtension = import_zod2.z.looseObject({
|
|
|
292
294
|
});
|
|
293
295
|
|
|
294
296
|
// src/schema/widgets/contentBlock.ts
|
|
295
|
-
var
|
|
297
|
+
var import_zod26 = require("zod");
|
|
296
298
|
|
|
297
299
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
298
|
-
var
|
|
300
|
+
var import_zod25 = require("zod");
|
|
299
301
|
|
|
300
302
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
301
303
|
var import_uuid13 = require("uuid");
|
|
302
|
-
var
|
|
304
|
+
var import_zod24 = require("zod");
|
|
303
305
|
|
|
304
306
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
305
|
-
var
|
|
307
|
+
var import_zod23 = require("zod");
|
|
306
308
|
|
|
307
309
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
308
310
|
var import_zod3 = require("zod");
|
|
@@ -381,11 +383,11 @@ var CABBannerSection = import_zod3.z.lazy(
|
|
|
381
383
|
|
|
382
384
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
383
385
|
var import_uuid3 = require("uuid");
|
|
384
|
-
var
|
|
386
|
+
var import_zod9 = require("zod");
|
|
385
387
|
|
|
386
388
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
387
389
|
var import_uuid = require("uuid");
|
|
388
|
-
var
|
|
390
|
+
var import_zod7 = require("zod");
|
|
389
391
|
|
|
390
392
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
391
393
|
var iconNames = [
|
|
@@ -471,11 +473,18 @@ var IconSize = freezeEnum(iconSizes);
|
|
|
471
473
|
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
472
474
|
var IconTone = freezeEnum(iconTones);
|
|
473
475
|
|
|
476
|
+
// src/schema/widgets/checkout-and-beyond/imageThumbnails.ts
|
|
477
|
+
var import_zod4 = require("zod");
|
|
478
|
+
var CABImageThumbnails = import_zod4.z.object({
|
|
479
|
+
limit: import_zod4.z.number().int().min(1).default(8),
|
|
480
|
+
perLine: import_zod4.z.number().int().min(1).max(8).default(4)
|
|
481
|
+
});
|
|
482
|
+
|
|
474
483
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
475
|
-
var
|
|
484
|
+
var import_zod6 = require("zod");
|
|
476
485
|
|
|
477
486
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
478
|
-
var
|
|
487
|
+
var import_zod5 = require("zod");
|
|
479
488
|
var ruleTypes = [
|
|
480
489
|
"cart",
|
|
481
490
|
"cart_count",
|
|
@@ -494,7 +503,7 @@ var ruleTypes = [
|
|
|
494
503
|
"product_type",
|
|
495
504
|
"product_vendor"
|
|
496
505
|
];
|
|
497
|
-
var ruleType =
|
|
506
|
+
var ruleType = import_zod5.z.enum(ruleTypes);
|
|
498
507
|
var RuleType = ruleType.enum;
|
|
499
508
|
var ruleOperators = [
|
|
500
509
|
"after",
|
|
@@ -509,124 +518,124 @@ var ruleOperators = [
|
|
|
509
518
|
"greater_than",
|
|
510
519
|
"less_than"
|
|
511
520
|
];
|
|
512
|
-
var ruleOperator =
|
|
521
|
+
var ruleOperator = import_zod5.z.enum(ruleOperators);
|
|
513
522
|
var RuleOperator = ruleOperator.enum;
|
|
514
|
-
var RuleCondition =
|
|
515
|
-
operator:
|
|
516
|
-
products:
|
|
517
|
-
type:
|
|
518
|
-
value:
|
|
523
|
+
var RuleCondition = import_zod5.z.object({
|
|
524
|
+
operator: import_zod5.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
525
|
+
products: import_zod5.z.union([import_zod5.z.array(import_zod5.z.unknown()), import_zod5.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
526
|
+
type: import_zod5.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
527
|
+
value: import_zod5.z.coerce.string().default("")
|
|
519
528
|
});
|
|
520
|
-
var RuleLogicBlock =
|
|
521
|
-
rules:
|
|
529
|
+
var RuleLogicBlock = import_zod5.z.object({
|
|
530
|
+
rules: import_zod5.z.array(RuleCondition).default(() => [])
|
|
522
531
|
});
|
|
523
|
-
var CABRulesetEntry =
|
|
524
|
-
exitIfMatched:
|
|
525
|
-
logic:
|
|
526
|
-
output:
|
|
527
|
-
|
|
528
|
-
key:
|
|
529
|
-
type:
|
|
530
|
-
value:
|
|
532
|
+
var CABRulesetEntry = import_zod5.z.object({
|
|
533
|
+
exitIfMatched: import_zod5.z.boolean().default(true),
|
|
534
|
+
logic: import_zod5.z.array(RuleLogicBlock).default(() => []),
|
|
535
|
+
output: import_zod5.z.array(
|
|
536
|
+
import_zod5.z.object({
|
|
537
|
+
key: import_zod5.z.string().default("should_show"),
|
|
538
|
+
type: import_zod5.z.literal("data_json").default("data_json"),
|
|
539
|
+
value: import_zod5.z.string().default("true")
|
|
531
540
|
})
|
|
532
541
|
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
533
542
|
});
|
|
534
|
-
var CABRuleset =
|
|
543
|
+
var CABRuleset = import_zod5.z.union([import_zod5.z.array(CABRulesetEntry), import_zod5.z.strictObject({}).transform(() => [])]).default(() => []);
|
|
535
544
|
|
|
536
545
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
537
|
-
var variableEffect =
|
|
538
|
-
var CABVariableSeed =
|
|
539
|
-
dataSourceId:
|
|
546
|
+
var variableEffect = import_zod6.z.enum(variableEffects);
|
|
547
|
+
var CABVariableSeed = import_zod6.z.object({
|
|
548
|
+
dataSourceId: import_zod6.z.number().nullable().default(null),
|
|
540
549
|
ruleset: CABRuleset
|
|
541
550
|
});
|
|
542
|
-
var CABBooleanVariable =
|
|
551
|
+
var CABBooleanVariable = import_zod6.z.object({
|
|
543
552
|
/**
|
|
544
553
|
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
545
554
|
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
546
555
|
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
547
556
|
*/
|
|
548
|
-
defaultValue:
|
|
549
|
-
name:
|
|
557
|
+
defaultValue: import_zod6.z.boolean().optional(),
|
|
558
|
+
name: import_zod6.z.string().min(1),
|
|
550
559
|
seed: CABVariableSeed.optional(),
|
|
551
560
|
/** Defaulted so every stored declaration (all boolean before `text` existed) parses unchanged. */
|
|
552
|
-
type:
|
|
561
|
+
type: import_zod6.z.literal(VariableType.boolean).default(VariableType.boolean)
|
|
553
562
|
});
|
|
554
|
-
var CABTextVariable =
|
|
555
|
-
defaultValue:
|
|
556
|
-
name:
|
|
557
|
-
seed:
|
|
558
|
-
type:
|
|
563
|
+
var CABTextVariable = import_zod6.z.object({
|
|
564
|
+
defaultValue: import_zod6.z.string(),
|
|
565
|
+
name: import_zod6.z.string().min(1),
|
|
566
|
+
seed: import_zod6.z.never().optional(),
|
|
567
|
+
type: import_zod6.z.literal(VariableType.text)
|
|
559
568
|
});
|
|
560
|
-
var CABNumberVariable =
|
|
561
|
-
defaultValue:
|
|
562
|
-
name:
|
|
563
|
-
seed:
|
|
564
|
-
type:
|
|
569
|
+
var CABNumberVariable = import_zod6.z.object({
|
|
570
|
+
defaultValue: import_zod6.z.number(),
|
|
571
|
+
name: import_zod6.z.string().min(1),
|
|
572
|
+
seed: import_zod6.z.never().optional(),
|
|
573
|
+
type: import_zod6.z.literal(VariableType.number)
|
|
565
574
|
});
|
|
566
|
-
var CABVariable =
|
|
575
|
+
var CABVariable = import_zod6.z.union([CABTextVariable, CABNumberVariable, CABBooleanVariable]).transform(
|
|
567
576
|
(variable) => variable.type === VariableType.boolean ? { ...variable, defaultValue: variable.defaultValue ?? variable.seed === void 0 } : variable
|
|
568
577
|
);
|
|
569
|
-
var CABVariableEffect =
|
|
578
|
+
var CABVariableEffect = import_zod6.z.object({
|
|
570
579
|
effect: variableEffect.default(VariableEffect.toggle),
|
|
571
|
-
variable:
|
|
580
|
+
variable: import_zod6.z.string().min(1)
|
|
572
581
|
});
|
|
573
|
-
var CABVisibility =
|
|
574
|
-
variable:
|
|
575
|
-
visibleWhen:
|
|
582
|
+
var CABVisibility = import_zod6.z.object({
|
|
583
|
+
variable: import_zod6.z.string().min(1),
|
|
584
|
+
visibleWhen: import_zod6.z.boolean().default(true)
|
|
576
585
|
});
|
|
577
|
-
var contentOperator =
|
|
578
|
-
var resultCountOperator =
|
|
579
|
-
var resultTagOperator =
|
|
580
|
-
var mutatorEvent =
|
|
581
|
-
var CABContentTrigger =
|
|
586
|
+
var contentOperator = import_zod6.z.enum(contentOperators);
|
|
587
|
+
var resultCountOperator = import_zod6.z.enum(resultCountOperators);
|
|
588
|
+
var resultTagOperator = import_zod6.z.enum(resultTagOperators);
|
|
589
|
+
var mutatorEvent = import_zod6.z.enum(mutatorEvents);
|
|
590
|
+
var CABContentTrigger = import_zod6.z.object({
|
|
582
591
|
operator: contentOperator.default(ContentOperator.is_empty),
|
|
583
|
-
type:
|
|
592
|
+
type: import_zod6.z.literal("content")
|
|
584
593
|
});
|
|
585
|
-
var CABResultCountTrigger =
|
|
594
|
+
var CABResultCountTrigger = import_zod6.z.object({
|
|
586
595
|
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
587
|
-
type:
|
|
588
|
-
value:
|
|
596
|
+
type: import_zod6.z.literal("result_count"),
|
|
597
|
+
value: import_zod6.z.number().default(0)
|
|
589
598
|
});
|
|
590
|
-
var CABResultTagTrigger =
|
|
599
|
+
var CABResultTagTrigger = import_zod6.z.object({
|
|
591
600
|
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
592
|
-
type:
|
|
593
|
-
value:
|
|
601
|
+
type: import_zod6.z.literal("result_tag"),
|
|
602
|
+
value: import_zod6.z.string().min(1)
|
|
594
603
|
});
|
|
595
|
-
var CABEventTrigger =
|
|
604
|
+
var CABEventTrigger = import_zod6.z.object({
|
|
596
605
|
event: mutatorEvent,
|
|
597
|
-
type:
|
|
606
|
+
type: import_zod6.z.literal("event")
|
|
598
607
|
});
|
|
599
|
-
var CABVariableTrigger =
|
|
608
|
+
var CABVariableTrigger = import_zod6.z.discriminatedUnion("type", [
|
|
600
609
|
CABContentTrigger,
|
|
601
610
|
CABEventTrigger,
|
|
602
611
|
CABResultCountTrigger,
|
|
603
612
|
CABResultTagTrigger
|
|
604
613
|
]);
|
|
605
|
-
var CABVariableMutator =
|
|
614
|
+
var CABVariableMutator = import_zod6.z.object({
|
|
606
615
|
effect: variableEffect.default(VariableEffect.set_false),
|
|
607
|
-
variable:
|
|
616
|
+
variable: import_zod6.z.string().min(1),
|
|
608
617
|
when: CABVariableTrigger
|
|
609
618
|
});
|
|
610
619
|
var CABVariableFields = {
|
|
611
|
-
mutators:
|
|
612
|
-
variables:
|
|
620
|
+
mutators: import_zod6.z.array(CABVariableMutator).optional(),
|
|
621
|
+
variables: import_zod6.z.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
613
622
|
message: "variable names must be unique within a section"
|
|
614
623
|
}).optional(),
|
|
615
624
|
visibility: CABVisibility.optional()
|
|
616
625
|
};
|
|
617
626
|
|
|
618
627
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
619
|
-
var CABImageSectionFields =
|
|
628
|
+
var CABImageSectionFields = import_zod7.z.object({
|
|
620
629
|
...CABVariableFields,
|
|
621
|
-
altText:
|
|
630
|
+
altText: import_zod7.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
622
631
|
/**
|
|
623
632
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
624
633
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
625
634
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
626
635
|
*/
|
|
627
|
-
aspectRatio:
|
|
628
|
-
border:
|
|
629
|
-
buttonField:
|
|
636
|
+
aspectRatio: import_zod7.z.number().positive().nullable().default(null),
|
|
637
|
+
border: import_zod7.z.lazy(() => CABBorder),
|
|
638
|
+
buttonField: import_zod7.z.enum(buttonFields).optional(),
|
|
630
639
|
/**
|
|
631
640
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
632
641
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -645,29 +654,30 @@ var CABImageSectionFields = import_zod6.z.object({
|
|
|
645
654
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
646
655
|
* the risky half.
|
|
647
656
|
*/
|
|
648
|
-
category:
|
|
657
|
+
category: import_zod7.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
649
658
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
650
|
-
iconSize:
|
|
659
|
+
iconSize: import_zod7.z.enum(iconSizes).nullable().default(null),
|
|
651
660
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
652
|
-
iconTone:
|
|
653
|
-
name:
|
|
654
|
-
naturalHeight:
|
|
655
|
-
naturalWidth:
|
|
661
|
+
iconTone: import_zod7.z.enum(iconTones).nullable().default(null),
|
|
662
|
+
name: import_zod7.z.string().optional(),
|
|
663
|
+
naturalHeight: import_zod7.z.number().default(0),
|
|
664
|
+
naturalWidth: import_zod7.z.number().default(0),
|
|
656
665
|
/**
|
|
657
666
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
658
667
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
659
668
|
*/
|
|
660
|
-
objectFit:
|
|
661
|
-
sectionId:
|
|
662
|
-
sectionType:
|
|
669
|
+
objectFit: import_zod7.z.enum(objectFits).default(ObjectFit.contain),
|
|
670
|
+
sectionId: import_zod7.z.uuid().default(() => (0, import_uuid.v7)()),
|
|
671
|
+
sectionType: import_zod7.z.literal(SectionType.image).default(SectionType.image),
|
|
663
672
|
/**
|
|
664
673
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
665
674
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
666
675
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
667
676
|
* server-chosen tier icon actually needs it.
|
|
668
677
|
*/
|
|
669
|
-
source:
|
|
670
|
-
|
|
678
|
+
source: import_zod7.z.union([import_zod7.z.url(), import_zod7.z.literal(""), import_zod7.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod7.z.enum(iconNames)]).default(""),
|
|
679
|
+
thumbnails: CABImageThumbnails.optional(),
|
|
680
|
+
width: import_zod7.z.number().default(100)
|
|
671
681
|
});
|
|
672
682
|
var iconNameSet = new Set(iconNames);
|
|
673
683
|
var isIconName = (source) => iconNameSet.has(source);
|
|
@@ -689,71 +699,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
|
|
|
689
699
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
690
700
|
var import_compat2 = require("es-toolkit/compat");
|
|
691
701
|
var import_uuid2 = require("uuid");
|
|
692
|
-
var
|
|
693
|
-
var enumOrOmit = (...vals) =>
|
|
694
|
-
var TiptapText =
|
|
695
|
-
marks:
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
attrs:
|
|
702
|
-
class:
|
|
703
|
-
href:
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
702
|
+
var import_zod8 = require("zod");
|
|
703
|
+
var enumOrOmit = (...vals) => import_zod8.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
704
|
+
var TiptapText = import_zod8.z.object({
|
|
705
|
+
marks: import_zod8.z.union([
|
|
706
|
+
import_zod8.z.array(
|
|
707
|
+
import_zod8.z.discriminatedUnion("type", [
|
|
708
|
+
import_zod8.z.object({ type: import_zod8.z.literal("bold") }),
|
|
709
|
+
import_zod8.z.object({ type: import_zod8.z.literal("italic") }),
|
|
710
|
+
import_zod8.z.object({
|
|
711
|
+
attrs: import_zod8.z.object({
|
|
712
|
+
class: import_zod8.z.string().nullable(),
|
|
713
|
+
href: import_zod8.z.union([
|
|
714
|
+
import_zod8.z.url(),
|
|
715
|
+
import_zod8.z.literal("#"),
|
|
716
|
+
import_zod8.z.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
717
|
+
import_zod8.z.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
708
718
|
]),
|
|
709
|
-
rel:
|
|
710
|
-
target:
|
|
719
|
+
rel: import_zod8.z.string().default("noopener noreferrer nofollow"),
|
|
720
|
+
target: import_zod8.z.string().default("_blank")
|
|
711
721
|
}),
|
|
712
|
-
type:
|
|
722
|
+
type: import_zod8.z.literal("link")
|
|
713
723
|
}),
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
attrs:
|
|
724
|
+
import_zod8.z.object({ type: import_zod8.z.literal("strike") }),
|
|
725
|
+
import_zod8.z.object({
|
|
726
|
+
attrs: import_zod8.z.object({
|
|
717
727
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
718
728
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
719
729
|
}),
|
|
720
|
-
type:
|
|
730
|
+
type: import_zod8.z.literal("textStyle")
|
|
721
731
|
})
|
|
722
732
|
])
|
|
723
733
|
),
|
|
724
|
-
|
|
734
|
+
import_zod8.z.strictObject({}).transform(() => [])
|
|
725
735
|
]).optional(),
|
|
726
|
-
text:
|
|
727
|
-
type:
|
|
736
|
+
text: import_zod8.z.string().default(""),
|
|
737
|
+
type: import_zod8.z.literal("text").default("text")
|
|
728
738
|
});
|
|
729
|
-
var TiptapParagraph =
|
|
730
|
-
attrs:
|
|
739
|
+
var TiptapParagraph = import_zod8.z.object({
|
|
740
|
+
attrs: import_zod8.z.object({
|
|
731
741
|
textAlign: enumOrOmit(...textAlignments)
|
|
732
742
|
}).default({ textAlign: TextAlignment.start }),
|
|
733
|
-
content:
|
|
734
|
-
type:
|
|
743
|
+
content: import_zod8.z.union([import_zod8.z.array(TiptapText), import_zod8.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
744
|
+
type: import_zod8.z.literal("paragraph").default("paragraph")
|
|
735
745
|
});
|
|
736
|
-
var TiptapDocument =
|
|
737
|
-
attrs:
|
|
746
|
+
var TiptapDocument = import_zod8.z.object({
|
|
747
|
+
attrs: import_zod8.z.object({
|
|
738
748
|
blockSpacing: enumOrOmit(...spacings)
|
|
739
749
|
}).default({ blockSpacing: Spacing.base }),
|
|
740
|
-
content:
|
|
741
|
-
type:
|
|
750
|
+
content: import_zod8.z.union([import_zod8.z.array(TiptapParagraph), import_zod8.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
751
|
+
type: import_zod8.z.literal("doc").default("doc")
|
|
742
752
|
});
|
|
743
|
-
var CABTextTier =
|
|
744
|
-
threshold:
|
|
745
|
-
thresholds:
|
|
746
|
-
tierId:
|
|
747
|
-
tierType:
|
|
753
|
+
var CABTextTier = import_zod8.z.object({
|
|
754
|
+
threshold: import_zod8.z.number().int().nonnegative(),
|
|
755
|
+
thresholds: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.number().int().nonnegative()).default(() => ({})),
|
|
756
|
+
tierId: import_zod8.z.string().optional(),
|
|
757
|
+
tierType: import_zod8.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
748
758
|
});
|
|
749
|
-
var CABTextSection =
|
|
759
|
+
var CABTextSection = import_zod8.z.object({
|
|
750
760
|
...CABVariableFields,
|
|
751
|
-
buttonField:
|
|
752
|
-
content:
|
|
753
|
-
name:
|
|
754
|
-
optionId:
|
|
755
|
-
sectionId:
|
|
756
|
-
sectionType:
|
|
761
|
+
buttonField: import_zod8.z.enum(buttonFields).optional(),
|
|
762
|
+
content: import_zod8.z.record(import_zod8.z.string(), import_zod8.z.union([import_zod8.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
763
|
+
name: import_zod8.z.string().optional(),
|
|
764
|
+
optionId: import_zod8.z.number().optional(),
|
|
765
|
+
sectionId: import_zod8.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
766
|
+
sectionType: import_zod8.z.literal(SectionType.text).default(SectionType.text),
|
|
757
767
|
tier: CABTextTier.optional()
|
|
758
768
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
759
769
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -775,35 +785,35 @@ var CABTextSection = import_zod7.z.object({
|
|
|
775
785
|
});
|
|
776
786
|
|
|
777
787
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
778
|
-
var CABButtonContent =
|
|
779
|
-
() =>
|
|
788
|
+
var CABButtonContent = import_zod9.z.lazy(
|
|
789
|
+
() => import_zod9.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
780
790
|
);
|
|
781
|
-
var CABButtonSection =
|
|
791
|
+
var CABButtonSection = import_zod9.z.object({
|
|
782
792
|
...CABVariableFields,
|
|
783
|
-
action:
|
|
784
|
-
buttonStyle:
|
|
785
|
-
custom:
|
|
786
|
-
color:
|
|
787
|
-
height:
|
|
788
|
-
width:
|
|
793
|
+
action: import_zod9.z.union([import_zod9.z.literal(""), import_zod9.z.enum(buttonActions)]).default(""),
|
|
794
|
+
buttonStyle: import_zod9.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
795
|
+
custom: import_zod9.z.object({
|
|
796
|
+
color: import_zod9.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
797
|
+
height: import_zod9.z.number().default(52),
|
|
798
|
+
width: import_zod9.z.number().default(300)
|
|
789
799
|
}).default({
|
|
790
800
|
color: "#005bd3",
|
|
791
801
|
height: 52,
|
|
792
802
|
width: 300
|
|
793
803
|
}),
|
|
794
|
-
disableDowngrade:
|
|
795
|
-
name:
|
|
796
|
-
optionId:
|
|
797
|
-
popover:
|
|
798
|
-
alignment:
|
|
799
|
-
position:
|
|
804
|
+
disableDowngrade: import_zod9.z.boolean().default(false),
|
|
805
|
+
name: import_zod9.z.string().optional(),
|
|
806
|
+
optionId: import_zod9.z.number().optional(),
|
|
807
|
+
popover: import_zod9.z.object({
|
|
808
|
+
alignment: import_zod9.z.enum(textAlignments).default(TextAlignment.center),
|
|
809
|
+
position: import_zod9.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
800
810
|
}).optional().default(() => ({
|
|
801
811
|
alignment: TextAlignment.center,
|
|
802
812
|
position: PopoverPosition.blockStart
|
|
803
813
|
})),
|
|
804
|
-
sectionId:
|
|
805
|
-
sections:
|
|
806
|
-
sectionType:
|
|
814
|
+
sectionId: import_zod9.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
815
|
+
sections: import_zod9.z.union([import_zod9.z.array(CABButtonContent), import_zod9.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
816
|
+
sectionType: import_zod9.z.literal(SectionType.button).default(SectionType.button),
|
|
807
817
|
/**
|
|
808
818
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
809
819
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -818,96 +828,96 @@ var CABButtonSection = import_zod8.z.object({
|
|
|
818
828
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
819
829
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
820
830
|
*/
|
|
821
|
-
tier:
|
|
831
|
+
tier: import_zod9.z.object({ tierId: import_zod9.z.string().min(1) }).optional(),
|
|
822
832
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
823
|
-
trackingUrl:
|
|
833
|
+
trackingUrl: import_zod9.z.string().optional(),
|
|
824
834
|
/**
|
|
825
835
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
826
836
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
827
837
|
*/
|
|
828
|
-
variableEffects:
|
|
838
|
+
variableEffects: import_zod9.z.array(CABVariableEffect).optional()
|
|
829
839
|
});
|
|
830
840
|
|
|
831
841
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
832
|
-
var
|
|
842
|
+
var import_zod14 = require("zod");
|
|
833
843
|
|
|
834
844
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
835
|
-
var
|
|
845
|
+
var import_zod13 = require("zod");
|
|
836
846
|
|
|
837
847
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
838
848
|
var import_uuid4 = require("uuid");
|
|
839
|
-
var
|
|
840
|
-
var CABDiscount =
|
|
841
|
-
amount:
|
|
842
|
-
discountedBy:
|
|
843
|
-
discountedFrom:
|
|
844
|
-
type:
|
|
849
|
+
var import_zod10 = require("zod");
|
|
850
|
+
var CABDiscount = import_zod10.z.object({
|
|
851
|
+
amount: import_zod10.z.union([import_zod10.z.number(), import_zod10.z.string()]).catch(0),
|
|
852
|
+
discountedBy: import_zod10.z.string().optional(),
|
|
853
|
+
discountedFrom: import_zod10.z.enum(discountSources).optional().catch(void 0),
|
|
854
|
+
type: import_zod10.z.enum(discountTypes).catch("none")
|
|
845
855
|
});
|
|
846
|
-
var CABIntegrations =
|
|
847
|
-
judgeme:
|
|
848
|
-
junip:
|
|
849
|
-
klaviyo:
|
|
850
|
-
loox:
|
|
851
|
-
okendo:
|
|
852
|
-
opinew:
|
|
853
|
-
reviewsio:
|
|
854
|
-
stamped:
|
|
855
|
-
yotpo:
|
|
856
|
+
var CABIntegrations = import_zod10.z.object({
|
|
857
|
+
judgeme: import_zod10.z.boolean().default(false),
|
|
858
|
+
junip: import_zod10.z.boolean().default(false),
|
|
859
|
+
klaviyo: import_zod10.z.boolean().default(false),
|
|
860
|
+
loox: import_zod10.z.boolean().default(false),
|
|
861
|
+
okendo: import_zod10.z.boolean().default(false),
|
|
862
|
+
opinew: import_zod10.z.boolean().default(false),
|
|
863
|
+
reviewsio: import_zod10.z.boolean().default(false),
|
|
864
|
+
stamped: import_zod10.z.boolean().default(false),
|
|
865
|
+
yotpo: import_zod10.z.boolean().default(false)
|
|
856
866
|
});
|
|
857
|
-
var CABVariantLabels =
|
|
858
|
-
variantOption:
|
|
859
|
-
variantOptions:
|
|
867
|
+
var CABVariantLabels = import_zod10.z.object({
|
|
868
|
+
variantOption: import_zod10.z.string().optional().catch(void 0),
|
|
869
|
+
variantOptions: import_zod10.z.string().optional().catch(void 0)
|
|
860
870
|
});
|
|
861
|
-
var CABDataSourceSection =
|
|
862
|
-
dataSourceId:
|
|
863
|
-
dataSourcePath:
|
|
871
|
+
var CABDataSourceSection = import_zod10.z.object({
|
|
872
|
+
dataSourceId: import_zod10.z.number().nullable().default(null),
|
|
873
|
+
dataSourcePath: import_zod10.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
864
874
|
discount: CABDiscount.optional(),
|
|
865
875
|
integrations: CABIntegrations.optional(),
|
|
866
|
-
limit:
|
|
867
|
-
matchVariant:
|
|
868
|
-
matchVariantOutOfStock:
|
|
869
|
-
name:
|
|
870
|
-
productType:
|
|
871
|
-
sectionId:
|
|
872
|
-
sectionType:
|
|
876
|
+
limit: import_zod10.z.number().default(1),
|
|
877
|
+
matchVariant: import_zod10.z.boolean().default(false),
|
|
878
|
+
matchVariantOutOfStock: import_zod10.z.boolean().default(false),
|
|
879
|
+
name: import_zod10.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
880
|
+
productType: import_zod10.z.enum(productTypes).optional(),
|
|
881
|
+
sectionId: import_zod10.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
882
|
+
sectionType: import_zod10.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
873
883
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
874
|
-
subscriptionIsDefault:
|
|
875
|
-
treatAsGwp:
|
|
884
|
+
subscriptionIsDefault: import_zod10.z.boolean().default(false),
|
|
885
|
+
treatAsGwp: import_zod10.z.boolean().default(false),
|
|
876
886
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
877
887
|
});
|
|
878
888
|
|
|
879
889
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
880
890
|
var import_uuid6 = require("uuid");
|
|
881
|
-
var
|
|
891
|
+
var import_zod12 = require("zod");
|
|
882
892
|
|
|
883
893
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
884
894
|
var import_uuid5 = require("uuid");
|
|
885
|
-
var
|
|
886
|
-
var CABVariantContent =
|
|
887
|
-
() =>
|
|
895
|
+
var import_zod11 = require("zod");
|
|
896
|
+
var CABVariantContent = import_zod11.z.lazy(
|
|
897
|
+
() => import_zod11.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
888
898
|
);
|
|
889
|
-
var CABProductSection =
|
|
899
|
+
var CABProductSection = import_zod11.z.object({
|
|
890
900
|
...CABVariableFields,
|
|
891
|
-
name:
|
|
892
|
-
productId:
|
|
893
|
-
sectionId:
|
|
894
|
-
sections:
|
|
895
|
-
sectionType:
|
|
896
|
-
selectors:
|
|
897
|
-
variantMode:
|
|
901
|
+
name: import_zod11.z.string().optional(),
|
|
902
|
+
productId: import_zod11.z.number().nullable().default(null),
|
|
903
|
+
sectionId: import_zod11.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
904
|
+
sections: import_zod11.z.union([import_zod11.z.array(CABVariantContent), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
905
|
+
sectionType: import_zod11.z.literal(SectionType.product).default(SectionType.product),
|
|
906
|
+
selectors: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
907
|
+
variantMode: import_zod11.z.enum(variantModes).default(VariantMode.multiple)
|
|
898
908
|
});
|
|
899
909
|
|
|
900
910
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
901
|
-
var CABProductsSection =
|
|
911
|
+
var CABProductsSection = import_zod12.z.object({
|
|
902
912
|
...CABVariableFields,
|
|
903
|
-
name:
|
|
904
|
-
sectionId:
|
|
905
|
-
sections:
|
|
906
|
-
sectionType:
|
|
913
|
+
name: import_zod12.z.string().optional(),
|
|
914
|
+
sectionId: import_zod12.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
915
|
+
sections: import_zod12.z.union([import_zod12.z.array(import_zod12.z.lazy(() => CABProductSection)), import_zod12.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
916
|
+
sectionType: import_zod12.z.literal(SectionType.products).default(SectionType.products)
|
|
907
917
|
});
|
|
908
918
|
|
|
909
919
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
910
|
-
var CABOffersSection =
|
|
920
|
+
var CABOffersSection = import_zod13.z.lazy(
|
|
911
921
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
912
922
|
/**
|
|
913
923
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -915,8 +925,8 @@ var CABOffersSection = import_zod12.z.lazy(
|
|
|
915
925
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
916
926
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
917
927
|
*/
|
|
918
|
-
divider:
|
|
919
|
-
sections:
|
|
928
|
+
divider: import_zod13.z.boolean().optional(),
|
|
929
|
+
sections: import_zod13.z.union([import_zod13.z.array(import_zod13.z.lazy(() => CABSection)), import_zod13.z.strictObject({}).transform(() => [])]).default(() => [
|
|
920
930
|
CABBannerSection.parse({
|
|
921
931
|
buttonField: "undoAddToOrder",
|
|
922
932
|
color: "success",
|
|
@@ -930,77 +940,77 @@ var CABOffersSection = import_zod12.z.lazy(
|
|
|
930
940
|
CABDataSourceSection.parse({}),
|
|
931
941
|
CABProductsSection.parse({})
|
|
932
942
|
]),
|
|
933
|
-
sectionType:
|
|
943
|
+
sectionType: import_zod13.z.literal(SectionType.offers).default(SectionType.offers)
|
|
934
944
|
})
|
|
935
945
|
);
|
|
936
946
|
|
|
937
947
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
938
|
-
var CABCarouselSection =
|
|
948
|
+
var CABCarouselSection = import_zod14.z.lazy(
|
|
939
949
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
940
|
-
autoAdvanceInterval:
|
|
941
|
-
itemsAtOnce:
|
|
950
|
+
autoAdvanceInterval: import_zod14.z.number().default(0),
|
|
951
|
+
itemsAtOnce: import_zod14.z.number().min(1).default(1),
|
|
942
952
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
943
|
-
offersDirection:
|
|
944
|
-
sections:
|
|
945
|
-
sectionType:
|
|
953
|
+
offersDirection: import_zod14.z.enum(offersDirections).default("vertical"),
|
|
954
|
+
sections: import_zod14.z.union([import_zod14.z.array(import_zod14.z.lazy(() => CABSection)), import_zod14.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
955
|
+
sectionType: import_zod14.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
946
956
|
})
|
|
947
957
|
);
|
|
948
958
|
|
|
949
959
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
950
|
-
var
|
|
951
|
-
var CABCartLineSection =
|
|
960
|
+
var import_zod15 = require("zod");
|
|
961
|
+
var CABCartLineSection = import_zod15.z.lazy(
|
|
952
962
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
953
|
-
sections:
|
|
954
|
-
sectionType:
|
|
963
|
+
sections: import_zod15.z.union([import_zod15.z.array(import_zod15.z.lazy(() => CABSection)), import_zod15.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
964
|
+
sectionType: import_zod15.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
955
965
|
})
|
|
956
966
|
);
|
|
957
967
|
|
|
958
968
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
959
969
|
var import_uuid7 = require("uuid");
|
|
960
|
-
var
|
|
961
|
-
var CABDiscountSection =
|
|
970
|
+
var import_zod16 = require("zod");
|
|
971
|
+
var CABDiscountSection = import_zod16.z.object({
|
|
962
972
|
...CABVariableFields,
|
|
963
|
-
amount:
|
|
964
|
-
discountedBy:
|
|
965
|
-
discountedFrom:
|
|
966
|
-
message:
|
|
967
|
-
name:
|
|
968
|
-
quantity:
|
|
969
|
-
sectionId:
|
|
970
|
-
sectionType:
|
|
971
|
-
type:
|
|
973
|
+
amount: import_zod16.z.union([import_zod16.z.number(), import_zod16.z.string()]).catch(0),
|
|
974
|
+
discountedBy: import_zod16.z.string().optional(),
|
|
975
|
+
discountedFrom: import_zod16.z.enum(discountSources).optional().catch(void 0),
|
|
976
|
+
message: import_zod16.z.string().optional(),
|
|
977
|
+
name: import_zod16.z.string().optional(),
|
|
978
|
+
quantity: import_zod16.z.number().default(1),
|
|
979
|
+
sectionId: import_zod16.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
980
|
+
sectionType: import_zod16.z.literal(SectionType.discount).default(SectionType.discount),
|
|
981
|
+
type: import_zod16.z.enum(discountTypes).catch("none")
|
|
972
982
|
});
|
|
973
983
|
|
|
974
984
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
975
985
|
var import_uuid8 = require("uuid");
|
|
976
|
-
var
|
|
977
|
-
var CABMonetizeAds =
|
|
978
|
-
requestId:
|
|
986
|
+
var import_zod17 = require("zod");
|
|
987
|
+
var CABMonetizeAds = import_zod17.z.object({
|
|
988
|
+
requestId: import_zod17.z.string().optional(),
|
|
979
989
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
980
|
-
testing:
|
|
990
|
+
testing: import_zod17.z.boolean().default(false)
|
|
981
991
|
});
|
|
982
|
-
var CABMonetizeSection =
|
|
992
|
+
var CABMonetizeSection = import_zod17.z.object({
|
|
983
993
|
...CABVariableFields,
|
|
984
994
|
ads: CABMonetizeAds.optional(),
|
|
985
|
-
name:
|
|
995
|
+
name: import_zod17.z.string().optional(),
|
|
986
996
|
/**
|
|
987
997
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
988
998
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
989
999
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
990
1000
|
*/
|
|
991
|
-
offers:
|
|
1001
|
+
offers: import_zod17.z.array(import_zod17.z.lazy(() => CABSection)).optional(),
|
|
992
1002
|
/** Privacy Policy footer href (the widget's `privacy_policy_url` setting); read server-side for hydration, relayed by the client only on the legacy `/cab/monetize` fallback. */
|
|
993
|
-
privacyPolicyUrl:
|
|
994
|
-
sectionId:
|
|
995
|
-
sectionType:
|
|
1003
|
+
privacyPolicyUrl: import_zod17.z.string().optional(),
|
|
1004
|
+
sectionId: import_zod17.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
1005
|
+
sectionType: import_zod17.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
996
1006
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
997
|
-
subVertical:
|
|
1007
|
+
subVertical: import_zod17.z.string().optional(),
|
|
998
1008
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
999
|
-
vertical:
|
|
1009
|
+
vertical: import_zod17.z.string().optional()
|
|
1000
1010
|
});
|
|
1001
1011
|
|
|
1002
1012
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
1003
|
-
var
|
|
1013
|
+
var import_zod18 = require("zod");
|
|
1004
1014
|
|
|
1005
1015
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
1006
1016
|
var GIFT_LABELS = {
|
|
@@ -1119,34 +1129,34 @@ var GIFT_LABELS = {
|
|
|
1119
1129
|
};
|
|
1120
1130
|
|
|
1121
1131
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
1122
|
-
var CABProgressTierExclusion =
|
|
1123
|
-
collectionIds:
|
|
1124
|
-
productIds:
|
|
1125
|
-
tags:
|
|
1126
|
-
type:
|
|
1132
|
+
var CABProgressTierExclusion = import_zod18.z.object({
|
|
1133
|
+
collectionIds: import_zod18.z.array(import_zod18.z.number().int().positive()).default(() => []),
|
|
1134
|
+
productIds: import_zod18.z.array(import_zod18.z.number().int().positive()).default(() => []),
|
|
1135
|
+
tags: import_zod18.z.array(import_zod18.z.string().min(1)).default(() => []),
|
|
1136
|
+
type: import_zod18.z.enum(progressTierExclusionTypes)
|
|
1127
1137
|
});
|
|
1128
|
-
var CABProgressTier =
|
|
1138
|
+
var CABProgressTier = import_zod18.z.object({
|
|
1129
1139
|
/**
|
|
1130
1140
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
1131
1141
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
1132
1142
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
1133
1143
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
1134
1144
|
*/
|
|
1135
|
-
discount:
|
|
1145
|
+
discount: import_zod18.z.object({ amount: import_zod18.z.number().nonnegative(), type: import_zod18.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
1136
1146
|
/**
|
|
1137
1147
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
1138
1148
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
1139
1149
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
1140
1150
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
1141
1151
|
*/
|
|
1142
|
-
exclusions:
|
|
1152
|
+
exclusions: import_zod18.z.array(CABProgressTierExclusion).default(() => []),
|
|
1143
1153
|
/**
|
|
1144
1154
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
1145
1155
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
1146
1156
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
1147
1157
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
1148
1158
|
*/
|
|
1149
|
-
filterOosVariants:
|
|
1159
|
+
filterOosVariants: import_zod18.z.boolean().default(false),
|
|
1150
1160
|
/**
|
|
1151
1161
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
1152
1162
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -1154,10 +1164,10 @@ var CABProgressTier = import_zod17.z.object({
|
|
|
1154
1164
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
1155
1165
|
* tree is complete.
|
|
1156
1166
|
*/
|
|
1157
|
-
gift:
|
|
1158
|
-
productId:
|
|
1159
|
-
title:
|
|
1160
|
-
variantIds:
|
|
1167
|
+
gift: import_zod18.z.object({
|
|
1168
|
+
productId: import_zod18.z.number().int().positive(),
|
|
1169
|
+
title: import_zod18.z.string().optional(),
|
|
1170
|
+
variantIds: import_zod18.z.array(import_zod18.z.number().int().positive()).default(() => [])
|
|
1161
1171
|
}).optional(),
|
|
1162
1172
|
/**
|
|
1163
1173
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -1177,7 +1187,7 @@ var CABProgressTier = import_zod17.z.object({
|
|
|
1177
1187
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
1178
1188
|
* React's size rather than the old hardcoded 20.
|
|
1179
1189
|
*/
|
|
1180
|
-
iconSizePx:
|
|
1190
|
+
iconSizePx: import_zod18.z.number().int().min(1).max(64).default(18),
|
|
1181
1191
|
/**
|
|
1182
1192
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
1183
1193
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -1187,35 +1197,35 @@ var CABProgressTier = import_zod17.z.object({
|
|
|
1187
1197
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
1188
1198
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
1189
1199
|
*/
|
|
1190
|
-
label:
|
|
1200
|
+
label: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.string()).optional(),
|
|
1191
1201
|
/**
|
|
1192
1202
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
1193
1203
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
1194
1204
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
1195
1205
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
1196
1206
|
*/
|
|
1197
|
-
productTierImage:
|
|
1207
|
+
productTierImage: import_zod18.z.boolean().default(false),
|
|
1198
1208
|
/**
|
|
1199
1209
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
1200
1210
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
1201
1211
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
1202
1212
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
1203
1213
|
*/
|
|
1204
|
-
threshold:
|
|
1214
|
+
threshold: import_zod18.z.number().int().nonnegative(),
|
|
1205
1215
|
/**
|
|
1206
1216
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
1207
1217
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
1208
1218
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
1209
1219
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
1210
1220
|
*/
|
|
1211
|
-
thresholds:
|
|
1221
|
+
thresholds: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.number().int().nonnegative()).default(() => ({})),
|
|
1212
1222
|
/**
|
|
1213
1223
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
1214
1224
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
1215
1225
|
* shipping bar (single unlabeled tier, no gift).
|
|
1216
1226
|
*/
|
|
1217
|
-
tierId:
|
|
1218
|
-
tierType:
|
|
1227
|
+
tierId: import_zod18.z.string().optional(),
|
|
1228
|
+
tierType: import_zod18.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
1219
1229
|
/**
|
|
1220
1230
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
1221
1231
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -1226,9 +1236,9 @@ var CABProgressTier = import_zod17.z.object({
|
|
|
1226
1236
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
1227
1237
|
* template text supplies grammatically-neutral wording around the token.
|
|
1228
1238
|
*/
|
|
1229
|
-
unit:
|
|
1239
|
+
unit: import_zod18.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
1230
1240
|
});
|
|
1231
|
-
var CABProgressBarSection =
|
|
1241
|
+
var CABProgressBarSection = import_zod18.z.lazy(
|
|
1232
1242
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1233
1243
|
/**
|
|
1234
1244
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -1237,35 +1247,35 @@ var CABProgressBarSection = import_zod17.z.lazy(
|
|
|
1237
1247
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
1238
1248
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
1239
1249
|
*/
|
|
1240
|
-
barId:
|
|
1250
|
+
barId: import_zod18.z.string().optional(),
|
|
1241
1251
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
1242
|
-
countryCodes:
|
|
1252
|
+
countryCodes: import_zod18.z.array(import_zod18.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
1243
1253
|
/**
|
|
1244
1254
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
1245
1255
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
1246
1256
|
*/
|
|
1247
|
-
excludeCountryCodes:
|
|
1257
|
+
excludeCountryCodes: import_zod18.z.array(import_zod18.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
1248
1258
|
/**
|
|
1249
1259
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
1250
1260
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
1251
1261
|
* adds the cart's discount allocations back to the live subtotal.
|
|
1252
1262
|
*/
|
|
1253
|
-
excludeDiscountInSubtotal:
|
|
1263
|
+
excludeDiscountInSubtotal: import_zod18.z.boolean().default(false),
|
|
1254
1264
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
1255
|
-
excludedVariantIds:
|
|
1265
|
+
excludedVariantIds: import_zod18.z.array(import_zod18.z.number().int().positive()).default(() => []),
|
|
1256
1266
|
/**
|
|
1257
1267
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
1258
1268
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
1259
1269
|
*/
|
|
1260
|
-
freeShippingOnSubscription:
|
|
1270
|
+
freeShippingOnSubscription: import_zod18.z.boolean().default(false),
|
|
1261
1271
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
1262
|
-
giftAreaTitle:
|
|
1272
|
+
giftAreaTitle: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
1263
1273
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
1264
|
-
giftLabels:
|
|
1265
|
-
addGift:
|
|
1266
|
-
remove:
|
|
1267
|
-
selectOptions:
|
|
1268
|
-
yourGift:
|
|
1274
|
+
giftLabels: import_zod18.z.object({
|
|
1275
|
+
addGift: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
1276
|
+
remove: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
1277
|
+
selectOptions: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
1278
|
+
yourGift: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
1269
1279
|
}).default(() => ({
|
|
1270
1280
|
addGift: { ...GIFT_LABELS.addGift },
|
|
1271
1281
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -1273,38 +1283,38 @@ var CABProgressBarSection = import_zod17.z.lazy(
|
|
|
1273
1283
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
1274
1284
|
})),
|
|
1275
1285
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
1276
|
-
name:
|
|
1286
|
+
name: import_zod18.z.string().default("Order progress"),
|
|
1277
1287
|
/**
|
|
1278
1288
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
1279
1289
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
1280
1290
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
1281
1291
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
1282
1292
|
*/
|
|
1283
|
-
progressColor:
|
|
1284
|
-
sectionType:
|
|
1293
|
+
progressColor: import_zod18.z.string().optional(),
|
|
1294
|
+
sectionType: import_zod18.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
1285
1295
|
/**
|
|
1286
1296
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
1287
1297
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
1288
1298
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
1289
1299
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
1290
1300
|
*/
|
|
1291
|
-
tiers:
|
|
1301
|
+
tiers: import_zod18.z.union([import_zod18.z.array(CABProgressTier), import_zod18.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
1292
1302
|
})
|
|
1293
1303
|
);
|
|
1294
1304
|
|
|
1295
1305
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
1296
1306
|
var import_uuid9 = require("uuid");
|
|
1297
|
-
var
|
|
1298
|
-
var CABQuantitySection =
|
|
1307
|
+
var import_zod19 = require("zod");
|
|
1308
|
+
var CABQuantitySection = import_zod19.z.object({
|
|
1299
1309
|
...CABVariableFields,
|
|
1300
|
-
errorMessages:
|
|
1301
|
-
|
|
1302
|
-
|
|
1310
|
+
errorMessages: import_zod19.z.record(
|
|
1311
|
+
import_zod19.z.string(),
|
|
1312
|
+
import_zod19.z.object({
|
|
1303
1313
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
1304
|
-
increment:
|
|
1305
|
-
max:
|
|
1306
|
-
min:
|
|
1307
|
-
neg:
|
|
1314
|
+
increment: import_zod19.z.string().optional(),
|
|
1315
|
+
max: import_zod19.z.string().optional(),
|
|
1316
|
+
min: import_zod19.z.string().optional(),
|
|
1317
|
+
neg: import_zod19.z.string().optional()
|
|
1308
1318
|
})
|
|
1309
1319
|
).default({
|
|
1310
1320
|
en: {
|
|
@@ -1314,18 +1324,18 @@ var CABQuantitySection = import_zod18.z.object({
|
|
|
1314
1324
|
neg: "Quantity cannot be negative"
|
|
1315
1325
|
}
|
|
1316
1326
|
}),
|
|
1317
|
-
inputType:
|
|
1318
|
-
max:
|
|
1319
|
-
min:
|
|
1327
|
+
inputType: import_zod19.z.enum(quantityInputs).default(QuantityInput.select),
|
|
1328
|
+
max: import_zod19.z.number().min(1).max(100).default(10),
|
|
1329
|
+
min: import_zod19.z.number().min(1).default(1),
|
|
1320
1330
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
1321
|
-
name:
|
|
1322
|
-
sectionId:
|
|
1323
|
-
sectionType:
|
|
1331
|
+
name: import_zod19.z.string().default("Quantity"),
|
|
1332
|
+
sectionId: import_zod19.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
1333
|
+
sectionType: import_zod19.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
1324
1334
|
});
|
|
1325
1335
|
|
|
1326
1336
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
1327
1337
|
var import_uuid10 = require("uuid");
|
|
1328
|
-
var
|
|
1338
|
+
var import_zod20 = require("zod");
|
|
1329
1339
|
|
|
1330
1340
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
1331
1341
|
var REVIEW_LABELS = {
|
|
@@ -1388,68 +1398,69 @@ var REVIEW_LABELS = {
|
|
|
1388
1398
|
};
|
|
1389
1399
|
|
|
1390
1400
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
1391
|
-
var CABReviewsSection =
|
|
1401
|
+
var CABReviewsSection = import_zod20.z.object({
|
|
1392
1402
|
...CABVariableFields,
|
|
1393
|
-
color:
|
|
1403
|
+
color: import_zod20.z.string().default("#fadb14"),
|
|
1394
1404
|
/**
|
|
1395
1405
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
1396
1406
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
1397
1407
|
* or merchant work.
|
|
1398
1408
|
*/
|
|
1399
|
-
countLabels:
|
|
1400
|
-
one:
|
|
1401
|
-
other:
|
|
1409
|
+
countLabels: import_zod20.z.object({
|
|
1410
|
+
one: import_zod20.z.record(import_zod20.z.string(), import_zod20.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
1411
|
+
other: import_zod20.z.record(import_zod20.z.string(), import_zod20.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
1402
1412
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
1403
|
-
name:
|
|
1404
|
-
sectionId:
|
|
1405
|
-
sectionType:
|
|
1406
|
-
size:
|
|
1413
|
+
name: import_zod20.z.string().optional(),
|
|
1414
|
+
sectionId: import_zod20.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
1415
|
+
sectionType: import_zod20.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
1416
|
+
size: import_zod20.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
1407
1417
|
/**
|
|
1408
1418
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
1409
1419
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
1410
1420
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
1411
1421
|
* the whole reviews section.
|
|
1412
1422
|
*/
|
|
1413
|
-
strokeColor:
|
|
1423
|
+
strokeColor: import_zod20.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
1414
1424
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
1415
|
-
strokeWidth:
|
|
1425
|
+
strokeWidth: import_zod20.z.number().nonnegative().default(0)
|
|
1416
1426
|
});
|
|
1417
1427
|
|
|
1418
1428
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
1419
1429
|
var import_uuid11 = require("uuid");
|
|
1420
|
-
var
|
|
1421
|
-
var CABSeparatorSection =
|
|
1430
|
+
var import_zod21 = require("zod");
|
|
1431
|
+
var CABSeparatorSection = import_zod21.z.object({
|
|
1422
1432
|
...CABVariableFields,
|
|
1423
|
-
sectionId:
|
|
1424
|
-
sectionType:
|
|
1433
|
+
sectionId: import_zod21.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
1434
|
+
sectionType: import_zod21.z.literal(SectionType.separator).default(SectionType.separator)
|
|
1425
1435
|
});
|
|
1426
1436
|
|
|
1427
1437
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
1428
1438
|
var import_compat3 = require("es-toolkit/compat");
|
|
1429
1439
|
var import_uuid12 = require("uuid");
|
|
1430
|
-
var
|
|
1431
|
-
var CABVariantsSection =
|
|
1440
|
+
var import_zod22 = require("zod");
|
|
1441
|
+
var CABVariantsSection = import_zod22.z.object({
|
|
1432
1442
|
...CABVariableFields,
|
|
1433
|
-
hideOutOfStockVariants:
|
|
1434
|
-
name:
|
|
1435
|
-
sectionId:
|
|
1436
|
-
sectionType:
|
|
1437
|
-
selector:
|
|
1438
|
-
|
|
1443
|
+
hideOutOfStockVariants: import_zod22.z.boolean().default(false),
|
|
1444
|
+
name: import_zod22.z.string().optional(),
|
|
1445
|
+
sectionId: import_zod22.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
1446
|
+
sectionType: import_zod22.z.literal(SectionType.variants).default(SectionType.variants),
|
|
1447
|
+
selector: import_zod22.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
1448
|
+
/** `productGroup` is additive (REB-24817): a renderer without group support must render nothing for it. */
|
|
1449
|
+
variantMode: import_zod22.z.enum(variantsModes).default(VariantsMode.multiple)
|
|
1439
1450
|
});
|
|
1440
1451
|
|
|
1441
1452
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1442
|
-
var CABBorder =
|
|
1443
|
-
radius:
|
|
1444
|
-
style:
|
|
1445
|
-
width:
|
|
1453
|
+
var CABBorder = import_zod23.z.object({
|
|
1454
|
+
radius: import_zod23.z.enum(borderRadii).default(BorderRadius.base),
|
|
1455
|
+
style: import_zod23.z.enum(borderStyles).default(BorderStyle.none),
|
|
1456
|
+
width: import_zod23.z.enum(borderWidths).default(BorderWidth.base)
|
|
1446
1457
|
}).default({
|
|
1447
1458
|
radius: BorderRadius.base,
|
|
1448
1459
|
style: BorderStyle.none,
|
|
1449
1460
|
width: BorderWidth.base
|
|
1450
1461
|
});
|
|
1451
|
-
var CABSection =
|
|
1452
|
-
() =>
|
|
1462
|
+
var CABSection = import_zod23.z.lazy(
|
|
1463
|
+
() => import_zod23.z.discriminatedUnion("sectionType", [
|
|
1453
1464
|
CABBannerSection,
|
|
1454
1465
|
CABButtonSection,
|
|
1455
1466
|
CABCarouselSection,
|
|
@@ -1472,41 +1483,41 @@ var CABSection = import_zod22.z.lazy(
|
|
|
1472
1483
|
);
|
|
1473
1484
|
|
|
1474
1485
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1475
|
-
var GridItem =
|
|
1476
|
-
var CABLayoutWrapping =
|
|
1477
|
-
breakAt:
|
|
1478
|
-
maxPerLine:
|
|
1486
|
+
var GridItem = import_zod24.z.union([import_zod24.z.literal("auto"), import_zod24.z.literal("fill"), import_zod24.z.string().regex(/^\d+%$/), import_zod24.z.number()]);
|
|
1487
|
+
var CABLayoutWrapping = import_zod24.z.object({
|
|
1488
|
+
breakAt: import_zod24.z.number().positive(),
|
|
1489
|
+
maxPerLine: import_zod24.z.number().int().positive()
|
|
1479
1490
|
});
|
|
1480
|
-
var CABLayoutSection =
|
|
1491
|
+
var CABLayoutSection = import_zod24.z.object({
|
|
1481
1492
|
...CABVariableFields,
|
|
1482
|
-
alignment:
|
|
1483
|
-
horizontal:
|
|
1484
|
-
vertical:
|
|
1493
|
+
alignment: import_zod24.z.object({
|
|
1494
|
+
horizontal: import_zod24.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
1495
|
+
vertical: import_zod24.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
1485
1496
|
}).default({
|
|
1486
1497
|
horizontal: HorizontalAlignment.start,
|
|
1487
1498
|
vertical: VerticalAlignment.top
|
|
1488
1499
|
}),
|
|
1489
|
-
border:
|
|
1490
|
-
buttonField:
|
|
1491
|
-
direction:
|
|
1500
|
+
border: import_zod24.z.lazy(() => CABBorder),
|
|
1501
|
+
buttonField: import_zod24.z.enum(buttonFields).optional(),
|
|
1502
|
+
direction: import_zod24.z.enum(directions).default(Direction.rows),
|
|
1492
1503
|
/**
|
|
1493
1504
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1494
1505
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
1495
1506
|
*/
|
|
1496
|
-
frame:
|
|
1497
|
-
grid:
|
|
1498
|
-
columns:
|
|
1499
|
-
rows:
|
|
1507
|
+
frame: import_zod24.z.enum(layoutFrames).optional(),
|
|
1508
|
+
grid: import_zod24.z.object({
|
|
1509
|
+
columns: import_zod24.z.union([import_zod24.z.array(GridItem), import_zod24.z.undefined()]).default(() => ["auto"]),
|
|
1510
|
+
rows: import_zod24.z.union([import_zod24.z.array(GridItem), import_zod24.z.undefined()]).default(() => ["auto"])
|
|
1500
1511
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
1501
|
-
name:
|
|
1502
|
-
padding:
|
|
1503
|
-
sectionId:
|
|
1504
|
-
sections:
|
|
1505
|
-
sectionType:
|
|
1506
|
-
spacing:
|
|
1512
|
+
name: import_zod24.z.string().optional(),
|
|
1513
|
+
padding: import_zod24.z.enum(spacings).default(Spacing.none),
|
|
1514
|
+
sectionId: import_zod24.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
1515
|
+
sections: import_zod24.z.union([import_zod24.z.array(import_zod24.z.lazy(() => CABSection)), import_zod24.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1516
|
+
sectionType: import_zod24.z.literal(SectionType.layout).default(SectionType.layout),
|
|
1517
|
+
spacing: import_zod24.z.enum(spacings).default(Spacing.base),
|
|
1507
1518
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
1508
|
-
viewUrl:
|
|
1509
|
-
width:
|
|
1519
|
+
viewUrl: import_zod24.z.string().optional(),
|
|
1520
|
+
width: import_zod24.z.number().default(100),
|
|
1510
1521
|
wrapping: CABLayoutWrapping.optional()
|
|
1511
1522
|
});
|
|
1512
1523
|
|
|
@@ -1528,8 +1539,8 @@ var UI_LABELS = {
|
|
|
1528
1539
|
};
|
|
1529
1540
|
|
|
1530
1541
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1531
|
-
var localized = (fallback) =>
|
|
1532
|
-
var CABUILabels =
|
|
1542
|
+
var localized = (fallback) => import_zod25.z.record(import_zod25.z.string(), import_zod25.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
1543
|
+
var CABUILabels = import_zod25.z.object({
|
|
1533
1544
|
currentPage: localized(UI_LABELS.currentPage),
|
|
1534
1545
|
guest: localized(UI_LABELS.guest),
|
|
1535
1546
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -1554,154 +1565,154 @@ var CABUILabels = import_zod24.z.object({
|
|
|
1554
1565
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
1555
1566
|
updating: { ...UI_LABELS.updating }
|
|
1556
1567
|
}));
|
|
1557
|
-
var TargetArea =
|
|
1558
|
-
fill:
|
|
1559
|
-
flip:
|
|
1560
|
-
icon:
|
|
1561
|
-
label:
|
|
1562
|
-
width:
|
|
1568
|
+
var TargetArea = import_zod25.z.object({
|
|
1569
|
+
fill: import_zod25.z.boolean().optional(),
|
|
1570
|
+
flip: import_zod25.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
1571
|
+
icon: import_zod25.z.string(),
|
|
1572
|
+
label: import_zod25.z.string(),
|
|
1573
|
+
width: import_zod25.z.string()
|
|
1563
1574
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
1564
|
-
var CABTracking =
|
|
1565
|
-
enableAttribution:
|
|
1566
|
-
enableSource:
|
|
1567
|
-
enableWidget:
|
|
1575
|
+
var CABTracking = import_zod25.z.object({
|
|
1576
|
+
enableAttribution: import_zod25.z.boolean().nullish().transform((value) => value ?? true),
|
|
1577
|
+
enableSource: import_zod25.z.boolean().nullish().transform((value) => value ?? true),
|
|
1578
|
+
enableWidget: import_zod25.z.boolean().nullish().transform((value) => value ?? true)
|
|
1568
1579
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
1569
|
-
var CABExperiment =
|
|
1570
|
-
elementId:
|
|
1571
|
-
experimentId:
|
|
1572
|
-
experimentType:
|
|
1573
|
-
selectedId:
|
|
1580
|
+
var CABExperiment = import_zod25.z.object({
|
|
1581
|
+
elementId: import_zod25.z.number(),
|
|
1582
|
+
experimentId: import_zod25.z.number(),
|
|
1583
|
+
experimentType: import_zod25.z.string(),
|
|
1584
|
+
selectedId: import_zod25.z.number()
|
|
1574
1585
|
});
|
|
1575
1586
|
var CABRootSection = CABLayoutSection.extend({
|
|
1576
|
-
editorMode:
|
|
1587
|
+
editorMode: import_zod25.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
1577
1588
|
experiment: CABExperiment.optional(),
|
|
1578
1589
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
1579
1590
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
1580
|
-
previewMode:
|
|
1581
|
-
storeId:
|
|
1591
|
+
previewMode: import_zod25.z.boolean().nullish().transform((value) => value ?? false),
|
|
1592
|
+
storeId: import_zod25.z.number().nullable().default(null),
|
|
1582
1593
|
targetArea: TargetArea.nullable(),
|
|
1583
1594
|
tracking: CABTracking,
|
|
1584
|
-
type:
|
|
1595
|
+
type: import_zod25.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
1585
1596
|
uiLabels: CABUILabels,
|
|
1586
|
-
version:
|
|
1587
|
-
widgetId:
|
|
1597
|
+
version: import_zod25.z.literal(2).default(2),
|
|
1598
|
+
widgetId: import_zod25.z.number().nullable().default(null)
|
|
1588
1599
|
});
|
|
1589
1600
|
|
|
1590
1601
|
// src/schema/widgets/contentBlock.ts
|
|
1591
|
-
var ContentBlockV1 =
|
|
1592
|
-
blockSpacing:
|
|
1593
|
-
imageBlocks:
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
altText:
|
|
1597
|
-
description:
|
|
1598
|
-
id:
|
|
1599
|
-
imagePlacement:
|
|
1600
|
-
imageSize:
|
|
1601
|
-
imageUrl:
|
|
1602
|
-
textAlignment:
|
|
1602
|
+
var ContentBlockV1 = import_zod26.z.object({
|
|
1603
|
+
blockSpacing: import_zod26.z.enum(spacings).optional(),
|
|
1604
|
+
imageBlocks: import_zod26.z.union([
|
|
1605
|
+
import_zod26.z.array(
|
|
1606
|
+
import_zod26.z.object({
|
|
1607
|
+
altText: import_zod26.z.string().nullable(),
|
|
1608
|
+
description: import_zod26.z.string().nullable(),
|
|
1609
|
+
id: import_zod26.z.uuid(),
|
|
1610
|
+
imagePlacement: import_zod26.z.enum(["top", "right", "bottom", "left"]),
|
|
1611
|
+
imageSize: import_zod26.z.number(),
|
|
1612
|
+
imageUrl: import_zod26.z.url(),
|
|
1613
|
+
textAlignment: import_zod26.z.enum(["left", "center", "right"]),
|
|
1603
1614
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
1604
|
-
textSize:
|
|
1615
|
+
textSize: import_zod26.z.enum(inlineTextSizeNames)
|
|
1605
1616
|
})
|
|
1606
1617
|
),
|
|
1607
|
-
|
|
1618
|
+
import_zod26.z.strictObject({}).transform(() => [])
|
|
1608
1619
|
]).optional(),
|
|
1609
|
-
imageLayout:
|
|
1610
|
-
language:
|
|
1611
|
-
description:
|
|
1612
|
-
superTitle:
|
|
1613
|
-
title:
|
|
1620
|
+
imageLayout: import_zod26.z.enum(["row", "column"]).optional(),
|
|
1621
|
+
language: import_zod26.z.object({
|
|
1622
|
+
description: import_zod26.z.string(),
|
|
1623
|
+
superTitle: import_zod26.z.string(),
|
|
1624
|
+
title: import_zod26.z.string()
|
|
1614
1625
|
}),
|
|
1615
|
-
previewMode:
|
|
1616
|
-
type:
|
|
1617
|
-
version:
|
|
1626
|
+
previewMode: import_zod26.z.boolean(),
|
|
1627
|
+
type: import_zod26.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
1628
|
+
version: import_zod26.z.literal(1)
|
|
1618
1629
|
});
|
|
1619
|
-
var ContentBlock =
|
|
1630
|
+
var ContentBlock = import_zod26.z.discriminatedUnion("version", [
|
|
1620
1631
|
ContentBlockV1,
|
|
1621
1632
|
CABRootSection.extend({
|
|
1622
|
-
type:
|
|
1633
|
+
type: import_zod26.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
1623
1634
|
})
|
|
1624
1635
|
]);
|
|
1625
1636
|
|
|
1626
1637
|
// src/schema/widgets/giftWithPurchase.ts
|
|
1627
|
-
var
|
|
1628
|
-
var GiftWithPurchase =
|
|
1629
|
-
type:
|
|
1638
|
+
var import_zod27 = require("zod");
|
|
1639
|
+
var GiftWithPurchase = import_zod27.z.looseObject({
|
|
1640
|
+
type: import_zod27.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
1630
1641
|
});
|
|
1631
1642
|
|
|
1632
1643
|
// src/schema/widgets/lineItemEditor.ts
|
|
1633
|
-
var
|
|
1634
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
1635
|
-
downgradeToOneTimeLabel:
|
|
1644
|
+
var import_zod28 = require("zod");
|
|
1645
|
+
var LineItemEditorSwitchLanguageV1 = import_zod28.z.object({
|
|
1646
|
+
downgradeToOneTimeLabel: import_zod28.z.string().optional(),
|
|
1636
1647
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
1637
|
-
subscriptionOptionLabel:
|
|
1638
|
-
upgradeToSubscriptionLabel:
|
|
1639
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
1648
|
+
subscriptionOptionLabel: import_zod28.z.string().optional(),
|
|
1649
|
+
upgradeToSubscriptionLabel: import_zod28.z.string().optional(),
|
|
1650
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod28.z.string().optional()
|
|
1640
1651
|
});
|
|
1641
|
-
var LineItemEditorV1 =
|
|
1652
|
+
var LineItemEditorV1 = import_zod28.z.object({
|
|
1642
1653
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
1643
|
-
button:
|
|
1644
|
-
previewMode:
|
|
1645
|
-
switchToSubscription:
|
|
1646
|
-
disableDowngrade:
|
|
1654
|
+
button: import_zod28.z.object({ kind: import_zod28.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
1655
|
+
previewMode: import_zod28.z.boolean().optional(),
|
|
1656
|
+
switchToSubscription: import_zod28.z.object({
|
|
1657
|
+
disableDowngrade: import_zod28.z.boolean().optional(),
|
|
1647
1658
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
1648
1659
|
}).optional(),
|
|
1649
|
-
switchToSubscriptionEnabled:
|
|
1650
|
-
tracking:
|
|
1651
|
-
enableAttribution:
|
|
1652
|
-
enableSource:
|
|
1653
|
-
enableWidget:
|
|
1660
|
+
switchToSubscriptionEnabled: import_zod28.z.boolean().optional(),
|
|
1661
|
+
tracking: import_zod28.z.object({
|
|
1662
|
+
enableAttribution: import_zod28.z.boolean().optional(),
|
|
1663
|
+
enableSource: import_zod28.z.boolean().optional(),
|
|
1664
|
+
enableWidget: import_zod28.z.boolean().optional()
|
|
1654
1665
|
}).optional(),
|
|
1655
|
-
type:
|
|
1656
|
-
version:
|
|
1666
|
+
type: import_zod28.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
1667
|
+
version: import_zod28.z.literal(1)
|
|
1657
1668
|
});
|
|
1658
|
-
var LineItemEditor =
|
|
1669
|
+
var LineItemEditor = import_zod28.z.discriminatedUnion("version", [
|
|
1659
1670
|
LineItemEditorV1,
|
|
1660
1671
|
CABRootSection.extend({
|
|
1661
|
-
type:
|
|
1672
|
+
type: import_zod28.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
1662
1673
|
})
|
|
1663
1674
|
]);
|
|
1664
1675
|
|
|
1665
1676
|
// src/schema/widgets/progressBar.ts
|
|
1666
|
-
var
|
|
1667
|
-
var ProgressBar =
|
|
1668
|
-
type:
|
|
1677
|
+
var import_zod29 = require("zod");
|
|
1678
|
+
var ProgressBar = import_zod29.z.looseObject({
|
|
1679
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
1669
1680
|
});
|
|
1670
1681
|
|
|
1671
1682
|
// src/schema/widgets/rebuyButton.ts
|
|
1672
|
-
var
|
|
1673
|
-
var RebuyButtonV1 =
|
|
1674
|
-
type:
|
|
1675
|
-
version:
|
|
1683
|
+
var import_zod30 = require("zod");
|
|
1684
|
+
var RebuyButtonV1 = import_zod30.z.looseObject({
|
|
1685
|
+
type: import_zod30.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
1686
|
+
version: import_zod30.z.literal(1)
|
|
1676
1687
|
});
|
|
1677
|
-
var RebuyButton =
|
|
1688
|
+
var RebuyButton = import_zod30.z.discriminatedUnion("version", [
|
|
1678
1689
|
RebuyButtonV1,
|
|
1679
1690
|
CABRootSection.extend({
|
|
1680
|
-
type:
|
|
1691
|
+
type: import_zod30.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
1681
1692
|
})
|
|
1682
1693
|
]);
|
|
1683
1694
|
|
|
1684
1695
|
// src/schema/widgets/rebuyMonetize.ts
|
|
1685
|
-
var
|
|
1686
|
-
var RebuyMonetize =
|
|
1687
|
-
type:
|
|
1696
|
+
var import_zod31 = require("zod");
|
|
1697
|
+
var RebuyMonetize = import_zod31.z.looseObject({
|
|
1698
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
1688
1699
|
});
|
|
1689
|
-
var RebuyMonetizeV1 =
|
|
1690
|
-
name:
|
|
1691
|
-
previewMode:
|
|
1700
|
+
var RebuyMonetizeV1 = import_zod31.z.object({
|
|
1701
|
+
name: import_zod31.z.string().nullable().optional(),
|
|
1702
|
+
previewMode: import_zod31.z.boolean().optional(),
|
|
1692
1703
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
1693
|
-
privacyPolicyUrl:
|
|
1704
|
+
privacyPolicyUrl: import_zod31.z.string().nullable().optional(),
|
|
1694
1705
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
1695
|
-
subVertical:
|
|
1696
|
-
tracking:
|
|
1697
|
-
enableAttribution:
|
|
1698
|
-
enableSource:
|
|
1699
|
-
enableWidget:
|
|
1706
|
+
subVertical: import_zod31.z.string().nullable().optional(),
|
|
1707
|
+
tracking: import_zod31.z.object({
|
|
1708
|
+
enableAttribution: import_zod31.z.boolean().optional(),
|
|
1709
|
+
enableSource: import_zod31.z.boolean().optional(),
|
|
1710
|
+
enableWidget: import_zod31.z.boolean().optional()
|
|
1700
1711
|
}).optional(),
|
|
1701
|
-
type:
|
|
1702
|
-
version:
|
|
1712
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
1713
|
+
version: import_zod31.z.literal(1),
|
|
1703
1714
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
1704
|
-
vertical:
|
|
1715
|
+
vertical: import_zod31.z.string().nullable().optional()
|
|
1705
1716
|
});
|
|
1706
1717
|
|
|
1707
1718
|
// src/schema/widgetData.ts
|
|
@@ -1715,7 +1726,7 @@ var extensionWidgetTypes = [
|
|
|
1715
1726
|
WidgetType.ui_extension_line_item_editor,
|
|
1716
1727
|
WidgetType.ui_extension_progress_bar
|
|
1717
1728
|
];
|
|
1718
|
-
var WidgetData =
|
|
1729
|
+
var WidgetData = import_zod32.z.discriminatedUnion("type", [
|
|
1719
1730
|
ABTestingPlaceholder,
|
|
1720
1731
|
CheckoutExtension,
|
|
1721
1732
|
ContentBlock,
|