@brytdesigns/shopify-ajax-cart-api 1.0.3 → 1.0.5

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/esm/index.js CHANGED
@@ -935,6 +935,15 @@ var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false
935
935
  var make3 = (...elements) => elements;
936
936
 
937
937
  // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Record.js
938
+ var fromEntries = Object.fromEntries;
939
+ var collect = /* @__PURE__ */ dual(2, (self, f) => {
940
+ const out = [];
941
+ for (const key of keys(self)) {
942
+ out.push(f(key, self[key]));
943
+ }
944
+ return out;
945
+ });
946
+ var toEntries = /* @__PURE__ */ collect((key, value2) => [key, value2]);
938
947
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
939
948
  const out = {
940
949
  ...self
@@ -14766,316 +14775,46 @@ var filterLevelOrNever = (level, effect3) => gen2(function* () {
14766
14775
  });
14767
14776
  var makeNamespacedLogSpan = (prefix) => (label) => withLogSpan2(`${prefix}:${label}`);
14768
14777
 
14769
- // src/effect/schema.ts
14770
- var BaseAttributes = Record({
14771
- key: String$,
14772
- value: Union2(
14773
- Null,
14774
- String$,
14775
- Boolean$,
14776
- Number$
14777
- )
14778
- });
14779
- var Attributes = BaseAttributes;
14780
- var DiscountApplication = Struct({
14781
- target_selection: Literal2("all", "entitled", "explicit"),
14782
- target_type: Literal2("line_item", "shipping_line"),
14783
- title: NonEmptyString,
14784
- total_allocated_amount: Number$,
14785
- type: Literal2("", "automatic", "discount_code", "manual", "script"),
14786
- value: Union2(Number$, NumberFromString),
14787
- value_type: Literal2("fixed_amount", "percentage"),
14788
- description: NullOr(String$)
14789
- });
14790
- var Discount = Struct({
14791
- amount: Number$,
14792
- title: String$
14793
- });
14794
- var CurrencyCode = String$;
14795
- var Image = Struct({
14796
- aspect_ratio: Number$,
14797
- alt: String$,
14798
- height: Number$,
14799
- url: String$,
14800
- width: Number$
14801
- });
14802
- var OptionWithValue = Struct({
14803
- name: String$,
14804
- value: String$
14805
- });
14806
- var QuantityRule = Struct({
14807
- min: Number$,
14808
- max: NullOr(Number$),
14809
- increment: Number$
14810
- });
14811
- var SellingPlanAllocationPriceAdjustment = Struct({
14812
- position: Number$,
14813
- price: Number$
14814
- });
14815
- var SellingPlanPriceAdjustment = Struct({
14816
- order_count: NullOr(Number$),
14817
- position: Number$,
14818
- value: Number$,
14819
- value_type: Literal2("percentage", "fixed_amount", "price")
14820
- });
14821
- var SellingPlanOption = Struct({
14822
- name: String$,
14823
- position: Number$,
14824
- value: String$
14825
- });
14826
- var SellingPlan = Struct({
14827
- id: Resource_exports.ID,
14828
- name: String$,
14829
- description: NullOr(String$),
14830
- options: Array$(SellingPlanOption),
14831
- recurring_deliveries: optionalWith(Boolean$, {
14832
- default: () => false
14833
- }),
14834
- fixed_selling_plan: optionalWith(Boolean$, {
14835
- default: () => false
14836
- }),
14837
- price_adjustments: Array$(SellingPlanPriceAdjustment)
14838
- });
14839
- var SellingPlanAllocation = Struct({
14840
- price_adjustments: Array$(SellingPlanAllocationPriceAdjustment),
14841
- price: Number$,
14842
- compare_at_price: Number$,
14843
- per_delivery_price: Number$,
14844
- selling_plan: SellingPlan
14845
- });
14846
- var LineLevelDiscountAllocation = Struct({
14847
- amount: Number$,
14848
- discount_application: DiscountApplication
14849
- });
14850
- var CartLevelDiscountApplicationUpdate = transform2(
14851
- Struct({
14852
- discount_application: DiscountApplication
14853
- }),
14854
- DiscountApplication,
14855
- {
14856
- decode: (application) => application.discount_application,
14857
- encode: (discountApplication) => ({
14858
- discount_application: discountApplication
14859
- }),
14860
- strict: false
14861
- }
14862
- );
14863
- var CartLevelDiscountApplication = Union2(
14864
- DiscountApplication,
14865
- CartLevelDiscountApplicationUpdate
14866
- );
14867
- var UnitPriceMeasurement = Struct({
14868
- measured_type: Literal2("volume", "weight", "dimension"),
14869
- quantity_unit: String$,
14870
- quantity_value: Number$,
14871
- reference_unit: String$,
14872
- reference_value: Number$
14873
- });
14874
- var LineItem = Struct({
14875
- id: Resource_exports.ID,
14876
- properties: optionalWith(NullOr(Attributes), {
14877
- default: () => ({})
14878
- }),
14879
- quantity: Number$,
14880
- variant_id: Resource_exports.ID,
14881
- key: String$,
14882
- title: String$,
14883
- price: Number$,
14884
- original_price: Number$,
14885
- discounted_price: Number$,
14886
- line_price: Number$,
14887
- original_line_price: Number$,
14888
- total_discount: Number$,
14889
- discounts: optionalWith(Array$(Discount), { default: () => [] }),
14890
- sku: NullOr(String$),
14891
- grams: Number$,
14892
- vendor: String$,
14893
- taxable: Boolean$,
14894
- product_id: Resource_exports.ID,
14895
- product_has_only_default_variant: Boolean$,
14896
- gift_card: Boolean$,
14897
- final_line_price: Number$,
14898
- final_price: Number$,
14899
- url: String$,
14900
- featured_image: optional(Image),
14901
- image: String$,
14902
- handle: String$,
14903
- requires_shipping: Boolean$,
14904
- product_type: String$,
14905
- product_title: String$,
14906
- product_description: String$,
14907
- variant_title: NullOr(String$),
14908
- variant_options: Array$(String$),
14909
- options_with_values: Array$(OptionWithValue),
14910
- line_level_discount_allocations: Array$(LineLevelDiscountAllocation),
14911
- line_level_total_discount: Number$,
14912
- quantity_rule: optional(QuantityRule),
14913
- has_components: optionalWith(Boolean$, { default: () => false }),
14914
- unit_price: optional(Number$),
14915
- unit_price_measurement: optional(UnitPriceMeasurement),
14916
- selling_plan_allocation: optionalWith(
14917
- NullOr(SellingPlanAllocation),
14918
- { default: () => null }
14919
- )
14920
- });
14921
- var Cart = Struct({
14922
- token: String$,
14923
- note: NullOr(String$),
14924
- attributes: optionalWith(Attributes, {
14925
- default: () => ({})
14926
- }),
14927
- discounts: optionalWith(Array$(Discount), { default: () => [] }),
14928
- discount_codes: optionalWith(
14929
- Array$(
14930
- Struct({ code: String$, applicable: Boolean$ })
14931
- ),
14932
- { default: () => [] }
14933
- ),
14934
- original_total_price: Number$,
14935
- total_price: Number$,
14936
- total_discount: Number$,
14937
- total_weight: Number$,
14938
- item_count: Number$,
14939
- items: Array$(LineItem),
14940
- requires_shipping: Boolean$,
14941
- currency: CurrencyCode,
14942
- items_subtotal_price: Number$,
14943
- cart_level_discount_applications: Array$(CartLevelDiscountApplication)
14944
- });
14945
- var AddItemInput = Struct({
14946
- id: Resource_exports.ID,
14947
- quantity: optionalWith(Number$, { default: () => 1 }),
14948
- properties: optionalWith(BaseAttributes, { default: () => ({}) }),
14949
- selling_plan: optional(Resource_exports.ID)
14950
- });
14951
- var BaseInput = extend3(Ajax_exports.Sections.Input);
14952
- var CartAddInput = Struct({
14953
- items: Array$(AddItemInput)
14954
- }).pipe(BaseInput);
14955
- var CartAddOutput = Struct({
14956
- items: Array$(LineItem)
14957
- });
14958
- var UpdateItemRecordInput = Record({
14959
- key: String$,
14960
- value: Number$
14961
- });
14962
- var DiscountCodeInput = Array$(String$);
14963
- var DiscountCodeTransformed = String$;
14964
- var CartUpdateInput = Struct({
14965
- updates: optional(
14966
- Union2(UpdateItemRecordInput, Array$(Number$))
14967
- ),
14968
- note: optional(NullOr(String$)),
14969
- attributes: optional(Attributes),
14970
- discount: optional(
14971
- transform2(DiscountCodeInput, DiscountCodeTransformed, {
14972
- decode: (input) => input.join(","),
14973
- encode: (input) => input.split(",")
14974
- })
14975
- )
14976
- }).pipe(BaseInput);
14977
- var ItemAddedChangelog = Struct({
14978
- variant_id: Number$,
14979
- quantity: Number$
14980
- });
14981
- var CartUpdateOutput = Struct({
14982
- ...Cart.fields,
14983
- items_changelog: Struct({
14984
- added: Array$(ItemAddedChangelog)
14985
- })
14986
- });
14987
- var CartChangeItemOptionalInput = Struct({
14988
- quantity: optional(Number$),
14989
- properties: optional(
14990
- Record({
14991
- key: String$,
14992
- value: NullOr(String$)
14993
- })
14994
- ),
14995
- selling_plan: optional(NullOr(Resource_exports.ID))
14996
- }).pipe(BaseInput);
14997
- var LineItemChange = Struct({
14998
- product_id: Number$,
14999
- variant_id: Number$,
15000
- id: String$,
15001
- image: String$,
15002
- price: String$,
15003
- presentment_price: Number$,
15004
- quantity: Number$,
15005
- title: String$,
15006
- product_title: String$,
15007
- variant_title: String$,
15008
- vendor: String$,
15009
- product_type: String$,
15010
- sku: String$,
15011
- url: String$,
15012
- untranslated_product_title: String$,
15013
- untranslated_variant_title: String$,
15014
- view_key: String$
15015
- });
15016
- var CartChangeInput = Union2(
15017
- extend3(CartChangeItemOptionalInput)(
15018
- Struct({
15019
- id: String$
15020
- })
15021
- ),
15022
- extend3(CartChangeItemOptionalInput)(
15023
- Struct({
15024
- line: Number$
15025
- })
15026
- )
15027
- );
15028
- var CartChangeOutput = Struct({
15029
- ...Cart.fields,
15030
- items_added: Array$(LineItemChange),
15031
- items_removed: Array$(LineItemChange)
15032
- });
15033
- var CartClearInput = Ajax_exports.Sections.Input;
15034
- var CartGetInput = Ajax_exports.Sections.Input;
15035
- mutable2(
15036
- Array$(NonEmptyString)
15037
- );
15038
-
15039
- // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/queue.js
15040
- var EnqueueSymbolKey = "effect/QueueEnqueue";
15041
- var EnqueueTypeId = /* @__PURE__ */ Symbol.for(EnqueueSymbolKey);
15042
- var DequeueSymbolKey = "effect/QueueDequeue";
15043
- var DequeueTypeId = /* @__PURE__ */ Symbol.for(DequeueSymbolKey);
15044
- var QueueStrategySymbolKey = "effect/QueueStrategy";
15045
- var QueueStrategyTypeId = /* @__PURE__ */ Symbol.for(QueueStrategySymbolKey);
15046
- var BackingQueueSymbolKey = "effect/BackingQueue";
15047
- var BackingQueueTypeId = /* @__PURE__ */ Symbol.for(BackingQueueSymbolKey);
15048
- var queueStrategyVariance = {
15049
- /* c8 ignore next */
15050
- _A: (_) => _
15051
- };
15052
- var backingQueueVariance = {
15053
- /* c8 ignore next */
15054
- _A: (_) => _
15055
- };
15056
- var enqueueVariance = {
15057
- /* c8 ignore next */
15058
- _In: (_) => _
15059
- };
15060
- var dequeueVariance = {
15061
- /* c8 ignore next */
15062
- _Out: (_) => _
15063
- };
15064
- var QueueImpl = class extends Class2 {
15065
- queue;
15066
- takers;
15067
- shutdownHook;
15068
- shutdownFlag;
15069
- strategy;
15070
- [EnqueueTypeId] = enqueueVariance;
15071
- [DequeueTypeId] = dequeueVariance;
15072
- constructor(queue, takers, shutdownHook, shutdownFlag, strategy) {
15073
- super();
15074
- this.queue = queue;
15075
- this.takers = takers;
15076
- this.shutdownHook = shutdownHook;
15077
- this.shutdownFlag = shutdownFlag;
15078
- this.strategy = strategy;
14778
+ // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/queue.js
14779
+ var EnqueueSymbolKey = "effect/QueueEnqueue";
14780
+ var EnqueueTypeId = /* @__PURE__ */ Symbol.for(EnqueueSymbolKey);
14781
+ var DequeueSymbolKey = "effect/QueueDequeue";
14782
+ var DequeueTypeId = /* @__PURE__ */ Symbol.for(DequeueSymbolKey);
14783
+ var QueueStrategySymbolKey = "effect/QueueStrategy";
14784
+ var QueueStrategyTypeId = /* @__PURE__ */ Symbol.for(QueueStrategySymbolKey);
14785
+ var BackingQueueSymbolKey = "effect/BackingQueue";
14786
+ var BackingQueueTypeId = /* @__PURE__ */ Symbol.for(BackingQueueSymbolKey);
14787
+ var queueStrategyVariance = {
14788
+ /* c8 ignore next */
14789
+ _A: (_) => _
14790
+ };
14791
+ var backingQueueVariance = {
14792
+ /* c8 ignore next */
14793
+ _A: (_) => _
14794
+ };
14795
+ var enqueueVariance = {
14796
+ /* c8 ignore next */
14797
+ _In: (_) => _
14798
+ };
14799
+ var dequeueVariance = {
14800
+ /* c8 ignore next */
14801
+ _Out: (_) => _
14802
+ };
14803
+ var QueueImpl = class extends Class2 {
14804
+ queue;
14805
+ takers;
14806
+ shutdownHook;
14807
+ shutdownFlag;
14808
+ strategy;
14809
+ [EnqueueTypeId] = enqueueVariance;
14810
+ [DequeueTypeId] = dequeueVariance;
14811
+ constructor(queue, takers, shutdownHook, shutdownFlag, strategy) {
14812
+ super();
14813
+ this.queue = queue;
14814
+ this.takers = takers;
14815
+ this.shutdownHook = shutdownHook;
14816
+ this.shutdownFlag = shutdownFlag;
14817
+ this.strategy = strategy;
15079
14818
  }
15080
14819
  pipe() {
15081
14820
  return pipeArguments(this, arguments);
@@ -16927,9 +16666,6 @@ var ChannelException = (error) => ({
16927
16666
  });
16928
16667
  var isChannelException = (u) => hasProperty(u, ChannelExceptionTypeId);
16929
16668
 
16930
- // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Runtime.js
16931
- var runFork3 = unsafeFork3;
16932
-
16933
16669
  // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/sink.js
16934
16670
  var SinkTypeId2 = /* @__PURE__ */ Symbol.for("effect/Sink");
16935
16671
  var sinkVariance2 = {
@@ -16965,6 +16701,9 @@ var forEachChunk = (f) => {
16965
16701
  var fromEffect6 = (effect3) => new SinkImpl(fromEffect4(effect3));
16966
16702
  var toChannel = (self) => isEffect2(self) ? toChannel(fromEffect6(self)) : self.channel;
16967
16703
 
16704
+ // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Runtime.js
16705
+ var runFork3 = unsafeFork3;
16706
+
16968
16707
  // ../../../node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/stream.js
16969
16708
  var StreamSymbolKey = "effect/Stream";
16970
16709
  var StreamTypeId2 = /* @__PURE__ */ Symbol.for(StreamSymbolKey);
@@ -17099,6 +16838,315 @@ var fromReadableStream2 = fromReadableStream;
17099
16838
  var suspend7 = suspend6;
17100
16839
  var toReadableStreamEffect2 = toReadableStreamEffect;
17101
16840
 
16841
+ // src/effect/schema.ts
16842
+ var BaseAttributeValue = Union2(
16843
+ Null,
16844
+ String$,
16845
+ Boolean$,
16846
+ Number$
16847
+ );
16848
+ var BaseAttributes = Record({
16849
+ key: String$,
16850
+ value: BaseAttributeValue
16851
+ });
16852
+ var BaseAttributesArray = transform2(
16853
+ BaseAttributes,
16854
+ Array$(
16855
+ Struct({ key: String$, value: BaseAttributeValue })
16856
+ ),
16857
+ {
16858
+ decode: (record2) => toEntries(record2).map(([key, value2]) => ({ key, value: value2 })),
16859
+ encode: (array3) => fromEntries(
16860
+ pipe(
16861
+ array3,
16862
+ map4(({ key, value: value2 }) => [key, value2])
16863
+ )
16864
+ )
16865
+ }
16866
+ );
16867
+ var Attributes = transform2(
16868
+ BaseAttributes,
16869
+ Struct({
16870
+ array: BaseAttributesArray,
16871
+ record: BaseAttributes
16872
+ }),
16873
+ {
16874
+ decode: (attributes) => ({
16875
+ array: attributes,
16876
+ record: attributes
16877
+ }),
16878
+ encode: (attributes) => ({
16879
+ ...attributes.record
16880
+ })
16881
+ }
16882
+ );
16883
+ var DiscountApplication = Struct({
16884
+ target_selection: Literal2("all", "entitled", "explicit"),
16885
+ target_type: Literal2("line_item", "shipping_line"),
16886
+ title: NonEmptyString,
16887
+ total_allocated_amount: Number$,
16888
+ type: Literal2("", "automatic", "discount_code", "manual", "script"),
16889
+ value: Union2(Number$, NumberFromString),
16890
+ value_type: Literal2("fixed_amount", "percentage"),
16891
+ description: NullOr(String$)
16892
+ });
16893
+ var Discount = Struct({
16894
+ amount: Number$,
16895
+ title: String$
16896
+ });
16897
+ var CurrencyCode = String$;
16898
+ var Image = Struct({
16899
+ aspect_ratio: Number$,
16900
+ alt: String$,
16901
+ height: Number$,
16902
+ url: String$,
16903
+ width: Number$
16904
+ });
16905
+ var OptionWithValue = Struct({
16906
+ name: String$,
16907
+ value: String$
16908
+ });
16909
+ var QuantityRule = Struct({
16910
+ min: Number$,
16911
+ max: NullOr(Number$),
16912
+ increment: Number$
16913
+ });
16914
+ var SellingPlanAllocationPriceAdjustment = Struct({
16915
+ position: Number$,
16916
+ price: Number$
16917
+ });
16918
+ var SellingPlanPriceAdjustment = Struct({
16919
+ order_count: NullOr(Number$),
16920
+ position: Number$,
16921
+ value: Number$,
16922
+ value_type: Literal2("percentage", "fixed_amount", "price")
16923
+ });
16924
+ var SellingPlanOption = Struct({
16925
+ name: String$,
16926
+ position: Number$,
16927
+ value: String$
16928
+ });
16929
+ var SellingPlan = Struct({
16930
+ id: Resource_exports.ID,
16931
+ name: String$,
16932
+ description: NullOr(String$),
16933
+ options: Array$(SellingPlanOption),
16934
+ recurring_deliveries: optionalWith(Boolean$, {
16935
+ default: () => false
16936
+ }),
16937
+ fixed_selling_plan: optionalWith(Boolean$, {
16938
+ default: () => false
16939
+ }),
16940
+ price_adjustments: Array$(SellingPlanPriceAdjustment)
16941
+ });
16942
+ var SellingPlanAllocation = Struct({
16943
+ price_adjustments: Array$(SellingPlanAllocationPriceAdjustment),
16944
+ price: Number$,
16945
+ compare_at_price: Number$,
16946
+ per_delivery_price: Number$,
16947
+ selling_plan: SellingPlan
16948
+ });
16949
+ var LineLevelDiscountAllocation = Struct({
16950
+ amount: Number$,
16951
+ discount_application: DiscountApplication
16952
+ });
16953
+ var CartLevelDiscountApplicationUpdate = transform2(
16954
+ Struct({
16955
+ discount_application: DiscountApplication
16956
+ }),
16957
+ DiscountApplication,
16958
+ {
16959
+ decode: (application) => application.discount_application,
16960
+ encode: (discountApplication) => ({
16961
+ discount_application: discountApplication
16962
+ }),
16963
+ strict: false
16964
+ }
16965
+ );
16966
+ var CartLevelDiscountApplication = Union2(
16967
+ DiscountApplication,
16968
+ CartLevelDiscountApplicationUpdate
16969
+ );
16970
+ var UnitPriceMeasurement = Struct({
16971
+ measured_type: Literal2("volume", "weight", "dimension"),
16972
+ quantity_unit: String$,
16973
+ quantity_value: Number$,
16974
+ reference_unit: String$,
16975
+ reference_value: Number$
16976
+ });
16977
+ var LineItem = Struct({
16978
+ id: Resource_exports.ID,
16979
+ properties: optionalWith(Attributes, {
16980
+ default: () => ({
16981
+ array: [],
16982
+ record: {}
16983
+ }),
16984
+ nullable: true
16985
+ }),
16986
+ quantity: Number$,
16987
+ variant_id: Resource_exports.ID,
16988
+ key: String$,
16989
+ title: String$,
16990
+ price: Number$,
16991
+ original_price: Number$,
16992
+ discounted_price: Number$,
16993
+ line_price: Number$,
16994
+ original_line_price: Number$,
16995
+ total_discount: Number$,
16996
+ discounts: optionalWith(Array$(Discount), { default: () => [] }),
16997
+ sku: NullOr(String$),
16998
+ grams: Number$,
16999
+ vendor: String$,
17000
+ taxable: Boolean$,
17001
+ product_id: Resource_exports.ID,
17002
+ product_has_only_default_variant: Boolean$,
17003
+ gift_card: Boolean$,
17004
+ final_line_price: Number$,
17005
+ final_price: Number$,
17006
+ url: String$,
17007
+ featured_image: optional(Image),
17008
+ image: String$,
17009
+ handle: String$,
17010
+ requires_shipping: Boolean$,
17011
+ product_type: String$,
17012
+ product_title: String$,
17013
+ product_description: String$,
17014
+ variant_title: NullOr(String$),
17015
+ variant_options: Array$(String$),
17016
+ options_with_values: Array$(OptionWithValue),
17017
+ line_level_discount_allocations: Array$(LineLevelDiscountAllocation),
17018
+ line_level_total_discount: Number$,
17019
+ quantity_rule: optional(QuantityRule),
17020
+ has_components: optionalWith(Boolean$, { default: () => false }),
17021
+ unit_price: optional(Number$),
17022
+ unit_price_measurement: optional(UnitPriceMeasurement),
17023
+ selling_plan_allocation: optionalWith(
17024
+ NullOr(SellingPlanAllocation),
17025
+ { default: () => null }
17026
+ )
17027
+ });
17028
+ var Cart = Struct({
17029
+ token: String$,
17030
+ note: NullOr(String$),
17031
+ attributes: optionalWith(Attributes, {
17032
+ default: () => ({
17033
+ record: {},
17034
+ array: []
17035
+ }),
17036
+ nullable: true
17037
+ }),
17038
+ discounts: optionalWith(Array$(Discount), { default: () => [] }),
17039
+ discount_codes: optionalWith(
17040
+ Array$(
17041
+ Struct({ code: String$, applicable: Boolean$ })
17042
+ ),
17043
+ { default: () => [] }
17044
+ ),
17045
+ original_total_price: Number$,
17046
+ total_price: Number$,
17047
+ total_discount: Number$,
17048
+ total_weight: Number$,
17049
+ item_count: Number$,
17050
+ items: Array$(LineItem),
17051
+ requires_shipping: Boolean$,
17052
+ currency: CurrencyCode,
17053
+ items_subtotal_price: Number$,
17054
+ cart_level_discount_applications: Array$(CartLevelDiscountApplication)
17055
+ });
17056
+ var AddItemInput = Struct({
17057
+ id: Resource_exports.ID,
17058
+ quantity: optionalWith(Number$, { default: () => 1 }),
17059
+ properties: optionalWith(BaseAttributes, { default: () => ({}) }),
17060
+ selling_plan: optional(Resource_exports.ID)
17061
+ });
17062
+ var BaseInput = extend3(Ajax_exports.Sections.Input);
17063
+ var CartAddInput = Struct({
17064
+ items: Array$(AddItemInput)
17065
+ }).pipe(BaseInput);
17066
+ var CartAddOutput = Struct({
17067
+ items: Array$(LineItem)
17068
+ });
17069
+ var UpdateItemRecordInput = Record({
17070
+ key: String$,
17071
+ value: Number$
17072
+ });
17073
+ var DiscountCodeInput = Array$(String$);
17074
+ var DiscountCodeTransformed = String$;
17075
+ var CartUpdateInput = Struct({
17076
+ updates: optional(
17077
+ Union2(UpdateItemRecordInput, Array$(Number$))
17078
+ ),
17079
+ note: optional(NullOr(String$)),
17080
+ attributes: optional(Attributes),
17081
+ discount: optional(
17082
+ transform2(DiscountCodeInput, DiscountCodeTransformed, {
17083
+ decode: (input) => input.join(","),
17084
+ encode: (input) => input.split(",")
17085
+ })
17086
+ )
17087
+ }).pipe(BaseInput);
17088
+ var ItemAddedChangelog = Struct({
17089
+ variant_id: Number$,
17090
+ quantity: Number$
17091
+ });
17092
+ var CartUpdateOutput = Struct({
17093
+ ...Cart.fields,
17094
+ items_changelog: Struct({
17095
+ added: Array$(ItemAddedChangelog)
17096
+ })
17097
+ });
17098
+ var CartChangeItemOptionalInput = Struct({
17099
+ quantity: optional(Number$),
17100
+ properties: optional(
17101
+ Record({
17102
+ key: String$,
17103
+ value: NullOr(String$)
17104
+ })
17105
+ ),
17106
+ selling_plan: optional(NullOr(Resource_exports.ID))
17107
+ }).pipe(BaseInput);
17108
+ var LineItemChange = Struct({
17109
+ product_id: Number$,
17110
+ variant_id: Number$,
17111
+ id: String$,
17112
+ image: String$,
17113
+ price: String$,
17114
+ presentment_price: Number$,
17115
+ quantity: Number$,
17116
+ title: String$,
17117
+ product_title: String$,
17118
+ variant_title: String$,
17119
+ vendor: String$,
17120
+ product_type: String$,
17121
+ sku: String$,
17122
+ url: String$,
17123
+ untranslated_product_title: String$,
17124
+ untranslated_variant_title: String$,
17125
+ view_key: String$
17126
+ });
17127
+ var CartChangeInput = Union2(
17128
+ extend3(CartChangeItemOptionalInput)(
17129
+ Struct({
17130
+ id: String$
17131
+ })
17132
+ ),
17133
+ extend3(CartChangeItemOptionalInput)(
17134
+ Struct({
17135
+ line: Number$
17136
+ })
17137
+ )
17138
+ );
17139
+ var CartChangeOutput = Struct({
17140
+ ...Cart.fields,
17141
+ items_added: Array$(LineItemChange),
17142
+ items_removed: Array$(LineItemChange)
17143
+ });
17144
+ var CartClearInput = Ajax_exports.Sections.Input;
17145
+ var CartGetInput = Ajax_exports.Sections.Input;
17146
+ mutable2(
17147
+ Array$(NonEmptyString)
17148
+ );
17149
+
17102
17150
  // ../../../node_modules/.pnpm/@effect+platform@0.82.4_effect@3.15.2/node_modules/@effect/platform/dist/esm/Error.js
17103
17151
  var TypeIdError = (typeId, tag2) => {
17104
17152
  class Base3 extends Error3 {