@foxy.io/elements 1.30.0-beta.4 → 1.30.0-beta.6

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.
@@ -113,169 +113,192 @@
113
113
  "done": "Copied to clipboard"
114
114
  }
115
115
  },
116
- "dimensions": "Dimensions",
117
- "subscriptions": "Subscriptions",
118
- "discount": "Discount",
119
- "name": {
120
- "label": "Name",
121
- "helper_text": "Public name of this item.",
122
- "placeholder": "13' Laptop Case",
123
- "v8n_required": "Name is required",
124
- "v8n_too_long": "Name mustn't exceed 255 characters"
125
- },
126
- "price": {
127
- "label": "Price",
128
- "helper_text": "Base price before option modifiers.",
129
- "placeholder": "25",
130
- "v8n_required": "Price is required",
131
- "v8n_negative": "Price can't be negative"
132
- },
133
- "quantity": {
134
- "label": "Quantity",
135
- "helper_text": "Number of items in the cart.",
136
- "placeholder": "1 by default",
137
- "v8n_less_than_one": "Quantity must be 1 or more"
138
- },
139
- "subscription-frequency": {
140
- "label": "Subscription frequency",
141
- "day": "Day",
142
- "day_plural": "Days",
143
- "week": "Week",
144
- "week_plural": "Weeks",
145
- "month": "Month",
146
- "month_plural": "Months",
147
- "year": "Year",
148
- "year_plural": "Years",
149
- "helper_text": "This determines how often this subscription will be processed. To modify this value for an existing subscription, you must modify the subscription directly."
150
- },
151
- "subscription-start-date": {
152
- "label": "Subscription start",
153
- "helper_text": "The original date this subscription began or will begin if set in the future. To modify this value for an existing subscription, you must modify the subscription directly.",
154
- "placeholder": "01/01/2022"
155
- },
156
- "subscription-end-date": {
157
- "label": "Subscription end",
158
- "helper_text": "If set, the date this subscription will end. The subscription will not run on this day.",
159
- "placeholder": "01/01/2022"
160
- },
161
- "discount-name": {
162
- "label": "Discount name",
163
- "helper_text": "The name of the line item discount if it is included on this item.",
164
- "placeholder": "One-off 10% discount"
165
- },
166
- "discount-builder": {
167
- "tier": "Tier",
168
- "tier_by": "by",
169
- "tier_if": "if",
170
- "tier_allunits": "price of each item",
171
- "tier_incremental": "price of additional items",
172
- "tier_repeat": "price of next item",
173
- "tier_single": "order total",
174
- "tier_then": "then",
175
- "quantity": "quantity",
176
- "total": "total",
177
- "reduce": "reduce",
178
- "increase": "increase"
179
- },
180
- "expires": {
181
- "label": "Expires",
182
- "helper_text": "Date when this item will be removed from the cart (optional).",
183
- "placeholder": "01/01/2022"
184
- },
185
- "image": {
186
- "label": "Image",
187
- "helper_text": "URL of the image to display for this item in the cart and checkout.",
188
- "placeholder": "https://picsum.photos/256"
189
- },
190
- "url": {
191
- "label": "URL",
192
- "helper_text": "Full URL for the customer to view this item on the store website.",
193
- "placeholder": "https://example.com/products/123"
194
- },
195
- "quantity-min": {
196
- "label": "Min quantity",
197
- "helper_text": "Minimum quantity per cart.",
198
- "placeholder": "1"
199
- },
200
- "quantity-max": {
201
- "label": "Max quantity",
202
- "helper_text": "Maximum quantity per cart.",
203
- "placeholder": "25"
204
- },
205
- "shipto": {
206
- "label": "Shipping address",
207
- "helper_text": "Used for multiship to assign this item to a specific shipment. This value will be the address name of the shipment.",
208
- "placeholder": "Select address to ship this item to..."
209
- },
210
- "width": {
211
- "label": "Width",
212
- "helper_text": "This is currently a placeholder for future use.",
213
- "placeholder": "16"
214
- },
215
- "height": {
216
- "label": "Height",
217
- "helper_text": "This is currently a placeholder for future use.",
218
- "placeholder": "8"
219
- },
220
- "length": {
221
- "label": "Width",
222
- "helper_text": "This is currently a placeholder for future use.",
223
- "placeholder": "32"
224
- },
225
- "weight": {
226
- "label": "Weight",
227
- "helper_text": "Per-item weight, used for shipping rate requests.",
228
- "placeholder": "24"
229
- },
230
- "item-category-uri": {
231
- "label": "Item category",
232
- "dialog": {
233
- "cancel": "Cancel",
234
- "close": "Close",
235
- "header": "Select an item category",
236
- "selection": {
237
- "label": "Item categories",
238
- "helper_text": "Select an item category to use with this item.",
239
- "search": "Search",
240
- "clear": "Clear",
241
- "pagination": {
242
- "search_button_text": "Search",
243
- "first": "First",
244
- "last": "Last",
245
- "next": "Next",
246
- "pagination": "{{from}}-{{to}} out of {{total}}",
247
- "previous": "Previous",
248
- "card": {
249
- "spinner": {
250
- "loading_busy": "Loading",
251
- "loading_empty": "No item categories found",
252
- "loading_error": "Unknown error"
116
+ "general": {
117
+ "label": "",
118
+ "helper_text": "",
119
+ "name": {
120
+ "label": "Name",
121
+ "helper_text": "",
122
+ "placeholder": "Required",
123
+ "v8n_required": "Name is required",
124
+ "v8n_too_long": "Name mustn't exceed 255 characters"
125
+ },
126
+ "price": {
127
+ "label": "Price",
128
+ "helper_text": "",
129
+ "placeholder": "Required",
130
+ "v8n_required": "Price is required",
131
+ "v8n_negative": "Price can't be negative"
132
+ },
133
+ "quantity": {
134
+ "label": "Quantity",
135
+ "helper_text": "",
136
+ "placeholder": "1",
137
+ "v8n_less_than_one": "Quantity must be 1 or more"
138
+ },
139
+ "item-category-uri": {
140
+ "label": "Item category",
141
+ "helper_text": "",
142
+ "placeholder": "Select",
143
+ "value": "{{ resource.name }}",
144
+ "dialog": {
145
+ "cancel": "Cancel",
146
+ "close": "Close",
147
+ "header": "Select an item category",
148
+ "selection": {
149
+ "label": "Item categories",
150
+ "helper_text": "Select an item category to use with this item.",
151
+ "search": "Search",
152
+ "clear": "Clear",
153
+ "pagination": {
154
+ "search_button_text": "Search",
155
+ "first": "First",
156
+ "last": "Last",
157
+ "next": "Next",
158
+ "pagination": "{{from}}-{{to}} out of {{total}}",
159
+ "previous": "Previous",
160
+ "card": {
161
+ "spinner": {
162
+ "loading_busy": "Loading",
163
+ "loading_empty": "No item categories found",
164
+ "loading_error": "Unknown error"
165
+ }
253
166
  }
254
167
  }
255
168
  }
169
+ },
170
+ "card": {
171
+ "spinner": {
172
+ "loading_busy": "Loading",
173
+ "loading_empty": "Not assigned – click to select",
174
+ "loading_error": "Unknown error"
175
+ }
256
176
  }
257
177
  },
258
- "card": {
259
- "spinner": {
260
- "loading_busy": "Loading",
261
- "loading_empty": "Not assigned – click to select",
262
- "loading_error": "Unknown error"
263
- }
178
+ "code": {
179
+ "label": "Code (SKU, barcode)",
180
+ "helper_text": "",
181
+ "placeholder": "Optional"
182
+ },
183
+ "parent-code": {
184
+ "label": "Parent code",
185
+ "helper_text": "",
186
+ "placeholder": "Optional"
187
+ },
188
+ "shipto": {
189
+ "label": "Shipment name",
190
+ "helper_text": "Used for multiship to assign this item to a specific shipment. This value will be the address name of the shipment.",
191
+ "placeholder": "Optional"
192
+ }
193
+ },
194
+ "subscriptions": {
195
+ "label": "Subscription",
196
+ "helper_text": "To modify these value for an existing subscription, you must modify the subscription directly.",
197
+ "subscription-frequency": {
198
+ "label": "Frequency",
199
+ "helper_text": "",
200
+ "select": "Select",
201
+ "day": "Day",
202
+ "day_plural": "Days",
203
+ "week": "Week",
204
+ "week_plural": "Weeks",
205
+ "month": "Month",
206
+ "month_plural": "Months",
207
+ "year": "Year",
208
+ "year_plural": "Years"
209
+ },
210
+ "subscription-start-date": {
211
+ "label": "Start date",
212
+ "helper_text": "",
213
+ "display_value": "{{ value, date }}",
214
+ "placeholder": "None"
215
+ },
216
+ "subscription-end-date": {
217
+ "label": "End date",
218
+ "helper_text": "",
219
+ "display_value": "{{ value, date }}",
220
+ "placeholder": "None"
221
+ }
222
+ },
223
+ "dimensions": {
224
+ "label": "Dimensions",
225
+ "helper_text": "",
226
+ "width": {
227
+ "label": "Width",
228
+ "helper_text": "",
229
+ "placeholder": "0"
230
+ },
231
+ "height": {
232
+ "label": "Height",
233
+ "helper_text": "",
234
+ "placeholder": "0"
235
+ },
236
+ "length": {
237
+ "label": "Length",
238
+ "helper_text": "",
239
+ "placeholder": "0"
264
240
  },
265
- "helper_text": "Item category associated with this item."
241
+ "weight": {
242
+ "label": "Weight",
243
+ "helper_text": "",
244
+ "placeholder": "0"
245
+ }
266
246
  },
267
- "code": {
268
- "label": "Code",
269
- "helper_text": "Unique item code such as SKU or barcode.",
270
- "placeholder": "MY-PRODUCT-001"
247
+ "meta": {
248
+ "label": "Meta",
249
+ "helper_text": "",
250
+ "url": {
251
+ "label": "URL",
252
+ "helper_text": "Full URL for the customer to view this item on the store website.",
253
+ "placeholder": "None"
254
+ },
255
+ "image": {
256
+ "label": "Image",
257
+ "helper_text": "URL of the image to display for this item in the cart and checkout.",
258
+ "placeholder": "None"
259
+ },
260
+ "quantity-max": {
261
+ "label": "Max quantity",
262
+ "helper_text": "",
263
+ "placeholder": "Unlimited"
264
+ },
265
+ "quantity-min": {
266
+ "label": "Min quantity",
267
+ "helper_text": "",
268
+ "placeholder": "1"
269
+ },
270
+ "expires": {
271
+ "label": "Expires",
272
+ "helper_text": "Date when this item will be removed from the cart.",
273
+ "display_value": "{{ value, date }}",
274
+ "placeholder": "Optional"
275
+ }
271
276
  },
272
- "parent-code": {
273
- "label": "Parent code",
274
- "helper_text": "Used if this should be a child product in a bundle.",
275
- "placeholder": "MY-BUNDLE-001"
277
+ "discount": {
278
+ "label": "Line item discount",
279
+ "helper_text": "",
280
+ "discount-name": {
281
+ "label": "Discount name",
282
+ "helper_text": "Enter a discount name to open a discount builder.",
283
+ "placeholder": "None"
284
+ },
285
+ "discount-builder": {
286
+ "tier": "Tier",
287
+ "tier_by": "by",
288
+ "tier_if": "if",
289
+ "tier_allunits": "price of each item",
290
+ "tier_incremental": "price of additional items",
291
+ "tier_repeat": "price of next item",
292
+ "tier_single": "order total",
293
+ "tier_then": "then",
294
+ "quantity": "quantity",
295
+ "total": "total",
296
+ "reduce": "reduce",
297
+ "increase": "increase"
298
+ }
276
299
  },
277
300
  "discount-details": {
278
- "title": "Discount details",
301
+ "label": "Applied discounts",
279
302
  "pagination": {
280
303
  "first": "First",
281
304
  "last": "Last",
@@ -292,7 +315,7 @@
292
315
  }
293
316
  },
294
317
  "coupon-details": {
295
- "title": "Coupon details",
318
+ "label": "Applied coupons",
296
319
  "pagination": {
297
320
  "first": "First",
298
321
  "last": "Last",
@@ -309,7 +332,7 @@
309
332
  }
310
333
  },
311
334
  "attributes": {
312
- "title": "Attributes",
335
+ "label": "Attributes",
313
336
  "delete_header": "Remove attribute?",
314
337
  "delete_message": "Please confirm that you'd like to remove this attribute from the item.",
315
338
  "delete_confirm": "Remove",
@@ -409,7 +432,7 @@
409
432
  }
410
433
  },
411
434
  "item-options": {
412
- "title": "Item options",
435
+ "label": "Item options",
413
436
  "delete_header": "Remove item option?",
414
437
  "delete_message": "Please confirm that you'd like to remove this item option from the item.",
415
438
  "delete_confirm": "Remove",
@@ -175,10 +175,9 @@ export class CartForm extends Base {
175
175
  `;
176
176
  }
177
177
  renderBody() {
178
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
178
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
179
179
  const links = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links;
180
180
  const customer = this.__customer;
181
- const customerAddresses = customer === null || customer === void 0 ? void 0 : customer._links['fx:customer_addresses'].href;
182
181
  return html `
183
182
  ${this.renderHeader()}
184
183
 
@@ -217,15 +216,15 @@ export class CartForm extends Base {
217
216
  class="min-w-0"
218
217
  first=${ifDefined(this.__itemsHref)}
219
218
  alert
219
+ wide
220
220
  item="foxy-item-card"
221
221
  form="foxy-item-form"
222
222
  .related=${this.href ? [this.href] : []}
223
- .itemProps=${{ 'locale-codes': (_d = this.localeCodes) !== null && _d !== void 0 ? _d : '' }}
223
+ .itemProps=${{ 'locale-codes': this.localeCodes }}
224
224
  .formProps=${{
225
- 'customer-addresses': customerAddresses !== null && customerAddresses !== void 0 ? customerAddresses : '',
226
- 'item-categories': (_e = this.itemCategories) !== null && _e !== void 0 ? _e : '',
227
- 'locale-codes': (_f = this.localeCodes) !== null && _f !== void 0 ? _f : '',
228
- 'coupons': (_g = this.coupons) !== null && _g !== void 0 ? _g : '',
225
+ 'item-categories': this.itemCategories,
226
+ 'locale-codes': this.localeCodes,
227
+ 'store': (_d = this.data) === null || _d === void 0 ? void 0 : _d._links['fx:store'].href,
229
228
  }}
230
229
  >
231
230
  </foxy-internal-async-list-control>
@@ -254,8 +253,8 @@ export class CartForm extends Base {
254
253
  form="foxy-internal-cart-form-payment-method-form"
255
254
  .getDisplayValueOptions=${this.__paymentMethodUriGetDisplayValueOptions}
256
255
  .formProps=${{
257
- 'default-payment-method': (_h = customer === null || customer === void 0 ? void 0 : customer._links['fx:default_payment_method'].href) !== null && _h !== void 0 ? _h : '',
258
- 'payment-card-embed-url': (_j = this.__pickerPaymentCardEmbedUrl) !== null && _j !== void 0 ? _j : '',
256
+ 'default-payment-method': (_e = customer === null || customer === void 0 ? void 0 : customer._links['fx:default_payment_method'].href) !== null && _e !== void 0 ? _e : '',
257
+ 'payment-card-embed-url': (_f = this.__pickerPaymentCardEmbedUrl) !== null && _f !== void 0 ? _f : '',
259
258
  }}
260
259
  .setValue=${this.__paymentMethodUriSetValue}
261
260
  .filters=${this.__paymentMethodUriFilters}
@@ -263,8 +262,8 @@ export class CartForm extends Base {
263
262
  </foxy-internal-resource-picker-control>
264
263
 
265
264
  <foxy-internal-cart-form-address-summary-item
266
- countries=${ifDefined((_k = this.countries) !== null && _k !== void 0 ? _k : void 0)}
267
- regions=${ifDefined((_l = this.regions) !== null && _l !== void 0 ? _l : void 0)}
265
+ countries=${ifDefined((_g = this.countries) !== null && _g !== void 0 ? _g : void 0)}
266
+ regions=${ifDefined((_h = this.regions) !== null && _h !== void 0 ? _h : void 0)}
268
267
  infer="billing-address"
269
268
  type="billing"
270
269
  .customer=${customer}
@@ -277,8 +276,8 @@ export class CartForm extends Base {
277
276
  </foxy-internal-switch-control>
278
277
 
279
278
  <foxy-internal-cart-form-address-summary-item
280
- countries=${ifDefined((_m = this.countries) !== null && _m !== void 0 ? _m : void 0)}
281
- regions=${ifDefined((_o = this.regions) !== null && _o !== void 0 ? _o : void 0)}
279
+ countries=${ifDefined((_j = this.countries) !== null && _j !== void 0 ? _j : void 0)}
280
+ regions=${ifDefined((_k = this.regions) !== null && _k !== void 0 ? _k : void 0)}
282
281
  infer="shipping-address"
283
282
  type="shipping"
284
283
  .customer=${customer}
@@ -313,7 +312,7 @@ export class CartForm extends Base {
313
312
  <foxy-nucleon
314
313
  class="hidden"
315
314
  infer=""
316
- href=${ifDefined((_p = this.languages) !== null && _p !== void 0 ? _p : void 0)}
315
+ href=${ifDefined((_l = this.languages) !== null && _l !== void 0 ? _l : void 0)}
317
316
  id=${this.__languagesLoaderId}
318
317
  @update=${() => this.requestUpdate()}
319
318
  >
@@ -1 +1 @@
1
- {"version":3,"file":"CartForm.js","sourceRoot":"","sources":["../../../../src/elements/public/CartForm/CartForm.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,iCAA8B;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,WAAW,CAAC;AACvB,MAAM,IAAI,GAAG,eAAe,CAAC,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAU;IAAxC;;QAuCE,oGAAoG;QACpG,wBAAmB,GAAkB,IAAI,CAAC;QAE1C,gEAAgE;QAChE,mBAAc,GAAkB,IAAI,CAAC;QAErC,8DAA8D;QAC9D,iBAAY,GAAkB,IAAI,CAAC;QAEnC,oDAAoD;QACpD,gBAAW,GAAkB,IAAI,CAAC;QAElC,iDAAiD;QACjD,cAAS,GAAkB,IAAI,CAAC;QAEhC,0DAA0D;QAC1D,cAAS,GAAkB,IAAI,CAAC;QAEhC,iDAAiD;QACjD,cAAS,GAAkB,IAAI,CAAC;QAEhC,+CAA+C;QAC/C,YAAO,GAAkB,IAAI,CAAC;QAE9B,wDA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AED,IAAY,WAAW;;QACrB,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,UAAU,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YAC9D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;YAC7C,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;SACvB;QAAC,WAAM;YACN,EAAE;SACH;IACH,CAAC;IAED,IAAY,iBAAiB;;QAE3B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAS,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;QACrF,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,aAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,0CAAE,MAAM,mCAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,IAAY,UAAU;;QAQpB,aAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAS,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC,0CAAE,IAAI,CAAC;IACpF,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Option } from '../QueryBuilder/types';\nimport type { Rels } from '@foxy.io/sdk/backend';\nimport type { Data } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { Type } from '../QueryBuilder/types';\nimport { html } from 'lit-html';\n\nconst NS = 'cart-form';\nconst Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));\n\n/**\n * Form element for creating or editing carts (`fx:cart`).\n *\n * @element foxy-cart-form\n * @since 1.21.0\n */\nexport class CartForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n paymentCardEmbedUrl: { attribute: 'payment-card-embed-url' },\n itemCategories: { attribute: 'item-categories' },\n templateSets: { attribute: 'template-sets' },\n localeCodes: { attribute: 'locale-codes' },\n languages: {},\n customers: {},\n countries: {},\n regions: {},\n coupons: {},\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ billing_first_name: v }) => !v || v.length <= 50 || 'billing-first-name:v8n_too_long',\n ({ billing_last_name: v }) => !v || v.length <= 50 || 'billing-last-name:v8n_too_long',\n ({ billing_state: v }) => !v || v.length <= 50 || 'billing-state:v8n_too_long',\n ({ billing_city: v }) => !v || v.length <= 50 || 'billing-city:v8n_too_long',\n ({ billing_phone: v }) => !v || v.length <= 50 || 'billing-phone:v8n_too_long',\n ({ billing_company: v }) => !v || v.length <= 50 || 'billing-company:v8n_too_long',\n ({ billing_address2: v }) => !v || v.length <= 100 || 'billing-address-two:v8n_too_long',\n ({ billing_address1: v }) => !v || v.length <= 100 || 'billing-address-one:v8n_too_long',\n ({ billing_postal_code: v }) => !v || v.length <= 50 || 'billing-postal-code:v8n_too_long',\n ({ shipping_first_name: v }) => !v || v.length <= 50 || 'shipping-first-name:v8n_too_long',\n ({ shipping_last_name: v }) => !v || v.length <= 50 || 'shipping-last-name:v8n_too_long',\n ({ shipping_state: v }) => !v || v.length <= 50 || 'shipping-state:v8n_too_long',\n ({ shipping_city: v }) => !v || v.length <= 50 || 'shipping-city:v8n_too_long',\n ({ shipping_phone: v }) => !v || v.length <= 50 || 'shipping-phone:v8n_too_long',\n ({ shipping_company: v }) => !v || v.length <= 50 || 'shipping-company:v8n_too_long',\n ({ shipping_address2: v }) => !v || v.length <= 100 || 'shipping-address-two:v8n_too_long',\n ({ shipping_address1: v }) => !v || v.length <= 100 || 'shipping-address-one:v8n_too_long',\n ({ shipping_postal_code: v }) => !v || v.length <= 50 || 'shipping-postal-code:v8n_too_long',\n ];\n }\n\n /** Payment Card Embed configuration URL. The form will append template set parameter on its own. */\n paymentCardEmbedUrl: string | null = null;\n\n /** URL of the `fx:item_categories` collection for the store. */\n itemCategories: string | null = null;\n\n /** URL of the `fx:template_sets` collection for the store. */\n templateSets: string | null = null;\n\n /** URL of the `fx:locale_codes` property helper. */\n localeCodes: string | null = null;\n\n /** URL of the `fx:languages` property helper. */\n languages: string | null = null;\n\n /** URL of the `fx:customers` collection for the store. */\n customers: string | null = null;\n\n /** URL of the `fx:countries` property helper. */\n countries: string | null = null;\n\n /** URL of the `fx:regions` property helper. */\n regions: string | null = null;\n\n /** URL of the `fx:coupons` collection for the store. */\n coupons: string | null = null;\n\n private readonly __languagesLoaderId = 'languagesLoader';\n\n private readonly __customerLoaderId = 'customerLoader';\n\n private readonly __paymentMethodUriGetDisplayValueOptions = (\n payments: Resource<Rels.Payments>\n ) => {\n const payment = payments?._embedded?.['fx:payments']?.[0] ?? null;\n const ccExpMonth = payment?.cc_exp_month;\n const ccExpYear = payment?.cc_exp_year;\n const ccLast4 = payment?.cc_number_masked?.replace(/x/g, '');\n const ccType = payment?.cc_type;\n\n return {\n cc_exp_month: ccExpMonth ?? '',\n cc_exp_year: ccExpYear ?? '',\n cc_last4: ccLast4 ?? '',\n cc_type: ccType ?? '',\n context: ccLast4 && ccExpMonth && ccExpYear && ccType ? '' : 'empty',\n };\n };\n\n private readonly __paymentMethodUriSetValue = (transactionUrl: string) => {\n try {\n // TODO use links instead of constructing the URL manually\n const url = new URL(transactionUrl);\n url.search = '';\n url.pathname += '/payments';\n this.edit({ payment_method_uri: url.toString() });\n } catch (err) {\n this.edit({ payment_method_uri: '' });\n }\n };\n\n private readonly __paymentMethodUriFilters: Option[] = [\n {\n label: 'filter_type',\n type: Type.String,\n path: 'payments:type',\n list: [\n { label: 'filter_type_value_purchase_order', value: 'purchase_order' },\n { label: 'filter_type_value_amazon_mws', value: 'amazon_mws' },\n { label: 'filter_type_value_paypal_ec', value: 'paypal_ec' },\n { label: 'filter_type_value_paypal', value: 'paypal' },\n { label: 'filter_type_value_hosted', value: 'hosted' },\n { label: 'filter_type_value_ogone', value: 'ogone' },\n ],\n },\n {\n label: 'filter_cc_type',\n type: Type.String,\n path: 'payments:cc_type',\n list: [\n { label: 'filter_cc_type_value_mastercard', value: 'mastercard' },\n { label: 'filter_cc_type_value_discover', value: 'discover' },\n { label: 'filter_cc_type_value_unionpay', value: 'unionpay' },\n { label: 'filter_cc_type_value_maestro', value: 'maestro' },\n { label: 'filter_cc_type_value_diners', value: 'diners' },\n { label: 'filter_cc_type_value_visa', value: 'visa' },\n { label: 'filter_cc_type_value_amex', value: 'amex' },\n { label: 'filter_cc_type_value_jcb', value: 'jcb' },\n ],\n },\n {\n label: 'filter_cc_number_masked',\n type: Type.String,\n path: 'payments:cc_number_masked',\n },\n ];\n\n private readonly __customerUriSetValue = (newValue: string) => {\n this.edit({ customer_uri: newValue, customer_email: '' });\n };\n\n private readonly __customerUriOptions: Option[] = [\n { label: 'filter_email', path: 'email', type: Type.String },\n {\n label: 'filter_is_anonymous',\n path: 'is_anonymous',\n type: Type.String,\n list: [\n { value: 'false', label: 'filter_is_anonymous_value_false' },\n { value: 'true', label: 'filter_is_anonymous_value_true' },\n ],\n },\n ];\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = [super.hiddenSelector.toString()];\n\n if (this.form.customer_uri) {\n alwaysMatch.unshift('general:customer-email');\n } else {\n alwaysMatch.unshift('billing:payment-method-uri');\n }\n\n if (this.data) {\n if (!this.form.use_customer_shipping_address) {\n alwaysMatch.unshift('shipping:shipping-address');\n }\n } else {\n alwaysMatch.unshift(\n 'applied-coupon-codes',\n 'custom-fields',\n 'attributes',\n 'shipping',\n 'billing',\n 'totals',\n 'items'\n );\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderHeaderActions(): TemplateResult {\n return html`\n <foxy-internal-cart-form-create-session-action infer=\"view-as-customer\">\n </foxy-internal-cart-form-create-session-action>\n `;\n }\n\n renderBody(): TemplateResult {\n const links = this.data?._links;\n const customer = this.__customer;\n const customerAddresses = customer?._links['fx:customer_addresses'].href;\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-summary-control infer=\"general\">\n <foxy-internal-resource-picker-control\n layout=\"summary-item\"\n first=${ifDefined(this.templateSets ?? void 0)}\n infer=\"template-set-uri\"\n item=\"foxy-template-set-card\"\n >\n </foxy-internal-resource-picker-control>\n\n <foxy-internal-select-control\n layout=\"summary-item\"\n infer=\"language\"\n .options=${this.__languageOptions}\n >\n </foxy-internal-select-control>\n\n <foxy-internal-resource-picker-control\n layout=\"summary-item\"\n first=${ifDefined(this.customers ?? void 0)}\n infer=\"customer-uri\"\n item=\"foxy-customer-card\"\n .setValue=${this.__customerUriSetValue}\n .filters=${this.__customerUriOptions}\n >\n </foxy-internal-resource-picker-control>\n\n <foxy-internal-text-control layout=\"summary-item\" infer=\"customer-email\">\n </foxy-internal-text-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-async-list-control\n infer=\"items\"\n class=\"min-w-0\"\n first=${ifDefined(this.__itemsHref)}\n alert\n item=\"foxy-item-card\"\n form=\"foxy-item-form\"\n .related=${this.href ? [this.href] : []}\n .itemProps=${{ 'locale-codes': this.localeCodes ?? '' }}\n .formProps=${{\n 'customer-addresses': customerAddresses ?? '',\n 'item-categories': this.itemCategories ?? '',\n 'locale-codes': this.localeCodes ?? '',\n 'coupons': this.coupons ?? '',\n }}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-cart-form-totals-control class=\"min-w-0\" infer=\"totals\">\n </foxy-internal-cart-form-totals-control>\n\n <foxy-internal-async-list-control\n infer=\"applied-coupon-codes\"\n class=\"min-w-0\"\n first=${ifDefined(links?.['fx:applied_coupon_codes'].href)}\n item=\"foxy-applied-coupon-code-card\"\n form=\"foxy-applied-coupon-code-form\"\n alert\n .related=${this.href ? [this.href] : []}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-summary-control infer=\"billing\">\n <foxy-internal-resource-picker-control\n placeholder=${this.__paymentMethodUriPlaceholder}\n layout=\"summary-item\"\n first=${ifDefined(this.__transactionsWithPaymentsUrl)}\n infer=\"payment-method-uri\"\n item=\"foxy-internal-cart-form-payment-method-card\"\n form=\"foxy-internal-cart-form-payment-method-form\"\n .getDisplayValueOptions=${this.__paymentMethodUriGetDisplayValueOptions}\n .formProps=${{\n 'default-payment-method': customer?._links['fx:default_payment_method'].href ?? '',\n 'payment-card-embed-url': this.__pickerPaymentCardEmbedUrl ?? '',\n }}\n .setValue=${this.__paymentMethodUriSetValue}\n .filters=${this.__paymentMethodUriFilters}\n >\n </foxy-internal-resource-picker-control>\n\n <foxy-internal-cart-form-address-summary-item\n countries=${ifDefined(this.countries ?? void 0)}\n regions=${ifDefined(this.regions ?? void 0)}\n infer=\"billing-address\"\n type=\"billing\"\n .customer=${customer}\n >\n </foxy-internal-cart-form-address-summary-item>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"shipping\">\n <foxy-internal-switch-control infer=\"use-customer-shipping-address\" invert>\n </foxy-internal-switch-control>\n\n <foxy-internal-cart-form-address-summary-item\n countries=${ifDefined(this.countries ?? void 0)}\n regions=${ifDefined(this.regions ?? void 0)}\n infer=\"shipping-address\"\n type=\"shipping\"\n .customer=${customer}\n >\n </foxy-internal-cart-form-address-summary-item>\n </foxy-internal-summary-control>\n\n <foxy-internal-async-list-control\n infer=\"custom-fields\"\n class=\"min-w-0\"\n first=${ifDefined(links?.['fx:custom_fields'].href)}\n limit=\"5\"\n item=\"foxy-custom-field-card\"\n form=\"foxy-custom-field-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"attributes\"\n class=\"min-w-0\"\n first=${ifDefined(links?.['fx:attributes'].href)}\n limit=\"5\"\n item=\"foxy-attribute-card\"\n form=\"foxy-attribute-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.languages ?? void 0)}\n id=${this.__languagesLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__customerHref)}\n id=${this.__customerLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n `;\n }\n\n private get __paymentMethodUriPlaceholder() {\n const defaultPaymentMethod = this.__customer?._embedded['fx:default_payment_method'];\n const ccExpMonth = defaultPaymentMethod?.cc_exp_month ?? null;\n const ccExpYear = defaultPaymentMethod?.cc_exp_year ?? null;\n const ccLast4 = defaultPaymentMethod?.cc_number_masked?.replace(/x/g, '') ?? null;\n const ccType = defaultPaymentMethod?.cc_type ?? null;\n\n return this.t('billing.payment-method-uri.value', {\n cc_exp_month: ccExpMonth ?? '',\n cc_exp_year: ccExpYear ?? '',\n cc_last4: ccLast4 ?? '',\n cc_type: ccType ?? '',\n context: ccLast4 && ccExpMonth && ccExpYear && ccType ? '' : 'empty',\n });\n }\n\n private get __transactionsWithPaymentsUrl() {\n try {\n const url = new URL(this.__customer?._links['fx:transactions'].href ?? '');\n url.searchParams.set('zoom', 'payments');\n return url.toString();\n } catch {\n // ignore\n }\n }\n\n private get __pickerPaymentCardEmbedUrl() {\n try {\n const url = new URL(this.paymentCardEmbedUrl ?? '');\n const id = getResourceId(this.form.template_set_uri ?? '');\n if (id !== null) {\n url.searchParams.set('template_set_id', String(id));\n return url.toString();\n }\n } catch {\n // ignore\n }\n }\n\n private get __customerHref() {\n try {\n const url = new URL(this.form.customer_uri ?? '');\n url.searchParams.set(\n 'zoom',\n 'default_payment_method,default_billing_address,default_shipping_address'\n );\n return url.toString();\n } catch {\n // ignore\n }\n }\n\n private get __itemsHref() {\n try {\n const url = new URL(this.data?._links['fx:items'].href ?? '');\n url.searchParams.set('zoom', 'item_options');\n return url.toString();\n } catch {\n //\n }\n }\n\n private get __languageOptions() {\n type Loader = NucleonElement<Resource<Rels.Languages>>;\n const loader = this.renderRoot.querySelector<Loader>(`#${this.__languagesLoaderId}`);\n const values = Object.entries(loader?.data?.values ?? {});\n return values.map(([value, rawLabel]) => ({ rawLabel, value }));\n }\n\n private get __customer() {\n type Loader = NucleonElement<\n Resource<\n Rels.Customer,\n { zoom: ['default_payment_method', 'default_shipping_address', 'default_billing_address'] }\n >\n >;\n\n return this.renderRoot.querySelector<Loader>(`#${this.__customerLoaderId}`)?.data;\n }\n}\n"]}
1
+ {"version":3,"file":"CartForm.js","sourceRoot":"","sources":["../../../../src/elements/public/CartForm/CartForm.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,iCAA8B;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,WAAW,CAAC;AACvB,MAAM,IAAI,GAAG,eAAe,CAAC,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAU;IAAxC;;QAuCE,oGAAoG;QACpG,wBAAmB,GAAkB,IAAI,CAAC;QAE1C,gEAAgE;QAChE,mBAAc,GAAkB,IAAI,CAAC;QAErC,8DAA8D;QAC9D,iBAAY,GAAkB,IAAI,C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AE,CAAC;SACvB;QAAC,WAAM;YACN,SAAS;SACV;IACH,CAAC;IAED,IAAY,WAAW;;QACrB,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,UAAU,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YAC9D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;YAC7C,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;SACvB;QAAC,WAAM;YACN,EAAE;SACH;IACH,CAAC;IAED,IAAY,iBAAiB;;QAE3B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAS,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;QACrF,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,aAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,0CAAE,MAAM,mCAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,IAAY,UAAU;;QAQpB,aAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAS,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC,0CAAE,IAAI,CAAC;IACpF,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Option } from '../QueryBuilder/types';\nimport type { Rels } from '@foxy.io/sdk/backend';\nimport type { Data } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { Type } from '../QueryBuilder/types';\nimport { html } from 'lit-html';\n\nconst NS = 'cart-form';\nconst Base = ResponsiveMixin(TranslatableMixin(InternalForm, NS));\n\n/**\n * Form element for creating or editing carts (`fx:cart`).\n *\n * @element foxy-cart-form\n * @since 1.21.0\n */\nexport class CartForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n paymentCardEmbedUrl: { attribute: 'payment-card-embed-url' },\n itemCategories: { attribute: 'item-categories' },\n templateSets: { attribute: 'template-sets' },\n localeCodes: { attribute: 'locale-codes' },\n languages: {},\n customers: {},\n countries: {},\n regions: {},\n coupons: {},\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ billing_first_name: v }) => !v || v.length <= 50 || 'billing-first-name:v8n_too_long',\n ({ billing_last_name: v }) => !v || v.length <= 50 || 'billing-last-name:v8n_too_long',\n ({ billing_state: v }) => !v || v.length <= 50 || 'billing-state:v8n_too_long',\n ({ billing_city: v }) => !v || v.length <= 50 || 'billing-city:v8n_too_long',\n ({ billing_phone: v }) => !v || v.length <= 50 || 'billing-phone:v8n_too_long',\n ({ billing_company: v }) => !v || v.length <= 50 || 'billing-company:v8n_too_long',\n ({ billing_address2: v }) => !v || v.length <= 100 || 'billing-address-two:v8n_too_long',\n ({ billing_address1: v }) => !v || v.length <= 100 || 'billing-address-one:v8n_too_long',\n ({ billing_postal_code: v }) => !v || v.length <= 50 || 'billing-postal-code:v8n_too_long',\n ({ shipping_first_name: v }) => !v || v.length <= 50 || 'shipping-first-name:v8n_too_long',\n ({ shipping_last_name: v }) => !v || v.length <= 50 || 'shipping-last-name:v8n_too_long',\n ({ shipping_state: v }) => !v || v.length <= 50 || 'shipping-state:v8n_too_long',\n ({ shipping_city: v }) => !v || v.length <= 50 || 'shipping-city:v8n_too_long',\n ({ shipping_phone: v }) => !v || v.length <= 50 || 'shipping-phone:v8n_too_long',\n ({ shipping_company: v }) => !v || v.length <= 50 || 'shipping-company:v8n_too_long',\n ({ shipping_address2: v }) => !v || v.length <= 100 || 'shipping-address-two:v8n_too_long',\n ({ shipping_address1: v }) => !v || v.length <= 100 || 'shipping-address-one:v8n_too_long',\n ({ shipping_postal_code: v }) => !v || v.length <= 50 || 'shipping-postal-code:v8n_too_long',\n ];\n }\n\n /** Payment Card Embed configuration URL. The form will append template set parameter on its own. */\n paymentCardEmbedUrl: string | null = null;\n\n /** URL of the `fx:item_categories` collection for the store. */\n itemCategories: string | null = null;\n\n /** URL of the `fx:template_sets` collection for the store. */\n templateSets: string | null = null;\n\n /** URL of the `fx:locale_codes` property helper. */\n localeCodes: string | null = null;\n\n /** URL of the `fx:languages` property helper. */\n languages: string | null = null;\n\n /** URL of the `fx:customers` collection for the store. */\n customers: string | null = null;\n\n /** URL of the `fx:countries` property helper. */\n countries: string | null = null;\n\n /** URL of the `fx:regions` property helper. */\n regions: string | null = null;\n\n /** URL of the `fx:coupons` collection for the store. */\n coupons: string | null = null;\n\n private readonly __languagesLoaderId = 'languagesLoader';\n\n private readonly __customerLoaderId = 'customerLoader';\n\n private readonly __paymentMethodUriGetDisplayValueOptions = (\n payments: Resource<Rels.Payments>\n ) => {\n const payment = payments?._embedded?.['fx:payments']?.[0] ?? null;\n const ccExpMonth = payment?.cc_exp_month;\n const ccExpYear = payment?.cc_exp_year;\n const ccLast4 = payment?.cc_number_masked?.replace(/x/g, '');\n const ccType = payment?.cc_type;\n\n return {\n cc_exp_month: ccExpMonth ?? '',\n cc_exp_year: ccExpYear ?? '',\n cc_last4: ccLast4 ?? '',\n cc_type: ccType ?? '',\n context: ccLast4 && ccExpMonth && ccExpYear && ccType ? '' : 'empty',\n };\n };\n\n private readonly __paymentMethodUriSetValue = (transactionUrl: string) => {\n try {\n // TODO use links instead of constructing the URL manually\n const url = new URL(transactionUrl);\n url.search = '';\n url.pathname += '/payments';\n this.edit({ payment_method_uri: url.toString() });\n } catch (err) {\n this.edit({ payment_method_uri: '' });\n }\n };\n\n private readonly __paymentMethodUriFilters: Option[] = [\n {\n label: 'filter_type',\n type: Type.String,\n path: 'payments:type',\n list: [\n { label: 'filter_type_value_purchase_order', value: 'purchase_order' },\n { label: 'filter_type_value_amazon_mws', value: 'amazon_mws' },\n { label: 'filter_type_value_paypal_ec', value: 'paypal_ec' },\n { label: 'filter_type_value_paypal', value: 'paypal' },\n { label: 'filter_type_value_hosted', value: 'hosted' },\n { label: 'filter_type_value_ogone', value: 'ogone' },\n ],\n },\n {\n label: 'filter_cc_type',\n type: Type.String,\n path: 'payments:cc_type',\n list: [\n { label: 'filter_cc_type_value_mastercard', value: 'mastercard' },\n { label: 'filter_cc_type_value_discover', value: 'discover' },\n { label: 'filter_cc_type_value_unionpay', value: 'unionpay' },\n { label: 'filter_cc_type_value_maestro', value: 'maestro' },\n { label: 'filter_cc_type_value_diners', value: 'diners' },\n { label: 'filter_cc_type_value_visa', value: 'visa' },\n { label: 'filter_cc_type_value_amex', value: 'amex' },\n { label: 'filter_cc_type_value_jcb', value: 'jcb' },\n ],\n },\n {\n label: 'filter_cc_number_masked',\n type: Type.String,\n path: 'payments:cc_number_masked',\n },\n ];\n\n private readonly __customerUriSetValue = (newValue: string) => {\n this.edit({ customer_uri: newValue, customer_email: '' });\n };\n\n private readonly __customerUriOptions: Option[] = [\n { label: 'filter_email', path: 'email', type: Type.String },\n {\n label: 'filter_is_anonymous',\n path: 'is_anonymous',\n type: Type.String,\n list: [\n { value: 'false', label: 'filter_is_anonymous_value_false' },\n { value: 'true', label: 'filter_is_anonymous_value_true' },\n ],\n },\n ];\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = [super.hiddenSelector.toString()];\n\n if (this.form.customer_uri) {\n alwaysMatch.unshift('general:customer-email');\n } else {\n alwaysMatch.unshift('billing:payment-method-uri');\n }\n\n if (this.data) {\n if (!this.form.use_customer_shipping_address) {\n alwaysMatch.unshift('shipping:shipping-address');\n }\n } else {\n alwaysMatch.unshift(\n 'applied-coupon-codes',\n 'custom-fields',\n 'attributes',\n 'shipping',\n 'billing',\n 'totals',\n 'items'\n );\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderHeaderActions(): TemplateResult {\n return html`\n <foxy-internal-cart-form-create-session-action infer=\"view-as-customer\">\n </foxy-internal-cart-form-create-session-action>\n `;\n }\n\n renderBody(): TemplateResult {\n const links = this.data?._links;\n const customer = this.__customer;\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-summary-control infer=\"general\">\n <foxy-internal-resource-picker-control\n layout=\"summary-item\"\n first=${ifDefined(this.templateSets ?? void 0)}\n infer=\"template-set-uri\"\n item=\"foxy-template-set-card\"\n >\n </foxy-internal-resource-picker-control>\n\n <foxy-internal-select-control\n layout=\"summary-item\"\n infer=\"language\"\n .options=${this.__languageOptions}\n >\n </foxy-internal-select-control>\n\n <foxy-internal-resource-picker-control\n layout=\"summary-item\"\n first=${ifDefined(this.customers ?? void 0)}\n infer=\"customer-uri\"\n item=\"foxy-customer-card\"\n .setValue=${this.__customerUriSetValue}\n .filters=${this.__customerUriOptions}\n >\n </foxy-internal-resource-picker-control>\n\n <foxy-internal-text-control layout=\"summary-item\" infer=\"customer-email\">\n </foxy-internal-text-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-async-list-control\n infer=\"items\"\n class=\"min-w-0\"\n first=${ifDefined(this.__itemsHref)}\n alert\n wide\n item=\"foxy-item-card\"\n form=\"foxy-item-form\"\n .related=${this.href ? [this.href] : []}\n .itemProps=${{ 'locale-codes': this.localeCodes }}\n .formProps=${{\n 'item-categories': this.itemCategories,\n 'locale-codes': this.localeCodes,\n 'store': this.data?._links['fx:store'].href,\n }}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-cart-form-totals-control class=\"min-w-0\" infer=\"totals\">\n </foxy-internal-cart-form-totals-control>\n\n <foxy-internal-async-list-control\n infer=\"applied-coupon-codes\"\n class=\"min-w-0\"\n first=${ifDefined(links?.['fx:applied_coupon_codes'].href)}\n item=\"foxy-applied-coupon-code-card\"\n form=\"foxy-applied-coupon-code-form\"\n alert\n .related=${this.href ? [this.href] : []}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-summary-control infer=\"billing\">\n <foxy-internal-resource-picker-control\n placeholder=${this.__paymentMethodUriPlaceholder}\n layout=\"summary-item\"\n first=${ifDefined(this.__transactionsWithPaymentsUrl)}\n infer=\"payment-method-uri\"\n item=\"foxy-internal-cart-form-payment-method-card\"\n form=\"foxy-internal-cart-form-payment-method-form\"\n .getDisplayValueOptions=${this.__paymentMethodUriGetDisplayValueOptions}\n .formProps=${{\n 'default-payment-method': customer?._links['fx:default_payment_method'].href ?? '',\n 'payment-card-embed-url': this.__pickerPaymentCardEmbedUrl ?? '',\n }}\n .setValue=${this.__paymentMethodUriSetValue}\n .filters=${this.__paymentMethodUriFilters}\n >\n </foxy-internal-resource-picker-control>\n\n <foxy-internal-cart-form-address-summary-item\n countries=${ifDefined(this.countries ?? void 0)}\n regions=${ifDefined(this.regions ?? void 0)}\n infer=\"billing-address\"\n type=\"billing\"\n .customer=${customer}\n >\n </foxy-internal-cart-form-address-summary-item>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"shipping\">\n <foxy-internal-switch-control infer=\"use-customer-shipping-address\" invert>\n </foxy-internal-switch-control>\n\n <foxy-internal-cart-form-address-summary-item\n countries=${ifDefined(this.countries ?? void 0)}\n regions=${ifDefined(this.regions ?? void 0)}\n infer=\"shipping-address\"\n type=\"shipping\"\n .customer=${customer}\n >\n </foxy-internal-cart-form-address-summary-item>\n </foxy-internal-summary-control>\n\n <foxy-internal-async-list-control\n infer=\"custom-fields\"\n class=\"min-w-0\"\n first=${ifDefined(links?.['fx:custom_fields'].href)}\n limit=\"5\"\n item=\"foxy-custom-field-card\"\n form=\"foxy-custom-field-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"attributes\"\n class=\"min-w-0\"\n first=${ifDefined(links?.['fx:attributes'].href)}\n limit=\"5\"\n item=\"foxy-attribute-card\"\n form=\"foxy-attribute-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.languages ?? void 0)}\n id=${this.__languagesLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__customerHref)}\n id=${this.__customerLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n `;\n }\n\n private get __paymentMethodUriPlaceholder() {\n const defaultPaymentMethod = this.__customer?._embedded['fx:default_payment_method'];\n const ccExpMonth = defaultPaymentMethod?.cc_exp_month ?? null;\n const ccExpYear = defaultPaymentMethod?.cc_exp_year ?? null;\n const ccLast4 = defaultPaymentMethod?.cc_number_masked?.replace(/x/g, '') ?? null;\n const ccType = defaultPaymentMethod?.cc_type ?? null;\n\n return this.t('billing.payment-method-uri.value', {\n cc_exp_month: ccExpMonth ?? '',\n cc_exp_year: ccExpYear ?? '',\n cc_last4: ccLast4 ?? '',\n cc_type: ccType ?? '',\n context: ccLast4 && ccExpMonth && ccExpYear && ccType ? '' : 'empty',\n });\n }\n\n private get __transactionsWithPaymentsUrl() {\n try {\n const url = new URL(this.__customer?._links['fx:transactions'].href ?? '');\n url.searchParams.set('zoom', 'payments');\n return url.toString();\n } catch {\n // ignore\n }\n }\n\n private get __pickerPaymentCardEmbedUrl() {\n try {\n const url = new URL(this.paymentCardEmbedUrl ?? '');\n const id = getResourceId(this.form.template_set_uri ?? '');\n if (id !== null) {\n url.searchParams.set('template_set_id', String(id));\n return url.toString();\n }\n } catch {\n // ignore\n }\n }\n\n private get __customerHref() {\n try {\n const url = new URL(this.form.customer_uri ?? '');\n url.searchParams.set(\n 'zoom',\n 'default_payment_method,default_billing_address,default_shipping_address'\n );\n return url.toString();\n } catch {\n // ignore\n }\n }\n\n private get __itemsHref() {\n try {\n const url = new URL(this.data?._links['fx:items'].href ?? '');\n url.searchParams.set('zoom', 'item_options');\n return url.toString();\n } catch {\n //\n }\n }\n\n private get __languageOptions() {\n type Loader = NucleonElement<Resource<Rels.Languages>>;\n const loader = this.renderRoot.querySelector<Loader>(`#${this.__languagesLoaderId}`);\n const values = Object.entries(loader?.data?.values ?? {});\n return values.map(([value, rawLabel]) => ({ rawLabel, value }));\n }\n\n private get __customer() {\n type Loader = NucleonElement<\n Resource<\n Rels.Customer,\n { zoom: ['default_payment_method', 'default_shipping_address', 'default_billing_address'] }\n >\n >;\n\n return this.renderRoot.querySelector<Loader>(`#${this.__customerLoaderId}`)?.data;\n }\n}\n"]}
@@ -1,7 +1,8 @@
1
1
  import type { PropertyDeclarations } from 'lit-element';
2
- import type { Data } from './types';
3
2
  import type { TemplateResult } from 'lit-html';
4
3
  import type { NucleonV8N } from '../NucleonElement/types';
4
+ import type { Data } from './types';
5
+ import { BooleanSelector } from '@foxy.io/sdk/core';
5
6
  import { InternalForm } from '../../internal/InternalForm/InternalForm';
6
7
  declare const ItemForm_base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
7
8
  defaultNS: string;
@@ -23,10 +24,17 @@ export declare class ItemForm extends ItemForm_base<Data> {
23
24
  localeCodes: string | null;
24
25
  /** @deprecated Link to the collection of coupons that can be used with this item. */
25
26
  coupons: string | null;
27
+ /** Link to `fx:store` this item belongs to. */
28
+ store: string | null;
26
29
  private __itemsLink;
27
30
  get headerSubtitleOptions(): Record<string, unknown>;
31
+ get readonlySelector(): BooleanSelector;
32
+ get hiddenSelector(): BooleanSelector;
28
33
  renderBody(): TemplateResult;
29
34
  protected _sendGet(): Promise<Data>;
35
+ private get __discountBuilderParsedValue();
30
36
  private get __itemOptionRelatedUrls();
37
+ private get __storeLoader();
38
+ private __handleDiscountBuilderChange;
31
39
  }
32
40
  export {};