@foxy.io/elements 1.30.0 → 1.31.0-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-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.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-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-store-card.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-settings-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-1d4fdfa8.js +1 -0
- package/dist/cdn/shared-cc8b47c6.js +1 -0
- package/dist/cdn/shared-fcbf196e.js +1 -0
- package/dist/cdn/translations/store-card/en.json +3 -1
- package/dist/cdn/translations/store-shipping-method-form/en.json +157 -127
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.d.ts +2 -0
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js +56 -35
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js.map +1 -1
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/types.d.ts +18 -0
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/types.js +2 -0
- package/dist/elements/internal/InternalAsyncResourceLinkListControl/types.js.map +1 -0
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.d.ts +1 -0
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js +4 -0
- package/dist/elements/internal/InternalPasswordControl/InternalPasswordControl.js.map +1 -1
- package/dist/elements/internal/InternalPasswordControl/index.d.ts +1 -0
- package/dist/elements/internal/InternalPasswordControl/index.js +1 -0
- package/dist/elements/internal/InternalPasswordControl/index.js.map +1 -1
- package/dist/elements/internal/InternalPasswordControl/vaadinStyles.d.ts +1 -0
- package/dist/elements/internal/InternalPasswordControl/vaadinStyles.js +73 -0
- package/dist/elements/internal/InternalPasswordControl/vaadinStyles.js.map +1 -0
- package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +7 -5
- package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
- package/dist/elements/public/StoreCard/StoreCard.js +13 -1
- package/dist/elements/public/StoreCard/StoreCard.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +4 -3
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +79 -63
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/index.d.ts +2 -1
- package/dist/elements/public/StoreShippingMethodForm/index.js +2 -1
- package/dist/elements/public/StoreShippingMethodForm/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-40c6b1f6.js +0 -1
- package/dist/cdn/shared-96a392d9.js +0 -1
- package/dist/cdn/shared-b980ba1d.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-9637a2de.js";import"./shared-ea5ff8bc.js";import"./shared-41e7554e.js";import"./shared-fae08dfb.js";import"./shared-471e77dd.js";import"./shared-73045804.js";import"./shared-96a392d9.js";import"./shared-3b975a29.js";import"./shared-e7bff5de.js";import"./shared-e5098b19.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.js";import"./foxy-nucleon-element.js";import"./shared-49ecea83.js";import{_ as t}from"./shared-0f6e4584.js";import{R as o,a as r}from"./shared-25502f01.js";import{i}from"./shared-9803aa7c.js";import{c as s}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import{a}from"./shared-522a172d.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-3cf043a7.js";import"./shared-77e15843.js";import"./shared-887e1795.js";import"./shared-226dd830.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-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-2c1dff50.js";import"./shared-ff7b2af6.js";import"./shared-651c44fa.js";import"./shared-0f00d4d8.js";import"./shared-19f46691.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-ad76e640.js";import"./shared-6f4fa343.js";import"./shared-e47bd38e.js";import"./shared-4a652d60.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let l,c,d,u,_,p,h,m,f,g,y,x,b,v,$,V,j,k,S,w,q=e=>e;const O=o(r(e,"store-form"));class C extends O{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.__singleCheckboxGroupOptions=[{label:"option_checked",value:"checked"}],this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var e;return(null!==(e=this.form.store_email)&&void 0!==e?e:"").split(",").map((e=>({value:e.trim()}))).filter((({value:e})=>e.length>0))},this.__setStoreEmailValue=e=>{this.edit({store_email:e.map((e=>e.value)).join(",")})},this.__getBccOnReceiptEmailValue=()=>this.form.bcc_on_receipt_email?["checked"]:[],this.__setBccOnReceiptEmailValue=e=>{this.edit({bcc_on_receipt_email:e.includes("checked")})},this.__getUseEmailDnsValue=()=>this.form.use_email_dns?["checked"]:[],this.__setUseEmailDnsValue=e=>{this.edit({use_email_dns:e.includes("checked")})},this.__getUseSmtpConfigValue=()=>this.form.smtp_config?["checked"]:[],this.__setUseSmtpConfigValue=e=>{e.includes("checked")?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getFeaturesMultishipValue=()=>this.form.features_multiship?["checked"]:[],this.__setFeaturesMultishipValue=e=>{this.edit({features_multiship:e.includes("checked")})},this.__getRequireSignedShippingRatesValue=()=>this.form.require_signed_shipping_rates?["checked"]:[],this.__setRequireSignedShippingRatesValue=e=>{this.edit({require_signed_shipping_rates:e.includes("checked")})},this.__getAppSessionTimeValue=()=>{const e=this.form.app_session_time||43200;return e%86400==0?e/86400+"d":e%3600==0?e/3600+"h":e%60==0?e/60+"m":`${e}s`},this.__setAppSessionTimeValue=e=>{const t=e[e.length-1],o=parseInt(e.substring(0,e.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[t]*o})},this.__getProductsRequireExpiresPropertyValue=()=>this.form.products_require_expires_property?["checked"]:[],this.__setProductsRequireExpiresPropertyValue=e=>{this.edit({products_require_expires_property:e.includes("checked")})},this.__getUseCartValidationValue=()=>this.form.use_cart_validation?["checked"]:[],this.__setUseCartValidationValue=e=>{this.edit({use_cart_validation:e.includes("checked")})},this.__getSingleSignOnUrlValue=()=>{var e;return this.form.use_single_sign_on&&null!==(e=this.form.single_sign_on_url)&&void 0!==e?e:""},this.__setSingleSignOnUrlValue=e=>{this.edit({use_single_sign_on:!!e,single_sign_on_url:e})},this.__getWebhookUrlValue=()=>{var e;return this.form.use_webhook&&null!==(e=this.form.webhook_url)&&void 0!==e?e:""},this.__setWebhookUrlValue=e=>{this.edit({use_webhook:!!e,webhook_url:e})},this.__setStoreDomainValue=e=>{if(e.endsWith(".foxycart.com")){const t=e.substring(0,e.length-13);this.edit({store_domain:t,use_remote_domain:t.includes(".")})}else this.edit({store_domain:e,use_remote_domain:e.includes(".")})}}static get properties(){return t(t({},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:e})=>!!e||"store-name:v8n_required",({store_name:e})=>e&&e.length<=50||"store-name:v8n_too_long",({store_domain:e})=>!!e||"store-domain:v8n_required",({store_domain:e})=>e&&e.length<=100||"store-domain:v8n_too_long",({store_url:e})=>!!e||"store-url:v8n_required",({store_url:e})=>e&&e.length<=300||"store-url:v8n_too_long",({receipt_continue_url:e})=>!e||e.length<=300||"receipt-continue-url:v8n_too_long",({store_email:e})=>!!e||"store-email:v8n_required",({store_email:e})=>e&&e.length<=300||"store-email:v8n_too_long",({from_email:e})=>!e||e.length<=100||"from-email:v8n_too_long",({smtp_config:e})=>!e||e.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:e})=>!!e||"postal-code:v8n_required",({postal_code:e})=>e&&e.length<=50||"postal-code:v8n_too_long",({region:e})=>!!e||"region:v8n_required",({region:e})=>e&&e.length<=100||"region:v8n_too_long",({country:e})=>!!e||"country:v8n_required",({logo_url:e})=>!e||e.length<=200||"logo-url:v8n_too_long",({webhook_url:e,use_webhook:t})=>!t||!e||e.length<=300||"webhook-url:v8n_too_long",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!!e||"webhook-key:v8n_required",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!e||e.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!!e||"single-sign-on-url:v8n_required",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!e||e.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:e})=>!e||String(e).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:e})=>!e||String(e).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:e})=>!e||String(e).length<=100||"custom-display-id-config-enabled:v8n_too_long"]}renderBody(){var e,t,o,r,s,a,u,_,p,h,m,f,g,y,x,b,v,$,V,j,k,S,w;const O=this.form.use_email_dns&&!(null===(e=this.data)||void 0===e?void 0:e.use_email_dns)&&!this.hiddenSelector.matches("use-email-dns",!0),C=this.form.require_signed_shipping_rates&&!(null===(t=this.data)||void 0===t?void 0:t.require_signed_shipping_rates)&&!this.hiddenSelector.matches("require-signed-shipping-rates",!0),U=this.form.products_require_expires_property&&!(null===(o=this.data)||void 0===o?void 0:o.products_require_expires_property)&&!this.hiddenSelector.matches("products-require-expires-property",!0),N=this.form.use_cart_validation&&!(null===(r=this.data)||void 0===r?void 0:r.use_cart_validation)&&!this.hiddenSelector.matches("use-cart-validation",!0),R=this.t(this.form.use_remote_domain&&!(null===(s=this.data)||void 0===s?void 0:s.use_remote_domain)?"store-domain.custom_domain_note":"store-domain.helper_text"),E=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",J=this.__renderLoader(1),M=this.__renderLoader(2),T=this.__renderLoader(3),P=this.__renderLoader(4),D=this.__renderLoader(5),L=this.__renderLoader(6),W=this.__renderLoader(7),A=this.__renderLoader(8),B=this.__renderLoader(9),G=Object.entries(null!==(u=null===(a=null==M?void 0:M.data)||void 0===a?void 0:a.values)&&void 0!==u?u:{}),I=null==P?void 0:P.data,z=null==D?void 0:D.data,F=null==L?void 0:L.data,H=null!==(p=null===(_=null==W?void 0:W.data)||void 0===_?void 0:_.values.timezone)&&void 0!==p?p:[],K=Object.values(null!==(m=null===(h=null==A?void 0:A.data)||void 0===h?void 0:h.values)&&void 0!==m?m:{}),Q=Object.values(null!==(g=null===(f=null==B?void 0:B.data)||void 0===f?void 0:f.values)&&void 0!==g?g:{}),X=Object.entries(null!==(x=null===(y=null==J?void 0:J.data)||void 0===y?void 0:y.values)&&void 0!==x?x:{}),Y=Object.entries(null!==(v=null===(b=null==T?void 0:T.data)||void 0===b?void 0:b.values)&&void 0!==v?v:{}),Z=Object.entries(null!==($=null==z?void 0:z.values)&&void 0!==$?$:{}),ee=Object.entries(null!==(V=null==F?void 0:F.values)&&void 0!==V?V:{}),te=X.map((e=>({label:e[1].description,value:e[0]}))),oe=G.map((([e,t])=>({label:t,value:e}))),re=Y.map((([e,t])=>({label:t,value:e}))),ie=Z.map((([e,t])=>({value:e,label:t}))),se=ee.map((([e,t])=>({value:e,label:t}))),ne=H.map((e=>({label:e.description,value:e.timezone}))),ae=K.map((e=>({label:e.default,value:e.cc2}))),le=Q.map((e=>({label:e.default,value:e.code})));let ce;try{const e=new URL(null!==(j=this.regions)&&void 0!==j?j:""),t=this.form.country;t&&e.searchParams.set("country_code",t),ce=e.toString()}catch(e){ce=void 0}return n(l||(l=q` ${0} <div class="grid gap-m grid-cols-1 sm-grid-cols-2"> <foxy-internal-text-control infer="store-name"></foxy-internal-text-control> <foxy-internal-text-control infer="logo-url"></foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="store-url"></foxy-internal-text-control> <foxy-internal-editable-list-control infer="store-email" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-select-control infer="timezone" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-async-combo-box-control item-label-path="version" item-value-path="_links.self.href" class="sm-col-span-2" infer="store-version-uri" first="${0}" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="from-email" class="sm-col-span-2" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-checkbox-group-control infer="bcc-on-receipt-email" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="use-email-dns" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-smtp-config" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="postal-code"></foxy-internal-text-control> <foxy-internal-select-control infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-checkbox-group-control infer="features-multiship" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="require-signed-shipping-rates" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-text-control class="sm-col-span-2" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-frequency-control class="sm-col-span-2" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-checkbox-group-control infer="products-require-expires-property" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-cart-validation" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="checkout-type" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-password-control infer="unified-order-entry-password"> </foxy-internal-password-control> <foxy-internal-text-control infer="single-sign-on-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webhook-url" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} ${0} </div> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),R,E,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,ne,i(null!==(k=this.storeVersions)&&void 0!==k?k:void 0),I,null!==(w=null===(S=this.__getStoreEmailValue()[0])||void 0===S?void 0:S.value)&&void 0!==w?w:this.t("from-email.placeholder"),this.__getBccOnReceiptEmailValue,this.__setBccOnReceiptEmailValue,this.__singleCheckboxGroupOptions,this.__getUseEmailDnsValue,this.__setUseEmailDnsValue,this.__singleCheckboxGroupOptions,O?this.__renderWarning("use_email_dns_helper_text",{href:"https://wiki.foxycart.com/v/1.1/emails#how_emails_are_sent_spf_dkim_dmarc_etc",caption:"How Emails Are Sent (SPF, DKIM, DMARC, etc.)"}):"",this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.__singleCheckboxGroupOptions,this.form.smtp_config&&!this.hiddenSelector.matches("smtp-config",!0)?this.__renderSmtpConfig():"",ae,le,oe,this.__getFeaturesMultishipValue,this.__setFeaturesMultishipValue,this.__singleCheckboxGroupOptions,this.__getRequireSignedShippingRatesValue,this.__setRequireSignedShippingRatesValue,this.__singleCheckboxGroupOptions,C?this.__renderWarning("require_signed_shipping_rates_helper_text"):"",se,ie,this.hiddenSelector.matches("currency-style",!0)?"":this.__renderCurrencyStyleSelector(),this.hiddenSelector.matches("custom-display-id-config",!0)?"":this.__renderCustomIDSettings(),this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__getProductsRequireExpiresPropertyValue,this.__setProductsRequireExpiresPropertyValue,this.__singleCheckboxGroupOptions,U?this.__renderWarning("products_require_expires_property_helper_text"):"",this.__getUseCartValidationValue,this.__setUseCartValidationValue,this.__singleCheckboxGroupOptions,N?this.__renderWarning("use_cart_validation_helper_text",{href:"https://wiki.foxycart.com/v/2.0/hmac_validation",caption:"HMAC Product Verification: Locking Down your Add-To-Cart Links and Forms"}):"",re,te,(e=>{var t;const o=X.find((([t])=>t===e));this.edit({customer_password_hash_type:e,customer_password_hash_config:null!==(t=null==o?void 0:o[1].config)&&void 0!==t?t:""})}),"number"==typeof this.form.customer_password_hash_config?n(c||(c=q` <foxy-internal-number-control infer="customer-password-hash-config"> </foxy-internal-number-control> `)):n(d||(d=q` <foxy-internal-text-control infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.__getSingleSignOnUrlValue,this.__setSingleSignOnUrlValue,this.__getWebhookUrlValue,this.__setWebhookUrlValue,this.__renderWebhookKey(),this.data&&!this.hiddenSelector.matches("is-maintenance-mode",!0)?this.__renderMaintenanceModeSwitch():"",super.renderBody(),J.render(this.customerPasswordHashTypes),M.render(this.shippingAddressTypes),T.render(this.checkoutTypes),P.render(this.form.store_version_uri),D.render(this.localeCodes),W.render(this.timezones),A.render(this.countries),L.render(this.languages),B.render(ce))}__renderWebhookKey(){var e,t;let o;try{o=JSON.parse(null!==(e=this.form.webhook_key)&&void 0!==e?e:"")}catch(e){const r=null!==(t=this.form.webhook_key)&&void 0!==t?t:"";o={cart_signing:r,xml_datafeed:r,api_legacy:r,sso:r}}return Object.keys(o).map((e=>n(u||(u=q` <foxy-internal-password-control infer="webhook-key-${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),e.replace("_","-"),(()=>o[e]),(t=>{o[e]=t,this.edit({webhook_key:JSON.stringify(o)})}))))}__renderMaintenanceModeSwitch(){var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.is_maintenance_mode),o=(t?"disable":"enable")+"_maintenance_mode",r=`maintenance_mode_${t?"on":"off"}_explainer`;return n(_||(_=q` <div data-testid="is-maintenance-mode" class="${0}"> <foxy-i18n infer="" class="block mb-s" key="${0}"></foxy-i18n> <vaadin-button theme="tertiary small ${0}" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </vaadin-button> </div> `),s({"rounded leading-s text-s sm-col-span-2":!0,"text-tertiary":!t,"text-error":t}),r,t?"contrast":"",this.disabledSelector.matches("is-maintenance-mode",!0),(()=>{this.edit({is_maintenance_mode:!this.form.is_maintenance_mode}),this.submit()}),o)}__renderCurrencyStyleSelector(){const e={101:0,100:0,"001":1,"000":2,111:3,110:3,"011":4,"010":5},t=[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((e=>Number(Boolean(e)))).join(""),o=e[t],r=this.disabledSelector.matches("currency-style",!0),i=this.readonlySelector.matches("currency-style",!0);return n(p||(p=q` <div data-testid="currency-style" class="sm-col-span-2"> ${0} <div class="grid grid-cols-1 gap-xs transition-colors text-secondary hover-text-body sm-col-span-2"> <foxy-i18n infer="" class="font-medium text-s" key="currency_style_label"></foxy-i18n> <div class="grid grid-cols-3 bg-contrast-10 rounded" style="gap:1px;padding:1px"> ${0} </div> <foxy-i18n infer="" class="text-xs" key="currency_style_helper_text"></foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("currency-style:before"),["12.34","USD 12.34","$12.34","12","USD 12","$12"].map(((t,a)=>n(h||(h=q` <label style="--lumo-border-radius:calc(var(--lumo-border-radius-m) - 1px)" class="${0}"> <span class="font-medium font-tnum">${0}</span> <input class="sr-only" value="${0}" type="radio" name="currency-style" ?checked="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </label> `),s({"relative z-0 px-s h-m flex items-center transition-colors":!0,"hover-cursor-pointer":!0,"focus-within-z-10 focus-within-ring-2 focus-within-ring-primary-50":!0,"bg-base text-body hover-bg-transparent":a!==o,"bg-primary text-primary-contrast":a===o,"rounded-tl":0===a,"rounded-tr":2===a,"rounded-bl":3===a,"rounded-br":5===a}),t,a,a===o,r,i,(()=>{const t=Object.entries(e).find((e=>e[1]===a))[0];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.renderTemplateOrSlot("currency-style:after"))}__renderCustomIDSettings(){var e;const t={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!==(e=this.form.custom_display_id_config)&&void 0!==e?e:"")}catch(e){o=a(t)}const r=parseInt(o.start||"0"),i=parseInt(o.length||"0")-o.prefix.length-o.suffix.length,s=Math.min(r+Math.floor(Math.random()*Math.pow(10,i)),Math.pow(10,i)-1),l=`${o.prefix}${s.toString().padStart(i,"0")}${o.suffix}`,c=Math.floor(1e3*Math.random()),d=String(c).padStart(3,"0");return n(m||(m=q` <foxy-internal-checkbox-group-control infer="custom-display-id-config-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>o.enabled?["checked"]:[]),(e=>{o.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.enabled?n(f||(f=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-integer-control infer="custom-display-id-config-start" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="custom-display-id-config-length" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-text-control infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> <foxy-internal-checkbox-group-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>parseInt(o.start||"0")),(e=>{o.start=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>parseInt(o.length||"0")),(e=>{o.length=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.prefix),(e=>{o.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.suffix),(e=>{o.suffix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&r/10<=i?n(g||(g=q` <table data-testid="custom-display-id-config-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-first-example"> </foxy-i18n> </td> <td> ${0}${0}${0} </td> </tr> <tr style="width:1%"> <td> <foxy-i18n infer="" key="custom-display-id-config-random-example"> </foxy-i18n> </td> <td>${0}</td> </tr> </tbody> </table> `),o.prefix,r.toString().padStart(i,"0"),o.suffix,l):"",(()=>o.transaction_journal_entries.enabled?["checked"]:[]),(e=>{o.transaction_journal_entries.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.transaction_journal_entries.enabled?n(y||(y=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control 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 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 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 infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> `),(()=>o.transaction_journal_entries.transaction_separator),(e=>{o.transaction_journal_entries.transaction_separator=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&r/10<=i?n(x||(x=q` <table data-testid="custom-display-id-config-transaction-journal-entries-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> </tbody> </table> `),l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix,d):""):""):"")}__renderSmtpConfig(){return n(b||(b=q` <div class="grid grid-cols-2 gap-m p-m rounded-t-l rounded-b-l border border-contrast-10 sm-col-span-2"> ${0} </div> `),["host","port","username","password","security"].map((e=>{const t=()=>JSON.parse(this.form.smtp_config||"{}")[e],o=t=>{var o,r,i,s,n;const a=JSON.parse(this.form.smtp_config||"{}");this.edit({smtp_config:JSON.stringify({username:null!==(o=a.username)&&void 0!==o?o:"",password:null!==(r=a.password)&&void 0!==r?r:"",security:null!==(i=a.security)&&void 0!==i?i:"",host:null!==(s=a.host)&&void 0!==s?s:"",port:null!==(n=a.port)&&void 0!==n?n:"",[e]:t})})},r=`smtp-config-${e}`;return"password"===e?n(v||(v=q` <foxy-internal-password-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),r,t,o):"port"===e?n($||($=q` <foxy-internal-integer-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> `),r,t,o):"security"===e?n(V||(V=q` <foxy-internal-radio-group-control infer="${0}" class="-mt-xs -mx-xs -mb-m col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),r,t,o,[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}]):n(j||(j=q` <foxy-internal-text-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),r,t,o)})))}__renderWarning(e,t){return n(k||(k=q` <div class="p-s leading-m text-s rounded bg-primary-10 text-primary sm-col-span-2"> <foxy-i18n infer="" key="${0}"></foxy-i18n> ${0} </div> `),e,t?n(S||(S=q` <a target="_blank" class="font-medium hover-underline rounded focus-outline-none focus-ring-2 focus-ring-primary" href="${0}" lang="en"> ${0} <iron-icon class="icon-inline" icon="icons:open-in-new"></iron-icon> </a> `),t.href,t.caption):"")}__renderLoader(e){var t;const o=`loader-${e}`;return{data:null===(t=this.renderRoot.querySelector(`#${o}`))||void 0===t?void 0:t.data,render:e=>n(w||(w=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),i(null!=e?e:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",C);export{C as StoreForm};
|
|
1
|
+
import"./shared-9637a2de.js";import"./shared-ea5ff8bc.js";import"./shared-41e7554e.js";import"./shared-fae08dfb.js";import"./shared-471e77dd.js";import"./shared-73045804.js";import"./shared-cc8b47c6.js";import"./shared-3b975a29.js";import"./shared-e7bff5de.js";import"./shared-e5098b19.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.js";import"./foxy-nucleon-element.js";import"./shared-49ecea83.js";import{_ as t}from"./shared-0f6e4584.js";import{R as o,a as r}from"./shared-25502f01.js";import{i}from"./shared-9803aa7c.js";import{c as s}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import{a}from"./shared-522a172d.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-3cf043a7.js";import"./shared-77e15843.js";import"./shared-887e1795.js";import"./shared-226dd830.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-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-2c1dff50.js";import"./shared-ff7b2af6.js";import"./shared-651c44fa.js";import"./shared-0f00d4d8.js";import"./shared-19f46691.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-ad76e640.js";import"./shared-6f4fa343.js";import"./shared-e47bd38e.js";import"./shared-4a652d60.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let l,c,d,u,_,p,h,m,f,g,y,x,b,v,$,V,j,k,S,w,q=e=>e;const O=o(r(e,"store-form"));class C extends O{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.__singleCheckboxGroupOptions=[{label:"option_checked",value:"checked"}],this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var e;return(null!==(e=this.form.store_email)&&void 0!==e?e:"").split(",").map((e=>({value:e.trim()}))).filter((({value:e})=>e.length>0))},this.__setStoreEmailValue=e=>{this.edit({store_email:e.map((e=>e.value)).join(",")})},this.__getBccOnReceiptEmailValue=()=>this.form.bcc_on_receipt_email?["checked"]:[],this.__setBccOnReceiptEmailValue=e=>{this.edit({bcc_on_receipt_email:e.includes("checked")})},this.__getUseEmailDnsValue=()=>this.form.use_email_dns?["checked"]:[],this.__setUseEmailDnsValue=e=>{this.edit({use_email_dns:e.includes("checked")})},this.__getUseSmtpConfigValue=()=>this.form.smtp_config?["checked"]:[],this.__setUseSmtpConfigValue=e=>{e.includes("checked")?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getFeaturesMultishipValue=()=>this.form.features_multiship?["checked"]:[],this.__setFeaturesMultishipValue=e=>{this.edit({features_multiship:e.includes("checked")})},this.__getRequireSignedShippingRatesValue=()=>this.form.require_signed_shipping_rates?["checked"]:[],this.__setRequireSignedShippingRatesValue=e=>{this.edit({require_signed_shipping_rates:e.includes("checked")})},this.__getAppSessionTimeValue=()=>{const e=this.form.app_session_time||43200;return e%86400==0?e/86400+"d":e%3600==0?e/3600+"h":e%60==0?e/60+"m":`${e}s`},this.__setAppSessionTimeValue=e=>{const t=e[e.length-1],o=parseInt(e.substring(0,e.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[t]*o})},this.__getProductsRequireExpiresPropertyValue=()=>this.form.products_require_expires_property?["checked"]:[],this.__setProductsRequireExpiresPropertyValue=e=>{this.edit({products_require_expires_property:e.includes("checked")})},this.__getUseCartValidationValue=()=>this.form.use_cart_validation?["checked"]:[],this.__setUseCartValidationValue=e=>{this.edit({use_cart_validation:e.includes("checked")})},this.__getSingleSignOnUrlValue=()=>{var e;return this.form.use_single_sign_on&&null!==(e=this.form.single_sign_on_url)&&void 0!==e?e:""},this.__setSingleSignOnUrlValue=e=>{this.edit({use_single_sign_on:!!e,single_sign_on_url:e})},this.__getWebhookUrlValue=()=>{var e;return this.form.use_webhook&&null!==(e=this.form.webhook_url)&&void 0!==e?e:""},this.__setWebhookUrlValue=e=>{this.edit({use_webhook:!!e,webhook_url:e})},this.__setStoreDomainValue=e=>{if(e.endsWith(".foxycart.com")){const t=e.substring(0,e.length-13);this.edit({store_domain:t,use_remote_domain:t.includes(".")})}else this.edit({store_domain:e,use_remote_domain:e.includes(".")})}}static get properties(){return t(t({},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:e})=>!!e||"store-name:v8n_required",({store_name:e})=>e&&e.length<=50||"store-name:v8n_too_long",({store_domain:e})=>!!e||"store-domain:v8n_required",({store_domain:e})=>e&&e.length<=100||"store-domain:v8n_too_long",({store_url:e})=>!!e||"store-url:v8n_required",({store_url:e})=>e&&e.length<=300||"store-url:v8n_too_long",({receipt_continue_url:e})=>!e||e.length<=300||"receipt-continue-url:v8n_too_long",({store_email:e})=>!!e||"store-email:v8n_required",({store_email:e})=>e&&e.length<=300||"store-email:v8n_too_long",({from_email:e})=>!e||e.length<=100||"from-email:v8n_too_long",({smtp_config:e})=>!e||e.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:e})=>!!e||"postal-code:v8n_required",({postal_code:e})=>e&&e.length<=50||"postal-code:v8n_too_long",({region:e})=>!!e||"region:v8n_required",({region:e})=>e&&e.length<=100||"region:v8n_too_long",({country:e})=>!!e||"country:v8n_required",({logo_url:e})=>!e||e.length<=200||"logo-url:v8n_too_long",({webhook_url:e,use_webhook:t})=>!t||!e||e.length<=300||"webhook-url:v8n_too_long",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!!e||"webhook-key:v8n_required",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!e||e.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!!e||"single-sign-on-url:v8n_required",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!e||e.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:e})=>!e||String(e).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:e})=>!e||String(e).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:e})=>!e||String(e).length<=100||"custom-display-id-config-enabled:v8n_too_long"]}renderBody(){var e,t,o,r,s,a,u,_,p,h,m,f,g,y,x,b,v,$,V,j,k,S,w;const O=this.form.use_email_dns&&!(null===(e=this.data)||void 0===e?void 0:e.use_email_dns)&&!this.hiddenSelector.matches("use-email-dns",!0),C=this.form.require_signed_shipping_rates&&!(null===(t=this.data)||void 0===t?void 0:t.require_signed_shipping_rates)&&!this.hiddenSelector.matches("require-signed-shipping-rates",!0),U=this.form.products_require_expires_property&&!(null===(o=this.data)||void 0===o?void 0:o.products_require_expires_property)&&!this.hiddenSelector.matches("products-require-expires-property",!0),N=this.form.use_cart_validation&&!(null===(r=this.data)||void 0===r?void 0:r.use_cart_validation)&&!this.hiddenSelector.matches("use-cart-validation",!0),R=this.t(this.form.use_remote_domain&&!(null===(s=this.data)||void 0===s?void 0:s.use_remote_domain)?"store-domain.custom_domain_note":"store-domain.helper_text"),E=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",J=this.__renderLoader(1),M=this.__renderLoader(2),T=this.__renderLoader(3),P=this.__renderLoader(4),D=this.__renderLoader(5),L=this.__renderLoader(6),W=this.__renderLoader(7),A=this.__renderLoader(8),B=this.__renderLoader(9),G=Object.entries(null!==(u=null===(a=null==M?void 0:M.data)||void 0===a?void 0:a.values)&&void 0!==u?u:{}),I=null==P?void 0:P.data,z=null==D?void 0:D.data,F=null==L?void 0:L.data,H=null!==(p=null===(_=null==W?void 0:W.data)||void 0===_?void 0:_.values.timezone)&&void 0!==p?p:[],K=Object.values(null!==(m=null===(h=null==A?void 0:A.data)||void 0===h?void 0:h.values)&&void 0!==m?m:{}),Q=Object.values(null!==(g=null===(f=null==B?void 0:B.data)||void 0===f?void 0:f.values)&&void 0!==g?g:{}),X=Object.entries(null!==(x=null===(y=null==J?void 0:J.data)||void 0===y?void 0:y.values)&&void 0!==x?x:{}),Y=Object.entries(null!==(v=null===(b=null==T?void 0:T.data)||void 0===b?void 0:b.values)&&void 0!==v?v:{}),Z=Object.entries(null!==($=null==z?void 0:z.values)&&void 0!==$?$:{}),ee=Object.entries(null!==(V=null==F?void 0:F.values)&&void 0!==V?V:{}),te=X.map((e=>({label:e[1].description,value:e[0]}))),oe=G.map((([e,t])=>({label:t,value:e}))),re=Y.map((([e,t])=>({label:t,value:e}))),ie=Z.map((([e,t])=>({value:e,label:t}))),se=ee.map((([e,t])=>({value:e,label:t}))),ne=H.map((e=>({label:e.description,value:e.timezone}))),ae=K.map((e=>({label:e.default,value:e.cc2}))),le=Q.map((e=>({label:e.default,value:e.code})));let ce;try{const e=new URL(null!==(j=this.regions)&&void 0!==j?j:""),t=this.form.country;t&&e.searchParams.set("country_code",t),ce=e.toString()}catch(e){ce=void 0}return n(l||(l=q` ${0} <div class="grid gap-m grid-cols-1 sm-grid-cols-2"> <foxy-internal-text-control infer="store-name"></foxy-internal-text-control> <foxy-internal-text-control infer="logo-url"></foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="store-url"></foxy-internal-text-control> <foxy-internal-editable-list-control infer="store-email" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-select-control infer="timezone" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-async-combo-box-control item-label-path="version" item-value-path="_links.self.href" class="sm-col-span-2" infer="store-version-uri" first="${0}" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="from-email" class="sm-col-span-2" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-checkbox-group-control infer="bcc-on-receipt-email" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="use-email-dns" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-smtp-config" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="postal-code"></foxy-internal-text-control> <foxy-internal-select-control infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-checkbox-group-control infer="features-multiship" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="require-signed-shipping-rates" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-text-control class="sm-col-span-2" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-frequency-control class="sm-col-span-2" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-checkbox-group-control infer="products-require-expires-property" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-cart-validation" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="checkout-type" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-password-control infer="unified-order-entry-password"> </foxy-internal-password-control> <foxy-internal-text-control infer="single-sign-on-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webhook-url" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} ${0} </div> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} `),this.renderHeader(),R,E,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,ne,i(null!==(k=this.storeVersions)&&void 0!==k?k:void 0),I,null!==(w=null===(S=this.__getStoreEmailValue()[0])||void 0===S?void 0:S.value)&&void 0!==w?w:this.t("from-email.placeholder"),this.__getBccOnReceiptEmailValue,this.__setBccOnReceiptEmailValue,this.__singleCheckboxGroupOptions,this.__getUseEmailDnsValue,this.__setUseEmailDnsValue,this.__singleCheckboxGroupOptions,O?this.__renderWarning("use_email_dns_helper_text",{href:"https://wiki.foxycart.com/v/1.1/emails#how_emails_are_sent_spf_dkim_dmarc_etc",caption:"How Emails Are Sent (SPF, DKIM, DMARC, etc.)"}):"",this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.__singleCheckboxGroupOptions,this.form.smtp_config&&!this.hiddenSelector.matches("smtp-config",!0)?this.__renderSmtpConfig():"",ae,le,oe,this.__getFeaturesMultishipValue,this.__setFeaturesMultishipValue,this.__singleCheckboxGroupOptions,this.__getRequireSignedShippingRatesValue,this.__setRequireSignedShippingRatesValue,this.__singleCheckboxGroupOptions,C?this.__renderWarning("require_signed_shipping_rates_helper_text"):"",se,ie,this.hiddenSelector.matches("currency-style",!0)?"":this.__renderCurrencyStyleSelector(),this.hiddenSelector.matches("custom-display-id-config",!0)?"":this.__renderCustomIDSettings(),this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__getProductsRequireExpiresPropertyValue,this.__setProductsRequireExpiresPropertyValue,this.__singleCheckboxGroupOptions,U?this.__renderWarning("products_require_expires_property_helper_text"):"",this.__getUseCartValidationValue,this.__setUseCartValidationValue,this.__singleCheckboxGroupOptions,N?this.__renderWarning("use_cart_validation_helper_text",{href:"https://wiki.foxycart.com/v/2.0/hmac_validation",caption:"HMAC Product Verification: Locking Down your Add-To-Cart Links and Forms"}):"",re,te,(e=>{var t;const o=X.find((([t])=>t===e));this.edit({customer_password_hash_type:e,customer_password_hash_config:null!==(t=null==o?void 0:o[1].config)&&void 0!==t?t:""})}),"number"==typeof this.form.customer_password_hash_config?n(c||(c=q` <foxy-internal-number-control infer="customer-password-hash-config"> </foxy-internal-number-control> `)):n(d||(d=q` <foxy-internal-text-control infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.__getSingleSignOnUrlValue,this.__setSingleSignOnUrlValue,this.__getWebhookUrlValue,this.__setWebhookUrlValue,this.__renderWebhookKey(),this.data&&!this.hiddenSelector.matches("is-maintenance-mode",!0)?this.__renderMaintenanceModeSwitch():"",super.renderBody(),J.render(this.customerPasswordHashTypes),M.render(this.shippingAddressTypes),T.render(this.checkoutTypes),P.render(this.form.store_version_uri),D.render(this.localeCodes),W.render(this.timezones),A.render(this.countries),L.render(this.languages),B.render(ce))}__renderWebhookKey(){var e,t;let o;try{o=JSON.parse(null!==(e=this.form.webhook_key)&&void 0!==e?e:"")}catch(e){const r=null!==(t=this.form.webhook_key)&&void 0!==t?t:"";o={cart_signing:r,xml_datafeed:r,api_legacy:r,sso:r}}return Object.keys(o).map((e=>n(u||(u=q` <foxy-internal-password-control infer="webhook-key-${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),e.replace("_","-"),(()=>o[e]),(t=>{o[e]=t,this.edit({webhook_key:JSON.stringify(o)})}))))}__renderMaintenanceModeSwitch(){var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.is_maintenance_mode),o=(t?"disable":"enable")+"_maintenance_mode",r=`maintenance_mode_${t?"on":"off"}_explainer`;return n(_||(_=q` <div data-testid="is-maintenance-mode" class="${0}"> <foxy-i18n infer="" class="block mb-s" key="${0}"></foxy-i18n> <vaadin-button theme="tertiary small ${0}" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </vaadin-button> </div> `),s({"rounded leading-s text-s sm-col-span-2":!0,"text-tertiary":!t,"text-error":t}),r,t?"contrast":"",this.disabledSelector.matches("is-maintenance-mode",!0),(()=>{this.edit({is_maintenance_mode:!this.form.is_maintenance_mode}),this.submit()}),o)}__renderCurrencyStyleSelector(){const e={101:0,100:0,"001":1,"000":2,111:3,110:3,"011":4,"010":5},t=[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((e=>Number(Boolean(e)))).join(""),o=e[t],r=this.disabledSelector.matches("currency-style",!0),i=this.readonlySelector.matches("currency-style",!0);return n(p||(p=q` <div data-testid="currency-style" class="sm-col-span-2"> ${0} <div class="grid grid-cols-1 gap-xs transition-colors text-secondary hover-text-body sm-col-span-2"> <foxy-i18n infer="" class="font-medium text-s" key="currency_style_label"></foxy-i18n> <div class="grid grid-cols-3 bg-contrast-10 rounded" style="gap:1px;padding:1px"> ${0} </div> <foxy-i18n infer="" class="text-xs" key="currency_style_helper_text"></foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("currency-style:before"),["12.34","USD 12.34","$12.34","12","USD 12","$12"].map(((t,a)=>n(h||(h=q` <label style="--lumo-border-radius:calc(var(--lumo-border-radius-m) - 1px)" class="${0}"> <span class="font-medium font-tnum">${0}</span> <input class="sr-only" value="${0}" type="radio" name="currency-style" ?checked="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </label> `),s({"relative z-0 px-s h-m flex items-center transition-colors":!0,"hover-cursor-pointer":!0,"focus-within-z-10 focus-within-ring-2 focus-within-ring-primary-50":!0,"bg-base text-body hover-bg-transparent":a!==o,"bg-primary text-primary-contrast":a===o,"rounded-tl":0===a,"rounded-tr":2===a,"rounded-bl":3===a,"rounded-br":5===a}),t,a,a===o,r,i,(()=>{const t=Object.entries(e).find((e=>e[1]===a))[0];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.renderTemplateOrSlot("currency-style:after"))}__renderCustomIDSettings(){var e;const t={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!==(e=this.form.custom_display_id_config)&&void 0!==e?e:"")}catch(e){o=a(t)}const r=parseInt(o.start||"0"),i=parseInt(o.length||"0")-o.prefix.length-o.suffix.length,s=Math.min(r+Math.floor(Math.random()*Math.pow(10,i)),Math.pow(10,i)-1),l=`${o.prefix}${s.toString().padStart(i,"0")}${o.suffix}`,c=Math.floor(1e3*Math.random()),d=String(c).padStart(3,"0");return n(m||(m=q` <foxy-internal-checkbox-group-control infer="custom-display-id-config-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>o.enabled?["checked"]:[]),(e=>{o.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.enabled?n(f||(f=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-integer-control infer="custom-display-id-config-start" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="custom-display-id-config-length" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-text-control infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> <foxy-internal-checkbox-group-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>parseInt(o.start||"0")),(e=>{o.start=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>parseInt(o.length||"0")),(e=>{o.length=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.prefix),(e=>{o.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.suffix),(e=>{o.suffix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&r/10<=i?n(g||(g=q` <table data-testid="custom-display-id-config-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-first-example"> </foxy-i18n> </td> <td> ${0}${0}${0} </td> </tr> <tr style="width:1%"> <td> <foxy-i18n infer="" key="custom-display-id-config-random-example"> </foxy-i18n> </td> <td>${0}</td> </tr> </tbody> </table> `),o.prefix,r.toString().padStart(i,"0"),o.suffix,l):"",(()=>o.transaction_journal_entries.enabled?["checked"]:[]),(e=>{o.transaction_journal_entries.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.transaction_journal_entries.enabled?n(y||(y=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control 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 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 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 infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> `),(()=>o.transaction_journal_entries.transaction_separator),(e=>{o.transaction_journal_entries.transaction_separator=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&r/10<=i?n(x||(x=q` <table data-testid="custom-display-id-config-transaction-journal-entries-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> </tbody> </table> `),l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix,d):""):""):"")}__renderSmtpConfig(){return n(b||(b=q` <div class="grid grid-cols-2 gap-m p-m rounded-t-l rounded-b-l border border-contrast-10 sm-col-span-2"> ${0} </div> `),["host","port","username","password","security"].map((e=>{const t=()=>JSON.parse(this.form.smtp_config||"{}")[e],o=t=>{var o,r,i,s,n;const a=JSON.parse(this.form.smtp_config||"{}");this.edit({smtp_config:JSON.stringify({username:null!==(o=a.username)&&void 0!==o?o:"",password:null!==(r=a.password)&&void 0!==r?r:"",security:null!==(i=a.security)&&void 0!==i?i:"",host:null!==(s=a.host)&&void 0!==s?s:"",port:null!==(n=a.port)&&void 0!==n?n:"",[e]:t})})},r=`smtp-config-${e}`;return"password"===e?n(v||(v=q` <foxy-internal-password-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),r,t,o):"port"===e?n($||($=q` <foxy-internal-integer-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> `),r,t,o):"security"===e?n(V||(V=q` <foxy-internal-radio-group-control infer="${0}" class="-mt-xs -mx-xs -mb-m col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),r,t,o,[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}]):n(j||(j=q` <foxy-internal-text-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),r,t,o)})))}__renderWarning(e,t){return n(k||(k=q` <div class="p-s leading-m text-s rounded bg-primary-10 text-primary sm-col-span-2"> <foxy-i18n infer="" key="${0}"></foxy-i18n> ${0} </div> `),e,t?n(S||(S=q` <a target="_blank" class="font-medium hover-underline rounded focus-outline-none focus-ring-2 focus-ring-primary" href="${0}" lang="en"> ${0} <iron-icon class="icon-inline" icon="icons:open-in-new"></iron-icon> </a> `),t.href,t.caption):"")}__renderLoader(e){var t;const o=`loader-${e}`;return{data:null===(t=this.renderRoot.querySelector(`#${o}`))||void 0===t?void 0:t.data,render:e=>n(w||(w=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),i(null!=e?e:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",C);export{C as StoreForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-1d4fdfa8.js";import"./shared-d5ff9121.js";import"./shared-cc8b47c6.js";import"./shared-fcbf196e.js";import"./shared-c5a0cdd7.js";import"./shared-787e8da4.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.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 o,B as t}from"./shared-0f6e4584.js";import{a as i}from"./shared-25502f01.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-3cf043a7.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-887e1795.js";import"./shared-59b7fcc0.js";import"./shared-49ecea83.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-9637a2de.js";import"./shared-4e709717.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-6d11abd7.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./shared-4a652d60.js";import"./shared-ff7b2af6.js";import"./shared-19f46691.js";import"./shared-77e15843.js";import"./shared-0f00d4d8.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-c4124870.js";import"./shared-df42c94f.js";import"./shared-63192750.js";let n,d=e=>e;const a=i(e,"store-shipping-method-form"),p=e=>{try{return new URL(e),!0}catch(e){return!1}};class c extends a{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 o(o({},super.properties),{},{shippingMethods:{attribute:"shipping-methods"},__useCustomAccount:{attribute:!1}})}static get v8n(){return[({shipping_method_uri:e})=>e&&p(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",e=>{var o,t;return"CUSTOM-ENDPOINT-POST"!==(null===(t=null===(o=e._embedded)||void 0===o?void 0:o["fx:shipping_method"])||void 0===t?void 0:t.code)||(e.accountid&&p(e.accountid)||"endpoint:v8n_required")},e=>{var o,t;const i=e.shipping_container_uri,r=null===(t=null===(o=e._embedded)||void 0===o?void 0:o["fx:shipping_method"])||void 0===t?void 0:t.code;return!r||!["USPS","FedEx","UPS"].includes(r)||(i&&p(i)||"shipping-container-uri:v8n_required")},e=>{var o,t;const i=e.shipping_drop_type_uri,r=null===(t=null===(o=e._embedded)||void 0===o?void 0:o["fx:shipping_method"])||void 0===t?void 0:t.code;return!r||!["FedEx","UPS"].includes(r)||(i&&p(i)||"shipping-drop-type-uri:v8n_required")}]}get hiddenSelector(){var e;const o=!!this.data,i=null===(e=this.__shippingMethod)||void 0===e?void 0:e.code;let r="general:shipping-container-uri general:shipping-drop-type-uri destinations account endpoint custom-code";if(i){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[i]&&(r=e[i])}return o&&!(null==i?void 0:i.startsWith("CUSTOM"))||(r+=" services"),o&&(r=`general:shipping-method-uri ${r}`),this.__useCustomAccountGetValue()||(r+=" account:accountid account:password account:authentication-key account:meter-number"),new t(`${r} ${super.hiddenSelector}`.trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}get headerTitleOptions(){var e;return o(o({},super.headerTitleOptions),{},{provider:null===(e=this.__shippingMethod)||void 0===e?void 0:e.name})}renderBody(){var e,o,t,i;const a=this.__shippingMethod;return s(n||(n=d` ${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(),r(null!==(e=this.shippingMethods)&&void 0!==e?e:null===(o=this.form._links)||void 0===o?void 0:o["fx:shipping_methods"].href),this.__shippingMethodUriSetValue,r(null==a?void 0:a._links["fx:shipping_containers"].href),r(null==a?void 0:a._links["fx:shipping_drop_types"].href),this.__useCustomAccountGetValue,this.__useCustomAccountSetValue,r(null===(t=this.data)||void 0===t?void 0:t._links.self.href),r(null==a?void 0:a._links["fx:shipping_services"].href),r(null===(i=this.data)||void 0===i?void 0:i._links["fx:store_shipping_services"].href),r(this.form.shipping_method_uri||void 0),this.__shippingMethodLoaderId,(e=>{const o=e.target.data;this.edit({_embedded:o?{"fx:shipping_method":o}:{}})}),super.renderBody())}updated(e){super.updated(e),e.has("href")&&(this.__useCustomAccount=!1)}get __shippingMethodLoader(){return this.renderRoot.querySelector(`#${this.__shippingMethodLoaderId}`)}get __shippingMethod(){var e,o,t;return null!==(o=null===(e=this.__shippingMethodLoader)||void 0===e?void 0:e.data)&&void 0!==o?o:null===(t=this.form._embedded)||void 0===t?void 0:t["fx:shipping_method"]}}customElements.define("foxy-store-shipping-method-form",c);export{c as StoreShippingMethodForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-fae08dfb.js";import"./shared-
|
|
1
|
+
import"./shared-fae08dfb.js";import"./shared-fcbf196e.js";import"./shared-787e8da4.js";import"./shared-e5098b19.js";import"./shared-e7bff5de.js";import"./shared-01f18104.js";import{I as e}from"./shared-97514fcb.js";import{a as t}from"./shared-25502f01.js";import{B as r}from"./shared-0f6e4584.js";import{h as i}from"./shared-dc73b9a5.js";import"./shared-1729e19a.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-fb1602a2.js";import"./shared-887e1795.js";import"./shared-6be24929.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-49ecea83.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-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-2c1dff50.js";import"./shared-ff7b2af6.js";import"./shared-651c44fa.js";import"./shared-0f00d4d8.js";import"./shared-19f46691.js";import"./shared-77e15843.js";import"./shared-61ade33e.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-ad76e640.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-copy-to-clipboard.js";import"./shared-59b7fcc0.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let a,s=e=>e;const o=t(e,"subscription-settings-form");class n extends o{constructor(){super(...arguments),this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,r)=>!isNaN(e)&&r.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})},this.__getReattemptBypassStringsValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_bypass_strings)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>e.trim())).filter(((e,t,r)=>e&&r.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{this.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join()})},this.__reattemptBypassLogicOptions=[{value:"",label:"option_always_reattempt"},{value:"skip_if_exists",label:"option_skip_if_exists"},{value:"reattempt_if_exists",label:"option_reattempt_if_exists"}]}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}get hiddenSelector(){const e=["header:copy-id",super.hiddenSelector.toString()];return this.form.reattempt_bypass_logic||e.push("reattempts-group:reattempt-bypass-strings"),new r(e.join(" ").trim())}renderBody(){return i(a||(a=s` ${0} <foxy-internal-summary-control infer="past-due-amount-group"> <foxy-internal-select-control layout="summary-item" infer="past-due-amount-handling" .options="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="automatically-charge-past-due-amount" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="reset-nextdate-on-makeup-payment" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-switch-control infer="prevent-customer-cancel-with-past-due" helper-text-as-tooltip> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="reattempts-group"> <foxy-internal-select-control layout="summary-item" infer="reattempt-bypass-logic" .options="${0}"> </foxy-internal-select-control> <foxy-internal-editable-list-control layout="summary-item" infer="reattempt-bypass-strings" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control layout="summary-item" infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="emails-group"> <foxy-internal-switch-control infer="send-email-receipts-for-automated-billing" helper-text-as-tooltip> </foxy-internal-switch-control> <foxy-internal-editable-list-control layout="summary-item" infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control layout="summary-item" infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="modification-group"> <foxy-internal-text-control layout="summary-item" infer="modification-url"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="cancellation-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="cancellation-schedule" step="1" min="1"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__pastDueAmountHandlingOptions,this.__reattemptBypassLogicOptions,this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",n);export{n as SubscriptionSettingsForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-49ecea83.js";import"./shared-6d11abd7.js";import"./shared-40c6b1f6.js";import"./shared-787e8da4.js";import{I as t}from"./shared-97514fcb.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import{a as e}from"./shared-226dd830.js";import{_ as o,B as i}from"./shared-0f6e4584.js";import{h as r,s}from"./shared-dc73b9a5.js";import{N as n}from"./shared-24d71d01.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{g as a}from"./shared-bab2ea2c.js";import{i as d}from"./shared-9803aa7c.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-25502f01.js";import"./shared-c4124870.js";import"./shared-df42c94f.js";import"./shared-59b7fcc0.js";import"./shared-887e1795.js";import"./shared-98ddb87c.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.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-471e77dd.js";import"./shared-fb1602a2.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-77e15843.js";import"./shared-c5a0cdd7.js";import"./shared-a0c6a159.js";import"./shared-c11df800.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-ea5ff8bc.js";import"./shared-3cf043a7.js";import"./shared-63192750.js";import"./shared-6ac0d05e.js";import"./shared-2bf89a21.js";import"./shared-96a392d9.js";import"./shared-4a652d60.js";import"./shared-ff7b2af6.js";import"./shared-19f46691.js";import"./shared-0f00d4d8.js";import"./shared-01f18104.js";import"./shared-22ba9566.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-90706e10.js";import"./shared-d5ff9121.js";import"./foxy-form-dialog.js";import"./shared-99940888.js";import"./shared-73045804.js";import"./shared-ad76e640.js";import"./shared-6f4fa343.js";import"./shared-e47bd38e.js";import"./shared-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-2c1dff50.js";import"./shared-651c44fa.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-e7bff5de.js";import"./shared-a8233033.js";import"./shared-cb3b9d8b.js";import"./shared-fb1dd186.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.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"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return o(o({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=p` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new n.API(this),o=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let m,h,_,y,v=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,o,i;const n=this.nucleon,c=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==n?void 0:n.getCustomerPageHref)||void 0===e?void 0:e.call(n,c):void 0;return r(m||(m=v` <foxy-i18n infer="" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors":!0,"ring-1 ring-contrast-10":!u,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),d(u),d(c),this.__renderCopyAction(s(h||(h=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(a(c)):""),this.__renderCopyAction(s(_||(_=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(t,e,o,i){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return r(y||(y=v` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(i,o)),(t=>"idle"!==s&&t.stopPropagation()),(t=>"idle"!==s&&t.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),t,e,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let x,b,g,j,w,$,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var t,e,o,i,s,n,a,d,l,c;return r(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return r(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return r(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,o;return r(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,o;return r(w||(w=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,o;const i=this.nucleon,s=null===(e=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,n=s?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,s):void 0;return r($||($=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),d(n))}});let S,P,A,C,H,L,E,I,R,B,q=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,o,i,s,n,a,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return r(S||(S=q``));const f=null!==(o=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(s=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==s?s:[];return r(P||(P=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),d(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?r(A||(A=q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((t=>r(C||(C=q` <span>${0}:</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===f.length||0===u.total_tax?r(H||(H=q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((t=>r(L||(L=q` <span>${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(a=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:applied_gift_card_codes"])||void 0===a?void 0:a.map((t=>{var e;return r(E||(E=q` <span>${0}:</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>r(I||(I=q` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,o;return null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var t,e;const o=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==e?e:null}__renderPrice(t,e=!1){var o,i,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===s?void 0:s.currency_code;return r(R||(R=q` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const o=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",r(B||(B=q` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let G,T,U,Z=t=>t;const M=c(u(t,"transaction"));class O extends M{constructor(){var t;super(...arguments),t=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(e){if(!t.data)return;const o=t.data._links["fx:send_webhooks"].href,i=new O.API(t),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:e.map((t=>a(t._links.self.href))),event:"refeed"})});if(e.forEach((t=>{O.Rumour("").share({related:[...e.map((t=>t._links["fx:logs"].href)),...e.map((t=>t._links["fx:statuses"].href))],source:t._links.self.href,data:t})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var t,e,o;const r=["billing-addresses","datafeed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var t,e,o,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new i(s.join(" ").trim())}get headerSubtitleOptions(){var t,e,o,i,r;const s=null===(t=this.data)||void 0===t?void 0:t.source,n=null===(e=this.data)||void 0===e?void 0:e.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerCopyIdValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.data)||void 0===t?void 0:t.display_id)||void 0===e?void 0:e.toString())&&void 0!==o?o:""}renderHeaderActions(){return r(G||(G=Z` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var t,e,o,i,s,n,a,l,c,u,f,p,m,h,_;let y,v,x;const b=this.hiddenSelector;if(this.data)try{const o=new URL(this.data._links["fx:shipments"].href),i=new URL(null!==(e=null===(t=this.__storeLoader)||void 0===t?void 0:t.data._links["fx:webhooks"].href)&&void 0!==e?e:""),r=new URL(this.data._links["fx:items"].href);o.searchParams.set("zoom","items:item_category"),i.searchParams.set("event_resource","transaction"),r.searchParams.set("zoom","item_options"),y=o.toString(),v=i.toString(),x=r.toString()}catch(t){}return r(T||(T=Z` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <div class="grid gap-m sm-grid-cols-2" ?hidden="${0}"> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> </div> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-transaction-post-action-control infer="process-webhook" href="${0}"> </foxy-internal-transaction-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(i=null===(o=this.data)||void 0===o?void 0:o.status)&&void 0!==i?i:"")?r(U||(U=Z` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(s=this.data)||void 0===s?void 0:s.status):"",b.matches("items",!0)&&b.matches("summary",!0),d(x),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(a=null===(n=this.__storeLoader)||void 0===n?void 0:n.data)||void 0===a?void 0:a._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href},d(null===(c=this.data)||void 0===c?void 0:c._links["fx:billing_addresses"].href),d(null===(u=this.data)||void 0===u?void 0:u._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},b.matches("custom-fields",!0)&&b.matches("attributes",!0),d(null===(f=this.data)||void 0===f?void 0:f._links["fx:custom_fields"].href),d(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),d(y),d(v),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(h=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===h?void 0:h.href),d(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",O);export{O as Transaction};
|
|
1
|
+
import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-49ecea83.js";import"./shared-6d11abd7.js";import"./shared-fcbf196e.js";import"./shared-787e8da4.js";import{I as t}from"./shared-97514fcb.js";import"./shared-9637a2de.js";import"./shared-09fc6fa0.js";import{a as e}from"./shared-226dd830.js";import{_ as o,B as i}from"./shared-0f6e4584.js";import{h as r,s}from"./shared-dc73b9a5.js";import{N as n}from"./shared-24d71d01.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{g as a}from"./shared-bab2ea2c.js";import{i as d}from"./shared-9803aa7c.js";import{c as l}from"./shared-4e709717.js";import{R as c,a as u}from"./shared-25502f01.js";import"./shared-c4124870.js";import"./shared-df42c94f.js";import"./shared-59b7fcc0.js";import"./shared-887e1795.js";import"./shared-98ddb87c.js";import"./shared-51c4a6dd.js";import"./shared-0b01f721.js";import"./shared-343d1fd7.js";import"./shared-f7a1193f.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-471e77dd.js";import"./shared-fb1602a2.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-77e15843.js";import"./shared-c5a0cdd7.js";import"./shared-a0c6a159.js";import"./shared-c11df800.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-ea5ff8bc.js";import"./shared-3cf043a7.js";import"./shared-63192750.js";import"./shared-6ac0d05e.js";import"./shared-2bf89a21.js";import"./shared-cc8b47c6.js";import"./shared-4a652d60.js";import"./shared-ff7b2af6.js";import"./shared-19f46691.js";import"./shared-0f00d4d8.js";import"./shared-01f18104.js";import"./shared-22ba9566.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-90706e10.js";import"./shared-d5ff9121.js";import"./foxy-form-dialog.js";import"./shared-99940888.js";import"./shared-73045804.js";import"./shared-ad76e640.js";import"./shared-6f4fa343.js";import"./shared-e47bd38e.js";import"./shared-8fbebf38.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-2c1dff50.js";import"./shared-651c44fa.js";import"./shared-ea8f9a88.js";import"./shared-5c4d786c.js";import"./shared-e7bff5de.js";import"./shared-a8233033.js";import"./shared-cb3b9d8b.js";import"./shared-fb1dd186.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.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"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let f,p=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return o(o({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return r(f||(f=p` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new n.API(this),o=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=o.ok?"idle":"fail",o.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let m,h,_,y,v=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,o,i;const n=this.nucleon,c=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==n?void 0:n.getCustomerPageHref)||void 0===e?void 0:e.call(n,c):void 0;return r(m||(m=v` <foxy-i18n infer="" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors":!0,"ring-1 ring-contrast-10":!u,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),d(u),d(c),this.__renderCopyAction(s(h||(h=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(a(c)):""),this.__renderCopyAction(s(_||(_=v`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(t,e,o,i){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return r(y||(y=v` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(i,o)),(t=>"idle"!==s&&t.stopPropagation()),(t=>"idle"!==s&&t.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),t,e,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let x,b,g,j,w,$,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var t,e,o,i,s,n,a,d,l,c;return r(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return r(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return r(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,o;return r(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,o;return r(w||(w=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),d(null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===o?void 0:o.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,o;const i=this.nucleon,s=null===(e=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,n=s?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,s):void 0;return r($||($=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),d(n))}});let S,P,A,C,H,L,E,I,R,B,q=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,o,i,s,n,a,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return r(S||(S=q``));const f=null!==(o=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(s=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==s?s:[];return r(P||(P=q` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),d(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?r(A||(A=q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((t=>r(C||(C=q` <span>${0}:</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===f.length||0===u.total_tax?r(H||(H=q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((t=>r(L||(L=q` <span>${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(a=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:applied_gift_card_codes"])||void 0===a?void 0:a.map((t=>{var e;return r(E||(E=q` <span>${0}:</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>r(I||(I=q` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,o;return null===(o=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var t,e;const o=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(o))||void 0===t?void 0:t.data)&&void 0!==e?e:null}__renderPrice(t,e=!1){var o,i,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===s?void 0:s.currency_code;return r(R||(R=q` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const o=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",r(B||(B=q` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let G,T,U,Z=t=>t;const M=c(u(t,"transaction"));class O extends M{constructor(){var t;super(...arguments),t=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(e){if(!t.data)return;const o=t.data._links["fx:send_webhooks"].href,i=new O.API(t),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:e.map((t=>a(t._links.self.href))),event:"refeed"})});if(e.forEach((t=>{O.Rumour("").share({related:[...e.map((t=>t._links["fx:logs"].href)),...e.map((t=>t._links["fx:statuses"].href))],source:t._links.self.href,data:t})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var t,e,o;const r=["billing-addresses","datafeed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var t,e,o,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new i(s.join(" ").trim())}get headerSubtitleOptions(){var t,e,o,i,r;const s=null===(t=this.data)||void 0===t?void 0:t.source,n=null===(e=this.data)||void 0===e?void 0:e.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerCopyIdValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.data)||void 0===t?void 0:t.display_id)||void 0===e?void 0:e.toString())&&void 0!==o?o:""}renderHeaderActions(){return r(G||(G=Z` <foxy-internal-transaction-actions-control infer="actions"> </foxy-internal-transaction-actions-control> `))}renderBody(){var t,e,o,i,s,n,a,l,c,u,f,p,m,h,_;let y,v,x;const b=this.hiddenSelector;if(this.data)try{const o=new URL(this.data._links["fx:shipments"].href),i=new URL(null!==(e=null===(t=this.__storeLoader)||void 0===t?void 0:t.data._links["fx:webhooks"].href)&&void 0!==e?e:""),r=new URL(this.data._links["fx:items"].href);o.searchParams.set("zoom","items:item_category"),i.searchParams.set("event_resource","transaction"),r.searchParams.set("zoom","item_options"),y=o.toString(),v=i.toString(),x=r.toString()}catch(t){}return r(T||(T=Z` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <div class="grid gap-m sm-grid-cols-2" ?hidden="${0}"> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> </div> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-transaction-post-action-control infer="process-webhook" href="${0}"> </foxy-internal-transaction-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(i=null===(o=this.data)||void 0===o?void 0:o.status)&&void 0!==i?i:"")?r(U||(U=Z` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(s=this.data)||void 0===s?void 0:s.status):"",b.matches("items",!0)&&b.matches("summary",!0),d(x),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(a=null===(n=this.__storeLoader)||void 0===n?void 0:n.data)||void 0===a?void 0:a._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href},d(null===(c=this.data)||void 0===c?void 0:c._links["fx:billing_addresses"].href),d(null===(u=this.data)||void 0===u?void 0:u._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},b.matches("custom-fields",!0)&&b.matches("attributes",!0),d(null===(f=this.data)||void 0===f?void 0:f._links["fx:custom_fields"].href),d(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),d(y),d(v),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},d(null===(h=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===h?void 0:h.href),d(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",O);export{O as Transaction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-471e77dd.js";import"./shared-6d11abd7.js";import"./shared-
|
|
1
|
+
import"./shared-471e77dd.js";import"./shared-6d11abd7.js";import"./shared-cc8b47c6.js";import"./shared-01f18104.js";import{I as r}from"./shared-97514fcb.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{_ as e,B as t}from"./shared-0f6e4584.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-25502f01.js";import{i}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-fb1602a2.js";import"./shared-98ddb87c.js";import"./shared-2bd96ec7.js";import"./shared-61ade33e.js";import"./shared-77e15843.js";import"./shared-887e1795.js";import"./shared-226dd830.js";import"./shared-51c4a6dd.js";import"./shared-49ecea83.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-4e709717.js";import"./shared-3cf043a7.js";import"./shared-9bf7d9a7.js";import"./shared-9b895561.js";import"./shared-e7232c2b.js";import"./shared-9637a2de.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-59b7fcc0.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-09fc6fa0.js";import"./shared-c11df800.js";import"./foxy-pagination.js";import"./shared-4a652d60.js";import"./shared-ff7b2af6.js";import"./shared-19f46691.js";import"./shared-0f00d4d8.js";import"./shared-22ba9566.js";import"./foxy-copy-to-clipboard.js";import"./shared-1729e19a.js";import"./shared-6be24929.js";import"./shared-c4124870.js";import"./shared-df42c94f.js";let n,d,c=r=>r;class p extends(s(r,"webhook-form")){constructor(){super(...arguments),this.resourceUri=null,this.__encryptionKeyGeneratorOptions={separator:"",length:512},this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"customer",label:"event_resource_customer"}]}static get properties(){return e(e({},super.properties),{},{resourceUri:{attribute:"resource-uri"}})}static get v8n(){return[({name:r})=>!!r||"name:v8n_required",({name:r})=>!!r&&r.length<=255||"name:v8n_too_long",({url:r})=>!r||r.length<=1e3||"url:v8n_too_long",({query:r})=>!r||r.length<=1e3||"query:v8n_too_long",({encryption_key:r})=>!!r||"encryption-key:v8n_required",({encryption_key:r})=>!r||r.length<=1e3||"encryption-key:v8n_too_long"]}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.data&&r.unshift("event-resource"),new t(r.join(" ").trim())}get headerSubtitleOptions(){var r,e;const t=null===(r=this.data)||void 0===r?void 0:r.format;return{context:"json"===t?null===(e=this.data)||void 0===e?void 0:e.event_resource:t}}edit(r){super.edit(r),this.form.format||super.edit({format:"json"}),this.form.version||super.edit({version:2})}renderBody(){var r,e,t,s;const p=this.resourceUri?o(this.resourceUri):null;let l,h;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:statuses"].href)&&void 0!==e?e:"");null!==p&&t.searchParams.set("resource_id",String(p)),t.searchParams.set("order","date_created desc"),l=t.toString()}catch(r){l=void 0}try{const r=new URL(null!==(s=null===(t=this.data)||void 0===t?void 0:t._links["fx:logs"].href)&&void 0!==s?s:"");null!==p&&r.searchParams.set("resource_id",String(p)),r.searchParams.set("order","date_created desc"),h=r.toString()}catch(r){h=void 0}return a(n||(n=c` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="event-resource" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="query"></foxy-internal-text-control> <foxy-internal-text-control infer="url"></foxy-internal-text-control> <foxy-internal-password-control infer="encryption-key" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} ${0} `),this.renderHeader(),this.__eventResources,this.__encryptionKeyGeneratorOptions,this.data?a(d||(d=c` <foxy-internal-async-list-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" infer="logs" limit="10" item="foxy-webhook-log-card"> </foxy-internal-async-list-control> `),i(l),i(h)):"",super.renderBody())}}customElements.define("foxy-webhook-form",p);export{p as WebhookForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-3cf043a7.js";import"./foxy-collection-page.js";import"./foxy-nucleon-element.js";import"./foxy-pagination.js";import"./shared-49ecea83.js";import{I as e}from"./shared-226dd830.js";import{m as t,_ as i}from"./shared-0f6e4584.js";import{N as s}from"./shared-24d71d01.js";import{i as r}from"./shared-9803aa7c.js";import{c as n}from"./shared-4e709717.js";import{h as o,c as a}from"./shared-dc73b9a5.js";let l,d,h,c,u,f=e=>e;customElements.define("foxy-internal-async-resource-link-list-control",class extends e{constructor(){super(...arguments),this.foreignKeyForUri=null,this.foreignKeyForId=null,this.ownKeyForUri=null,this.optionsHref=null,this.linksHref=null,this.embedKey=null,this.ownUri=null,this.limit=20,this.item=null,this.__getItemRenderer=t(((e,t)=>new Function("ctx",`return ctx.html\`\n <${null!=e?e:"foxy-null"}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n infer=""\n ${t?".data=${ctx.data}":"href=${ctx.href}"}\n ...=\${ctx.spread(ctx.props)}\n >\n </${null!=e?e:"foxy-null"}>\``)),((...e)=>e.join())),this.__renderItem=e=>{var t;const i=this.__getItemRenderer(this.item,!!e.data),s=e=>o(l||(l=f` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)">${0}</div> `),e);if(!e.href||e.href.startsWith("foxy://"))return s(i(e));if(this.readonly)return s(i(e));const r=this.foreignKeyForUri,n=r?null===(t=this.__allLinks)||void 0===t?void 0:t.find((t=>t[r]===e.href)):void 0,a=this.disabled||!this.__allLinks||this.__isFetching;return s(o(d||(d=f` <vaadin-checkbox class="block" ?disabled="${0}" ?checked="${0}" @change="${0}"> <div class="transition-opacity ${0}"> ${0} </div> </vaadin-checkbox> `),a,!!n,(t=>{var i,s,r;t.currentTarget.checked?this.__insertLink(null!==(s=null===(i=e.data)||void 0===i?void 0:i._links.self.href)&&void 0!==s?s:""):this.__deleteLink(null!==(r=null==n?void 0:n._links.self.href)&&void 0!==r?r:"")}),a?"opacity-50":"opacity-100",i(e)))},this.__isFetching=!1}static get properties(){return i(i({},super.properties),{},{foreignKeyForUri:{attribute:"foreign-key-for-uri"},foreignKeyForId:{attribute:"foreign-key-for-id"},ownKeyForUri:{attribute:"own-key-for-uri"},optionsHref:{attribute:"options-href"},linksHref:{attribute:"links-href"},embedKey:{attribute:"embed-key"},ownUri:{attribute:"own-uri"},limit:{type:Number},item:{},__isFetching:{attribute:!1}})}static get styles(){return[super.styles,a(h||(h=f`vaadin-checkbox::part(label){margin:0 0 0 calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);align-self:center}`))]}renderControl(){var e;let t;try{const i=new URL(null!==(e=this.optionsHref)&&void 0!==e?e:"");i.searchParams.set("limit",this.limit.toString()),t=i.toString()}catch(e){t=void 0}const i=this.__isFetching||!this.__allLinks;return o(c||(c=f` <div class="group"> <div class="${0}"> <span>${0}</span> <foxy-i18n class="transition-opacity ${0}" infer="" key="${0}"> </foxy-i18n> </div> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page infer="card" class="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> <div class="${0}" ?hidden="${0}"> ${0} </div> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> ${0} </div> `),n({"flex justify-between transition-colors mb-xs font-medium text-s":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled}),this.label,i?"opacity-100":"opacity-0",this.__isFetching?"status_saving":"status_loading",r(t),n({"block transition-colors divide-y rounded overflow-hidden":!0,"divide-contrast-10 ring-1 ring-inset ring-contrast-10":!0}),this.__renderItem,n({"transition-colors mt-xs text-xs":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled}),!this.helperText,this.helperText,!this._errorMessage||this.disabled||this.readonly,this._errorMessage,this.__renderLinkResourceLoaders())}updated(e){var t,i;super.updated(e),e.has("item")&&(null===(i=(t=this.__getItemRenderer.cache).clear)||void 0===i||i.call(t))}async __insertLink(e){var t,i,r,n,o,a;this.__isFetching=!0;const l=new s.API(this),d=await l.fetch(null!==(t=this.linksHref)&&void 0!==t?t:"",{method:"POST",body:JSON.stringify({[null!==(i=this.foreignKeyForUri)&&void 0!==i?i:""]:e,[null!==(r=this.ownKeyForUri)&&void 0!==r?r:""]:this.ownUri})});if(d.ok){const e=await d.json(),t=await l.fetch(e._links.self.href);if(t.ok){const i=s.Rumour(null!==(o=null===(n=this.nucleon)||void 0===n?void 0:n.group)&&void 0!==o?o:""),r=await t.json();i.share({related:[null!==(a=this.linksHref)&&void 0!==a?a:""],source:e._links.self.href,data:r})}}this.__isFetching=!1}async __deleteLink(e){var t,i,r;this.__isFetching=!0;const n=new s.API(this);if((await n.fetch(e,{method:"DELETE"})).ok){s.Rumour(null!==(i=null===(t=this.nucleon)||void 0===t?void 0:t.group)&&void 0!==i?i:"").share({related:[null!==(r=this.linksHref)&&void 0!==r?r:""],source:e,data:null})}this.__isFetching=!1}__renderLinkResourceLoaders(){var e,t,i;const s=200,r=this.renderRoot.querySelector("[data-link-page]"),n=Number(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.total_items)&&void 0!==t?t:s),a=[];try{for(let e=0;e<Math.max(1,Math.ceil(n/s));e++){const t=new URL(null!==(i=this.linksHref)&&void 0!==i?i:"");t.searchParams.set("offset",String(e*s)),t.searchParams.set("limit",String(s)),a.push(t.toString())}}catch(e){}return a.map((e=>o(u||(u=f` <foxy-nucleon class="hidden" data-link-page infer="" href="${0}" @update="${0}"> </foxy-nucleon> `),e,(()=>this.requestUpdate()))))}get __allLinks(){var e,t;const i=this.embedKey;if(!i)return null;const s=this.renderRoot.querySelectorAll("[data-link-page]"),r=[];for(const n of s){const s=null===(t=null===(e=n.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t[i];if(!s)return null;r.push(...s)}return r}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-4a652d60.js";import"./shared-19f46691.js";import{I as e}from"./shared-226dd830.js";import{w as t}from"./shared-25502f01.js";import{c as r,h as a,s as o}from"./shared-dc73b9a5.js";import{_ as l}from"./shared-0f6e4584.js";import{i as s}from"./shared-9803aa7c.js";import{c as i}from"./shared-4e709717.js";let n;t("vaadin-password-field",r(n||(n=(e=>e)`:host([theme~=summary-item])::before{display:none}:host([theme~=summary-item]) .vaadin-text-field-container{display:grid;grid-template-columns:auto 1fr;grid-template-rows:repeat(3,min-content);gap:0 var(--lumo-space-m)}:host([theme~=summary-item]) [part=label]{font:normal var(--lumo-font-size-m) var(--lumo-font-family);color:var(--lumo-body-text-color)!important;grid-row:1;-webkit-text-fill-color:var(--lumo-body-text-color)!important}:host([theme~=summary-item]) [part=helper-text]{font:normal var(--lumo-font-size-s) var(--lumo-font-family);color:var(--lumo-secondary-text-color)!important;grid-row:2}:host([theme~=summary-item]) [part=helper-text]::before{display:none}:host([theme~=summary-item]) [part=error-message]{font:normal var(--lumo-font-size-s) var(--lumo-font-family);color:var(--lumo-error-text-color);grid-row:3}:host([theme~=summary-item]) [part=error-message],:host([theme~=summary-item]) [part=helper-text],:host([theme~=summary-item]) [part=label]{line-height:var(--lumo-line-height-xs);grid-column:1;padding:0}:host([theme~=summary-item]) [part=input-field]{grid-column:2;grid-row:1;padding:0;background:0 0;align-self:start;height:1em;--lumo-icon-size-m:1rem}:host([theme~=summary-item]) [part=input-field]::after,:host([theme~=summary-item][readonly]) [part=input-field] slot[name=suffix]{display:none}:host([theme~=summary-item]) [part=value]{line-height:var(--lumo-line-height-xs);text-align:right;min-height:auto;padding:0;margin-right:var(--lumo-space-xs);-webkit-mask-image:none}:host([theme~=summary-item][readonly]) [part=value]{margin-right:0}`)));let m,h,d,u=e=>e;customElements.define("foxy-internal-password-control",class extends e{constructor(){super(...arguments),this.generatorOptions=null,this.showGenerator=!1,this.layout=null}static get properties(){return l(l({},super.properties),{},{generatorOptions:{type:Object,attribute:"generator-options"},showGenerator:{type:Boolean,attribute:"show-generator"},layout:{}})}renderControl(){var e;return a(m||(m=u` <vaadin-password-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" theme="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} </vaadin-password-field> `),s(this._errorMessage),this.helperText,this.placeholder,this.label,s(null!==(e=this.layout)&&void 0!==e?e:void 0),this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.showGenerator?this.__renderGenerator():"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderGenerator(){return a(h||(h=u` <div data-testid="generator" class="${0}" slot="suffix" @click="${0}"> ${0} </div> `),i({"w-s h-s flex items-center justify-center cursor-default transition-colors":!0,"text-contrast-60 hover-text-contrast-80":!this.disabled&&!this.readonly,"text-contrast-20":this.disabled||this.readonly}),(()=>{var e;this._value=function(e){var t,r,a;const o=null!==(t=null==e?void 0:e.separator)&&void 0!==t?t:"-",l=null!==(r=null==e?void 0:e.charset)&&void 0!==r?r:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=null!==(a=null==e?void 0:e.length)&&void 0!==a?a:18;let i="";for(let e=0;e<s;e++)o&&e>0&&e%6==0&&(i+=o),i+=l[Math.floor(Math.random()*l.length)];return i}(null!==(e=this.generatorOptions)&&void 0!==e?e:void 0);const t=this.renderRoot.querySelector("vaadin-password-field");null==t||t._setPasswordVisible(!0)}),o(d||(d=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.15em; height: 1.15em"><path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" /></svg>`)))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./shared-226dd830.js";import"./shared-49ecea83.js";import{c as s,h as r}from"./shared-dc73b9a5.js";let t,d,o=e=>e;customElements.define("foxy-internal-summary-control",class extends e{static get styles(){return[...super.styles,s(t||(t=o`::slotted(*){background-color:var(--lumo-base-color);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)}`))]}renderLightDom(){}renderControl(){return r(d||(d=o` <p class="mb-xs font-medium text-secondary text-s" ?hidden="${0}">${0}</p> <div class="rounded overflow-hidden border border-transparent grid bg-contrast-10" style="gap:1px"> <slot></slot> </div> <p class="mt-xs text-xs text-secondary" ?hidden="${0}">${0}</p> `),!this.label,this.label,!this.helperText,this.helperText)}});
|