@foxy.io/elements 1.14.0-beta.6 → 1.14.0-beta.7
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-bb824ab4.js";import{C as e,a as t}from"./shared-8edee4e1.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{_ as s,h as i,k as n,E as o,N as r,B as a,P as l,A as c}from"./shared-63eaded9.js";import{l as d}from"./shared-218ba06e.js";import{C as u}from"./shared-d8852c42.js";import{C as h}from"./shared-593f7e2c.js";import{N as p}from"./shared-44cfc617.js";import{T as g,a as f,S as _,R as y}from"./shared-3f35fa81.js";import{c as x}from"./shared-4e709717.js";import{i as m}from"./shared-6d45a07b.js";import{G as b}from"./shared-4d3c7828.js";import"./shared-ff79f3f9.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import"./shared-ec861f31.js";import"./shared-1761daef.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-a46edf4b.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";let $,v,k,S,w,j=e=>e;const O=h(g(f(p)));class T extends O{constructor(){super(...arguments),this.regions=[],this.region="",this.name="",this.code=""}static get properties(){return s(s({},super.properties),{},{regions:{type:Array},region:{type:String},name:{type:String},code:{type:String}})}render(){var e,t;return i($||($=j` <div class="border border-contrast-10 rounded text-s"> <div class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button class="mr-xs flex items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div class="flex flex-wrap p-xs"> ${0} <div class="h-s m-xs flex items-center transition-colors border border-contrast-10 hover-border-contrast-40 focus-within-ring-1 focus-within-ring-primary-50 focus-within-border-primary-50" style="border-radius:var(--lumo-size-s)"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),this.name||this.code,this.name?i(v||(v=j`<span class="text-secondary">${0}</span>`),this.code):"",(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const n=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return i(k||(k=j` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button class="flex items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),n||e,n?i(S||(S=j`<span class="text-secondary">${0}</span>`),e):"",(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),this.t("add_region"),this.region,(e=>{"Enter"===e.key&&this.region&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.region=t.value}),x({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.region,"bg-success-10 text-success cursor-pointer":!!this.region,"hover-bg-success hover-text-success-contrast":!!this.region,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.region}),!this.region,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(w||(w=j`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.region])],this.region="",this.dispatchEvent(new CustomEvent("update:regions"))}}let q,F,
|
|
1
|
+
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-bb824ab4.js";import{C as e,a as t}from"./shared-8edee4e1.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{_ as s,h as i,k as n,E as o,N as r,B as a,P as l,A as c}from"./shared-63eaded9.js";import{l as d}from"./shared-218ba06e.js";import{C as u}from"./shared-d8852c42.js";import{C as h}from"./shared-593f7e2c.js";import{N as p}from"./shared-44cfc617.js";import{T as g,a as f,S as _,R as y}from"./shared-3f35fa81.js";import{c as x}from"./shared-4e709717.js";import{i as m}from"./shared-6d45a07b.js";import{G as b}from"./shared-4d3c7828.js";import"./shared-ff79f3f9.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import"./shared-ec861f31.js";import"./shared-1761daef.js";import"./shared-87ca7818.js";import"./shared-b0f0e8b5.js";import"./shared-a46edf4b.js";import"./shared-00563cb0.js";import"./shared-7684cb05.js";let $,v,k,S,w,j=e=>e;const O=h(g(f(p)));class T extends O{constructor(){super(...arguments),this.regions=[],this.region="",this.name="",this.code=""}static get properties(){return s(s({},super.properties),{},{regions:{type:Array},region:{type:String},name:{type:String},code:{type:String}})}render(){var e,t;return i($||($=j` <div class="border border-contrast-10 rounded text-s"> <div class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button class="mr-xs flex items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div class="flex flex-wrap p-xs"> ${0} <div class="h-s m-xs flex items-center transition-colors border border-contrast-10 hover-border-contrast-40 focus-within-ring-1 focus-within-ring-primary-50 focus-within-border-primary-50" style="border-radius:var(--lumo-size-s)"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),this.name||this.code,this.name?i(v||(v=j`<span class="text-secondary">${0}</span>`),this.code):"",(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const n=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return i(k||(k=j` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button class="flex items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),n||e,n?i(S||(S=j`<span class="text-secondary">${0}</span>`),e):"",(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),this.t("add_region"),this.region,(e=>{"Enter"===e.key&&this.region&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.region=t.value}),x({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.region,"bg-success-10 text-success cursor-pointer":!!this.region,"hover-bg-success hover-text-success-contrast":!!this.region,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.region}),!this.region,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(w||(w=j`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.region])],this.region="",this.dispatchEvent(new CustomEvent("update:regions"))}}let q,N,F,J=e=>e;const E=_(g(f(p)));class C extends E{constructor(){super(...arguments),this.countries={},this.disabled=!1,this.readonly=!1,this.regions="",this.country=""}static get scopedElements(){return{"x-country-card":T,"iron-icon":customElements.get("iron-icon")}}static get properties(){return s(s({},super.properties),{},{countries:{type:Object},disabled:{type:Boolean},readonly:{type:Boolean},regions:{type:String},country:{type:String}})}render(){var e,t;return i(q||(q=J` <div> <div class="space-y-s"> ${0} <div class="h-m flex items-center rounded transition-colors border border-contrast-10 hover-border-contrast-40 focus-within-ring-1 focus-within-ring-primary-50 focus-within-border-primary-50"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" @keydown="${0}" @input="${0}"> <button class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([e,t])=>{var n,o;let r;try{const t=new URL(this.regions);t.searchParams.set("country_code",e),r=t.toString()}catch(e){r=""}return i(N||(N=J` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===t?[]:t),e,m(null===(o=null===(n=this.data)||void 0===n?void 0:n.values[e])||void 0===o?void 0:o.default),r,this.lang,this.ns,this.disabled,this.readonly,(t=>{const i=s({},this.countries),n=t.currentTarget.regions;i[e]=n.length?n:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const t=s({},this.countries);delete t[e],this.countries=t,this.dispatchEvent(new CustomEvent("update:countries"))}))})),this.t("add_country"),this.country,(e=>{"Enter"===e.key&&this.country&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.country=t.value}),x({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.country,"bg-success-10 text-success cursor-pointer":!!this.country,"hover-bg-success hover-text-success-contrast":!!this.country,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.country}),!this.country,this.__addCountry,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(F||(F=J`<option value="${0}">${0}</option>`),e.cc2,e.default))))}__addCountry(){this.countries=s(s({},this.countries),{},{[this.country]:"*"}),this.country="",this.dispatchEvent(new CustomEvent("update:countries"))}}const H=n((e=>t=>{let s;if(t instanceof o||t instanceof r)throw new Error("The `live` directive is not allowed on text or event bindings");if(t instanceof a)I(t.strings),s=t.element.hasAttribute(t.name),t.value=s;else{const{element:i,name:n,strings:o}=t.committer;if(I(o),t instanceof l){if(s=i[n],s===e)return}else t instanceof c&&(s=i.getAttribute(n));if(s===String(e))return}t.setValue(e)})),I=e=>{if(2!==e.length||""!==e[0]||""!==e[1])throw new Error("`live` bindings can only contain a single expression")};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
@@ -11,4 +11,4 @@ import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-bb824a
|
|
|
11
11
|
* Code distributed by Google as part of the polymer project is also
|
|
12
12
|
* subject to an additional IP rights grant found at
|
|
13
13
|
* http://polymer.github.io/PATENTS.txt
|
|
14
|
-
*/let V,z,A,R,D,B,G,P,L,M,U,W,Y,K,Q,X,Z,ee,te,se,ie,ne,oe,re,ae,le,ce,de=e=>e;const ue=_(y(h(g(f(p,"template-config-form")))));class he extends ue{constructor(){super(...arguments),this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":C,"x-checkbox":u,"x-choice":e,"x-group":b}}static get properties(){return s(s({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenControls,n=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},segment_io:{usage:"none",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return i(V||(V=de` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="${0}"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),x({"space-y-l transition-opacity":!0,"opacity-50":!this.in("idle")}),s.matches("cart-type",!0)?"":this.__renderCartType(n),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(n),s.matches("locations",!0)?"":this.__renderLocations(n),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(n),s.matches("cards",!0)?"":this.__renderCards(n),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(n),s.matches("consent",!0)?"":this.__renderConsent(n),s.matches("fields",!0)?"":this.__renderFields(n),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(n),s.matches("segment-io",!0)?"":this.__renderSegmentIo(n),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(n),s.matches("custom-config",!0)?"":this.__renderCustomConfig(n),s.matches("header",!0)?"":this.__renderHeader(n),s.matches("custom-fields",!0)?"":this.__renderCustomFields(n),s.matches("footer",!0)?"":this.__renderFooter(n),x({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(e){const{lang:t,ns:n}=this,o=["default","fullpage","custom"];return i(z||(z=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="cart_type" ns="${0}"></foxy-i18n> <x-choice .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),t,n,e.cart_type,o,this.disabledSelector.matches("cart-type",!0),this.readonlySelector.matches("cart-type",!0),(t=>{this.edit({json:JSON.stringify(s(s({},e),{},{cart_type:t.detail}))})}),o.map((e=>i(A||(A=de` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-secondary text-xs" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,n,t,e,n))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:n,ns:o}=this,r=this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),l=["combobox","search","disabled"],c="none"===e.foxycomplete.usage?"disabled":e.foxycomplete.show_combobox?"combobox":"search",d=()=>i(R||(R=de` <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="show_country_flags" ns="${0}"> </foxy-i18n> </x-checkbox> `),r,a,e.foxycomplete.show_flags,(t=>{const i=s(s({},e.foxycomplete),{},{show_flags:t.detail});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:i}))})}),n,o);return i(D||(D=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="foxycomplete" ns="${0}"></foxy-i18n> <x-choice .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}"> ${0} </div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),n,o,c,l,r,a,(i=>{if(!(i instanceof t))return;const n=s(s({},e.foxycomplete),{},{usage:"disabled"===i.detail?"none":"required",show_combobox:"combobox"===i.detail});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:n}))})}),l.map((e=>i(B||(B=de` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-secondary text-xs" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,n,e,o,n,e,o))),"combobox"!==c,["open","close"].map((t=>{const n="open"===t?"combobox_open":"combobox_close";return i(G||(G=de` <vaadin-text-field label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-field> `),this.t(`${t}_icon`),e.foxycomplete[n],r,a,(t=>{const i=t.currentTarget,o=s(s({},e.foxycomplete),{},{[n]:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:o}))})}))})),d(),"search"!==c,d(),r,a,"enabled"===e.postal_code_lookup.usage,(t=>{const i={usage:t.detail?"enabled":"none"};this.edit({json:JSON.stringify(s(s({},e),{},{postal_code_lookup:i}))})}),n,o,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,n=e.location_filtering,o="blacklist"===n.shipping_filter_type?"block":"allow",r="both"===n.usage?"copy":"blacklist"===n.billing_filter_type?"block":"allow",a=()=>{if("both"===n.usage)n.billing_filter_type=n.shipping_filter_type,n.billing_filter_values=n.shipping_filter_values;else{const e=Object.keys(n.billing_filter_values).length>0,t=Object.keys(n.shipping_filter_values).length>0;n.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return i(P||(P=de` ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="location_plural" ns="${0}"></foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="text-tertiary" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice .items="${0}" .value="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="text-tertiary" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice .items="${0}" .value="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"></foxy-i18n> <x-countries-list countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} `),this.renderTemplateOrSlot("locations:before"),t,s,t,s,["allow","block"],o,(t=>{"both"!==n.usage&&(n.usage="independent"),n.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",a(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(n.shipping_filter_values),this.regions,this.countries,o,t,s,this.disabledSelector.matches("locations",!0),this.readonlySelector.matches("locations",!0),(t=>{n.shipping_filter_values=t.currentTarget.countries,a(),this.edit({json:JSON.stringify(e)})}),t,s,["allow","block","copy"],r,(t=>{"copy"===t.detail?n.usage="both":(n.usage="independent",n.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),a(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(n.billing_filter_values),this.regions,this.countries,r,t,s,this.disabledSelector.matches("locations",!0),this.readonlySelector.matches("locations",!0),"copy"===r,(t=>{n.billing_filter_values=t.currentTarget.countries,a(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,n=[],o=[],r=e.cart_display_config;for(const e in r){if(!e.startsWith("show_"))continue;const t=e.substring(5);n.push(t),"required"!==r.usage||r[e]||o.push(t)}"required"===r.usage&&o.push(...r.hidden_product_options);const a=()=>{r.usage="required",n.includes(this.__addHiddenFieldInputValue)?r[`show_${this.__addHiddenFieldInputValue}`]=!1:r.hidden_product_options.includes(this.__addHiddenFieldInputValue)||r.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},l="calc(var(--lumo-border-radius-l) / 1.2)",c=0===o.length?[l]:["0","0",l,l];return i(L||(L=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="hidden_fields" ns="${0}"></foxy-i18n> <div class="divide-y divide-contrast-10"> ${0} </div> <div style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),t,s,o.map((o=>i(M||(M=de` <div class="h-m ml-m pr-xs flex items-center justify-between"> ${0} <button class="flex w-xs h-xs items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),n.includes(o)?i(U||(U=de`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,o,s):i(W||(W=de`<span>${0}</span>`),o),(()=>{"boolean"==typeof r[`show_${o}`]?r[`show_${o}`]=!0:r.hidden_product_options=r.hidden_product_options.filter((e=>e!==o)),this.edit({json:JSON.stringify(e)})})))),c.join(" "),x({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":o.length>0}),this.t("add_field"),H(this.__addHiddenFieldInputValue),(e=>"Enter"===e.key&&a()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),n.filter((e=>!o.includes(e))).map((e=>i(Y||(Y=de`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),x({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__addHiddenFieldInputValue,"bg-success-10 text-success cursor-pointer":!!this.__addHiddenFieldInputValue,"hover-bg-success hover-text-success-contrast":!!this.__addHiddenFieldInputValue,"focus-outline-none focus-ring-2":!!this.__addHiddenFieldInputValue}),!this.__addHiddenFieldInputValue,a,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:t,ns:s}=this,n=this.disabledSelector.matches("cards",!0),o=e.supported_payment_cards;let r,a;"all_cards"===e.csc_requirements?(r=!1,a=!1):"sso_only"===e.csc_requirements?(r=!0,a=!1):(r=!0,a=!0);const l={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(K||(K=de` <div> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="supported_cards" ns="${0}"></foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs text-secondary leading-s block" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),t,s,Object.entries(d).map((([t,s])=>{if(!l[t])return;const r=o.includes(t);return i(Q||(Q=de` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),x({"m-xs rounded":!0,"opacity-50 cursor-default":n,"cursor-pointer ring-primary-50 focus-within-ring-2":!n}),x({"overflow-hidden transition-colors flex rounded border":!0,"border-primary bg-primary-10 text-primary":r,"hover-text-body":r&&!n,"border-contrast-10":!r,"hover-border-primary hover-text-primary":!r&&!n}),s,l[t],n,r,(s=>{s.stopPropagation(),r?o.splice(o.indexOf(t),1):o.push(t),this.edit({json:JSON.stringify(e)})}))})),n||"new_cards_only"===e.csc_requirements,r,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,n,a,(t=>{e.csc_requirements=t.detail?"new_cards_only":r?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this;return i(X||(X=de` <div> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="checkout_type" ns="${0}"></foxy-i18n> <x-choice ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-secondary text-xs leading-s block" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),t,s,this.disabledSelector.matches("checkout-type",!0),this.readonlySelector.matches("checkout-type",!0),["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,n=e.tos_checkbox_settings,o=e.newsletter_subscribe,r=e.eu_secure_data_transfer_consent,a=this.disabledSelector.matches("consent",!0),l=this.readonlySelector.matches("consent",!0),c="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return i(Z||(Z=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="consent" ns="${0}"></foxy-i18n> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),t,s,a,l,"required"===n.usage||"optional"===n.usage,(t=>{n.initial_state=t.detail?n.initial_state:"unchecked",n.is_hidden=!1,n.usage=t.detail?"required":"none",n.url=t.detail?n.url:"",this.edit({json:JSON.stringify(e)})}),t,s,t,s,"none"===n.usage,this.t("location_url"),a,l,n.url,(t=>{n.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),a,"required"===n.usage,(t=>{n.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,a,"checked"===n.initial_state,(t=>{n.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,c,a,l,"required"===o.usage,(t=>{o.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,t,s,c,a,l,"required"===r.usage,(t=>{r.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("consent:before"))}__renderFields(e){const{lang:t,ns:s}=this,n=this.disabledSelector.matches("fields",!0),o=e.custom_checkout_field_requirements;return i(ee||(ee=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="field_plural" ns="${0}"></foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 md-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden md-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([e,r])=>i(te||(te=de` <label class="flex items-center pl-m bg-base"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> <select class="h-s mr-xs text-right appearance-none bg-transparent cursor-pointer focus-outline-none font-medium"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),t,e.replace("billing_",""),s,x({"px-s m-xs flex items-center cursor-pointer rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!n,"hover-text-primary":!n,"opacity-50":n}),r.map((t=>i(se||(se=de` <option value="${0}" ?selected="${0}"> ${0} </option> `),t,o[e]===t,this.t(t))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,n=e.analytics_config,o=n.segment_io,r=n.google_analytics,a=this.disabledSelector.matches("google-analytics",!0),l=this.readonlySelector.matches("google-analytics",!0);return i(ie||(ie=de` <div> ${0} <x-group frame> <span slot="header">Google Analytics</span> <div class="p-m space-y-m"> <vaadin-text-field class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),this.t("ga_account_id"),this.t("ga_account_id_explainer"),H(r.account_id),a,l,(e=>"Enter"===e.key&&this.submit()),(e=>{r.account_id=e.currentTarget.value,r.usage=r.account_id?"required":"none",n.usage=r.account_id||o.account_id?"required":"none"}),a,l,r.include_on_site,(t=>{r.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderSegmentIo(e){const t=e.analytics_config,s=t.segment_io,n=t.google_analytics,o=this.disabledSelector.matches("segment-io",!0),r=this.readonlySelector.matches("segment-io",!0);return i(ne||(ne=de` <div> ${0} <x-group frame> <span slot="header">Segment.io</span> <div class="p-m"> <vaadin-text-field class="w-full" label="${0}" placeholder="MY-WRITE-KEY" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("segment-io:before"),this.t("sio_account_id"),this.t("sio_account_id_explainer"),H(s.account_id),o,r,(e=>"Enter"===e.key&&this.submit()),(e=>{s.account_id=e.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=n.account_id||s.account_id?"required":"none"}),this.renderTemplateOrSlot("segment-io:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,n=e.debug;return i(oe||(oe=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="troubleshooting" ns="${0}"></foxy-i18n> <div class="p-m space-y-m"> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),t,s,this.disabledSelector.matches("troubleshooting",!0),this.readonlySelector.matches("troubleshooting",!0),"required"===n.usage,(t=>{n.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("troubleshooting:after"))}__renderCustomConfig(e){return i(re||(re=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" placeholder='{ "key": "value" }' helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-config:before"),this.t("custom_config"),this.t("custom_config_helper_text"),e.custom_config?JSON.stringify(e.custom_config,null,2):"",this.disabledSelector.matches("custom-config",!0),this.readonlySelector.matches("custom-config",!0),(t=>{const s=t.currentTarget;try{e.custom_config=s.value?JSON.parse(s.value):"",this.edit({json:JSON.stringify(e)}),s.invalid=!1}catch(e){s.invalid=!0}}),this.renderTemplateOrSlot("custom-config:after"))}__renderHeader(e){return i(ae||(ae=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.t("custom_header"),this.t("custom_header_helper_text"),e.custom_script_values.header,this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{header:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("header:after"))}__renderCustomFields(e){return i(le||(le=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-fields:before"),this.t("custom_fields"),this.t("custom_fields_helper_text"),e.custom_script_values.header,this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const s=t.currentTarget.value;e.custom_script_values.checkout_fields=s,this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("custom-fields:after"))}__renderFooter(e){return i(ce||(ce=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("footer:before"),this.t("custom_footer"),this.t("custom_footer_helper_text"),e.custom_script_values.footer,this.disabledSelector.matches("footer",!0),this.readonlySelector.matches("footer",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{footer:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("footer:after"))}}customElements.define("foxy-template-config-form",he);export{he as TemplateConfigForm};
|
|
14
|
+
*/let V,z,A,R,D,B,G,P,L,M,U,W,Y,K,Q,X,Z,ee,te,se,ie,ne,oe,re,ae,le,ce,de=e=>e;const ue=_(y(h(g(f(p,"template-config-form")))));class he extends ue{constructor(){super(...arguments),this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":C,"x-checkbox":u,"x-choice":e,"x-group":b}}static get properties(){return s(s({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenControls,n=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},segment_io:{usage:"none",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return i(V||(V=de` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="${0}"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),x({"space-y-l transition-opacity":!0,"opacity-50":!this.in("idle")}),s.matches("cart-type",!0)?"":this.__renderCartType(n),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(n),s.matches("locations",!0)?"":this.__renderLocations(n),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(n),s.matches("cards",!0)?"":this.__renderCards(n),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(n),s.matches("consent",!0)?"":this.__renderConsent(n),s.matches("fields",!0)?"":this.__renderFields(n),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(n),s.matches("segment-io",!0)?"":this.__renderSegmentIo(n),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(n),s.matches("custom-config",!0)?"":this.__renderCustomConfig(n),s.matches("header",!0)?"":this.__renderHeader(n),s.matches("custom-fields",!0)?"":this.__renderCustomFields(n),s.matches("footer",!0)?"":this.__renderFooter(n),x({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(e){const{lang:t,ns:n}=this,o=["default","fullpage","custom"];return i(z||(z=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="cart_type" ns="${0}"></foxy-i18n> <x-choice .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),t,n,e.cart_type,o,this.disabledSelector.matches("cart-type",!0),this.readonlySelector.matches("cart-type",!0),(t=>{this.edit({json:JSON.stringify(s(s({},e),{},{cart_type:t.detail}))})}),o.map((e=>i(A||(A=de` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-secondary text-xs" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,n,t,e,n))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:n,ns:o}=this,r=this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),l=["combobox","search","disabled"],c="none"===e.foxycomplete.usage?"disabled":e.foxycomplete.show_combobox?"combobox":"search",d=()=>i(R||(R=de` <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="show_country_flags" ns="${0}"> </foxy-i18n> </x-checkbox> `),r,a,e.foxycomplete.show_flags,(t=>{const i=s(s({},e.foxycomplete),{},{show_flags:t.detail});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:i}))})}),n,o);return i(D||(D=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="foxycomplete" ns="${0}"></foxy-i18n> <x-choice .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}"> ${0} </div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),n,o,c,l,r,a,(i=>{if(!(i instanceof t))return;const n=s(s({},e.foxycomplete),{},{usage:"disabled"===i.detail?"none":"required",show_combobox:"combobox"===i.detail});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:n}))})}),l.map((e=>i(B||(B=de` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-secondary text-xs" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,n,e,o,n,e,o))),"combobox"!==c,["open","close"].map((t=>{const n="open"===t?"combobox_open":"combobox_close";return i(G||(G=de` <vaadin-text-field label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-field> `),this.t(`${t}_icon`),e.foxycomplete[n],r,a,(t=>{const i=t.currentTarget,o=s(s({},e.foxycomplete),{},{[n]:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{foxycomplete:o}))})}))})),d(),"search"!==c,d(),r,a,"enabled"===e.postal_code_lookup.usage,(t=>{const i={usage:t.detail?"enabled":"none"};this.edit({json:JSON.stringify(s(s({},e),{},{postal_code_lookup:i}))})}),n,o,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,n=e.location_filtering,o="blacklist"===n.shipping_filter_type?"block":"allow",r="both"===n.usage?"copy":"blacklist"===n.billing_filter_type?"block":"allow",a=()=>{if("both"===n.usage)n.billing_filter_type=n.shipping_filter_type,n.billing_filter_values=n.shipping_filter_values;else{const e=Object.keys(n.billing_filter_values).length>0,t=Object.keys(n.shipping_filter_values).length>0;n.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return i(P||(P=de` ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="location_plural" ns="${0}"></foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="text-tertiary" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice .items="${0}" .value="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="text-tertiary" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice .items="${0}" .value="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"></foxy-i18n> <x-countries-list countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} `),this.renderTemplateOrSlot("locations:before"),t,s,t,s,["allow","block"],o,(t=>{"both"!==n.usage&&(n.usage="independent"),n.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",a(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(n.shipping_filter_values),this.regions,this.countries,o,t,s,this.disabledSelector.matches("locations",!0),this.readonlySelector.matches("locations",!0),(t=>{n.shipping_filter_values=t.currentTarget.countries,a(),this.edit({json:JSON.stringify(e)})}),t,s,["allow","block","copy"],r,(t=>{"copy"===t.detail?n.usage="both":(n.usage="independent",n.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),a(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(n.billing_filter_values),this.regions,this.countries,r,t,s,this.disabledSelector.matches("locations",!0),this.readonlySelector.matches("locations",!0),"copy"===r,(t=>{n.billing_filter_values=t.currentTarget.countries,a(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,n=[],o=[],r=e.cart_display_config;for(const e in r){if(!e.startsWith("show_"))continue;const t=e.substring(5);n.push(t),"required"!==r.usage||r[e]||o.push(t)}"required"===r.usage&&o.push(...r.hidden_product_options);const a=()=>{r.usage="required",n.includes(this.__addHiddenFieldInputValue)?r[`show_${this.__addHiddenFieldInputValue}`]=!1:r.hidden_product_options.includes(this.__addHiddenFieldInputValue)||r.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},l="calc(var(--lumo-border-radius-l) / 1.2)",c=0===o.length?[l]:["0","0",l,l];return i(L||(L=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="hidden_fields" ns="${0}"></foxy-i18n> <div class="divide-y divide-contrast-10"> ${0} </div> <div style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),t,s,o.map((o=>i(M||(M=de` <div class="h-m ml-m pr-xs flex items-center justify-between"> ${0} <button class="flex w-xs h-xs items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),n.includes(o)?i(U||(U=de`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,o,s):i(W||(W=de`<span>${0}</span>`),o),(()=>{"boolean"==typeof r[`show_${o}`]?r[`show_${o}`]=!0:r.hidden_product_options=r.hidden_product_options.filter((e=>e!==o)),this.edit({json:JSON.stringify(e)})})))),c.join(" "),x({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":o.length>0}),this.t("add_field"),H(this.__addHiddenFieldInputValue),(e=>"Enter"===e.key&&a()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),n.filter((e=>!o.includes(e))).map((e=>i(Y||(Y=de`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),x({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__addHiddenFieldInputValue,"bg-success-10 text-success cursor-pointer":!!this.__addHiddenFieldInputValue,"hover-bg-success hover-text-success-contrast":!!this.__addHiddenFieldInputValue,"focus-outline-none focus-ring-2":!!this.__addHiddenFieldInputValue}),!this.__addHiddenFieldInputValue,a,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:t,ns:s}=this,n=this.disabledSelector.matches("cards",!0),o=e.supported_payment_cards;let r,a;"all_cards"===e.csc_requirements?(r=!1,a=!1):"sso_only"===e.csc_requirements?(r=!0,a=!1):(r=!0,a=!0);const l={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(K||(K=de` <div> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="supported_cards" ns="${0}"></foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs text-secondary leading-s block" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),t,s,Object.entries(d).map((([t,s])=>{if(!l[t])return;const r=o.includes(t);return i(Q||(Q=de` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),x({"m-xs rounded":!0,"opacity-50 cursor-default":n,"cursor-pointer ring-primary-50 focus-within-ring-2":!n}),x({"overflow-hidden transition-colors flex rounded border":!0,"border-primary bg-primary-10 text-primary":r,"hover-text-body":r&&!n,"border-contrast-10":!r,"hover-border-primary hover-text-primary":!r&&!n}),s,l[t],n,r,(s=>{s.stopPropagation(),r?o.splice(o.indexOf(t),1):o.push(t),this.edit({json:JSON.stringify(e)})}))})),n||"new_cards_only"===e.csc_requirements,r,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,n,a,(t=>{e.csc_requirements=t.detail?"new_cards_only":r?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this;return i(X||(X=de` <div> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n slot="header" lang="${0}" key="checkout_type" ns="${0}"></foxy-i18n> <x-choice ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-secondary text-xs leading-s block" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),t,s,this.disabledSelector.matches("checkout-type",!0),this.readonlySelector.matches("checkout-type",!0),["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,n=e.tos_checkbox_settings,o=e.newsletter_subscribe,r=e.eu_secure_data_transfer_consent,a=this.disabledSelector.matches("consent",!0),l=this.readonlySelector.matches("consent",!0),c="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return i(Z||(Z=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="consent" ns="${0}"></foxy-i18n> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox class="m-s" ?disabled="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),t,s,a,l,"required"===n.usage||"optional"===n.usage,(t=>{n.initial_state=t.detail?n.initial_state:"unchecked",n.is_hidden=!1,n.usage=t.detail?"required":"none",n.url=t.detail?n.url:"",this.edit({json:JSON.stringify(e)})}),t,s,t,s,"none"===n.usage,this.t("location_url"),a,l,n.url,(t=>{n.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),a,"required"===n.usage,(t=>{n.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,a,"checked"===n.initial_state,(t=>{n.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,c,a,l,"required"===o.usage,(t=>{o.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,t,s,c,a,l,"required"===r.usage,(t=>{r.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("consent:before"))}__renderFields(e){const{lang:t,ns:s}=this,n=this.disabledSelector.matches("fields",!0),o=e.custom_checkout_field_requirements;return i(ee||(ee=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="field_plural" ns="${0}"></foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 md-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden md-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,a])=>i(te||(te=de` <label class="flex items-center pl-m bg-base"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> <select class="h-s mr-xs text-right appearance-none bg-transparent cursor-pointer focus-outline-none font-medium" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),t,r.replace("billing_",""),s,x({"px-s m-xs flex items-center cursor-pointer rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!n,"hover-text-primary":!n,"opacity-50":n}),(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;o[r]=i,this.edit({json:JSON.stringify(e)})}),a.map((e=>i(se||(se=de` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,o[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,n=e.analytics_config,o=n.segment_io,r=n.google_analytics,a=this.disabledSelector.matches("google-analytics",!0),l=this.readonlySelector.matches("google-analytics",!0);return i(ie||(ie=de` <div> ${0} <x-group frame> <span slot="header">Google Analytics</span> <div class="p-m space-y-m"> <vaadin-text-field class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),this.t("ga_account_id"),this.t("ga_account_id_explainer"),H(r.account_id),a,l,(e=>"Enter"===e.key&&this.submit()),(e=>{r.account_id=e.currentTarget.value,r.usage=r.account_id?"required":"none",n.usage=r.account_id||o.account_id?"required":"none"}),a,l,r.include_on_site,(t=>{r.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderSegmentIo(e){const t=e.analytics_config,s=t.segment_io,n=t.google_analytics,o=this.disabledSelector.matches("segment-io",!0),r=this.readonlySelector.matches("segment-io",!0);return i(ne||(ne=de` <div> ${0} <x-group frame> <span slot="header">Segment.io</span> <div class="p-m"> <vaadin-text-field class="w-full" label="${0}" placeholder="MY-WRITE-KEY" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("segment-io:before"),this.t("sio_account_id"),this.t("sio_account_id_explainer"),H(s.account_id),o,r,(e=>"Enter"===e.key&&this.submit()),(e=>{s.account_id=e.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=n.account_id||s.account_id?"required":"none"}),this.renderTemplateOrSlot("segment-io:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,n=e.debug;return i(oe||(oe=de` <div> ${0} <x-group frame> <foxy-i18n slot="header" lang="${0}" key="troubleshooting" ns="${0}"></foxy-i18n> <div class="p-m space-y-m"> <x-checkbox ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s text-secondary" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),t,s,this.disabledSelector.matches("troubleshooting",!0),this.readonlySelector.matches("troubleshooting",!0),"required"===n.usage,(t=>{n.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,t,s,this.renderTemplateOrSlot("troubleshooting:after"))}__renderCustomConfig(e){return i(re||(re=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" placeholder='{ "key": "value" }' helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-config:before"),this.t("custom_config"),this.t("custom_config_helper_text"),e.custom_config?JSON.stringify(e.custom_config,null,2):"",this.disabledSelector.matches("custom-config",!0),this.readonlySelector.matches("custom-config",!0),(t=>{const s=t.currentTarget;try{e.custom_config=s.value?JSON.parse(s.value):"",this.edit({json:JSON.stringify(e)}),s.invalid=!1}catch(e){s.invalid=!0}}),this.renderTemplateOrSlot("custom-config:after"))}__renderHeader(e){return i(ae||(ae=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.t("custom_header"),this.t("custom_header_helper_text"),e.custom_script_values.header,this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{header:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("header:after"))}__renderCustomFields(e){return i(le||(le=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-fields:before"),this.t("custom_fields"),this.t("custom_fields_helper_text"),e.custom_script_values.header,this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const s=t.currentTarget.value;e.custom_script_values.checkout_fields=s,this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("custom-fields:after"))}__renderFooter(e){return i(ce||(ce=de` <div> ${0} <vaadin-text-area class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("footer:before"),this.t("custom_footer"),this.t("custom_footer_helper_text"),e.custom_script_values.footer,this.disabledSelector.matches("footer",!0),this.readonlySelector.matches("footer",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{footer:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("footer:after"))}}customElements.define("foxy-template-config-form",he);export{he as TemplateConfigForm};
|
|
@@ -837,6 +837,12 @@ export class TemplateConfigForm extends Base {
|
|
|
837
837
|
>
|
|
838
838
|
<select
|
|
839
839
|
class="h-s mr-xs text-right appearance-none bg-transparent cursor-pointer focus-outline-none font-medium"
|
|
840
|
+
@change=${(evt) => {
|
|
841
|
+
const select = evt.currentTarget;
|
|
842
|
+
const value = select.options[select.options.selectedIndex].value;
|
|
843
|
+
config[property] = value;
|
|
844
|
+
this.edit({ json: JSON.stringify(json) });
|
|
845
|
+
}}
|
|
840
846
|
>
|
|
841
847
|
${values.map(value => {
|
|
842
848
|
return html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateConfigForm.js","sourceRoot":"","sources":["../../../../src/elements/public/TemplateConfigForm/TemplateConfigForm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,sCAAmC;AAEpD,OAAO,EAAuB,iBAAiB,EAAE,gCAA6B;AAE9E,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,2CAAwC;AAC3D,OAAO,EAAE,MAAM,EAAE,uCAAoC;AACrD,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,aAAa,EAAE,2BAAwB;AAChD,OAAO,EAAE,KAAK,EAAE,qCAAkC;AAClD,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAG7D,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,cAAc,EAAE,sBAAmB;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAClC,MAAM,IAAI,GAAG,mBAAmB,CAC9B,eAAe,CAAC,iBAAiB,CAAC,cAAc,CAAC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AG,CAAC,aAAiC,CAAC,KAAK,CAAC;YAC9D,IAAI,CAAC,oBAAoB,CAAC,eAAe,GAAG,QAAQ,CAAC;YACrD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC;;;;UAID,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,CAAC;;KAErD,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,IAAwB;QAC7C,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC;;;;kBAIlC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;wBACjB,IAAI,CAAC,CAAC,CAAC,2BAA2B,CAAC;mBACxC,IAAI,CAAC,oBAAoB,CAAC,MAAM;sBAC7B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;sBAC7C,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;mBAChD,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,MAAM,GAAG,GAAG,CAAC,aAAgC,CAAC;YACpD,MAAM,SAAS,GAA+C;gBAC5D,GAAG,IAAI,CAAC,oBAAoB;gBAC5B,MAAM,EAAE,MAAM,CAAC,KAAK;aACrB,CAAC;YAEF,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,oBAAoB,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;QACpF,CAAC;;;;UAID,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;KAE9C,CAAC;IACJ,CAAC;CACF","sourcesContent":["import * as logos from '../PaymentMethodCard/logos';\n\nimport { CheckboxChangeEvent, ChoiceChangeEvent } from '../../private/events';\nimport { Data, TemplateConfigJSON } from './types';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { Checkbox } from '../../private/Checkbox/Checkbox';\nimport { Choice } from '../../private/Choice/Choice';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { CountriesList } from './CountriesList';\nimport { Group } from '../../private/Group/Group';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { TextAreaElement } from '@vaadin/vaadin-text-field/vaadin-text-area';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { getDefaultJSON } from './defaults';\nimport { live } from 'lit-html/directives/live';\n\nconst NS = 'template-config-form';\nconst Base = ScopedElementsMixin(\n ResponsiveMixin(ConfigurableMixin(ThemeableMixin(TranslatableMixin(NucleonElement, NS))))\n);\n\nexport class TemplateConfigForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-text-area': customElements.get('vaadin-text-area'),\n 'iron-icon': customElements.get('iron-icon'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'x-countries-list': CountriesList,\n 'x-checkbox': Checkbox,\n 'x-choice': Choice,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __addHiddenFieldInputValue: { attribute: false },\n countries: { type: String },\n regions: { type: String },\n };\n }\n\n countries = '';\n\n regions = '';\n\n private __addHiddenFieldInputValue = '';\n\n render(): TemplateResult {\n const hidden = this.hiddenControls;\n const json: TemplateConfigJSON = this.form.json ? JSON.parse(this.form.json) : getDefaultJSON();\n\n return html`\n <div class=\"relative\" aria-busy=${this.in('busy')} aria-live=\"polite\">\n <div\n class=${classMap({\n 'space-y-l transition-opacity': true,\n 'opacity-50': !this.in('idle'),\n })}\n >\n ${hidden.matches('cart-type', true) ? '' : this.__renderCartType(json)}\n ${hidden.matches('foxycomplete', true) ? '' : this.__renderFoxycomplete(json)}\n ${hidden.matches('locations', true) ? '' : this.__renderLocations(json)}\n ${hidden.matches('hidden-fields', true) ? '' : this.__renderHiddenFields(json)}\n ${hidden.matches('cards', true) ? '' : this.__renderCards(json)}\n ${hidden.matches('checkout-type', true) ? '' : this.__renderCheckoutType(json)}\n ${hidden.matches('consent', true) ? '' : this.__renderConsent(json)}\n ${hidden.matches('fields', true) ? '' : this.__renderFields(json)}\n ${hidden.matches('google-analytics', true) ? '' : this.__renderGoogleAnalytics(json)}\n ${hidden.matches('segment-io', true) ? '' : this.__renderSegmentIo(json)}\n ${hidden.matches('troubleshooting', true) ? '' : this.__renderTroubleshooting(json)}\n ${hidden.matches('custom-config', true) ? '' : this.__renderCustomConfig(json)}\n ${hidden.matches('header', true) ? '' : this.__renderHeader(json)}\n ${hidden.matches('custom-fields', true) ? '' : this.__renderCustomFields(json)}\n ${hidden.matches('footer', true) ? '' : this.__renderFooter(json)}\n </div>\n\n <div\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': this.in('idle'),\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : 'busy'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private __renderCartType(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const items = ['default', 'fullpage', 'custom'];\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('cart-type:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"cart_type\" ns=${ns}></foxy-i18n>\n\n <x-choice\n .value=${json.cart_type}\n .items=${items}\n ?disabled=${this.disabledSelector.matches('cart-type', true)}\n ?readonly=${this.readonlySelector.matches('cart-type', true)}\n @change=${(evt: ChoiceChangeEvent) => {\n this.edit({ json: JSON.stringify({ ...json, cart_type: evt.detail }) });\n }}\n >\n ${items.map(item => {\n return html`\n <div slot=\"${item}-label\" class=\"grid leading-s py-s\">\n <foxy-i18n lang=${lang} key=\"cart_type_${item}\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-secondary text-xs\"\n lang=${lang}\n key=\"cart_type_${item}_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n `;\n })}\n </x-choice>\n </x-group>\n\n ${this.renderTemplateOrSlot('cart-type:after')}\n </div>\n `;\n }\n\n private __renderFoxycomplete(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const isDisabled = this.disabledSelector.matches('foxycomplete', true);\n const isReadonly = this.readonlySelector.matches('foxycomplete', true);\n const items = ['combobox', 'search', 'disabled'];\n const value =\n json.foxycomplete.usage === 'none'\n ? 'disabled'\n : json.foxycomplete.show_combobox\n ? 'combobox'\n : 'search';\n\n const renderFlagsCheckbox = () => html`\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${json.foxycomplete.show_flags}\n @change=${(evt: CheckboxChangeEvent) => {\n const newConfig: TemplateConfigJSON['foxycomplete'] = {\n ...json.foxycomplete,\n show_flags: evt.detail,\n };\n\n this.edit({ json: JSON.stringify({ ...json, foxycomplete: newConfig }) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"show_country_flags\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n `;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('foxycomplete:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"foxycomplete\" ns=${ns}></foxy-i18n>\n\n <x-choice\n .value=${value}\n .items=${items}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n @change=${(evt: Event) => {\n if (!(evt instanceof ChoiceChangeEvent)) return;\n\n const newConfig: TemplateConfigJSON['foxycomplete'] = {\n ...json.foxycomplete,\n usage: evt.detail === 'disabled' ? 'none' : 'required',\n show_combobox: evt.detail === 'combobox',\n };\n\n this.edit({ json: JSON.stringify({ ...json, foxycomplete: newConfig }) });\n }}\n >\n ${items.map(item => {\n return html`\n <div slot=\"${item}-label\" class=\"grid leading-s py-s\">\n <foxy-i18n lang=${lang} key=\"foxycomplete_${item}\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-secondary text-xs\"\n lang=${lang}\n key=\"foxycomplete_${item}_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n `;\n })}\n\n <div slot=\"combobox\" class=\"space-y-m pb-s\" ?hidden=${value !== 'combobox'}>\n <div class=\"grid grid-cols-2 gap-m\" style=\"max-width: 16rem\">\n ${['open', 'close'].map(action => {\n const field = action === 'open' ? 'combobox_open' : 'combobox_close';\n\n return html`\n <vaadin-text-field\n label=${this.t(`${action}_icon`)}\n .value=${json.foxycomplete[field]}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n @input=${(evt: CustomEvent) => {\n const target = evt.currentTarget as TextFieldElement;\n const newConfig: TemplateConfigJSON['foxycomplete'] = {\n ...json.foxycomplete,\n [field]: target.value,\n };\n\n this.edit({ json: JSON.stringify({ ...json, foxycomplete: newConfig }) });\n }}\n >\n </vaadin-text-field>\n `;\n })}\n </div>\n\n ${renderFlagsCheckbox()}\n </div>\n\n <div slot=\"search\" class=\"pb-s\" ?hidden=${value !== 'search'}>\n ${renderFlagsCheckbox()}\n </div>\n </x-choice>\n\n <div class=\"border-t border-contrast-10 p-m\">\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${json.postal_code_lookup.usage === 'enabled'}\n @change=${(evt: CheckboxChangeEvent) => {\n const newConfig: TemplateConfigJSON['postal_code_lookup'] = {\n usage: evt.detail ? 'enabled' : 'none',\n };\n\n this.edit({ json: JSON.stringify({ ...json, postal_code_lookup: newConfig }) });\n }}\n >\n <foxy-i18n lang=${lang} key=\"enable_postcode_lookup\" ns=${ns}></foxy-i18n>\n </x-checkbox>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('foxycomplete:after')}\n </div>\n `;\n }\n\n private __renderLocations(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const config = json.location_filtering;\n\n const shippingChoice = config.shipping_filter_type === 'blacklist' ? 'block' : 'allow';\n const billingChoice =\n config.usage === 'both'\n ? 'copy'\n : config.billing_filter_type === 'blacklist'\n ? 'block'\n : 'allow';\n\n const normalize = () => {\n if (config.usage === 'both') {\n config.billing_filter_type = config.shipping_filter_type;\n config.billing_filter_values = config.shipping_filter_values;\n } else {\n const hasBillingFilters = Object.keys(config.billing_filter_values).length > 0;\n const hasShippingFilters = Object.keys(config.shipping_filter_values).length > 0;\n\n if (!hasBillingFilters && !hasShippingFilters) {\n config.usage = 'none';\n } else if (hasBillingFilters && !hasShippingFilters) {\n config.usage = 'billing';\n } else if (hasShippingFilters && !hasBillingFilters) {\n config.usage = 'shipping';\n } else {\n config.usage = 'independent';\n }\n }\n };\n\n return html`\n ${this.renderTemplateOrSlot('locations:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"location_plural\" ns=${ns}></foxy-i18n>\n\n <div class=\"grid sm-grid-cols-2 bg-contrast-10\" style=\"gap: 1px\">\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n class=\"text-tertiary\" slot=\"header\" lang=${lang} key=\"shipping\" ns=${ns}>\n </foxy-i18n>\n\n <x-choice\n .items=${['allow', 'block']}\n .value=${shippingChoice}\n @change=${(evt: ChoiceChangeEvent) => {\n if (config.usage !== 'both') config.usage = 'independent';\n config.shipping_filter_type = evt.detail === 'block' ? 'blacklist' : 'whitelist';\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n slot=\"allow-label\" lang=${lang} key=\"allowlist\" ns=${ns}></foxy-i18n>\n <foxy-i18n slot=\"block-label\" lang=${lang} key=\"blocklist\" ns=${ns}></foxy-i18n>\n\n <x-countries-list\n countries=${JSON.stringify(config.shipping_filter_values)}\n regions=${this.regions}\n class=\"mb-m\"\n href=${this.countries}\n slot=${shippingChoice}\n lang=${lang}\n ns=${ns}\n ?disabled=${this.disabledSelector.matches('locations', true)}\n ?readonly=${this.readonlySelector.matches('locations', true)}\n @update:countries=${(evt: CustomEvent) => {\n config.shipping_filter_values = (evt.currentTarget as CountriesList).countries;\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </x-countries-list>\n </x-choice>\n </x-group>\n\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n class=\"text-tertiary\" slot=\"header\" lang=${lang} key=\"billing\" ns=${ns}>\n </foxy-i18n>\n\n <x-choice\n .items=${['allow', 'block', 'copy']}\n .value=${billingChoice}\n @change=${(evt: ChoiceChangeEvent) => {\n if (evt.detail === 'copy') {\n config.usage = 'both';\n } else {\n config.usage = 'independent';\n config.billing_filter_type = evt.detail === 'block' ? 'blacklist' : 'whitelist';\n }\n\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n slot=\"allow-label\" lang=${lang} key=\"allowlist\" ns=${ns}></foxy-i18n>\n <foxy-i18n slot=\"block-label\" lang=${lang} key=\"blocklist\" ns=${ns}></foxy-i18n>\n <foxy-i18n slot=\"copy-label\" lang=${lang} key=\"same_as_shipping\" ns=${ns}></foxy-i18n>\n\n <x-countries-list\n countries=${JSON.stringify(config.billing_filter_values)}\n regions=${this.regions}\n class=\"mb-m\"\n href=${this.countries}\n slot=${billingChoice}\n lang=${lang}\n ns=${ns}\n ?disabled=${this.disabledSelector.matches('locations', true)}\n ?readonly=${this.readonlySelector.matches('locations', true)}\n ?hidden=${billingChoice === 'copy'}\n @update:countries=${(evt: CustomEvent) => {\n config.billing_filter_values = (evt.currentTarget as CountriesList).countries;\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </x-countries-list>\n </x-choice>\n </x-group>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('locations:after')}\n `;\n }\n\n private __renderHiddenFields(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const suggestions = [] as string[];\n const fields = [] as string[];\n const config = json.cart_display_config;\n\n type FieldName = keyof Omit<\n TemplateConfigJSON['cart_display_config'],\n 'hidden_product_options' | 'usage'\n >;\n\n for (const key in config) {\n if (!key.startsWith('show_')) continue;\n const field = key.substring(5);\n suggestions.push(field);\n if (config.usage === 'required' && !config[key as FieldName]) fields.push(field);\n }\n\n if (config.usage === 'required') {\n fields.push(...config.hidden_product_options);\n }\n\n const addField = () => {\n config.usage = 'required';\n\n if (suggestions.includes(this.__addHiddenFieldInputValue)) {\n config[`show_${this.__addHiddenFieldInputValue}` as FieldName] = false;\n } else if (!config.hidden_product_options.includes(this.__addHiddenFieldInputValue)) {\n config.hidden_product_options.push(this.__addHiddenFieldInputValue);\n }\n\n this.edit({ json: JSON.stringify(json) });\n this.__addHiddenFieldInputValue = '';\n };\n\n const radius = 'calc(var(--lumo-border-radius-l) / 1.2)';\n const inputRadius = fields.length === 0 ? [radius] : ['0', '0', radius, radius];\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('hidden-fields:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"hidden_fields\" ns=${ns}></foxy-i18n>\n\n <div class=\"divide-y divide-contrast-10\">\n ${fields.map(\n field => html`\n <div class=\"h-m ml-m pr-xs flex items-center justify-between\">\n ${suggestions.includes(field)\n ? html`<foxy-i18n lang=${lang} key=${field} ns=${ns}></foxy-i18n>`\n : html`<span>${field}</span>`}\n\n <button\n class=\"flex w-xs h-xs items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50\"\n @click=${() => {\n if (typeof config[`show_${field}` as FieldName] === 'boolean') {\n config[`show_${field}` as FieldName] = true;\n } else {\n config.hidden_product_options = config.hidden_product_options.filter(\n option => option !== field\n );\n }\n\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <iron-icon icon=\"icons:close\" class=\"icon-inline text-m\"></iron-icon>\n </button>\n </div>\n `\n )}\n </div>\n\n <div\n style=\"border-radius: ${inputRadius.join(' ')}\"\n class=${classMap({\n 'h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2': true,\n 'border-t border-contrast-10': fields.length > 0,\n })}\n >\n <input\n placeholder=${this.t('add_field')}\n class=\"w-full bg-transparent appearance-none h-m px-m focus-outline-none\"\n list=\"hidden-fields-list\"\n .value=${live(this.__addHiddenFieldInputValue)}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addField()}\n @input=${(evt: InputEvent) => {\n this.__addHiddenFieldInputValue = (evt.currentTarget as HTMLInputElement).value;\n }}\n />\n\n <datalist id=\"hidden-fields-list\">\n ${suggestions\n .filter(suggestion => !fields.includes(suggestion))\n .map(\n suggestion => html`<option value=${suggestion}>${this.t(suggestion)}</option>`\n )}\n </datalist>\n\n <button\n aria-label=${this.t('add_field')}\n class=${classMap({\n 'w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50': true,\n 'flex items-center justify-center rounded-full transition-colors': true,\n 'bg-contrast-5 text-disabled cursor-default': !this.__addHiddenFieldInputValue,\n 'bg-success-10 text-success cursor-pointer': !!this.__addHiddenFieldInputValue,\n 'hover-bg-success hover-text-success-contrast': !!this.__addHiddenFieldInputValue,\n 'focus-outline-none focus-ring-2': !!this.__addHiddenFieldInputValue,\n })}\n ?disabled=${!this.__addHiddenFieldInputValue}\n @click=${addField}\n >\n <iron-icon icon=\"icons:add\" class=\"icon-inline text-m\"></iron-icon>\n </button>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('hidden-fields:after')}\n </div>\n `;\n }\n\n private __renderCards(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const isDisabled = this.disabledSelector.matches('cards', true);\n const config = json.supported_payment_cards as string[];\n\n let skipForSaved: boolean;\n let skipForSSO: boolean;\n\n if (json.csc_requirements === 'all_cards') {\n skipForSaved = false;\n skipForSSO = false;\n } else if (json.csc_requirements === 'sso_only') {\n skipForSaved = true;\n skipForSSO = false;\n } else {\n skipForSaved = true;\n skipForSSO = true;\n }\n\n const typeToName: Record<string, string> = {\n amex: 'American Express',\n diners: 'Diners Club',\n discover: 'Discover',\n jcb: 'JCB',\n maestro: 'Maestro',\n mastercard: 'Mastercard',\n unionpay: 'UnionPay',\n visa: 'Visa',\n };\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('cards:before')}\n\n <div class=\"space-y-xs\">\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"supported_cards\" ns=${ns}></foxy-i18n>\n\n <div class=\"flex flex-wrap m-xs p-s\">\n ${Object.entries(logos).map(([type, logo]) => {\n if (!typeToName[type]) return;\n const isChecked = config.includes(type);\n\n return html`\n <div\n class=${classMap({\n 'm-xs rounded': true,\n 'opacity-50 cursor-default': isDisabled,\n 'cursor-pointer ring-primary-50 focus-within-ring-2': !isDisabled,\n })}\n >\n <label\n class=${classMap({\n 'overflow-hidden transition-colors flex rounded border': true,\n 'border-primary bg-primary-10 text-primary': isChecked,\n 'hover-text-body': isChecked && !isDisabled,\n 'border-contrast-10': !isChecked,\n 'hover-border-primary hover-text-primary': !isChecked && !isDisabled,\n })}\n >\n <div class=\"h-s\">${logo}</div>\n\n <div class=\"text-s font-medium mx-s my-auto leading-none\">\n ${typeToName[type]}\n </div>\n\n <input\n type=\"checkbox\"\n class=\"sr-only\"\n ?disabled=${isDisabled}\n ?checked=${isChecked}\n @change=${(evt: Event) => {\n evt.stopPropagation();\n\n if (isChecked) {\n config.splice(config.indexOf(type), 1);\n } else {\n config.push(type);\n }\n\n this.edit({ json: JSON.stringify(json) });\n }}\n />\n </label>\n </div>\n `;\n })}\n </div>\n\n <div class=\"flex flex-wrap p-s border-t border-contrast-10\">\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled || json.csc_requirements === 'new_cards_only'}\n ?checked=${skipForSaved}\n @change=${(evt: CheckboxChangeEvent) => {\n json.csc_requirements = evt.detail ? 'sso_only' : 'all_cards';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"skip_csc_for_saved\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled}\n ?checked=${skipForSSO}\n @change=${(evt: CheckboxChangeEvent) => {\n json.csc_requirements = evt.detail\n ? 'new_cards_only'\n : skipForSaved\n ? 'sso_only'\n : 'all_cards';\n\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"skip_csc_for_sso\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n </div>\n </x-group>\n\n <foxy-i18n\n class=\"text-xs text-secondary leading-s block\"\n lang=${lang}\n key=\"supported_cards_disclaimer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('cards:after')}\n </div>\n `;\n }\n\n private __renderCheckoutType(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('checkout-type:before')}\n\n <div class=\"space-y-xs\">\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"checkout_type\" ns=${ns}></foxy-i18n>\n\n <x-choice\n ?disabled=${this.disabledSelector.matches('checkout-type', true)}\n ?readonly=${this.readonlySelector.matches('checkout-type', true)}\n .items=${['default_account', 'default_guest', 'guest_only', 'account_only']}\n .value=${json.checkout_type}\n .getText=${(item: string) => this.t(`checkout_type_${item}`)}\n @change=${(evt: ChoiceChangeEvent) => {\n json.checkout_type = evt.detail as TemplateConfigJSON['checkout_type'];\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </x-choice>\n </x-group>\n\n <foxy-i18n\n class=\"text-secondary text-xs leading-s block\"\n lang=${lang}\n key=\"checkout_type_helper_text\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('checkout-type:after')}\n </div>\n `;\n }\n\n private __renderConsent(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const tosConfig = json.tos_checkbox_settings;\n const mailConfig = json.newsletter_subscribe;\n const sdtaConfig = json.eu_secure_data_transfer_consent;\n const isDisabled = this.disabledSelector.matches('consent', true);\n const isReadonly = this.readonlySelector.matches('consent', true);\n const dividerStyle = 'margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('consent:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"consent\" ns=${ns}></foxy-i18n>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${tosConfig.usage === 'required' || tosConfig.usage === 'optional'}\n class=\"m-m\"\n @change=${(evt: CheckboxChangeEvent) => {\n tosConfig.initial_state = evt.detail ? tosConfig.initial_state : 'unchecked';\n tosConfig.is_hidden = false;\n tosConfig.usage = evt.detail ? 'required' : 'none';\n tosConfig.url = evt.detail ? tosConfig.url : '';\n\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"display_tos_link\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"display_tos_link_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n\n <div slot=\"content\" ?hidden=${tosConfig.usage === 'none'}>\n <vaadin-text-field\n label=${this.t('location_url')}\n class=\"w-full mt-m\"\n placeholder=\"https://example.com/path/to/tos\"\n clear-button-visible\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n .value=${tosConfig.url}\n @input=${(evt: CustomEvent) => {\n tosConfig.url = (evt.currentTarget as TextFieldElement).value;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </vaadin-text-field>\n\n <div class=\"flex flex-wrap -mx-s -mb-s mt-s\">\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled}\n ?checked=${tosConfig.usage === 'required'}\n @change=${(evt: CheckboxChangeEvent) => {\n tosConfig.usage = evt.detail ? 'required' : 'optional';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"require_consent\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled}\n ?checked=${tosConfig.initial_state === 'checked'}\n @change=${(evt: CheckboxChangeEvent) => {\n tosConfig.initial_state = evt.detail ? 'checked' : 'unchecked';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"checked_by_default\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n </div>\n </div>\n </x-checkbox>\n\n <div style=${dividerStyle} class=\"border-b border-contrast-10\"></div>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${mailConfig.usage === 'required'}\n class=\"m-m\"\n @change=${(evt: CheckboxChangeEvent) => {\n mailConfig.usage = evt.detail ? 'required' : 'none';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"newsletter_subscribe\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"newsletter_subscribe_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n\n <div style=${dividerStyle} class=\"border-b border-contrast-10\"></div>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${sdtaConfig.usage === 'required'}\n class=\"m-m\"\n @change=${(evt: CheckboxChangeEvent) => {\n sdtaConfig.usage = evt.detail ? 'required' : 'none';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"display_sdta\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"display_sdta_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n </x-group>\n\n ${this.renderTemplateOrSlot('consent:before')}\n </div>\n `;\n }\n\n private __renderFields(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const isDisabled = this.disabledSelector.matches('fields', true);\n const config = json.custom_checkout_field_requirements;\n const options = {\n cart_controls: ['enabled', 'disabled'],\n coupon_entry: ['enabled', 'disabled'],\n billing_first_name: ['default', 'optional', 'required', 'hidden'],\n billing_last_name: ['default', 'optional', 'required', 'hidden'],\n billing_company: ['default', 'optional', 'required', 'hidden'],\n billing_tax_id: ['default', 'optional', 'required', 'hidden'],\n billing_phone: ['default', 'optional', 'required', 'hidden'],\n billing_address1: ['default', 'optional', 'required', 'hidden'],\n billing_address2: ['default', 'optional', 'required', 'hidden'],\n billing_city: ['default', 'optional', 'required', 'hidden'],\n billing_region: ['default', 'optional', 'required', 'hidden'],\n billing_postal_code: ['default', 'optional', 'required', 'hidden'],\n billing_country: ['default', 'optional', 'required', 'hidden'],\n };\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('fields:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"field_plural\" ns=${ns}></foxy-i18n>\n\n <div class=\"bg-contrast-10 grid grid-cols-1 md-grid-cols-2\" style=\"gap: 1px\">\n ${Object.entries(options).map(([property, values]) => {\n return html`\n <label class=\"flex items-center pl-m bg-base\">\n <foxy-i18n\n class=\"flex-1\"\n lang=${lang}\n key=${property.replace('billing_', '')}\n ns=${ns}\n >\n </foxy-i18n>\n\n <div\n class=${classMap({\n 'px-s m-xs flex items-center cursor-pointer rounded leading-none': true,\n 'ring-primary-50 ring-inset focus-within-ring-2': !isDisabled,\n 'hover-text-primary': !isDisabled,\n 'opacity-50': isDisabled,\n })}\n >\n <select\n class=\"h-s mr-xs text-right appearance-none bg-transparent cursor-pointer focus-outline-none font-medium\"\n >\n ${values.map(value => {\n return html`\n <option\n value=${value}\n ?selected=${(config as Record<string, string>)[property] === value}\n >\n ${this.t(value)}\n </option>\n `;\n })}\n </select>\n\n <iron-icon\n class=\"pointer-events-none icon-inline text-xl\"\n icon=\"icons:expand-more\"\n >\n </iron-icon>\n </div>\n </label>\n `;\n })}\n\n <div class=\"bg-base hidden md-block\"></div>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('fields:after')}\n </div>\n `;\n }\n\n private __renderGoogleAnalytics(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const config = json.analytics_config;\n const sioConfig = config.segment_io;\n const gaConfig = config.google_analytics;\n const isDisabled = this.disabledSelector.matches('google-analytics', true);\n const isReadonly = this.readonlySelector.matches('google-analytics', true);\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('google-analytics:before')}\n\n <x-group frame>\n <span slot=\"header\">Google Analytics</span>\n\n <div class=\"p-m space-y-m\">\n <vaadin-text-field\n class=\"w-full\"\n label=${this.t('ga_account_id')}\n placeholder=\"UA-1234567-1\"\n helper-text=${this.t('ga_account_id_explainer')}\n .value=${live(gaConfig.account_id)}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n clear-button-visible\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: InputEvent) => {\n gaConfig.account_id = (evt.currentTarget as TextFieldElement).value;\n gaConfig.usage = gaConfig.account_id ? 'required' : 'none';\n config.usage = gaConfig.account_id || sioConfig.account_id ? 'required' : 'none';\n }}\n >\n </vaadin-text-field>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${gaConfig.include_on_site}\n @change=${(evt: CheckboxChangeEvent) => {\n gaConfig.include_on_site = evt.detail;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"ga_include_on_site\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"ga_include_on_site_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('google-analytics:after')}\n </div>\n `;\n }\n\n private __renderSegmentIo(json: TemplateConfigJSON) {\n const config = json.analytics_config;\n const sioConfig = config.segment_io;\n const gaConfig = config.google_analytics;\n const isDisabled = this.disabledSelector.matches('segment-io', true);\n const isReadonly = this.readonlySelector.matches('segment-io', true);\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('segment-io:before')}\n\n <x-group frame>\n <span slot=\"header\">Segment.io</span>\n\n <div class=\"p-m\">\n <vaadin-text-field\n class=\"w-full\"\n label=${this.t('sio_account_id')}\n placeholder=\"MY-WRITE-KEY\"\n helper-text=${this.t('sio_account_id_explainer')}\n .value=${live(sioConfig.account_id)}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n clear-button-visible\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: InputEvent) => {\n sioConfig.account_id = (evt.currentTarget as TextFieldElement).value;\n sioConfig.usage = sioConfig.account_id ? 'required' : 'none';\n config.usage = gaConfig.account_id || sioConfig.account_id ? 'required' : 'none';\n }}\n >\n </vaadin-text-field>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('segment-io:after')}\n </div>\n `;\n }\n\n private __renderTroubleshooting(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const config = json.debug;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('troubleshooting:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"troubleshooting\" ns=${ns}></foxy-i18n>\n\n <div class=\"p-m space-y-m\">\n <x-checkbox\n ?disabled=${this.disabledSelector.matches('troubleshooting', true)}\n ?readonly=${this.readonlySelector.matches('troubleshooting', true)}\n ?checked=${config.usage === 'required'}\n @change=${(evt: CheckboxChangeEvent) => {\n config.usage = evt.detail ? 'required' : 'none';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"troubleshooting_debug\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"troubleshooting_debug_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('troubleshooting:after')}\n </div>\n `;\n }\n\n private __renderCustomConfig(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('custom-config:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_config')}\n placeholder='{ \"key\": \"value\" }'\n helper-text=${this.t('custom_config_helper_text')}\n .value=${json.custom_config ? JSON.stringify(json.custom_config, null, 2) : ''}\n ?disabled=${this.disabledSelector.matches('custom-config', true)}\n ?readonly=${this.readonlySelector.matches('custom-config', true)}\n @input=${(evt: CustomEvent) => {\n const input = evt.currentTarget as TextAreaElement;\n\n try {\n json.custom_config = input.value ? JSON.parse(input.value) : '';\n this.edit({ json: JSON.stringify(json) });\n input.invalid = false;\n } catch {\n input.invalid = true;\n }\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('custom-config:after')}\n </div>\n `;\n }\n\n private __renderHeader(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('header:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_header')}\n helper-text=${this.t('custom_header_helper_text')}\n .value=${json.custom_script_values.header}\n ?disabled=${this.disabledSelector.matches('header', true)}\n ?readonly=${this.readonlySelector.matches('header', true)}\n @input=${(evt: CustomEvent) => {\n const target = evt.currentTarget as TextAreaElement;\n const newConfig: TemplateConfigJSON['custom_script_values'] = {\n ...json.custom_script_values,\n header: target.value,\n };\n\n this.edit({ json: JSON.stringify({ ...json, custom_script_values: newConfig }) });\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n }\n\n private __renderCustomFields(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('custom-fields:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_fields')}\n helper-text=${this.t('custom_fields_helper_text')}\n .value=${json.custom_script_values.header}\n ?disabled=${this.disabledSelector.matches('header', true)}\n ?readonly=${this.readonlySelector.matches('header', true)}\n @input=${(evt: CustomEvent) => {\n const newValue = (evt.currentTarget as TextAreaElement).value;\n json.custom_script_values.checkout_fields = newValue;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('custom-fields:after')}\n </div>\n `;\n }\n\n private __renderFooter(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('footer:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_footer')}\n helper-text=${this.t('custom_footer_helper_text')}\n .value=${json.custom_script_values.footer}\n ?disabled=${this.disabledSelector.matches('footer', true)}\n ?readonly=${this.readonlySelector.matches('footer', true)}\n @input=${(evt: CustomEvent) => {\n const target = evt.currentTarget as TextAreaElement;\n const newConfig: TemplateConfigJSON['custom_script_values'] = {\n ...json.custom_script_values,\n footer: target.value,\n };\n\n this.edit({ json: JSON.stringify({ ...json, custom_script_values: newConfig }) });\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('footer:after')}\n </div>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TemplateConfigForm.js","sourceRoot":"","sources":["../../../../src/elements/public/TemplateConfigForm/TemplateConfigForm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,sCAAmC;AAEpD,OAAO,EAAuB,iBAAiB,EAAE,gCAA6B;AAE9E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,EAAE,CAAC,CAAC;QAC5C,CAAC;;;;UAID,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,CAAC;;KAErD,CAAC;IACJ,CAAC;IAEO,cAAc,CAAC,IAAwB;QAC7C,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC;;;;kBAIlC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;wBACjB,IAAI,CAAC,CAAC,CAAC,2BAA2B,CAAC;mBACxC,IAAI,CAAC,oBAAoB,CAAC,MAAM;sBAC7B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;sBAC7C,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;mBAChD,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,MAAM,GAAG,GAAG,CAAC,aAAgC,CAAC;YACpD,MAAM,SAAS,GAA+C;gBAC5D,GAAG,IAAI,CAAC,oBAAoB;gBAC5B,MAAM,EAAE,MAAM,CAAC,KAAK;aACrB,CAAC;YAEF,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,oBAAoB,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;QACpF,CAAC;;;;UAID,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;KAE9C,CAAC;IACJ,CAAC;CACF","sourcesContent":["import * as logos from '../PaymentMethodCard/logos';\n\nimport { CheckboxChangeEvent, ChoiceChangeEvent } from '../../private/events';\nimport { Data, TemplateConfigJSON } from './types';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { Checkbox } from '../../private/Checkbox/Checkbox';\nimport { Choice } from '../../private/Choice/Choice';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { CountriesList } from './CountriesList';\nimport { Group } from '../../private/Group/Group';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { TextAreaElement } from '@vaadin/vaadin-text-field/vaadin-text-area';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { getDefaultJSON } from './defaults';\nimport { live } from 'lit-html/directives/live';\n\nconst NS = 'template-config-form';\nconst Base = ScopedElementsMixin(\n ResponsiveMixin(ConfigurableMixin(ThemeableMixin(TranslatableMixin(NucleonElement, NS))))\n);\n\nexport class TemplateConfigForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-text-area': customElements.get('vaadin-text-area'),\n 'iron-icon': customElements.get('iron-icon'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n 'x-countries-list': CountriesList,\n 'x-checkbox': Checkbox,\n 'x-choice': Choice,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __addHiddenFieldInputValue: { attribute: false },\n countries: { type: String },\n regions: { type: String },\n };\n }\n\n countries = '';\n\n regions = '';\n\n private __addHiddenFieldInputValue = '';\n\n render(): TemplateResult {\n const hidden = this.hiddenControls;\n const json: TemplateConfigJSON = this.form.json ? JSON.parse(this.form.json) : getDefaultJSON();\n\n return html`\n <div class=\"relative\" aria-busy=${this.in('busy')} aria-live=\"polite\">\n <div\n class=${classMap({\n 'space-y-l transition-opacity': true,\n 'opacity-50': !this.in('idle'),\n })}\n >\n ${hidden.matches('cart-type', true) ? '' : this.__renderCartType(json)}\n ${hidden.matches('foxycomplete', true) ? '' : this.__renderFoxycomplete(json)}\n ${hidden.matches('locations', true) ? '' : this.__renderLocations(json)}\n ${hidden.matches('hidden-fields', true) ? '' : this.__renderHiddenFields(json)}\n ${hidden.matches('cards', true) ? '' : this.__renderCards(json)}\n ${hidden.matches('checkout-type', true) ? '' : this.__renderCheckoutType(json)}\n ${hidden.matches('consent', true) ? '' : this.__renderConsent(json)}\n ${hidden.matches('fields', true) ? '' : this.__renderFields(json)}\n ${hidden.matches('google-analytics', true) ? '' : this.__renderGoogleAnalytics(json)}\n ${hidden.matches('segment-io', true) ? '' : this.__renderSegmentIo(json)}\n ${hidden.matches('troubleshooting', true) ? '' : this.__renderTroubleshooting(json)}\n ${hidden.matches('custom-config', true) ? '' : this.__renderCustomConfig(json)}\n ${hidden.matches('header', true) ? '' : this.__renderHeader(json)}\n ${hidden.matches('custom-fields', true) ? '' : this.__renderCustomFields(json)}\n ${hidden.matches('footer', true) ? '' : this.__renderFooter(json)}\n </div>\n\n <div\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': this.in('idle'),\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : 'busy'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n private __renderCartType(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const items = ['default', 'fullpage', 'custom'];\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('cart-type:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"cart_type\" ns=${ns}></foxy-i18n>\n\n <x-choice\n .value=${json.cart_type}\n .items=${items}\n ?disabled=${this.disabledSelector.matches('cart-type', true)}\n ?readonly=${this.readonlySelector.matches('cart-type', true)}\n @change=${(evt: ChoiceChangeEvent) => {\n this.edit({ json: JSON.stringify({ ...json, cart_type: evt.detail }) });\n }}\n >\n ${items.map(item => {\n return html`\n <div slot=\"${item}-label\" class=\"grid leading-s py-s\">\n <foxy-i18n lang=${lang} key=\"cart_type_${item}\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-secondary text-xs\"\n lang=${lang}\n key=\"cart_type_${item}_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n `;\n })}\n </x-choice>\n </x-group>\n\n ${this.renderTemplateOrSlot('cart-type:after')}\n </div>\n `;\n }\n\n private __renderFoxycomplete(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const isDisabled = this.disabledSelector.matches('foxycomplete', true);\n const isReadonly = this.readonlySelector.matches('foxycomplete', true);\n const items = ['combobox', 'search', 'disabled'];\n const value =\n json.foxycomplete.usage === 'none'\n ? 'disabled'\n : json.foxycomplete.show_combobox\n ? 'combobox'\n : 'search';\n\n const renderFlagsCheckbox = () => html`\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${json.foxycomplete.show_flags}\n @change=${(evt: CheckboxChangeEvent) => {\n const newConfig: TemplateConfigJSON['foxycomplete'] = {\n ...json.foxycomplete,\n show_flags: evt.detail,\n };\n\n this.edit({ json: JSON.stringify({ ...json, foxycomplete: newConfig }) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"show_country_flags\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n `;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('foxycomplete:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"foxycomplete\" ns=${ns}></foxy-i18n>\n\n <x-choice\n .value=${value}\n .items=${items}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n @change=${(evt: Event) => {\n if (!(evt instanceof ChoiceChangeEvent)) return;\n\n const newConfig: TemplateConfigJSON['foxycomplete'] = {\n ...json.foxycomplete,\n usage: evt.detail === 'disabled' ? 'none' : 'required',\n show_combobox: evt.detail === 'combobox',\n };\n\n this.edit({ json: JSON.stringify({ ...json, foxycomplete: newConfig }) });\n }}\n >\n ${items.map(item => {\n return html`\n <div slot=\"${item}-label\" class=\"grid leading-s py-s\">\n <foxy-i18n lang=${lang} key=\"foxycomplete_${item}\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-secondary text-xs\"\n lang=${lang}\n key=\"foxycomplete_${item}_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n `;\n })}\n\n <div slot=\"combobox\" class=\"space-y-m pb-s\" ?hidden=${value !== 'combobox'}>\n <div class=\"grid grid-cols-2 gap-m\" style=\"max-width: 16rem\">\n ${['open', 'close'].map(action => {\n const field = action === 'open' ? 'combobox_open' : 'combobox_close';\n\n return html`\n <vaadin-text-field\n label=${this.t(`${action}_icon`)}\n .value=${json.foxycomplete[field]}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n @input=${(evt: CustomEvent) => {\n const target = evt.currentTarget as TextFieldElement;\n const newConfig: TemplateConfigJSON['foxycomplete'] = {\n ...json.foxycomplete,\n [field]: target.value,\n };\n\n this.edit({ json: JSON.stringify({ ...json, foxycomplete: newConfig }) });\n }}\n >\n </vaadin-text-field>\n `;\n })}\n </div>\n\n ${renderFlagsCheckbox()}\n </div>\n\n <div slot=\"search\" class=\"pb-s\" ?hidden=${value !== 'search'}>\n ${renderFlagsCheckbox()}\n </div>\n </x-choice>\n\n <div class=\"border-t border-contrast-10 p-m\">\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${json.postal_code_lookup.usage === 'enabled'}\n @change=${(evt: CheckboxChangeEvent) => {\n const newConfig: TemplateConfigJSON['postal_code_lookup'] = {\n usage: evt.detail ? 'enabled' : 'none',\n };\n\n this.edit({ json: JSON.stringify({ ...json, postal_code_lookup: newConfig }) });\n }}\n >\n <foxy-i18n lang=${lang} key=\"enable_postcode_lookup\" ns=${ns}></foxy-i18n>\n </x-checkbox>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('foxycomplete:after')}\n </div>\n `;\n }\n\n private __renderLocations(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const config = json.location_filtering;\n\n const shippingChoice = config.shipping_filter_type === 'blacklist' ? 'block' : 'allow';\n const billingChoice =\n config.usage === 'both'\n ? 'copy'\n : config.billing_filter_type === 'blacklist'\n ? 'block'\n : 'allow';\n\n const normalize = () => {\n if (config.usage === 'both') {\n config.billing_filter_type = config.shipping_filter_type;\n config.billing_filter_values = config.shipping_filter_values;\n } else {\n const hasBillingFilters = Object.keys(config.billing_filter_values).length > 0;\n const hasShippingFilters = Object.keys(config.shipping_filter_values).length > 0;\n\n if (!hasBillingFilters && !hasShippingFilters) {\n config.usage = 'none';\n } else if (hasBillingFilters && !hasShippingFilters) {\n config.usage = 'billing';\n } else if (hasShippingFilters && !hasBillingFilters) {\n config.usage = 'shipping';\n } else {\n config.usage = 'independent';\n }\n }\n };\n\n return html`\n ${this.renderTemplateOrSlot('locations:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"location_plural\" ns=${ns}></foxy-i18n>\n\n <div class=\"grid sm-grid-cols-2 bg-contrast-10\" style=\"gap: 1px\">\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n class=\"text-tertiary\" slot=\"header\" lang=${lang} key=\"shipping\" ns=${ns}>\n </foxy-i18n>\n\n <x-choice\n .items=${['allow', 'block']}\n .value=${shippingChoice}\n @change=${(evt: ChoiceChangeEvent) => {\n if (config.usage !== 'both') config.usage = 'independent';\n config.shipping_filter_type = evt.detail === 'block' ? 'blacklist' : 'whitelist';\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n slot=\"allow-label\" lang=${lang} key=\"allowlist\" ns=${ns}></foxy-i18n>\n <foxy-i18n slot=\"block-label\" lang=${lang} key=\"blocklist\" ns=${ns}></foxy-i18n>\n\n <x-countries-list\n countries=${JSON.stringify(config.shipping_filter_values)}\n regions=${this.regions}\n class=\"mb-m\"\n href=${this.countries}\n slot=${shippingChoice}\n lang=${lang}\n ns=${ns}\n ?disabled=${this.disabledSelector.matches('locations', true)}\n ?readonly=${this.readonlySelector.matches('locations', true)}\n @update:countries=${(evt: CustomEvent) => {\n config.shipping_filter_values = (evt.currentTarget as CountriesList).countries;\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </x-countries-list>\n </x-choice>\n </x-group>\n\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n class=\"text-tertiary\" slot=\"header\" lang=${lang} key=\"billing\" ns=${ns}>\n </foxy-i18n>\n\n <x-choice\n .items=${['allow', 'block', 'copy']}\n .value=${billingChoice}\n @change=${(evt: ChoiceChangeEvent) => {\n if (evt.detail === 'copy') {\n config.usage = 'both';\n } else {\n config.usage = 'independent';\n config.billing_filter_type = evt.detail === 'block' ? 'blacklist' : 'whitelist';\n }\n\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n slot=\"allow-label\" lang=${lang} key=\"allowlist\" ns=${ns}></foxy-i18n>\n <foxy-i18n slot=\"block-label\" lang=${lang} key=\"blocklist\" ns=${ns}></foxy-i18n>\n <foxy-i18n slot=\"copy-label\" lang=${lang} key=\"same_as_shipping\" ns=${ns}></foxy-i18n>\n\n <x-countries-list\n countries=${JSON.stringify(config.billing_filter_values)}\n regions=${this.regions}\n class=\"mb-m\"\n href=${this.countries}\n slot=${billingChoice}\n lang=${lang}\n ns=${ns}\n ?disabled=${this.disabledSelector.matches('locations', true)}\n ?readonly=${this.readonlySelector.matches('locations', true)}\n ?hidden=${billingChoice === 'copy'}\n @update:countries=${(evt: CustomEvent) => {\n config.billing_filter_values = (evt.currentTarget as CountriesList).countries;\n normalize();\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </x-countries-list>\n </x-choice>\n </x-group>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('locations:after')}\n `;\n }\n\n private __renderHiddenFields(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const suggestions = [] as string[];\n const fields = [] as string[];\n const config = json.cart_display_config;\n\n type FieldName = keyof Omit<\n TemplateConfigJSON['cart_display_config'],\n 'hidden_product_options' | 'usage'\n >;\n\n for (const key in config) {\n if (!key.startsWith('show_')) continue;\n const field = key.substring(5);\n suggestions.push(field);\n if (config.usage === 'required' && !config[key as FieldName]) fields.push(field);\n }\n\n if (config.usage === 'required') {\n fields.push(...config.hidden_product_options);\n }\n\n const addField = () => {\n config.usage = 'required';\n\n if (suggestions.includes(this.__addHiddenFieldInputValue)) {\n config[`show_${this.__addHiddenFieldInputValue}` as FieldName] = false;\n } else if (!config.hidden_product_options.includes(this.__addHiddenFieldInputValue)) {\n config.hidden_product_options.push(this.__addHiddenFieldInputValue);\n }\n\n this.edit({ json: JSON.stringify(json) });\n this.__addHiddenFieldInputValue = '';\n };\n\n const radius = 'calc(var(--lumo-border-radius-l) / 1.2)';\n const inputRadius = fields.length === 0 ? [radius] : ['0', '0', radius, radius];\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('hidden-fields:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"hidden_fields\" ns=${ns}></foxy-i18n>\n\n <div class=\"divide-y divide-contrast-10\">\n ${fields.map(\n field => html`\n <div class=\"h-m ml-m pr-xs flex items-center justify-between\">\n ${suggestions.includes(field)\n ? html`<foxy-i18n lang=${lang} key=${field} ns=${ns}></foxy-i18n>`\n : html`<span>${field}</span>`}\n\n <button\n class=\"flex w-xs h-xs items-center justify-center rounded-full transition-colors hover-bg-error-10 hover-text-error focus-outline-none focus-ring-2 focus-ring-inset focus-ring-error-50\"\n @click=${() => {\n if (typeof config[`show_${field}` as FieldName] === 'boolean') {\n config[`show_${field}` as FieldName] = true;\n } else {\n config.hidden_product_options = config.hidden_product_options.filter(\n option => option !== field\n );\n }\n\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <iron-icon icon=\"icons:close\" class=\"icon-inline text-m\"></iron-icon>\n </button>\n </div>\n `\n )}\n </div>\n\n <div\n style=\"border-radius: ${inputRadius.join(' ')}\"\n class=${classMap({\n 'h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2': true,\n 'border-t border-contrast-10': fields.length > 0,\n })}\n >\n <input\n placeholder=${this.t('add_field')}\n class=\"w-full bg-transparent appearance-none h-m px-m focus-outline-none\"\n list=\"hidden-fields-list\"\n .value=${live(this.__addHiddenFieldInputValue)}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addField()}\n @input=${(evt: InputEvent) => {\n this.__addHiddenFieldInputValue = (evt.currentTarget as HTMLInputElement).value;\n }}\n />\n\n <datalist id=\"hidden-fields-list\">\n ${suggestions\n .filter(suggestion => !fields.includes(suggestion))\n .map(\n suggestion => html`<option value=${suggestion}>${this.t(suggestion)}</option>`\n )}\n </datalist>\n\n <button\n aria-label=${this.t('add_field')}\n class=${classMap({\n 'w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50': true,\n 'flex items-center justify-center rounded-full transition-colors': true,\n 'bg-contrast-5 text-disabled cursor-default': !this.__addHiddenFieldInputValue,\n 'bg-success-10 text-success cursor-pointer': !!this.__addHiddenFieldInputValue,\n 'hover-bg-success hover-text-success-contrast': !!this.__addHiddenFieldInputValue,\n 'focus-outline-none focus-ring-2': !!this.__addHiddenFieldInputValue,\n })}\n ?disabled=${!this.__addHiddenFieldInputValue}\n @click=${addField}\n >\n <iron-icon icon=\"icons:add\" class=\"icon-inline text-m\"></iron-icon>\n </button>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('hidden-fields:after')}\n </div>\n `;\n }\n\n private __renderCards(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const isDisabled = this.disabledSelector.matches('cards', true);\n const config = json.supported_payment_cards as string[];\n\n let skipForSaved: boolean;\n let skipForSSO: boolean;\n\n if (json.csc_requirements === 'all_cards') {\n skipForSaved = false;\n skipForSSO = false;\n } else if (json.csc_requirements === 'sso_only') {\n skipForSaved = true;\n skipForSSO = false;\n } else {\n skipForSaved = true;\n skipForSSO = true;\n }\n\n const typeToName: Record<string, string> = {\n amex: 'American Express',\n diners: 'Diners Club',\n discover: 'Discover',\n jcb: 'JCB',\n maestro: 'Maestro',\n mastercard: 'Mastercard',\n unionpay: 'UnionPay',\n visa: 'Visa',\n };\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('cards:before')}\n\n <div class=\"space-y-xs\">\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"supported_cards\" ns=${ns}></foxy-i18n>\n\n <div class=\"flex flex-wrap m-xs p-s\">\n ${Object.entries(logos).map(([type, logo]) => {\n if (!typeToName[type]) return;\n const isChecked = config.includes(type);\n\n return html`\n <div\n class=${classMap({\n 'm-xs rounded': true,\n 'opacity-50 cursor-default': isDisabled,\n 'cursor-pointer ring-primary-50 focus-within-ring-2': !isDisabled,\n })}\n >\n <label\n class=${classMap({\n 'overflow-hidden transition-colors flex rounded border': true,\n 'border-primary bg-primary-10 text-primary': isChecked,\n 'hover-text-body': isChecked && !isDisabled,\n 'border-contrast-10': !isChecked,\n 'hover-border-primary hover-text-primary': !isChecked && !isDisabled,\n })}\n >\n <div class=\"h-s\">${logo}</div>\n\n <div class=\"text-s font-medium mx-s my-auto leading-none\">\n ${typeToName[type]}\n </div>\n\n <input\n type=\"checkbox\"\n class=\"sr-only\"\n ?disabled=${isDisabled}\n ?checked=${isChecked}\n @change=${(evt: Event) => {\n evt.stopPropagation();\n\n if (isChecked) {\n config.splice(config.indexOf(type), 1);\n } else {\n config.push(type);\n }\n\n this.edit({ json: JSON.stringify(json) });\n }}\n />\n </label>\n </div>\n `;\n })}\n </div>\n\n <div class=\"flex flex-wrap p-s border-t border-contrast-10\">\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled || json.csc_requirements === 'new_cards_only'}\n ?checked=${skipForSaved}\n @change=${(evt: CheckboxChangeEvent) => {\n json.csc_requirements = evt.detail ? 'sso_only' : 'all_cards';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"skip_csc_for_saved\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled}\n ?checked=${skipForSSO}\n @change=${(evt: CheckboxChangeEvent) => {\n json.csc_requirements = evt.detail\n ? 'new_cards_only'\n : skipForSaved\n ? 'sso_only'\n : 'all_cards';\n\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"skip_csc_for_sso\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n </div>\n </x-group>\n\n <foxy-i18n\n class=\"text-xs text-secondary leading-s block\"\n lang=${lang}\n key=\"supported_cards_disclaimer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('cards:after')}\n </div>\n `;\n }\n\n private __renderCheckoutType(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('checkout-type:before')}\n\n <div class=\"space-y-xs\">\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"checkout_type\" ns=${ns}></foxy-i18n>\n\n <x-choice\n ?disabled=${this.disabledSelector.matches('checkout-type', true)}\n ?readonly=${this.readonlySelector.matches('checkout-type', true)}\n .items=${['default_account', 'default_guest', 'guest_only', 'account_only']}\n .value=${json.checkout_type}\n .getText=${(item: string) => this.t(`checkout_type_${item}`)}\n @change=${(evt: ChoiceChangeEvent) => {\n json.checkout_type = evt.detail as TemplateConfigJSON['checkout_type'];\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </x-choice>\n </x-group>\n\n <foxy-i18n\n class=\"text-secondary text-xs leading-s block\"\n lang=${lang}\n key=\"checkout_type_helper_text\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('checkout-type:after')}\n </div>\n `;\n }\n\n private __renderConsent(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const tosConfig = json.tos_checkbox_settings;\n const mailConfig = json.newsletter_subscribe;\n const sdtaConfig = json.eu_secure_data_transfer_consent;\n const isDisabled = this.disabledSelector.matches('consent', true);\n const isReadonly = this.readonlySelector.matches('consent', true);\n const dividerStyle = 'margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))';\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('consent:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"consent\" ns=${ns}></foxy-i18n>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${tosConfig.usage === 'required' || tosConfig.usage === 'optional'}\n class=\"m-m\"\n @change=${(evt: CheckboxChangeEvent) => {\n tosConfig.initial_state = evt.detail ? tosConfig.initial_state : 'unchecked';\n tosConfig.is_hidden = false;\n tosConfig.usage = evt.detail ? 'required' : 'none';\n tosConfig.url = evt.detail ? tosConfig.url : '';\n\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"display_tos_link\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"display_tos_link_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n\n <div slot=\"content\" ?hidden=${tosConfig.usage === 'none'}>\n <vaadin-text-field\n label=${this.t('location_url')}\n class=\"w-full mt-m\"\n placeholder=\"https://example.com/path/to/tos\"\n clear-button-visible\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n .value=${tosConfig.url}\n @input=${(evt: CustomEvent) => {\n tosConfig.url = (evt.currentTarget as TextFieldElement).value;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </vaadin-text-field>\n\n <div class=\"flex flex-wrap -mx-s -mb-s mt-s\">\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled}\n ?checked=${tosConfig.usage === 'required'}\n @change=${(evt: CheckboxChangeEvent) => {\n tosConfig.usage = evt.detail ? 'required' : 'optional';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"require_consent\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n\n <x-checkbox\n class=\"m-s\"\n ?disabled=${isDisabled}\n ?checked=${tosConfig.initial_state === 'checked'}\n @change=${(evt: CheckboxChangeEvent) => {\n tosConfig.initial_state = evt.detail ? 'checked' : 'unchecked';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <foxy-i18n class=\"leading-s block\" lang=${lang} key=\"checked_by_default\" ns=${ns}>\n </foxy-i18n>\n </x-checkbox>\n </div>\n </div>\n </x-checkbox>\n\n <div style=${dividerStyle} class=\"border-b border-contrast-10\"></div>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${mailConfig.usage === 'required'}\n class=\"m-m\"\n @change=${(evt: CheckboxChangeEvent) => {\n mailConfig.usage = evt.detail ? 'required' : 'none';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"newsletter_subscribe\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"newsletter_subscribe_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n\n <div style=${dividerStyle} class=\"border-b border-contrast-10\"></div>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${sdtaConfig.usage === 'required'}\n class=\"m-m\"\n @change=${(evt: CheckboxChangeEvent) => {\n sdtaConfig.usage = evt.detail ? 'required' : 'none';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"display_sdta\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"display_sdta_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n </x-group>\n\n ${this.renderTemplateOrSlot('consent:before')}\n </div>\n `;\n }\n\n private __renderFields(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const isDisabled = this.disabledSelector.matches('fields', true);\n const config = json.custom_checkout_field_requirements;\n const options = {\n cart_controls: ['enabled', 'disabled'],\n coupon_entry: ['enabled', 'disabled'],\n billing_first_name: ['default', 'optional', 'required', 'hidden'],\n billing_last_name: ['default', 'optional', 'required', 'hidden'],\n billing_company: ['default', 'optional', 'required', 'hidden'],\n billing_tax_id: ['default', 'optional', 'required', 'hidden'],\n billing_phone: ['default', 'optional', 'required', 'hidden'],\n billing_address1: ['default', 'optional', 'required', 'hidden'],\n billing_address2: ['default', 'optional', 'required', 'hidden'],\n billing_city: ['default', 'optional', 'required', 'hidden'],\n billing_region: ['default', 'optional', 'required', 'hidden'],\n billing_postal_code: ['default', 'optional', 'required', 'hidden'],\n billing_country: ['default', 'optional', 'required', 'hidden'],\n };\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('fields:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"field_plural\" ns=${ns}></foxy-i18n>\n\n <div class=\"bg-contrast-10 grid grid-cols-1 md-grid-cols-2\" style=\"gap: 1px\">\n ${Object.entries(options).map(([property, values]) => {\n return html`\n <label class=\"flex items-center pl-m bg-base\">\n <foxy-i18n\n class=\"flex-1\"\n lang=${lang}\n key=${property.replace('billing_', '')}\n ns=${ns}\n >\n </foxy-i18n>\n\n <div\n class=${classMap({\n 'px-s m-xs flex items-center cursor-pointer rounded leading-none': true,\n 'ring-primary-50 ring-inset focus-within-ring-2': !isDisabled,\n 'hover-text-primary': !isDisabled,\n 'opacity-50': isDisabled,\n })}\n >\n <select\n class=\"h-s mr-xs text-right appearance-none bg-transparent cursor-pointer focus-outline-none font-medium\"\n @change=${(evt: Event) => {\n const select = evt.currentTarget as HTMLSelectElement;\n const value = select.options[select.options.selectedIndex].value;\n (config as Record<string, string>)[property] = value;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n ${values.map(value => {\n return html`\n <option\n value=${value}\n ?selected=${(config as Record<string, string>)[property] === value}\n >\n ${this.t(value)}\n </option>\n `;\n })}\n </select>\n\n <iron-icon\n class=\"pointer-events-none icon-inline text-xl\"\n icon=\"icons:expand-more\"\n >\n </iron-icon>\n </div>\n </label>\n `;\n })}\n\n <div class=\"bg-base hidden md-block\"></div>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('fields:after')}\n </div>\n `;\n }\n\n private __renderGoogleAnalytics(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const config = json.analytics_config;\n const sioConfig = config.segment_io;\n const gaConfig = config.google_analytics;\n const isDisabled = this.disabledSelector.matches('google-analytics', true);\n const isReadonly = this.readonlySelector.matches('google-analytics', true);\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('google-analytics:before')}\n\n <x-group frame>\n <span slot=\"header\">Google Analytics</span>\n\n <div class=\"p-m space-y-m\">\n <vaadin-text-field\n class=\"w-full\"\n label=${this.t('ga_account_id')}\n placeholder=\"UA-1234567-1\"\n helper-text=${this.t('ga_account_id_explainer')}\n .value=${live(gaConfig.account_id)}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n clear-button-visible\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: InputEvent) => {\n gaConfig.account_id = (evt.currentTarget as TextFieldElement).value;\n gaConfig.usage = gaConfig.account_id ? 'required' : 'none';\n config.usage = gaConfig.account_id || sioConfig.account_id ? 'required' : 'none';\n }}\n >\n </vaadin-text-field>\n\n <x-checkbox\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n ?checked=${gaConfig.include_on_site}\n @change=${(evt: CheckboxChangeEvent) => {\n gaConfig.include_on_site = evt.detail;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"ga_include_on_site\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"ga_include_on_site_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('google-analytics:after')}\n </div>\n `;\n }\n\n private __renderSegmentIo(json: TemplateConfigJSON) {\n const config = json.analytics_config;\n const sioConfig = config.segment_io;\n const gaConfig = config.google_analytics;\n const isDisabled = this.disabledSelector.matches('segment-io', true);\n const isReadonly = this.readonlySelector.matches('segment-io', true);\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('segment-io:before')}\n\n <x-group frame>\n <span slot=\"header\">Segment.io</span>\n\n <div class=\"p-m\">\n <vaadin-text-field\n class=\"w-full\"\n label=${this.t('sio_account_id')}\n placeholder=\"MY-WRITE-KEY\"\n helper-text=${this.t('sio_account_id_explainer')}\n .value=${live(sioConfig.account_id)}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n clear-button-visible\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: InputEvent) => {\n sioConfig.account_id = (evt.currentTarget as TextFieldElement).value;\n sioConfig.usage = sioConfig.account_id ? 'required' : 'none';\n config.usage = gaConfig.account_id || sioConfig.account_id ? 'required' : 'none';\n }}\n >\n </vaadin-text-field>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('segment-io:after')}\n </div>\n `;\n }\n\n private __renderTroubleshooting(json: TemplateConfigJSON) {\n const { lang, ns } = this;\n const config = json.debug;\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('troubleshooting:before')}\n\n <x-group frame>\n <foxy-i18n slot=\"header\" lang=${lang} key=\"troubleshooting\" ns=${ns}></foxy-i18n>\n\n <div class=\"p-m space-y-m\">\n <x-checkbox\n ?disabled=${this.disabledSelector.matches('troubleshooting', true)}\n ?readonly=${this.readonlySelector.matches('troubleshooting', true)}\n ?checked=${config.usage === 'required'}\n @change=${(evt: CheckboxChangeEvent) => {\n config.usage = evt.detail ? 'required' : 'none';\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n <div class=\"flex flex-col\">\n <foxy-i18n lang=${lang} key=\"troubleshooting_debug\" ns=${ns}></foxy-i18n>\n <foxy-i18n\n class=\"text-xs leading-s text-secondary\"\n lang=${lang}\n key=\"troubleshooting_debug_explainer\"\n ns=${ns}\n >\n </foxy-i18n>\n </div>\n </x-checkbox>\n </div>\n </x-group>\n\n ${this.renderTemplateOrSlot('troubleshooting:after')}\n </div>\n `;\n }\n\n private __renderCustomConfig(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('custom-config:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_config')}\n placeholder='{ \"key\": \"value\" }'\n helper-text=${this.t('custom_config_helper_text')}\n .value=${json.custom_config ? JSON.stringify(json.custom_config, null, 2) : ''}\n ?disabled=${this.disabledSelector.matches('custom-config', true)}\n ?readonly=${this.readonlySelector.matches('custom-config', true)}\n @input=${(evt: CustomEvent) => {\n const input = evt.currentTarget as TextAreaElement;\n\n try {\n json.custom_config = input.value ? JSON.parse(input.value) : '';\n this.edit({ json: JSON.stringify(json) });\n input.invalid = false;\n } catch {\n input.invalid = true;\n }\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('custom-config:after')}\n </div>\n `;\n }\n\n private __renderHeader(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('header:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_header')}\n helper-text=${this.t('custom_header_helper_text')}\n .value=${json.custom_script_values.header}\n ?disabled=${this.disabledSelector.matches('header', true)}\n ?readonly=${this.readonlySelector.matches('header', true)}\n @input=${(evt: CustomEvent) => {\n const target = evt.currentTarget as TextAreaElement;\n const newConfig: TemplateConfigJSON['custom_script_values'] = {\n ...json.custom_script_values,\n header: target.value,\n };\n\n this.edit({ json: JSON.stringify({ ...json, custom_script_values: newConfig }) });\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('header:after')}\n </div>\n `;\n }\n\n private __renderCustomFields(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('custom-fields:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_fields')}\n helper-text=${this.t('custom_fields_helper_text')}\n .value=${json.custom_script_values.header}\n ?disabled=${this.disabledSelector.matches('header', true)}\n ?readonly=${this.readonlySelector.matches('header', true)}\n @input=${(evt: CustomEvent) => {\n const newValue = (evt.currentTarget as TextAreaElement).value;\n json.custom_script_values.checkout_fields = newValue;\n this.edit({ json: JSON.stringify(json) });\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('custom-fields:after')}\n </div>\n `;\n }\n\n private __renderFooter(json: TemplateConfigJSON) {\n return html`\n <div>\n ${this.renderTemplateOrSlot('footer:before')}\n\n <vaadin-text-area\n class=\"w-full\"\n label=${this.t('custom_footer')}\n helper-text=${this.t('custom_footer_helper_text')}\n .value=${json.custom_script_values.footer}\n ?disabled=${this.disabledSelector.matches('footer', true)}\n ?readonly=${this.readonlySelector.matches('footer', true)}\n @input=${(evt: CustomEvent) => {\n const target = evt.currentTarget as TextAreaElement;\n const newConfig: TemplateConfigJSON['custom_script_values'] = {\n ...json.custom_script_values,\n footer: target.value,\n };\n\n this.edit({ json: JSON.stringify({ ...json, custom_script_values: newConfig }) });\n }}\n >\n </vaadin-text-area>\n\n ${this.renderTemplateOrSlot('footer:after')}\n </div>\n `;\n }\n}\n"]}
|