@foxy.io/elements 1.31.0 → 1.31.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/{shared-638468a5.js → shared-60d586ba.js} +1 -1
- package/dist/cdn/shared-7c411b0a.js +1 -0
- package/dist/cdn/translations/admin-subscription-form/en.json +3 -3
- package/dist/elements/internal/InternalDateControl/InternalDateControl.js +12 -6
- package/dist/elements/internal/InternalDateControl/InternalDateControl.js.map +1 -1
- package/dist/elements/internal/InternalDateControl/vaadinStyles.js +8 -0
- package/dist/elements/internal/InternalDateControl/vaadinStyles.js.map +1 -1
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js +15 -2
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js.map +1 -1
- package/dist/elements/internal/InternalPasswordControl/generateRandomPassword.d.ts +3 -2
- package/dist/elements/internal/InternalPasswordControl/generateRandomPassword.js.map +1 -1
- package/dist/elements/public/CustomerForm/CustomerForm.d.ts +1 -0
- package/dist/elements/public/CustomerForm/CustomerForm.js +6 -1
- package/dist/elements/public/CustomerForm/CustomerForm.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +2 -1
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-dfc33ff6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-3c3497d6.js";import"./shared-ce75e928.js";import"./shared-28f74114.js";import"./shared-388e9240.js";import"./shared-5a2f398c.js";import"./shared-ef78d7d9.js";import"./shared-08e0a194.js";import{I as e}from"./shared-0e055562.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-0cc5420d.js";import{I as t}from"./shared-7d38cb8a.js";import{R as r,a as o}from"./shared-fb34e84c.js";import{h as i}from"./shared-dc73b9a5.js";import{_ as s,B as n}from"./shared-0f6e4584.js";import{T as a}from"./shared-8874ec69.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-56bf05ef.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-6e859df6.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-22ba9566.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./foxy-swipe-actions.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-ac0368ec.js";import"./shared-16c17e32.js";import"./shared-0a6a28ce.js";import"./shared-19884cf4.js";import"./shared-651c44fa.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-c388e926.js";import"./shared-21bc5d5e.js";import"./shared-51c4a6dd.js";import"./shared-fb0ca5e2.js";import"./shared-f3773d62.js";import"./shared-3ee151ce.js";import"./shared-e778071b.js";import"./shared-638468a5.js";import"./shared-0700fd80.js";import"./shared-56a559fd.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-f34aeb6c.js";import"./shared-f407c2cb.js";let l,c,f=e=>e;const m=r(t);customElements.define("foxy-internal-gift-card-form-provisioning-control",class extends m{constructor(){super(...arguments),this.__maxBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_max},this.__maxBalanceValueSetter=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:s>e?e:s,initial_balance_max:e}})},this.__minBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_min},this.__minBalanceValueSetter=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:s<e?e:s}})},this.__toggleValueGetter=()=>{var e,t;return(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?["allow"]:[]},this.__toggleValueSetter=e=>{var t,r,o,i,s,n,a,d;e.includes("allow")?null===(t=this.nucleon)||void 0===t||t.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(i=null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.form.provisioning_config)||void 0===o?void 0:o.initial_balance_min)&&void 0!==i?i:0,initial_balance_max:null!==(a=null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.form.provisioning_config)||void 0===n?void 0:n.initial_balance_max)&&void 0!==a?a:0}}):null===(d=this.nucleon)||void 0===d||d.edit({provisioning_config:null})},this.__toggleOptions=[{label:"text",value:"allow"}]}renderControl(){var e,t;return i(l||(l=f` <foxy-internal-checkbox-group-control infer="toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__toggleValueGetter,this.__toggleValueSetter,this.__toggleOptions,(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?i(c||(c=f` <div class="grid grid-cols-2 sm-grid-cols-4 gap-m mt-s"> <foxy-internal-text-control infer="sku" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-integer-control infer="min-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> </div> `),this.__minBalanceValueGetter,this.__minBalanceValueSetter,this.__maxBalanceValueGetter,this.__maxBalanceValueSetter):"")}});const p=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let u,_,h=e=>e;const g=r(o(e,"gift-card-form"));class v extends g{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"current_balance",path:"current_balance",type:a.Number},{label:"end_date",path:"end_date",type:a.Date},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(t.code),e.__codesActions[0].state="end"}catch(t){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return s(s({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var t;if(null===(t=e.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_min;return!("number"==typeof r&&r<0)||"min-balance:v8n_negative"},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_max;return!("number"==typeof r&&r<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("codes","category-restrictions","attributes"),new n(e.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return i(u||(u=h` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,n,a,l;let c;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),c=r.toString()}catch(e){c=void 0}return i(_||(_=h` ${0} <div class="grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m"> <foxy-internal-text-control infer="name" class="md-col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" infer="expires"> </foxy-internal-frequency-control> </div> <foxy-internal-gift-card-form-provisioning-control infer="provisioning"> </foxy-internal-gift-card-form-provisioning-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,p.map((e=>({label:this.t(`currency.code_${e}`),value:e}))),c,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===o?void 0:o._links["fx:item_categories"].href),d(null===(s=this.data)||void 0===s?void 0:s._links["fx:gift_card_item_categories"].href),d(null===(n=this.data)||void 0===n?void 0:n._links.self.href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",v);export{v as GiftCardForm};
|
|
1
|
+
import"./shared-3c3497d6.js";import"./shared-ce75e928.js";import"./shared-28f74114.js";import"./shared-388e9240.js";import"./shared-5a2f398c.js";import"./shared-ef78d7d9.js";import"./shared-08e0a194.js";import{I as e}from"./shared-0e055562.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-0cc5420d.js";import{I as t}from"./shared-7d38cb8a.js";import{R as r,a as o}from"./shared-fb34e84c.js";import{h as i}from"./shared-dc73b9a5.js";import{_ as s,B as n}from"./shared-0f6e4584.js";import{T as a}from"./shared-8874ec69.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-56bf05ef.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-6e859df6.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-22ba9566.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./foxy-swipe-actions.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-ac0368ec.js";import"./shared-16c17e32.js";import"./shared-0a6a28ce.js";import"./shared-19884cf4.js";import"./shared-651c44fa.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-c388e926.js";import"./shared-21bc5d5e.js";import"./shared-51c4a6dd.js";import"./shared-fb0ca5e2.js";import"./shared-f3773d62.js";import"./shared-3ee151ce.js";import"./shared-e778071b.js";import"./shared-60d586ba.js";import"./shared-0700fd80.js";import"./shared-56a559fd.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-f34aeb6c.js";import"./shared-6ac0d05e.js";import"./shared-f407c2cb.js";let l,c,f=e=>e;const m=r(t);customElements.define("foxy-internal-gift-card-form-provisioning-control",class extends m{constructor(){super(...arguments),this.__maxBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_max},this.__maxBalanceValueSetter=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:s>e?e:s,initial_balance_max:e}})},this.__minBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_min},this.__minBalanceValueSetter=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:s<e?e:s}})},this.__toggleValueGetter=()=>{var e,t;return(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?["allow"]:[]},this.__toggleValueSetter=e=>{var t,r,o,i,s,n,a,d;e.includes("allow")?null===(t=this.nucleon)||void 0===t||t.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(i=null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.form.provisioning_config)||void 0===o?void 0:o.initial_balance_min)&&void 0!==i?i:0,initial_balance_max:null!==(a=null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.form.provisioning_config)||void 0===n?void 0:n.initial_balance_max)&&void 0!==a?a:0}}):null===(d=this.nucleon)||void 0===d||d.edit({provisioning_config:null})},this.__toggleOptions=[{label:"text",value:"allow"}]}renderControl(){var e,t;return i(l||(l=f` <foxy-internal-checkbox-group-control infer="toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__toggleValueGetter,this.__toggleValueSetter,this.__toggleOptions,(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?i(c||(c=f` <div class="grid grid-cols-2 sm-grid-cols-4 gap-m mt-s"> <foxy-internal-text-control infer="sku" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-integer-control infer="min-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> </div> `),this.__minBalanceValueGetter,this.__minBalanceValueSetter,this.__maxBalanceValueGetter,this.__maxBalanceValueSetter):"")}});const p=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let u,_,h=e=>e;const g=r(o(e,"gift-card-form"));class v extends g{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"current_balance",path:"current_balance",type:a.Number},{label:"end_date",path:"end_date",type:a.Date},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(t.code),e.__codesActions[0].state="end"}catch(t){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return s(s({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var t;if(null===(t=e.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_min;return!("number"==typeof r&&r<0)||"min-balance:v8n_negative"},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_max;return!("number"==typeof r&&r<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("codes","category-restrictions","attributes"),new n(e.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return i(u||(u=h` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,n,a,l;let c;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),c=r.toString()}catch(e){c=void 0}return i(_||(_=h` ${0} <div class="grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m"> <foxy-internal-text-control infer="name" class="md-col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" infer="expires"> </foxy-internal-frequency-control> </div> <foxy-internal-gift-card-form-provisioning-control infer="provisioning"> </foxy-internal-gift-card-form-provisioning-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,p.map((e=>({label:this.t(`currency.code_${e}`),value:e}))),c,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===o?void 0:o._links["fx:item_categories"].href),d(null===(s=this.data)||void 0===s?void 0:s._links["fx:gift_card_item_categories"].href),d(null===(n=this.data)||void 0===n?void 0:n._links.self.href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",v);export{v as GiftCardForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-3ee151ce.js";import"./foxy-nucleon-element.js";import"./shared-37efab30.js";import{_ as e}from"./shared-0f6e4584.js";import{a as t}from"./shared-fb34e84c.js";import{C as i}from"./shared-0b01f721.js";import{p as r}from"./shared-f34aeb6c.js";import{I as o}from"./shared-f3773d62.js";import{i as a}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let d,l,n,c,u,_,h=e=>e;const f=i(t(o,"item-card"));class v extends f{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"}})}renderBody(){var e,t,i,r,o,f,p,m,y,x;const L=null!==(t=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==t?t:0,$=null===(r=null===(i=this.data)||void 0===i?void 0:i._embedded)||void 0===r?void 0:r["fx:item_options"],g=null!==(f=null===(o=this.data)||void 0===o?void 0:o.price)&&void 0!==f?f:0,C=this.__currencyDisplay,H=this.__currencyCode;return s(d||(d=h` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="flex items-start leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-s bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <div class="flex-1 min-w-0"> <div class="h-s flex items-center"> <div class="min-w-0 flex-1 leading-s"> <div class="flex items-center justify-between"> <div class="truncate text-m font-medium"> ${0} </div> <span class="text-s text-tertiary whitespace-nowrap"> ${0} × <foxy-i18n .options="${0}" key="price" infer=""> </foxy-i18n> </span> </div> <div class="truncate text-secondary text-s"> ${0} ${0} ​ </div> </div> </div> ${0} </div> </div> `),a(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),a(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),a(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),a(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),a(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),a(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),a(null===(p=this.data)||void 0===p?void 0:p.image),(e=>{e.currentTarget.src=v.__placeholder}),(null===(m=this.data)||void 0===m?void 0:m.name)||s(l||(l=h`<foxy-i18n infer="" key="no_code"></foxy-i18n>`)),L,{amount:`${g} ${H}`,currencyDisplay:C},(null===(y=this.data)||void 0===y?void 0:y.code)||void 0,(null===(x=this.data)||void 0===x?void 0:x.subscription_frequency)&&!this.hiddenSelector.matches("autorenew-icon",!0)?s(n||(n=h` <span> • </span> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> `),this.__subinfoKey,this.__subinfoOptions):"",$&&$.length>0?s(c||(c=h` <div class="mt-m"> ${0} </div> `),$.map((e=>s(u||(u=h` <div data-testclass="option" class="flex items-center gap-s text-s leading-s"> <div class="truncate text-secondary"> ${0}: <span class="font-medium text-body">${0}</span> </div> ${0} </div> `),e.name,e.value,e.price_mod?s(_||(_=h` <div class="border-t border-dashed border-contrast-10 flex-1"></div> <div class="whitespace-nowrap text-tertiary"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),JSON.stringify({amount:`${e.price_mod} ${H}`,signDisplay:"exceptZero",currencyDisplay:C})):"")))):"")}get isBodyReady(){const e=!!this.__currencyDisplay&&!!this.__currencyCode;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t,i;try{const r=null===(e=this.data)||void 0===e?void 0:e._links,o=new URL(null!==(i=null===(t=null==r?void 0:r["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==i?i:"");return o.searchParams.set("zoom","transaction_template"),o.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,i,r;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(r=null===(i=this.__store)||void 0===i?void 0:i._links["fx:template_sets"].href)&&void 0!==r?r:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==i?void 0:i["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const i=`#${this.__transactionTemplateLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const i=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const i=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t||this.data&&!this.data._links["fx:store"]?"symbol":void 0}get __currencyCode(){var e,t,i,r;const o=this.__transaction;if(o)return o.currency_code;{const o=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(null==o?void 0:o.currency_code)return o.currency_code;{const e=this.__localeCodesHelper,o=null===(i=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===i?void 0:i.locale_code,a=o?null==e?void 0:e.values[o]:void 0;if(a)return null===(r=/Currency: ([A-Z]{3})/g.exec(a))||void 0===r?void 0:r[1]}}}get __subinfoOptions(){var t,i,o;const a=this.__currencyDisplay;if(void 0===a)return;const s=this.__currencyCode;if(void 0===s)return;const d=null===(t=this.__transactionTemplate)||void 0===t?void 0:t.total_order;if(void 0===d)return;const l=null===(i=this.data)||void 0===i?void 0:i.subscription_frequency;if(void 0===l)return;const n=null===(o=this.data)||void 0===o?void 0:o.subscription_start_date;return void 0!==n?e(e({},r(l)),{},{amount:`${d} ${s}`,currencyDisplay:a,startDate:n}):void 0}get __subinfoKey(){var e;const t=null===(e=this.data)||void 0===e?void 0:e.subscription_frequency;if(t)return"subinfo_"+(".5m"===t?"twice_a_month":"recurring")}}v.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",v);export{v as ItemCard};
|
|
1
|
+
import"./shared-3ee151ce.js";import"./foxy-nucleon-element.js";import"./shared-37efab30.js";import{_ as e}from"./shared-0f6e4584.js";import{a as t}from"./shared-fb34e84c.js";import{C as i}from"./shared-0b01f721.js";import{p as r}from"./shared-f34aeb6c.js";import{I as o}from"./shared-f3773d62.js";import{i as a}from"./shared-9803aa7c.js";import{d as s}from"./shared-6ac0d05e.js";import{h as d}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-44ce656d.js";import"./shared-56bf05ef.js";import"./shared-f7a1193f.js";import"./shared-343d1fd7.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";let l,n,c,u,_,h,f=e=>e;const v=i(t(o,"item-card"));class p extends v{constructor(){super(...arguments),this.localeCodes=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__transactionLoaderId="transactionLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__cartLoaderId="cartLoader"}static get properties(){return e(e({},super.properties),{},{localeCodes:{type:String,attribute:"locale-codes"}})}renderBody(){var e,t,i,r,o,v,m,y,x,L;const $=null!==(t=null===(e=this.data)||void 0===e?void 0:e.quantity)&&void 0!==t?t:0,g=null===(r=null===(i=this.data)||void 0===i?void 0:i._embedded)||void 0===r?void 0:r["fx:item_options"],C=null!==(v=null===(o=this.data)||void 0===o?void 0:o.price)&&void 0!==v?v:0,H=this.__currencyDisplay,w=this.__currencyCode;return d(l||(l=f` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="flex items-start leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-s bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="" @error="${0}"> <div class="flex-1 min-w-0"> <div class="h-s flex items-center"> <div class="min-w-0 flex-1 leading-s"> <div class="flex items-center justify-between"> <div class="truncate text-m font-medium"> ${0} </div> <span class="text-s text-tertiary whitespace-nowrap"> ${0} × <foxy-i18n .options="${0}" key="price" infer=""> </foxy-i18n> </span> </div> <div class="truncate text-secondary text-s"> ${0} ${0} ​ </div> </div> </div> ${0} </div> </div> `),a(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),a(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),a(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),a(this.__transactionHref),this.__transactionLoaderId,(()=>this.requestUpdate()),a(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),a(this.__cartHref),this.__cartLoaderId,(()=>this.requestUpdate()),a(null===(m=this.data)||void 0===m?void 0:m.image),(e=>{e.currentTarget.src=p.__placeholder}),s(null===(y=this.data)||void 0===y?void 0:y.name)||d(n||(n=f`<foxy-i18n infer="" key="no_code"></foxy-i18n>`)),$,{amount:`${C} ${w}`,currencyDisplay:H},(null===(x=this.data)||void 0===x?void 0:x.code)||void 0,(null===(L=this.data)||void 0===L?void 0:L.subscription_frequency)&&!this.hiddenSelector.matches("autorenew-icon",!0)?d(c||(c=f` <span> • </span> <foxy-i18n infer="" key="${0}" .options="${0}"> </foxy-i18n> `),this.__subinfoKey,this.__subinfoOptions):"",g&&g.length>0?d(u||(u=f` <div class="mt-m"> ${0} </div> `),g.map((e=>d(_||(_=f` <div data-testclass="option" class="flex items-center gap-s text-s leading-s"> <div class="truncate text-secondary"> ${0}: <span class="font-medium text-body">${0}</span> </div> ${0} </div> `),e.name,e.value,e.price_mod?d(h||(h=f` <div class="border-t border-dashed border-contrast-10 flex-1"></div> <div class="whitespace-nowrap text-tertiary"> <foxy-i18n options="${0}" key="price" infer=""> </foxy-i18n> </div> `),JSON.stringify({amount:`${e.price_mod} ${w}`,signDisplay:"exceptZero",currencyDisplay:H})):"")))):"")}get isBodyReady(){const e=!!this.__currencyDisplay&&!!this.__currencyCode;return super.isBodyReady&&e}get __transactionTemplateHref(){var e,t,i;try{const r=null===(e=this.data)||void 0===e?void 0:e._links,o=new URL(null!==(i=null===(t=null==r?void 0:r["fx:subscription"])||void 0===t?void 0:t.href)&&void 0!==i?i:"");return o.searchParams.set("zoom","transaction_template"),o.toString()}catch(e){}}get __defaultTemplateSetHref(){var e,t,i,r;if(""===(null===(t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const e=new URL(null!==(r=null===(i=this.__store)||void 0===i?void 0:i._links["fx:template_sets"].href)&&void 0!==r?r:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __transactionHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transaction"])||void 0===t?void 0:t.href}get __templateSetHref(){var e;const t=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __cartHref(){var e,t;const i=null===(e=this.data)||void 0===e?void 0:e._links;return null===(t=null==i?void 0:i["fx:cart"])||void 0===t?void 0:t.href}get __transactionTemplate(){var e,t;const i=`#${this.__transactionTemplateLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:transaction_template"])&&void 0!==t?t:null}get __defaultTemplateSet(){var e,t;const i=`#${this.__defaultTemplateSetLoaderId}`,r=this.renderRoot.querySelector(i);return null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __transaction(){var e,t;const i=`#${this.__transactionLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __templateSet(){var e,t;const i=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __store(){var e,t;const i=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __cart(){var e,t;const i=`#${this.__cartLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(i))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __currencyDisplay(){var e;const t=null===(e=this.__store)||void 0===e?void 0:e.use_international_currency_symbol;return!0===t?"code":!1===t||this.data&&!this.data._links["fx:store"]?"symbol":void 0}get __currencyCode(){var e,t,i,r;const o=this.__transaction;if(o)return o.currency_code;{const o=null!==(e=this.__cart)&&void 0!==e?e:this.__transactionTemplate;if(null==o?void 0:o.currency_code)return o.currency_code;{const e=this.__localeCodesHelper,o=null===(i=null!==(t=this.__templateSet)&&void 0!==t?t:this.__defaultTemplateSet)||void 0===i?void 0:i.locale_code,a=o?null==e?void 0:e.values[o]:void 0;if(a)return null===(r=/Currency: ([A-Z]{3})/g.exec(a))||void 0===r?void 0:r[1]}}}get __subinfoOptions(){var t,i,o;const a=this.__currencyDisplay;if(void 0===a)return;const s=this.__currencyCode;if(void 0===s)return;const d=null===(t=this.__transactionTemplate)||void 0===t?void 0:t.total_order;if(void 0===d)return;const l=null===(i=this.data)||void 0===i?void 0:i.subscription_frequency;if(void 0===l)return;const n=null===(o=this.data)||void 0===o?void 0:o.subscription_start_date;return void 0!==n?e(e({},r(l)),{},{amount:`${d} ${s}`,currencyDisplay:a,startDate:n}):void 0}get __subinfoKey(){var e;const t=null===(e=this.data)||void 0===e?void 0:e.subscription_frequency;if(t)return"subinfo_"+(".5m"===t?"twice_a_month":"recurring")}}p.__placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E',customElements.define("foxy-item-card",p);export{p as ItemCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-e778071b.js";import"./shared-388e9240.js";import"./shared-5a2f398c.js";import"./shared-8cd578ee.js";import"./shared-c388e926.js";import"./shared-08e0a194.js";import"./shared-
|
|
1
|
+
import"./shared-e778071b.js";import"./shared-388e9240.js";import"./shared-5a2f398c.js";import"./shared-8cd578ee.js";import"./shared-c388e926.js";import"./shared-08e0a194.js";import"./shared-60d586ba.js";import{I as t}from"./shared-0e055562.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as r,B as e}from"./shared-0f6e4584.js";import{a as o}from"./shared-fb34e84c.js";import{i}from"./shared-9803aa7c.js";import{c as n}from"./shared-4e709717.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-6e859df6.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./shared-fc1dfa64.js";import"./shared-99940888.js";import"./shared-90a47948.js";import"./shared-61b6ef6e.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-56bf05ef.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-ac0368ec.js";import"./shared-16c17e32.js";import"./shared-0a6a28ce.js";import"./shared-19884cf4.js";import"./shared-651c44fa.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./shared-22ba9566.js";import"./shared-0700fd80.js";import"./shared-56a559fd.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-copy-to-clipboard.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-bab2ea2c.js";import"./shared-fb0ca5e2.js";import"./shared-f3773d62.js";import"./shared-8438d4ca.js";import"./shared-f407c2cb.js";import"./shared-21bc5d5e.js";let a,l=t=>t;class m extends(o(t,"item-form")){constructor(){super(...arguments),this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.coupons=null,this.store=null,this.__itemsLink=""}static get properties(){return r(r({},super.properties),{},{customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},coupons:{},store:{}})}static get v8n(){return[({name:t})=>!!t||"name:v8n_required",({name:t})=>!!t&&t.length<=255||"name:v8n_too_long",({price:t})=>"number"==typeof t&&!isNaN(t)||"price:v8n_required",({price:t})=>"number"==typeof t&&t>=0||"price:v8n_negative",({quantity:t})=>"number"==typeof t&&t>=1||"quantity:v8n_less_than_one"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_future_line_item)?"future_line_item":"regular"}}get readonlySelector(){const t=[super.readonlySelector.toString()];return this.href&&t.unshift("subscriptions"),new e(t.join(" ").trim())}get hiddenSelector(){var t,r;const o=[super.hiddenSelector.toString()];return(null===(r=null===(t=this.__storeLoader)||void 0===t?void 0:t.data)||void 0===r?void 0:r.features_multiship)||o.unshift("general:shipto"),this.data&&!this.data.subscription_frequency&&o.unshift("subscriptions"),this.form.discount_name||o.unshift("discount:discount-builder"),this.href||o.unshift("discount-details","coupon-details","item-options","attributes"),new e(o.join(" ").trim())}renderBody(){var t,r,e,o,m,d,f;return s(a||(a=l` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="price" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="quantity" step="1" min="1"> </foxy-internal-number-control> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="parent-code"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="shipto"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="subscriptions"> <foxy-internal-frequency-control layout="summary-item" infer="subscription-frequency"> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="subscription-start-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="subscription-end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="item-options" first="${0}" form="foxy-item-option-form" item="foxy-item-option-card" alert .related="${0}" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="dimensions"> <foxy-internal-number-control layout="summary-item" infer="weight" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="length" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="width" min="0"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="height" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="meta"> <foxy-internal-text-control layout="summary-item" infer="url"></foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="image"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="quantity-max" step="1" min="1"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="quantity-min" step="1" min="1"> </foxy-internal-number-control> <foxy-internal-date-control layout="summary-item" infer="expires" format="unix"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="discount"> <foxy-internal-text-control layout="summary-item" infer="discount-name"> </foxy-internal-text-control> <foxy-discount-builder infer="discount-builder" class="${0}" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="discount-details" first="${0}" item="foxy-discount-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="coupon-details" first="${0}" item="foxy-coupon-detail-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),i(null!==(t=null==this?void 0:this.itemCategories)&&void 0!==t?t:void 0),i(null===(r=this.data)||void 0===r?void 0:r._links["fx:item_options"].href),this.__itemOptionRelatedUrls,{"locale-codes":null!==(e=this.localeCodes)&&void 0!==e?e:""},n({hidden:this.hiddenSelector.matches("discount-builder",!0)}),this.__discountBuilderParsedValue,this.__handleDiscountBuilderChange,i(null===(o=this.data)||void 0===o?void 0:o._links["fx:discount_details"].href),i(null===(m=this.data)||void 0===m?void 0:m._links["fx:coupon_details"].href),i(null===(d=this.data)||void 0===d?void 0:d._links["fx:attributes"].href),super.renderBody(),i(null!==(f=this.store)&&void 0!==f?f:void 0),(()=>this.requestUpdate()))}async _sendGet(){const t=await super._sendGet();if(t._links["fx:subscription"]){const r=t._links["fx:subscription"].href,e=(await super._fetch(r))._links["fx:transaction_template"].href,o=await super._fetch(e);return this.__itemsLink=o._links["fx:items"].href,t}if(t._links["fx:transaction"]){const r=await super._fetch(t._links["fx:transaction"].href);return this.__itemsLink=r._links["fx:items"].href,t}if(t._links["fx:cart"]){const r=await super._fetch(t._links["fx:cart"].href);return this.__itemsLink=r._links["fx:items"].href,t}return t}get __discountBuilderParsedValue(){return{details:this.form.discount_details,type:this.form.discount_type,name:this.form.discount_name}}get __itemOptionRelatedUrls(){var t,r;const e=null!==(r=null===(t=this.data)||void 0===t?void 0:t._links)&&void 0!==r?r:{},o=[];return e["fx:subscription"]&&o.push(e["fx:subscription"].href),e["fx:transaction"]&&o.push(e["fx:transaction"].href),e["fx:shipment"]&&o.push(e["fx:shipment"].href),e["fx:cart"]&&o.push(e["fx:cart"].href),this.__itemsLink&&o.push(this.__itemsLink),o}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}__handleDiscountBuilderChange(t){const r=t.currentTarget.parsedValue;this.edit({discount_details:r.details,discount_type:r.type,discount_name:r.name})}}customElements.define("foxy-item-form",m);export{m as ItemForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-0cc5420d.js";import"./shared-28f74114.js";import"./shared-f407c2cb.js";import"./shared-dfc33ff6.js";import"./shared-55e95bd2.js";import"./shared-08e0a194.js";import{I as e}from"./shared-0e055562.js";import{m as r,B as t,_ as o}from"./shared-0f6e4584.js";import{a as i}from"./shared-fb34e84c.js";import{h as a,s as n}from"./shared-dc73b9a5.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./shared-a207423c.js";import"./shared-90a47948.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-2a5c89a4.js";import"./shared-4b346553.js";import"./shared-b8198665.js";import"./shared-8f3398dc.js";import"./shared-245f8836.js";import"./shared-6e859df6.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./foxy-copy-to-clipboard.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const l={service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""},s={encryption_key:"",service:"json",version:1,events:[],title:"",url:""},_={part_number_product_option:"",product_order_priority:"",calling_system_number:"",external_company_id:"",audit_settings:"never",company_role:"B",service_url:"",host_system:"",from_city:""},c={category_to_product_tax_code_mappings:{},enable_colorado_delivery_fee:!1,address_validation_countries:[],use_address_validation:!1,create_invoice:!1,company_code:"",service_url:"",use_ava_tax:!1,key:"",id:""},d={inventory_field_name:"",inventory_field_id:"",collection_name:"",sku_field_name:"",collection_id:"",sku_field_id:"",site_name:"",service:"webflow",version:1,site_id:"",events:["transaction/created"],auth:""},u={service:"zapier",events:[],url:""},f={category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""};let p,v,g,h,x,y,m,b,w,C,V,$,k,j,F=e=>e;const S=i(e,"native-integration-form");class G extends S{constructor(){super(...arguments),this.__createConfigGetterFor=r((e=>()=>{var r;return null===(r=this.__config)||void 0===r?void 0:r[e]})),this.__createConfigSetterFor=r((e=>r=>this.__config={[e]:r})),this.__providerGetValue=()=>{var e;return null!==(e=this.form.provider)&&void 0!==e?e:"avalara"},this.__providerSetValue=e=>{this.edit({provider:e,config:"{}"}),this.__config={}},this.__templateProviderOptions=[{value:"avalara",label:"option_avalara"},{value:"onesource",label:"option_onesource"},{value:"taxjar",label:"option_taxjar"}],this.__avalaraConfigOptions=[{value:"use_ava_tax",label:"option_use_ava_tax"},{value:"enable_colorado_delivery_fee",label:"option_enable_colorado_delivery_fee"},{value:"create_invoice",label:"option_create_invoice"},{value:"use_address_validation",label:"option_use_address_validation"}],this.__taxjarConfigOptions=[{value:"create_invoice",label:"option_create_invoice"}],this.__configOptionsGetValue=()=>{const e=this.__config,r=[];return(null==e?void 0:e.enable_colorado_delivery_fee)&&r.push("enable_colorado_delivery_fee"),(null==e?void 0:e.use_address_validation)&&r.push("use_address_validation"),(null==e?void 0:e.create_invoice)&&r.push("create_invoice"),(null==e?void 0:e.use_ava_tax)&&r.push("use_ava_tax"),r},this.__configOptionsSetValue=e=>{this.__config={enable_colorado_delivery_fee:e.includes("enable_colorado_delivery_fee"),use_address_validation:e.includes("use_address_validation"),create_invoice:e.includes("create_invoice"),use_ava_tax:e.includes("use_ava_tax")}},this.__avalaraAddressValidationCountriesOptions=[{value:"US",label:"option_US"},{value:"CA",label:"option_CA"}],this.__codeMappingsGetValue=()=>{var e,r;const t=null!==(r=null===(e=this.__config)||void 0===e?void 0:e.category_to_product_tax_code_mappings)&&void 0!==r?r:{};return Object.entries(t).map((([e,r])=>({value:`${e}:${r}`})))},this.__codeMappingsSetValue=e=>{const r={};for(const{value:t}of e){const[e,o]=t.split(":");e&&o&&(r[e]=o)}this.__config={category_to_product_tax_code_mappings:r}},this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,r;return(null!==(r=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==r?r:[]).filter((e=>!!e)).map((e=>({value:e})))},this.__onesourceProductOrderPrioritySetValue=e=>{this.__config={product_order_priority:e.map((e=>e.value)).join(",")}},this.__onesourceAuditSettingsOptions=[{value:"capture_only",label:"option_capture_only"},{value:"auth_and_capture",label:"option_auth_and_capture"},{value:"never",label:"option_never"}],this.__webhookServiceOptions=[{value:"json",label:"option_json"},{value:"legacy_xml",label:"option_legacy_xml"}],this.__webhookJsonEventsOptions=[{value:"transaction/created",label:"option_transaction_created"},{value:"subscription/cancelled",label:"option_subscription_cancelled"}]}static get v8n(){const e=r(JSON.parse),t=r((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:r="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?t(i)?null:"v8n_invalid":"v8n_required";return"avalara"!==r||!a||`avalara-service-url:${a}`},({provider:r="avalara",config:t="{}"})=>"avalara"!==r||!!e(t).id||"avalara-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"avalara"!==r||!!e(t).key||"avalara-key:v8n_required",({provider:r="avalara",config:t="{}"})=>"avalara"!==r||!!e(t).company_code||"avalara-company-code:v8n_required",({provider:r="avalara",config:t="{}"})=>{if("avalara"!==r)return!0;const o=e(t).category_to_product_tax_code_mappings;return o&&Object.entries(o).length>0||"avalara-category-to-product-tax-code-mappings:v8n_required"},({provider:r="avalara",config:t="{}"})=>"taxjar"!==r||!!e(t).api_token||"taxjar-api-token:v8n_required",({provider:r="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?t(i)?null:"v8n_invalid":"v8n_required";return"onesource"!==r||!a||`onesource-service-url:${a}`},({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).external_company_id||"onesource-external-company-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).from_city||"onesource-from-city:v8n_required",({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).host_system||"onesource-host-system:v8n_required",({provider:r="avalara",config:t="{}"})=>{const{service:o,title:i}=e(t);return"webhook"!==r||"json"!==o||!!i||"webhook-json-title:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:o,encryption_key:i}=e(t);return"webhook"!==r||"json"!==o||!!i||"webhook-json-encryption-key:v8n_required"},({provider:r="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?t(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"json"!==i||!n||`webhook-json-url:${n}`},({provider:r="avalara",config:t="{}"})=>{const{service:o,title:i}=e(t);return"webhook"!==r||"legacy_xml"!==o||!!i||"webhook-legacy-xml-title:v8n_required"},({provider:r="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?t(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"legacy_xml"!==i||!n||`webhook-legacy-xml-url:${n}`},({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).site_id||"webflow-site-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).site_name||"webflow-site-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).collection_id||"webflow-collection-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).collection_name||"webflow-collection-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-merchant-id","custom-tax-url","zapier-events","zapier-url","provider"),new t(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const r=null!==(e=this.form.provider)&&void 0!==e?e:"avalara";return a(p||(p=F` ${0} ${0} ${0} ${0} `),this.renderHeader(),this.href?"":a(v||(v=F` <foxy-internal-radio-group-control infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===r?this.__renderAvalaraConfig():"taxjar"===r?this.__renderTaxJarConfig():"onesource"===r?this.__renderOneSourceConfig():"webflow"===r?this.__renderWebflowConfig():"zapier"===r?this.__renderZapierConfig():"webhook"===r?this.__renderWebhookConfig():"apple_pay"===r?this.__renderApplePayConfig():"custom_tax"===r?this.__renderCustomTaxConfig():"",super.renderBody())}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let r;try{r=(await e.json())._embedded["fx:errors"][0].message}catch(r){throw e}throw r.includes("has already been configured")?["error:already_configured"]:e}}get __config(){try{return JSON.parse(this.form.config)}catch(e){return null}}set __config(e){var r;const t=this.__config,i=null!==(r=this.form.provider)&&void 0!==r?r:"avalara",a="avalara"===i?c:"taxjar"===i?f:"onesource"===i?_:"webflow"===i?d:"zapier"===i?u:"webhook"===i?"legacy_xml"===(null==t?void 0:t.service)?l:s:void 0,n=JSON.stringify(o(o(o({},a),t),e));this.edit({provider:i,config:n})}__renderAvalaraConfig(){var e;return a(g||(g=F` <foxy-internal-text-control infer="avalara-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="avalara-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control infer="avalara-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-text-control infer="avalara-company-code" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="avalara-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="avalara-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("id"),this.__createConfigSetterFor("id"),this.__createConfigGetterFor("key"),this.__createConfigSetterFor("key"),this.__createConfigGetterFor("company_code"),this.__createConfigSetterFor("company_code"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__avalaraConfigOptions,(null===(e=this.__config)||void 0===e?void 0:e.use_address_validation)?a(h||(h=F` <foxy-internal-checkbox-group-control infer="avalara-address-validation-countries" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("address_validation_countries"),this.__createConfigSetterFor("address_validation_countries"),this.__avalaraAddressValidationCountriesOptions):"")}__renderTaxJarConfig(){return a(x||(x=F` <foxy-internal-password-control infer="taxjar-api-token" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-editable-list-control infer="taxjar-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="taxjar-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("api_token"),this.__createConfigSetterFor("api_token"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__taxjarConfigOptions)}__renderOneSourceConfig(){return a(y||(y=F` <foxy-internal-text-control infer="onesource-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-external-company-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-calling-system-number" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-from-city" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-host-system" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="onesource-company-role" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-radio-group-control infer="onesource-audit-settings" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("external_company_id"),this.__createConfigSetterFor("external_company_id"),this.__createConfigGetterFor("calling_system_number"),this.__createConfigSetterFor("calling_system_number"),this.__createConfigGetterFor("from_city"),this.__createConfigSetterFor("from_city"),this.__createConfigGetterFor("host_system"),this.__createConfigSetterFor("host_system"),this.__createConfigGetterFor("company_role"),this.__createConfigSetterFor("company_role"),this.__onesourceCompanyRoleOptions,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue,this.__createConfigGetterFor("audit_settings"),this.__createConfigSetterFor("audit_settings"),this.__onesourceAuditSettingsOptions)}__renderWebhookConfig(){var e,r;return a(m||(m=F` <div class="flex items-start border border-error rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> </div> ${0} `),n(b||(b=F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(r=this.__config)||void 0===r?void 0:r.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return a(w||(w=F` <foxy-internal-text-control infer="webhook-json-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-json-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="webhook-json-events" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="webhook-json-encryption-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions,this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__webhookJsonEventsOptions,this.__createConfigGetterFor("encryption_key"),this.__createConfigSetterFor("encryption_key"))}__renderWebhookLegacyXmlConfig(){return a(C||(C=F` <foxy-internal-text-control infer="webhook-legacy-xml-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-legacy-xml-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions)}__renderWebflowConfig(){return a(V||(V=F` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="webflow-site-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-site-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </div> `),this.__createConfigGetterFor("site_id"),this.__createConfigSetterFor("site_id"),this.__createConfigGetterFor("site_name"),this.__createConfigSetterFor("site_name"),this.__createConfigGetterFor("collection_id"),this.__createConfigSetterFor("collection_id"),this.__createConfigGetterFor("collection_name"),this.__createConfigSetterFor("collection_name"),this.__createConfigGetterFor("sku_field_id"),this.__createConfigSetterFor("sku_field_id"),this.__createConfigGetterFor("sku_field_name"),this.__createConfigSetterFor("sku_field_name"),this.__createConfigGetterFor("inventory_field_id"),this.__createConfigSetterFor("inventory_field_id"),this.__createConfigGetterFor("inventory_field_name"),this.__createConfigSetterFor("inventory_field_name"))}__renderZapierConfig(){return a($||($=F` <foxy-internal-editable-list-control infer="zapier-events" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-text-area-control infer="zapier-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}__renderApplePayConfig(){return a(k||(k=F` <foxy-internal-text-control infer="apple-pay-merchant-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("merchantID"),this.__createConfigSetterFor("merchantID"))}__renderCustomTaxConfig(){return a(j||(j=F` <foxy-internal-text-control infer="custom-tax-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="custom-tax-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}}customElements.define("foxy-native-integration-form",G);export{G as NativeIntegrationForm};
|
|
1
|
+
import"./shared-0cc5420d.js";import"./shared-28f74114.js";import"./shared-f407c2cb.js";import"./shared-7c411b0a.js";import"./shared-55e95bd2.js";import"./shared-08e0a194.js";import{I as e}from"./shared-0e055562.js";import{m as r,B as t,_ as o}from"./shared-0f6e4584.js";import{a as i}from"./shared-fb34e84c.js";import{h as a,s as n}from"./shared-dc73b9a5.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./shared-a207423c.js";import"./shared-90a47948.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-9803aa7c.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-2a5c89a4.js";import"./shared-4b346553.js";import"./shared-b8198665.js";import"./shared-8f3398dc.js";import"./shared-245f8836.js";import"./shared-6e859df6.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./foxy-copy-to-clipboard.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const l={service:"legacy_xml",version:1,events:["transaction/created"],title:"",url:""},s={encryption_key:"",service:"json",version:1,events:[],title:"",url:""},_={part_number_product_option:"",product_order_priority:"",calling_system_number:"",external_company_id:"",audit_settings:"never",company_role:"B",service_url:"",host_system:"",from_city:""},c={category_to_product_tax_code_mappings:{},enable_colorado_delivery_fee:!1,address_validation_countries:[],use_address_validation:!1,create_invoice:!1,company_code:"",service_url:"",use_ava_tax:!1,key:"",id:""},d={inventory_field_name:"",inventory_field_id:"",collection_name:"",sku_field_name:"",collection_id:"",sku_field_id:"",site_name:"",service:"webflow",version:1,site_id:"",events:["transaction/created"],auth:""},u={service:"zapier",events:[],url:""},f={category_to_product_tax_code_mappings:{},create_invoice:!1,api_token:""};let p,v,g,h,x,y,m,b,w,C,V,$,k,j,F=e=>e;const S=i(e,"native-integration-form");class G extends S{constructor(){super(...arguments),this.__createConfigGetterFor=r((e=>()=>{var r;return null===(r=this.__config)||void 0===r?void 0:r[e]})),this.__createConfigSetterFor=r((e=>r=>this.__config={[e]:r})),this.__providerGetValue=()=>{var e;return null!==(e=this.form.provider)&&void 0!==e?e:"avalara"},this.__providerSetValue=e=>{this.edit({provider:e,config:"{}"}),this.__config={}},this.__templateProviderOptions=[{value:"avalara",label:"option_avalara"},{value:"onesource",label:"option_onesource"},{value:"taxjar",label:"option_taxjar"}],this.__avalaraConfigOptions=[{value:"use_ava_tax",label:"option_use_ava_tax"},{value:"enable_colorado_delivery_fee",label:"option_enable_colorado_delivery_fee"},{value:"create_invoice",label:"option_create_invoice"},{value:"use_address_validation",label:"option_use_address_validation"}],this.__taxjarConfigOptions=[{value:"create_invoice",label:"option_create_invoice"}],this.__configOptionsGetValue=()=>{const e=this.__config,r=[];return(null==e?void 0:e.enable_colorado_delivery_fee)&&r.push("enable_colorado_delivery_fee"),(null==e?void 0:e.use_address_validation)&&r.push("use_address_validation"),(null==e?void 0:e.create_invoice)&&r.push("create_invoice"),(null==e?void 0:e.use_ava_tax)&&r.push("use_ava_tax"),r},this.__configOptionsSetValue=e=>{this.__config={enable_colorado_delivery_fee:e.includes("enable_colorado_delivery_fee"),use_address_validation:e.includes("use_address_validation"),create_invoice:e.includes("create_invoice"),use_ava_tax:e.includes("use_ava_tax")}},this.__avalaraAddressValidationCountriesOptions=[{value:"US",label:"option_US"},{value:"CA",label:"option_CA"}],this.__codeMappingsGetValue=()=>{var e,r;const t=null!==(r=null===(e=this.__config)||void 0===e?void 0:e.category_to_product_tax_code_mappings)&&void 0!==r?r:{};return Object.entries(t).map((([e,r])=>({value:`${e}:${r}`})))},this.__codeMappingsSetValue=e=>{const r={};for(const{value:t}of e){const[e,o]=t.split(":");e&&o&&(r[e]=o)}this.__config={category_to_product_tax_code_mappings:r}},this.__onesourceCompanyRoleOptions=[{value:"B",label:"option_buyer"},{value:"M",label:"option_middleman"},{value:"S",label:"option_seller"}],this.__onesourceProductOrderPriorityGetValue=()=>{var e,r;return(null!==(r=null===(e=this.__config)||void 0===e?void 0:e.product_order_priority.split(","))&&void 0!==r?r:[]).filter((e=>!!e)).map((e=>({value:e})))},this.__onesourceProductOrderPrioritySetValue=e=>{this.__config={product_order_priority:e.map((e=>e.value)).join(",")}},this.__onesourceAuditSettingsOptions=[{value:"capture_only",label:"option_capture_only"},{value:"auth_and_capture",label:"option_auth_and_capture"},{value:"never",label:"option_never"}],this.__webhookServiceOptions=[{value:"json",label:"option_json"},{value:"legacy_xml",label:"option_legacy_xml"}],this.__webhookJsonEventsOptions=[{value:"transaction/created",label:"option_transaction_created"},{value:"subscription/cancelled",label:"option_subscription_cancelled"}]}static get v8n(){const e=r(JSON.parse),t=r((e=>{try{return Boolean(new URL(e))}catch(e){return!1}}));return[({provider:r="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?t(i)?null:"v8n_invalid":"v8n_required";return"avalara"!==r||!a||`avalara-service-url:${a}`},({provider:r="avalara",config:t="{}"})=>"avalara"!==r||!!e(t).id||"avalara-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"avalara"!==r||!!e(t).key||"avalara-key:v8n_required",({provider:r="avalara",config:t="{}"})=>"avalara"!==r||!!e(t).company_code||"avalara-company-code:v8n_required",({provider:r="avalara",config:t="{}"})=>{if("avalara"!==r)return!0;const o=e(t).category_to_product_tax_code_mappings;return o&&Object.entries(o).length>0||"avalara-category-to-product-tax-code-mappings:v8n_required"},({provider:r="avalara",config:t="{}"})=>"taxjar"!==r||!!e(t).api_token||"taxjar-api-token:v8n_required",({provider:r="avalara",config:o="{}"})=>{const i=e(o).service_url,a=i?t(i)?null:"v8n_invalid":"v8n_required";return"onesource"!==r||!a||`onesource-service-url:${a}`},({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).external_company_id||"onesource-external-company-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).calling_system_number||"onesource-calling-system-number:v8n_required",({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).from_city||"onesource-from-city:v8n_required",({provider:r="avalara",config:t="{}"})=>"onesource"!==r||!!e(t).host_system||"onesource-host-system:v8n_required",({provider:r="avalara",config:t="{}"})=>{const{service:o,title:i}=e(t);return"webhook"!==r||"json"!==o||!!i||"webhook-json-title:v8n_required"},({provider:r="avalara",config:t="{}"})=>{const{service:o,encryption_key:i}=e(t);return"webhook"!==r||"json"!==o||!!i||"webhook-json-encryption-key:v8n_required"},({provider:r="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?t(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"json"!==i||!n||`webhook-json-url:${n}`},({provider:r="avalara",config:t="{}"})=>{const{service:o,title:i}=e(t);return"webhook"!==r||"legacy_xml"!==o||!!i||"webhook-legacy-xml-title:v8n_required"},({provider:r="avalara",config:o="{}"})=>{const{service:i,url:a}=e(o),n=a?t(a)?null:"v8n_invalid":"v8n_required";return"webhook"!==r||"legacy_xml"!==i||!n||`webhook-legacy-xml-url:${n}`},({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).site_id||"webflow-site-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).site_name||"webflow-site-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).collection_id||"webflow-collection-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).collection_name||"webflow-collection-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).sku_field_id||"webflow-sku-field-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).sku_field_name||"webflow-sku-field-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).inventory_field_id||"webflow-inventory-field-id:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).inventory_field_name||"webflow-inventory-field-name:v8n_required",({provider:r="avalara",config:t="{}"})=>"webflow"!==r||!!e(t).auth||"webflow-auth:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("apple-pay-merchant-id","custom-tax-url","zapier-events","zapier-url","provider"),new t(e.join(" ").trim())}get headerTitleOptions(){return{context:this.data?`existing_${this.data.provider}`:"new",id:this.headerCopyIdValue}}renderBody(){var e;const r=null!==(e=this.form.provider)&&void 0!==e?e:"avalara";return a(p||(p=F` ${0} ${0} ${0} ${0} `),this.renderHeader(),this.href?"":a(v||(v=F` <foxy-internal-radio-group-control infer="provider" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__providerGetValue,this.__providerSetValue,this.__templateProviderOptions),"avalara"===r?this.__renderAvalaraConfig():"taxjar"===r?this.__renderTaxJarConfig():"onesource"===r?this.__renderOneSourceConfig():"webflow"===r?this.__renderWebflowConfig():"zapier"===r?this.__renderZapierConfig():"webhook"===r?this.__renderWebhookConfig():"apple_pay"===r?this.__renderApplePayConfig():"custom_tax"===r?this.__renderCustomTaxConfig():"",super.renderBody())}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let r;try{r=(await e.json())._embedded["fx:errors"][0].message}catch(r){throw e}throw r.includes("has already been configured")?["error:already_configured"]:e}}get __config(){try{return JSON.parse(this.form.config)}catch(e){return null}}set __config(e){var r;const t=this.__config,i=null!==(r=this.form.provider)&&void 0!==r?r:"avalara",a="avalara"===i?c:"taxjar"===i?f:"onesource"===i?_:"webflow"===i?d:"zapier"===i?u:"webhook"===i?"legacy_xml"===(null==t?void 0:t.service)?l:s:void 0,n=JSON.stringify(o(o(o({},a),t),e));this.edit({provider:i,config:n})}__renderAvalaraConfig(){var e;return a(g||(g=F` <foxy-internal-text-control infer="avalara-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="avalara-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control infer="avalara-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-text-control infer="avalara-company-code" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="avalara-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="avalara-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("id"),this.__createConfigSetterFor("id"),this.__createConfigGetterFor("key"),this.__createConfigSetterFor("key"),this.__createConfigGetterFor("company_code"),this.__createConfigSetterFor("company_code"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__avalaraConfigOptions,(null===(e=this.__config)||void 0===e?void 0:e.use_address_validation)?a(h||(h=F` <foxy-internal-checkbox-group-control infer="avalara-address-validation-countries" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("address_validation_countries"),this.__createConfigSetterFor("address_validation_countries"),this.__avalaraAddressValidationCountriesOptions):"")}__renderTaxJarConfig(){return a(x||(x=F` <foxy-internal-password-control infer="taxjar-api-token" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-editable-list-control infer="taxjar-category-to-product-tax-code-mappings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="taxjar-options" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__createConfigGetterFor("api_token"),this.__createConfigSetterFor("api_token"),this.__codeMappingsGetValue,this.__codeMappingsSetValue,this.__configOptionsGetValue,this.__configOptionsSetValue,this.__taxjarConfigOptions)}__renderOneSourceConfig(){return a(y||(y=F` <foxy-internal-text-control infer="onesource-service-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-external-company-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-calling-system-number" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-from-city" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="onesource-host-system" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-radio-group-control infer="onesource-company-role" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="onesource-part-number-product-option" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-editable-list-control infer="onesource-product-order-priority" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-radio-group-control infer="onesource-audit-settings" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("service_url"),this.__createConfigSetterFor("service_url"),this.__createConfigGetterFor("external_company_id"),this.__createConfigSetterFor("external_company_id"),this.__createConfigGetterFor("calling_system_number"),this.__createConfigSetterFor("calling_system_number"),this.__createConfigGetterFor("from_city"),this.__createConfigSetterFor("from_city"),this.__createConfigGetterFor("host_system"),this.__createConfigSetterFor("host_system"),this.__createConfigGetterFor("company_role"),this.__createConfigSetterFor("company_role"),this.__onesourceCompanyRoleOptions,this.__createConfigGetterFor("part_number_product_option"),this.__createConfigSetterFor("part_number_product_option"),this.__onesourceProductOrderPriorityGetValue,this.__onesourceProductOrderPrioritySetValue,this.__createConfigGetterFor("audit_settings"),this.__createConfigSetterFor("audit_settings"),this.__onesourceAuditSettingsOptions)}__renderWebhookConfig(){var e,r;return a(m||(m=F` <div class="flex items-start border border-error rounded" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-error transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n> </a> </p> </div> ${0} `),n(b||(b=F`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),"json"===(null===(e=this.__config)||void 0===e?void 0:e.service)?this.__renderWebhookJsonConfig():"legacy_xml"===(null===(r=this.__config)||void 0===r?void 0:r.service)?this.__renderWebhookLegacyXmlConfig():"")}__renderWebhookJsonConfig(){return a(w||(w=F` <foxy-internal-text-control infer="webhook-json-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-json-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="webhook-json-events" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="webhook-json-encryption-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions,this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__webhookJsonEventsOptions,this.__createConfigGetterFor("encryption_key"),this.__createConfigSetterFor("encryption_key"))}__renderWebhookLegacyXmlConfig(){return a(C||(C=F` <foxy-internal-text-control infer="webhook-legacy-xml-title" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-area-control infer="webhook-legacy-xml-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <foxy-internal-radio-group-control infer="webhook-service" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),this.__createConfigGetterFor("title"),this.__createConfigSetterFor("title"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"),this.__createConfigGetterFor("service"),this.__createConfigSetterFor("service"),this.__webhookServiceOptions)}__renderWebflowConfig(){return a(V||(V=F` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="webflow-site-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-site-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-collection-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-sku-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webflow-inventory-field-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> </div> `),this.__createConfigGetterFor("site_id"),this.__createConfigSetterFor("site_id"),this.__createConfigGetterFor("site_name"),this.__createConfigSetterFor("site_name"),this.__createConfigGetterFor("collection_id"),this.__createConfigSetterFor("collection_id"),this.__createConfigGetterFor("collection_name"),this.__createConfigSetterFor("collection_name"),this.__createConfigGetterFor("sku_field_id"),this.__createConfigSetterFor("sku_field_id"),this.__createConfigGetterFor("sku_field_name"),this.__createConfigSetterFor("sku_field_name"),this.__createConfigGetterFor("inventory_field_id"),this.__createConfigSetterFor("inventory_field_id"),this.__createConfigGetterFor("inventory_field_name"),this.__createConfigSetterFor("inventory_field_name"))}__renderZapierConfig(){return a($||($=F` <foxy-internal-editable-list-control infer="zapier-events" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-text-area-control infer="zapier-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-area-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("events"),this.__createConfigSetterFor("events"),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}__renderApplePayConfig(){return a(k||(k=F` <foxy-internal-text-control infer="apple-pay-merchant-id" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="apple-pay-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("merchantID"),this.__createConfigSetterFor("merchantID"))}__renderCustomTaxConfig(){return a(j||(j=F` <foxy-internal-text-control infer="custom-tax-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <p class="text-xs text-secondary leading-xs"> <foxy-i18n infer="custom-tax-warning" key="warning_text"></foxy-i18n> </p> `),this.__createConfigGetterFor("url"),this.__createConfigSetterFor("url"))}}customElements.define("foxy-native-integration-form",G);export{G as NativeIntegrationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-28f74114.js";import"./shared-5a2f398c.js";import"./shared-dfc33ff6.js";import"./shared-8cd578ee.js";import"./shared-937b497c.js";import"./shared-c388e926.js";import"./shared-ef78d7d9.js";import"./shared-08e0a194.js";import{I as t}from"./shared-0e055562.js";import"./foxy-nucleon-element.js";import"./shared-37efab30.js";import{_ as e}from"./shared-0f6e4584.js";import{R as o,a as n}from"./shared-fb34e84c.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import{a as i}from"./shared-522a172d.js";import"./shared-9b2d6d62.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-b08ca8d0.js";import"./shared-90a47948.js";import"./shared-029d623b.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-61ade33e.js";import"./shared-ac0368ec.js";import"./shared-16c17e32.js";import"./shared-0a6a28ce.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./shared-19884cf4.js";import"./shared-651c44fa.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./shared-2a5c89a4.js";import"./shared-6e859df6.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./foxy-copy-to-clipboard.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,l,u,c,m,f,_,p,y,d,h,g=t=>t;const x=o(n(t,"store-form"));class b extends x{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.__currencyStyleOptions=[{rawLabel:"12.34",value:"101"},{rawLabel:"USD 12.34",value:"001"},{rawLabel:"$12.34",value:"000"},{rawLabel:"12",value:"111"},{rawLabel:"USD 12",value:"011"},{rawLabel:"$12",value:"010"}],this.__currencyStyleGetValue=()=>({101:"101",100:"101","001":"001","000":"000",111:"111",110:"111","011":"011","010":"010"}[[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((t=>Number(Boolean(t)))).join("")]),this.__currencyStyleSetValue=t=>{this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})},this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var t;return(null!==(t=this.form.store_email)&&void 0!==t?t:"").split(",").map((t=>({value:t.trim()}))).filter((({value:t})=>t.length>0))},this.__setStoreEmailValue=t=>{this.edit({store_email:t.map((t=>t.value)).join(",")})},this.__getUseSmtpConfigValue=()=>!!this.form.smtp_config,this.__setUseSmtpConfigValue=t=>{t?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getAppSessionTimeValue=()=>{const t=this.form.app_session_time||43200;return t%86400==0?t/86400+"d":t%3600==0?t/3600+"h":t%60==0?t/60+"m":`${t}s`},this.__setAppSessionTimeValue=t=>{const e=t[t.length-1],o=parseInt(t.substring(0,t.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[e]*o})},this.__setStoreDomainValue=t=>{if(t.endsWith(".foxycart.com")){const e=t.substring(0,t.length-13);this.edit({store_domain:e,use_remote_domain:e.includes(".")})}else this.edit({store_domain:t,use_remote_domain:t.includes(".")})},this.__smtpConfigHostGetValue=()=>this.__getSmtpConfig().host,this.__smtpConfigHostSetValue=t=>{this.__setSmtpConfig("host",t)},this.__smtpConfigPortGetValue=()=>{const t=parseInt(this.__getSmtpConfig().port);return isNaN(t)?void 0:t},this.__smtpConfigPortSetValue=t=>{this.__setSmtpConfig("port",String(t))},this.__smtpConfigUsernameGetValue=()=>this.__getSmtpConfig().username,this.__smtpConfigUsernameSetValue=t=>{this.__setSmtpConfig("username",t)},this.__smtpConfigPasswordGetValue=()=>this.__getSmtpConfig().password,this.__smtpConfigPasswordSetValue=t=>{this.__setSmtpConfig("password",t)},this.__smtpConfigSecurityGetValue=()=>this.__getSmtpConfig().security,this.__smtpConfigSecuritySetValue=t=>{this.__setSmtpConfig("security",t)},this.__smtpConfigSecurityOptions=[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}],this.__webhookKeyGeneratorOptions={length:32,separator:""},this.__webhookKeyApiLegacyGetValue=()=>this.__getWebhookKey().api_legacy,this.__webhookKeyApiLegacySetValue=t=>{this.__setWebhookKey("api_legacy",t)},this.__webhookKeyCartSigningGetValue=()=>this.__getWebhookKey().cart_signing,this.__webhookKeyCartSigningSetValue=t=>{this.__setWebhookKey("cart_signing",t)},this.__webhookKeyXmlDatafeedGetValue=()=>this.__getWebhookKey().xml_datafeed,this.__webhookKeyXmlDatafeedSetValue=t=>{this.__setWebhookKey("xml_datafeed",t)},this.__webhookKeySsoGetValue=()=>this.__getWebhookKey().sso,this.__webhookKeySsoSetValue=t=>{this.__setWebhookKey("sso",t)}}static get properties(){return e(e({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:t})=>!!t||"store-name:v8n_required",({store_name:t})=>t&&t.length<=50||"store-name:v8n_too_long",({store_domain:t})=>!!t||"store-domain:v8n_required",({store_domain:t})=>t&&t.length<=100||"store-domain:v8n_too_long",({store_url:t})=>!!t||"store-url:v8n_required",({store_url:t})=>t&&t.length<=300||"store-url:v8n_too_long",({receipt_continue_url:t})=>!t||t.length<=300||"receipt-continue-url:v8n_too_long",({store_email:t})=>!!t||"store-email:v8n_required",({store_email:t})=>t&&t.length<=300||"store-email:v8n_too_long",({from_email:t})=>!t||t.length<=100||"from-email:v8n_too_long",({smtp_config:t})=>!t||t.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:t})=>!!t||"postal-code:v8n_required",({postal_code:t})=>t&&t.length<=50||"postal-code:v8n_too_long",({region:t})=>!!t||"region:v8n_required",({region:t})=>t&&t.length<=100||"region:v8n_too_long",({country:t})=>!!t||"country:v8n_required",({logo_url:t})=>!t||t.length<=200||"logo-url:v8n_too_long",({webhook_url:t,use_webhook:e})=>!e||!t||t.length<=300||"webhook-url:v8n_too_long",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!!t||"webhook-key:v8n_required",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!t||t.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!!t||"single-sign-on-url:v8n_required",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!t||t.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:t})=>!t||String(t).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:t})=>!t||String(t).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:t})=>!t||String(t).length<=500||"custom-display-id-config-enabled:v8n_too_long"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_active)?"active":"inactive"}}renderBody(){var t,e,o,n,r,i,h,x,b,v,w,$,V,S;const j=this.t(this.form.use_remote_domain&&!(null===(t=this.data)||void 0===t?void 0:t.use_remote_domain)?"essentials.store-domain.custom_domain_note":"essentials.store-domain.helper_text"),C=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",k=this.__renderLoader(1),K=this.__renderLoader(2),q=this.__renderLoader(7),I=this.__renderLoader(8),O=this.__renderLoader(9),G=Object.entries(null!==(o=null===(e=null==K?void 0:K.data)||void 0===e?void 0:e.values)&&void 0!==o?o:{}),T=null!==(r=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.values.timezone)&&void 0!==r?r:[],D=Object.values(null!==(h=null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.values)&&void 0!==h?h:{}),L=Object.values(null!==(b=null===(x=null==O?void 0:O.data)||void 0===x?void 0:x.values)&&void 0!==b?b:{}),E=Object.entries(null!==(w=null===(v=null==k?void 0:k.data)||void 0===v?void 0:v.values)&&void 0!==w?w:{}),J=E.map((t=>({rawLabel:t[1].description,value:t[0]}))),P=G.map((([t,e])=>({rawLabel:e,value:t}))),N=T.map((t=>({rawLabel:t.description,value:t.timezone}))),M=D.map((t=>({rawLabel:t.default,value:t.cc2}))),U=L.map((t=>({rawLabel:t.default,value:t.code})));let W;try{const t=new URL(null!==($=this.regions)&&void 0!==$?$:""),e=this.form.country;e&&t.searchParams.set("country_code",e),W=t.toString()}catch(t){W=void 0}const A=this.__getCustomDisplayIdConfig(),H=A.transaction_journal_entries,z=H.log_detail_request_types,B=this.__displayIdExamples,X=this.__journalIdExamples;return s(a||(a=g` ${0} <foxy-internal-summary-control infer="essentials"> <foxy-internal-text-control layout="summary-item" infer="store-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="logo-url"> </foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" layout="summary-item" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-switch-control infer="is-maintenance-mode"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-editable-list-control layout="summary-item" infer="store-email" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-select-control layout="summary-item" infer="timezone" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="postal-code"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="currency-style" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="legacy-api"> <foxy-internal-password-control layout="summary-item" infer="webhook-key-api-legacy" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-text-control layout="summary-item" infer="from-email" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="use-email-dns" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-smtp-config" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-select-control layout="summary-item" infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="features-multiship" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="require-signed-shipping-rates" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cart"> <foxy-internal-frequency-control layout="summary-item" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-switch-control infer="products-require-expires-property" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-cart-validation" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-cart-signing" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout"> <foxy-internal-select-control layout="summary-item" infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-password-control layout="summary-item" infer="unified-order-entry-password" show-generator> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-switch-control infer="use-single-sign-on"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="receipt"> <foxy-internal-text-control layout="summary-item" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-switch-control infer="bcc-on-receipt-email"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-enabled" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="xml-datafeed"> <foxy-internal-switch-control infer="use-webhook"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),j,C,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,N,M,U.length>0?s(l||(l=g` <foxy-internal-select-control layout="summary-item" infer="region" .options="${0}"> </foxy-internal-select-control> `),U):s(u||(u=g` <foxy-internal-text-control layout="summary-item" infer="region"> </foxy-internal-text-control> `)),this.__currencyStyleOptions,this.__currencyStyleGetValue,this.__currencyStyleSetValue,this.__webhookKeyGeneratorOptions,this.__webhookKeyApiLegacyGetValue,this.__webhookKeyApiLegacySetValue,null!==(S=null===(V=this.__getStoreEmailValue()[0])||void 0===V?void 0:V.value)&&void 0!==S?S:this.t("emails.from-email.placeholder"),this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.form.smtp_config?s(c||(c=g` <foxy-internal-text-control layout="summary-item" infer="smtp-config-host" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="smtp-config-port" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="smtp-config-username" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="smtp-config-password" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-select-control layout="summary-item" infer="smtp-config-security" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> `),this.__smtpConfigHostGetValue,this.__smtpConfigHostSetValue,this.__smtpConfigPortGetValue,this.__smtpConfigPortSetValue,this.__smtpConfigUsernameGetValue,this.__smtpConfigUsernameSetValue,this.__smtpConfigPasswordGetValue,this.__smtpConfigPasswordSetValue,this.__smtpConfigSecurityGetValue,this.__smtpConfigSecuritySetValue,this.__smtpConfigSecurityOptions):"",P,this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__webhookKeyGeneratorOptions,this.__webhookKeyCartSigningGetValue,this.__webhookKeyCartSigningSetValue,J,(t=>{var e;const o=E.find((([e])=>e===t));this.edit({customer_password_hash_type:t,customer_password_hash_config:null!==(e=null==o?void 0:o[1].config)&&void 0!==e?e:""})}),"number"==typeof this.form.customer_password_hash_config?s(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-number-control> `)):s(f||(f=g` <foxy-internal-text-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.form.use_single_sign_on?s(_||(_=g` <foxy-internal-text-control layout="summary-item" infer="single-sign-on-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-sso" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeySsoGetValue,this.__webhookKeySsoSetValue):"",(()=>A.enabled),(t=>{this.__setCustomDisplayIdConfig("enabled",t)}),A.enabled?s(p||(p=g` <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-start" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-length" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="text-right text-secondary"> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-first-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-random-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> </div> `),(()=>parseInt(A.start||"0")),(t=>{this.__setCustomDisplayIdConfig("start",String(t))}),(()=>parseInt(A.length||"0")),(t=>{this.__setCustomDisplayIdConfig("length",String(t))}),(()=>A.prefix),(t=>{this.__setCustomDisplayIdConfig("prefix",t)}),(()=>A.suffix),(t=>{this.__setCustomDisplayIdConfig("suffix",t)}),null==B?void 0:B.first,null==B?void 0:B.random):"",(()=>H.enabled),(t=>{this.__setTransactionJournalEntriesConfig("enabled",t)}),H.enabled?s(y||(y=g` <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="sm-col-span-2 leading-s text-right text-secondary"> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> <span style="font-family:monospace"> ${0} </span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> </div> `),(()=>z.transaction_authcapture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_authcapture",t)}),(()=>z.transaction_capture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_capture",t)}),(()=>z.transaction_void.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_void",t)}),(()=>z.transaction_refund.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_refund",t)}),(()=>H.transaction_separator),(t=>{this.__setTransactionJournalEntriesConfig("transaction_separator",t)}),null==X?void 0:X.authcapture,null==X?void 0:X.capture,null==X?void 0:X.void,null==X?void 0:X.refund):"",this.form.use_webhook?s(d||(d=g` <foxy-internal-text-control layout="summary-item" infer="webhook-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-xml-datafeed" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeyXmlDatafeedGetValue,this.__webhookKeyXmlDatafeedSetValue):"",super.renderBody(),k.render(this.customerPasswordHashTypes),K.render(this.shippingAddressTypes),q.render(this.timezones),I.render(this.countries),O.render(W))}get __displayIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=parseInt(t.start||"0"),o=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,n=Math.min(e+Math.floor(Math.random()*Math.pow(10,o)),Math.pow(10,o)-1);if(t.start&&t.length&&e/10<=o)return{first:`${t.prefix}${e.toString().padStart(o,"0")}${t.suffix}`,random:`${t.prefix}${n.toString().padStart(o,"0")}${t.suffix}`}}get __journalIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=t.transaction_journal_entries,o=parseInt(t.start||"0"),n=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,r=Math.min(o+Math.floor(Math.random()*Math.pow(10,n)),Math.pow(10,n)-1),s=`${t.prefix}${r.toString().padStart(n,"0")}${t.suffix}`,i=Math.floor(1e3*Math.random()),a=String(i).padStart(3,"0");if(t.start&&t.length&&o/10<=n)return{authcapture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_authcapture.prefix}${a}`,capture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_capture.prefix}${a}`,refund:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_refund.prefix}${a}`,void:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_void.prefix}${a}`}}__getWebhookKey(){var t,e;let o;try{o=JSON.parse(null!==(t=this.form.webhook_key)&&void 0!==t?t:"")}catch(t){const n=null!==(e=this.form.webhook_key)&&void 0!==e?e:"";o={cart_signing:n,xml_datafeed:n,api_legacy:n,sso:n}}return o}__setWebhookKey(t,e){const o=this.__getWebhookKey();o[t]=e,this.edit({webhook_key:JSON.stringify(o)})}__getCustomDisplayIdConfig(){var t;const e={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(t=this.form.custom_display_id_config)&&void 0!==t?t:"")}catch(t){o=i(e)}return o}__setCustomDisplayIdConfig(t,e){const o=this.__getCustomDisplayIdConfig();o[t]=e,this.edit({custom_display_id_config:JSON.stringify(o)})}__getTransactionJournalEntriesConfig(){return this.__getCustomDisplayIdConfig().transaction_journal_entries}__setTransactionJournalEntriesConfig(t,e){const o=this.__getCustomDisplayIdConfig().transaction_journal_entries;o[t]=e,this.__setCustomDisplayIdConfig("transaction_journal_entries",o)}__setTransactionJournalEntriesPrefix(t,e){const o=this.__getTransactionJournalEntriesConfig();o.log_detail_request_types[t].prefix=e,this.__setTransactionJournalEntriesConfig("log_detail_request_types",o.log_detail_request_types)}__getSmtpConfig(){var t;let e;try{e=JSON.parse(null!==(t=this.form.smtp_config)&&void 0!==t?t:"")}catch(t){e={username:"",password:"",security:"",host:"",port:""}}return e}__setSmtpConfig(t,e){const o=this.__getSmtpConfig();o[t]=e,this.edit({smtp_config:JSON.stringify(o)})}__renderLoader(t){var e;const o=`loader-${t}`;return{data:null===(e=this.renderRoot.querySelector(`#${o}`))||void 0===e?void 0:e.data,render:t=>s(h||(h=g` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=t?t:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",b);export{b as StoreForm};
|
|
1
|
+
import"./shared-28f74114.js";import"./shared-5a2f398c.js";import"./shared-7c411b0a.js";import"./shared-8cd578ee.js";import"./shared-937b497c.js";import"./shared-c388e926.js";import"./shared-ef78d7d9.js";import"./shared-08e0a194.js";import{I as t}from"./shared-0e055562.js";import"./foxy-nucleon-element.js";import"./shared-37efab30.js";import{_ as e}from"./shared-0f6e4584.js";import{R as o,a as n}from"./shared-fb34e84c.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import{a as i}from"./shared-522a172d.js";import"./shared-9b2d6d62.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-b08ca8d0.js";import"./shared-90a47948.js";import"./shared-029d623b.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-f7a1193f.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-d132bd37.js";import"./shared-4b346553.js";import"./shared-8f3398dc.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-61ade33e.js";import"./shared-ac0368ec.js";import"./shared-16c17e32.js";import"./shared-0a6a28ce.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./shared-19884cf4.js";import"./shared-651c44fa.js";import"./shared-f2968508.js";import"./shared-d8c3067b.js";import"./shared-2a5c89a4.js";import"./shared-6e859df6.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./foxy-copy-to-clipboard.js";import"./shared-56bf05ef.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,l,u,c,m,f,_,p,y,d,h,g=t=>t;const x=o(n(t,"store-form"));class b extends x{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.__currencyStyleOptions=[{rawLabel:"12.34",value:"101"},{rawLabel:"USD 12.34",value:"001"},{rawLabel:"$12.34",value:"000"},{rawLabel:"12",value:"111"},{rawLabel:"USD 12",value:"011"},{rawLabel:"$12",value:"010"}],this.__currencyStyleGetValue=()=>({101:"101",100:"101","001":"001","000":"000",111:"111",110:"111","011":"011","010":"010"}[[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((t=>Number(Boolean(t)))).join("")]),this.__currencyStyleSetValue=t=>{this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})},this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var t;return(null!==(t=this.form.store_email)&&void 0!==t?t:"").split(",").map((t=>({value:t.trim()}))).filter((({value:t})=>t.length>0))},this.__setStoreEmailValue=t=>{this.edit({store_email:t.map((t=>t.value)).join(",")})},this.__getUseSmtpConfigValue=()=>!!this.form.smtp_config,this.__setUseSmtpConfigValue=t=>{t?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getAppSessionTimeValue=()=>{const t=this.form.app_session_time||43200;return t%86400==0?t/86400+"d":t%3600==0?t/3600+"h":t%60==0?t/60+"m":`${t}s`},this.__setAppSessionTimeValue=t=>{const e=t[t.length-1],o=parseInt(t.substring(0,t.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[e]*o})},this.__setStoreDomainValue=t=>{if(t.endsWith(".foxycart.com")){const e=t.substring(0,t.length-13);this.edit({store_domain:e,use_remote_domain:e.includes(".")})}else this.edit({store_domain:t,use_remote_domain:t.includes(".")})},this.__smtpConfigHostGetValue=()=>this.__getSmtpConfig().host,this.__smtpConfigHostSetValue=t=>{this.__setSmtpConfig("host",t)},this.__smtpConfigPortGetValue=()=>{const t=parseInt(this.__getSmtpConfig().port);return isNaN(t)?void 0:t},this.__smtpConfigPortSetValue=t=>{this.__setSmtpConfig("port",String(t))},this.__smtpConfigUsernameGetValue=()=>this.__getSmtpConfig().username,this.__smtpConfigUsernameSetValue=t=>{this.__setSmtpConfig("username",t)},this.__smtpConfigPasswordGetValue=()=>this.__getSmtpConfig().password,this.__smtpConfigPasswordSetValue=t=>{this.__setSmtpConfig("password",t)},this.__smtpConfigSecurityGetValue=()=>this.__getSmtpConfig().security,this.__smtpConfigSecuritySetValue=t=>{this.__setSmtpConfig("security",t)},this.__smtpConfigSecurityOptions=[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}],this.__webhookKeyGeneratorOptions={length:32,separator:""},this.__webhookKeyApiLegacyGetValue=()=>this.__getWebhookKey().api_legacy,this.__webhookKeyApiLegacySetValue=t=>{this.__setWebhookKey("api_legacy",t)},this.__webhookKeyCartSigningGetValue=()=>this.__getWebhookKey().cart_signing,this.__webhookKeyCartSigningSetValue=t=>{this.__setWebhookKey("cart_signing",t)},this.__webhookKeyXmlDatafeedGetValue=()=>this.__getWebhookKey().xml_datafeed,this.__webhookKeyXmlDatafeedSetValue=t=>{this.__setWebhookKey("xml_datafeed",t)},this.__webhookKeySsoGetValue=()=>this.__getWebhookKey().sso,this.__webhookKeySsoSetValue=t=>{this.__setWebhookKey("sso",t)}}static get properties(){return e(e({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:t})=>!!t||"store-name:v8n_required",({store_name:t})=>t&&t.length<=50||"store-name:v8n_too_long",({store_domain:t})=>!!t||"store-domain:v8n_required",({store_domain:t})=>t&&t.length<=100||"store-domain:v8n_too_long",({store_url:t})=>!!t||"store-url:v8n_required",({store_url:t})=>t&&t.length<=300||"store-url:v8n_too_long",({receipt_continue_url:t})=>!t||t.length<=300||"receipt-continue-url:v8n_too_long",({store_email:t})=>!!t||"store-email:v8n_required",({store_email:t})=>t&&t.length<=300||"store-email:v8n_too_long",({from_email:t})=>!t||t.length<=100||"from-email:v8n_too_long",({smtp_config:t})=>!t||t.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:t})=>!!t||"postal-code:v8n_required",({postal_code:t})=>t&&t.length<=50||"postal-code:v8n_too_long",({region:t})=>!!t||"region:v8n_required",({region:t})=>t&&t.length<=100||"region:v8n_too_long",({country:t})=>!!t||"country:v8n_required",({logo_url:t})=>!t||t.length<=200||"logo-url:v8n_too_long",({webhook_url:t,use_webhook:e})=>!e||!t||t.length<=300||"webhook-url:v8n_too_long",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!!t||"webhook-key:v8n_required",({webhook_key:t,use_webhook:e,use_cart_validation:o})=>!e&&!o||!t||t.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!!t||"single-sign-on-url:v8n_required",({single_sign_on_url:t,use_single_sign_on:e})=>!e||!t||t.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:t})=>!t||String(t).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:t})=>!t||String(t).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:t})=>!t||String(t).length<=500||"custom-display-id-config-enabled:v8n_too_long"]}get headerSubtitleOptions(){var t;return{context:(null===(t=this.data)||void 0===t?void 0:t.is_active)?"active":"inactive"}}renderBody(){var t,e,o,n,r,i,h,x,b,v,w,$,V,S;const j=this.t(this.form.use_remote_domain&&!(null===(t=this.data)||void 0===t?void 0:t.use_remote_domain)?"essentials.store-domain.custom_domain_note":"essentials.store-domain.helper_text"),C=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",k=this.__renderLoader(1),K=this.__renderLoader(2),q=this.__renderLoader(7),I=this.__renderLoader(8),O=this.__renderLoader(9),G=Object.entries(null!==(o=null===(e=null==K?void 0:K.data)||void 0===e?void 0:e.values)&&void 0!==o?o:{}),T=null!==(r=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.values.timezone)&&void 0!==r?r:[],D=Object.values(null!==(h=null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.values)&&void 0!==h?h:{}),L=Object.values(null!==(b=null===(x=null==O?void 0:O.data)||void 0===x?void 0:x.values)&&void 0!==b?b:{}),E=Object.entries(null!==(w=null===(v=null==k?void 0:k.data)||void 0===v?void 0:v.values)&&void 0!==w?w:{}),J=E.map((t=>({rawLabel:t[1].description,value:t[0]}))),P=G.map((([t,e])=>({rawLabel:e,value:t}))),N=T.map((t=>({rawLabel:t.description,value:t.timezone}))),M=D.map((t=>({rawLabel:t.default,value:t.cc2}))),U=L.map((t=>({rawLabel:t.default,value:t.code})));let W;try{const t=new URL(null!==($=this.regions)&&void 0!==$?$:""),e=this.form.country;e&&t.searchParams.set("country_code",e),W=t.toString()}catch(t){W=void 0}const A=this.__getCustomDisplayIdConfig(),H=A.transaction_journal_entries,z=H.log_detail_request_types,B=this.__displayIdExamples,X=this.__journalIdExamples;return s(a||(a=g` ${0} <foxy-internal-summary-control infer="essentials"> <foxy-internal-text-control layout="summary-item" infer="store-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="logo-url"> </foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" layout="summary-item" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-switch-control infer="is-maintenance-mode"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-editable-list-control layout="summary-item" infer="store-email" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="essentials" label="" helper-text=""> <foxy-internal-select-control layout="summary-item" infer="timezone" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control layout="summary-item" infer="country" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-text-control layout="summary-item" infer="postal-code"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="currency-style" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="legacy-api"> <foxy-internal-password-control layout="summary-item" infer="webhook-key-api-legacy" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails"> <foxy-internal-text-control layout="summary-item" infer="from-email" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="use-email-dns" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-smtp-config" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="shipping"> <foxy-internal-select-control layout="summary-item" infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="features-multiship" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="require-signed-shipping-rates" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cart"> <foxy-internal-frequency-control layout="summary-item" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-switch-control infer="products-require-expires-property" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="use-cart-validation" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-cart-signing" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout"> <foxy-internal-select-control layout="summary-item" infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-password-control layout="summary-item" infer="unified-order-entry-password" show-generator> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="checkout" label="" helper-text=""> <foxy-internal-switch-control infer="use-single-sign-on"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="receipt"> <foxy-internal-text-control layout="summary-item" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-switch-control infer="bcc-on-receipt-email"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-enabled" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control helper-text="" label="" infer="custom-display-id-config"> <foxy-internal-switch-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="xml-datafeed"> <foxy-internal-switch-control infer="use-webhook"></foxy-internal-switch-control> ${0} </foxy-internal-summary-control> ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),j,C,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,N,M,U.length>0?s(l||(l=g` <foxy-internal-select-control layout="summary-item" infer="region" .options="${0}"> </foxy-internal-select-control> `),U):s(u||(u=g` <foxy-internal-text-control layout="summary-item" infer="region"> </foxy-internal-text-control> `)),this.__currencyStyleOptions,this.__currencyStyleGetValue,this.__currencyStyleSetValue,this.__webhookKeyGeneratorOptions,this.__webhookKeyApiLegacyGetValue,this.__webhookKeyApiLegacySetValue,null!==(S=null===(V=this.__getStoreEmailValue()[0])||void 0===V?void 0:V.value)&&void 0!==S?S:this.t("emails.from-email.placeholder"),this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.form.smtp_config?s(c||(c=g` <foxy-internal-text-control layout="summary-item" infer="smtp-config-host" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="smtp-config-port" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="smtp-config-username" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="smtp-config-password" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-select-control layout="summary-item" infer="smtp-config-security" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> `),this.__smtpConfigHostGetValue,this.__smtpConfigHostSetValue,this.__smtpConfigPortGetValue,this.__smtpConfigPortSetValue,this.__smtpConfigUsernameGetValue,this.__smtpConfigUsernameSetValue,this.__smtpConfigPasswordGetValue,this.__smtpConfigPasswordSetValue,this.__smtpConfigSecurityGetValue,this.__smtpConfigSecuritySetValue,this.__smtpConfigSecurityOptions):"",P,this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__webhookKeyGeneratorOptions,this.__webhookKeyCartSigningGetValue,this.__webhookKeyCartSigningSetValue,J,(t=>{var e;const o=E.find((([e])=>e===t));this.edit({customer_password_hash_type:t,customer_password_hash_config:null!==(e=null==o?void 0:o[1].config)&&void 0!==e?e:""})}),"number"==typeof this.form.customer_password_hash_config?s(m||(m=g` <foxy-internal-number-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-number-control> `)):s(f||(f=g` <foxy-internal-text-control layout="summary-item" infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.form.use_single_sign_on?s(_||(_=g` <foxy-internal-text-control layout="summary-item" infer="single-sign-on-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-sso" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeySsoGetValue,this.__webhookKeySsoSetValue):"",(()=>A.enabled),(t=>{this.__setCustomDisplayIdConfig("enabled",t)}),A.enabled?s(p||(p=g` <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-start" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" infer="custom-display-id-config-length" step="1" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="text-right text-secondary"> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-first-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> <p class="flex justify-end"> <foxy-i18n infer="" key="custom-display-id-config-random-example"></foxy-i18n> <span style="font-family:monospace"> ${0}</span> </p> </div> `),(()=>parseInt(A.start||"0")),(t=>{this.__setCustomDisplayIdConfig("start",String(t))}),(()=>parseInt(A.length||"0")),(t=>{this.__setCustomDisplayIdConfig("length",String(t))}),(()=>A.prefix),(t=>{this.__setCustomDisplayIdConfig("prefix",t)}),(()=>A.suffix),(t=>{this.__setCustomDisplayIdConfig("suffix",t)}),null==B?void 0:B.first,null==B?void 0:B.random):"",(()=>H.enabled),(t=>{this.__setTransactionJournalEntriesConfig("enabled",t)}),H.enabled?s(y||(y=g` <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <div class="sm-col-span-2 leading-s text-right text-secondary"> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> <span style="font-family:monospace"> ${0} </span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> <p> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> <span style="font-family:monospace">${0}</span> </p> </div> `),(()=>z.transaction_authcapture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_authcapture",t)}),(()=>z.transaction_capture.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_capture",t)}),(()=>z.transaction_void.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_void",t)}),(()=>z.transaction_refund.prefix),(t=>{this.__setTransactionJournalEntriesPrefix("transaction_refund",t)}),(()=>H.transaction_separator),(t=>{this.__setTransactionJournalEntriesConfig("transaction_separator",t)}),null==X?void 0:X.authcapture,null==X?void 0:X.capture,null==X?void 0:X.void,null==X?void 0:X.refund):"",this.form.use_webhook?s(d||(d=g` <foxy-internal-text-control layout="summary-item" infer="webhook-url"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="webhook-key-xml-datafeed" show-generator .generatorOptions="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),this.__webhookKeyGeneratorOptions,this.__webhookKeyXmlDatafeedGetValue,this.__webhookKeyXmlDatafeedSetValue):"",super.renderBody(),k.render(this.customerPasswordHashTypes),K.render(this.shippingAddressTypes),q.render(this.timezones),I.render(this.countries),O.render(W))}get __displayIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=parseInt(t.start||"0"),o=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,n=Math.min(e+Math.floor(Math.random()*Math.pow(10,o)),Math.pow(10,o)-1);if(t.start&&t.length&&e/10<=o)return{first:`${t.prefix}${e.toString().padStart(o,"0")}${t.suffix}`,random:`${t.prefix}${n.toString().padStart(o,"0")}${t.suffix}`}}get __journalIdExamples(){const t=this.__getCustomDisplayIdConfig(),e=t.transaction_journal_entries,o=parseInt(t.start||"0"),n=parseInt(t.length||"0")-t.prefix.length-t.suffix.length,r=Math.min(o+Math.floor(Math.random()*Math.pow(10,n)),Math.pow(10,n)-1),s=`${t.prefix}${r.toString().padStart(n,"0")}${t.suffix}`,i=Math.floor(1e3*Math.random()),a=String(i).padStart(3,"0");if(t.start&&t.length&&o/10<=n)return{authcapture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_authcapture.prefix}${a}`,capture:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_capture.prefix}${a}`,refund:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_refund.prefix}${a}`,void:`${s}${e.transaction_separator}${e.log_detail_request_types.transaction_void.prefix}${a}`}}__getWebhookKey(){var t,e;let o;try{o=JSON.parse(null!==(t=this.form.webhook_key)&&void 0!==t?t:"")}catch(t){const n=null!==(e=this.form.webhook_key)&&void 0!==e?e:"";o={cart_signing:n,xml_datafeed:n,api_legacy:n,sso:n}}return o}__setWebhookKey(t,e){const o=this.__getWebhookKey();o[t]=e,this.edit({webhook_key:JSON.stringify(o)})}__getCustomDisplayIdConfig(){var t;const e={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(t=this.form.custom_display_id_config)&&void 0!==t?t:"")}catch(t){o=i(e)}return o}__setCustomDisplayIdConfig(t,e){const o=this.__getCustomDisplayIdConfig();o[t]=e,this.edit({custom_display_id_config:JSON.stringify(o)})}__getTransactionJournalEntriesConfig(){return this.__getCustomDisplayIdConfig().transaction_journal_entries}__setTransactionJournalEntriesConfig(t,e){const o=this.__getCustomDisplayIdConfig().transaction_journal_entries;o[t]=e,this.__setCustomDisplayIdConfig("transaction_journal_entries",o)}__setTransactionJournalEntriesPrefix(t,e){const o=this.__getTransactionJournalEntriesConfig();o.log_detail_request_types[t].prefix=e,this.__setTransactionJournalEntriesConfig("log_detail_request_types",o.log_detail_request_types)}__getSmtpConfig(){var t;let e;try{e=JSON.parse(null!==(t=this.form.smtp_config)&&void 0!==t?t:"")}catch(t){e={username:"",password:"",security:"",host:"",port:""}}return e}__setSmtpConfig(t,e){const o=this.__getSmtpConfig();o[t]=e,this.edit({smtp_config:JSON.stringify(o)})}__renderLoader(t){var e;const o=`loader-${t}`;return{data:null===(e=this.renderRoot.querySelector(`#${o}`))||void 0===e?void 0:e.data,render:t=>s(h||(h=g` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=t?t:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",b);export{b as StoreForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-3c3497d6.js";import"./shared-e778071b.js";import"./shared-
|
|
1
|
+
import"./shared-3c3497d6.js";import"./shared-e778071b.js";import"./shared-7c411b0a.js";import"./shared-8cd578ee.js";import"./shared-21bc5d5e.js";import"./shared-937b497c.js";import"./shared-08e0a194.js";import{I as e}from"./shared-0e055562.js";import"./foxy-shipping-container-card.js";import"./foxy-shipping-drop-type-card.js";import"./foxy-shipping-service-card.js";import"./foxy-shipping-method-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-0f6e4584.js";import{a as o}from"./shared-fb34e84c.js";import{i}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-61b6ef6e.js";import"./shared-b08ca8d0.js";import"./shared-44ce656d.js";import"./shared-09b4185a.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-90a47948.js";import"./shared-56bf05ef.js";import"./shared-37efab30.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.js";import"./shared-0b01f721.js";import"./shared-24d71d01.js";import"./shared-c286c5ad.js";import"./shared-cd96ff03.js";import"./shared-522a172d.js";import"./shared-12a7a15d.js";import"./shared-6474675f.js";import"./shared-ee36b83f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-6e859df6.js";import"./shared-4e709717.js";import"./shared-7d38cb8a.js";import"./shared-51c4a6dd.js";import"./shared-388e9240.js";import"./shared-280f868d.js";import"./shared-c2776a33.js";import"./shared-e24da82e.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-6918312e.js";import"./shared-fc1dfa64.js";import"./shared-2a5c89a4.js";import"./shared-4b346553.js";import"./shared-b8198665.js";import"./shared-a207423c.js";import"./shared-8f3398dc.js";import"./shared-9b2d6d62.js";import"./shared-029d623b.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-3ee151ce.js";import"./shared-f3773d62.js";import"./shared-fb0ca5e2.js";let n,a=e=>e;const d=o(e,"store-shipping-method-form");class p extends d{constructor(){super(...arguments),this.shippingMethods=null,this.__shippingMethodLoaderId="shippingMethodLoader",this.__shippingMethodUriSetValue=e=>{this.undo(),this.edit({shipping_method_uri:e})},this.__useCustomAccount=!1,this.__useCustomAccountGetValue=()=>Boolean(this.__useCustomAccount||this.form.authentication_key||this.form.meter_number||this.form.accountid||this.form.password),this.__useCustomAccountSetValue=e=>{e||this.edit({authentication_key:"",meter_number:"",accountid:"",password:""}),this.__useCustomAccount=e}}static get properties(){return t(t({},super.properties),{},{shippingMethods:{attribute:"shipping-methods"},__useCustomAccount:{attribute:!1}})}static get v8n(){return[({shipping_method_uri:e})=>e&&(e=>{try{return new URL(e),!0}catch(e){return!1}})(e)||"shipping-method-uri:v8n_required",({accountid:e})=>!e||e.length<=50||"accountid:v8n_too_long",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({meter_number:e})=>!e||e.length<=50||"meter-number:v8n_too_long",({authentication_key:e})=>!e||e.length<=50||"authentication-key:v8n_too_long",({custom_code:e})=>!e||new Blob([e]).size/1024<=64||"custom-code:v8n_too_long"]}get hiddenSelector(){var e;const t=!!this.data,o=null===(e=this.__shippingMethod)||void 0===e?void 0:e.code;let i="general:shipping-container-uri general:shipping-drop-type-uri destinations account endpoint custom-code";if(o){const e={"CUSTOM-ENDPOINT-POST":"general destinations account custom-code","CUSTOM-CODE":"general destinations account endpoint",CUSTOM:"general account endpoint custom-code",FedEx:"endpoint custom-code",USPS:"account endpoint custom-code",UPS:"endpoint custom-code"};e[o]&&(i=e[o])}return t&&!(null==o?void 0:o.startsWith("CUSTOM-"))||(i+=" services"),t&&(i=`general:shipping-method-uri ${i}`),this.__useCustomAccountGetValue()||(i+=" account:accountid account:password account:authentication-key account:meter-number"),new r(`${i} ${super.hiddenSelector}`.trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}get headerTitleOptions(){var e;return t(t({},super.headerTitleOptions),{},{provider:null===(e=this.__shippingMethod)||void 0===e?void 0:e.name})}renderBody(){var e,t,r,o;const d=this.__shippingMethod;return s(n||(n=a` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-method-uri" first="${0}" item="foxy-shipping-method-card" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-container-uri" first="${0}" item="foxy-shipping-container-card"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control layout="summary-item" infer="shipping-drop-type-uri" first="${0}" item="foxy-shipping-drop-type-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="destinations"> <foxy-internal-switch-control infer="use-for-domestic"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-for-international"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="account"> <foxy-internal-switch-control infer="use-custom-account" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="authentication-key"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="meter-number"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="accountid"> </foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="password"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-text-control infer="endpoint" property="accountid"> </foxy-internal-text-control> <foxy-internal-source-control infer="custom-code"></foxy-internal-source-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="shipping_service_uri" foreign-key-for-id="shipping_service_id" own-key-for-uri="shipping_method_uri" own-uri="${0}" embed-key="fx:store_shipping_services" options-href="${0}" links-href="${0}" infer="services" limit="200" item="foxy-shipping-service-card"> </foxy-internal-async-resource-link-list-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> ${0} `),this.renderHeader(),i(null!==(e=this.shippingMethods)&&void 0!==e?e:null===(t=this.form._links)||void 0===t?void 0:t["fx:shipping_methods"].href),this.__shippingMethodUriSetValue,i(null==d?void 0:d._links["fx:shipping_containers"].href),i(null==d?void 0:d._links["fx:shipping_drop_types"].href),this.__useCustomAccountGetValue,this.__useCustomAccountSetValue,i(null===(r=this.data)||void 0===r?void 0:r._links.self.href),i(null==d?void 0:d._links["fx:shipping_services"].href),i(null===(o=this.data)||void 0===o?void 0:o._links["fx:store_shipping_services"].href),i(this.form.shipping_method_uri||void 0),this.__shippingMethodLoaderId,(()=>this.requestUpdate()),super.renderBody())}updated(e){super.updated(e),e.has("href")&&(this.__useCustomAccount=!1)}async _fetch(...e){try{return await super._fetch(...e)}catch(e){const t=[];try{for(const r of(await e.json())._embedded["fx:errors"])r.message.startsWith("shipping_container_id must be")?t.push("shipping-container-uri:v8n_required"):r.message.startsWith("shipping_drop_type_id must be")&&t.push("shipping-drop-type-uri:v8n_required")}catch(e){}throw t.length>0?t:e}}get __shippingMethodLoader(){return this.renderRoot.querySelector(`#${this.__shippingMethodLoaderId}`)}get __shippingMethod(){var e;return null===(e=this.__shippingMethodLoader)||void 0===e?void 0:e.data}}customElements.define("foxy-store-shipping-method-form",p);export{p as StoreShippingMethodForm};
|