@foxy.io/elements 1.40.0 → 1.41.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.
Files changed (86) hide show
  1. package/dist/cdn/foxy-address-form.js +1 -1
  2. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  3. package/dist/cdn/foxy-api-browser.js +1 -1
  4. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  5. package/dist/cdn/foxy-attribute-form.js +1 -1
  6. package/dist/cdn/foxy-cart-form.js +2 -2
  7. package/dist/cdn/foxy-client-form.js +1 -1
  8. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  10. package/dist/cdn/foxy-coupon-form.js +1 -1
  11. package/dist/cdn/foxy-custom-field-form.js +1 -1
  12. package/dist/cdn/foxy-customer-form.js +1 -1
  13. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  14. package/dist/cdn/foxy-customer-portal.js +1 -1
  15. package/dist/cdn/foxy-customer.js +1 -1
  16. package/dist/cdn/foxy-downloadable-form.js +1 -1
  17. package/dist/cdn/foxy-email-template-form.js +1 -1
  18. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  19. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  20. package/dist/cdn/foxy-form-dialog.js +1 -1
  21. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  22. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  23. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  24. package/dist/cdn/foxy-gift-card-form.js +1 -1
  25. package/dist/cdn/foxy-integration-form.js +1 -1
  26. package/dist/cdn/foxy-item-category-form.js +1 -1
  27. package/dist/cdn/foxy-item-form.js +1 -1
  28. package/dist/cdn/foxy-item-option-form.js +1 -1
  29. package/dist/cdn/foxy-native-integration-form.js +1 -1
  30. package/dist/cdn/foxy-passkey-form.js +1 -1
  31. package/dist/cdn/foxy-payment-method-card.js +1 -1
  32. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  33. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  34. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  35. package/dist/cdn/foxy-report-form.js +1 -1
  36. package/dist/cdn/foxy-store-form.js +1 -1
  37. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  38. package/dist/cdn/foxy-subscription-form.js +1 -1
  39. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  40. package/dist/cdn/foxy-tax-form.js +1 -1
  41. package/dist/cdn/foxy-template-config-form.js +1 -1
  42. package/dist/cdn/foxy-template-form.js +1 -1
  43. package/dist/cdn/foxy-template-set-form.js +1 -1
  44. package/dist/cdn/foxy-transaction.js +1 -1
  45. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  46. package/dist/cdn/foxy-user-form.js +1 -1
  47. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  48. package/dist/cdn/foxy-users-table.js +1 -1
  49. package/dist/cdn/foxy-webhook-form.js +1 -1
  50. package/dist/cdn/{shared-5b4e2567.js → shared-109ec474.js} +1 -1
  51. package/dist/cdn/shared-1100bca8.js +1 -0
  52. package/dist/cdn/{shared-eef73355.js → shared-18e3b778.js} +1 -1
  53. package/dist/cdn/{shared-9e8ed3af.js → shared-35a49192.js} +1 -1
  54. package/dist/cdn/{shared-00e02b35.js → shared-43637d69.js} +1 -1
  55. package/dist/cdn/{shared-cc7e1dc6.js → shared-47d95cdd.js} +1 -1
  56. package/dist/cdn/{shared-17f2f27a.js → shared-57a179b3.js} +1 -1
  57. package/dist/cdn/{shared-3a952968.js → shared-6199cae2.js} +1 -1
  58. package/dist/cdn/{shared-5cd33249.js → shared-63eef674.js} +1 -1
  59. package/dist/cdn/{shared-e4119ddc.js → shared-67f73b81.js} +1 -1
  60. package/dist/cdn/{shared-c73c69bf.js → shared-697d44e6.js} +1 -1
  61. package/dist/cdn/{shared-0c2879b9.js → shared-6be00444.js} +1 -1
  62. package/dist/cdn/{shared-0098edce.js → shared-7097e2e1.js} +1 -1
  63. package/dist/cdn/{shared-e21ddeae.js → shared-77132fe8.js} +1 -1
  64. package/dist/cdn/{shared-653368ea.js → shared-864ff856.js} +1 -1
  65. package/dist/cdn/{shared-33ecc7ee.js → shared-86e9c57a.js} +1 -1
  66. package/dist/cdn/{shared-e0da7113.js → shared-88220d9e.js} +1 -1
  67. package/dist/cdn/{shared-4a4f6eb9.js → shared-888018de.js} +1 -1
  68. package/dist/cdn/{shared-4a32f76a.js → shared-9a64bf35.js} +1 -1
  69. package/dist/cdn/{shared-511fcf8e.js → shared-e41fced3.js} +1 -1
  70. package/dist/cdn/translations/admin-subscription-form/en.json +16 -0
  71. package/dist/elements/internal/InternalConfirmDialog/InternalConfirmDialog.d.ts +1 -0
  72. package/dist/elements/internal/InternalConfirmDialog/InternalConfirmDialog.js +3 -0
  73. package/dist/elements/internal/InternalConfirmDialog/InternalConfirmDialog.js.map +1 -1
  74. package/dist/elements/internal/InternalPostActionControl/InternalPostActionControl.d.ts +13 -0
  75. package/dist/elements/internal/InternalPostActionControl/InternalPostActionControl.js +98 -0
  76. package/dist/elements/internal/InternalPostActionControl/InternalPostActionControl.js.map +1 -0
  77. package/dist/elements/internal/InternalPostActionControl/index.d.ts +7 -0
  78. package/dist/elements/internal/InternalPostActionControl/index.js +9 -0
  79. package/dist/elements/internal/InternalPostActionControl/index.js.map +1 -0
  80. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +21 -4
  81. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -1
  82. package/dist/elements/public/AdminSubscriptionForm/index.d.ts +1 -0
  83. package/dist/elements/public/AdminSubscriptionForm/index.js +1 -0
  84. package/dist/elements/public/AdminSubscriptionForm/index.js.map +1 -1
  85. package/package.json +1 -1
  86. package/dist/cdn/shared-e5546d55.js +0 -1
@@ -1 +1 @@
1
- import"./shared-8ef0ca65.js";import"./shared-4a4f6eb9.js";import"./shared-511fcf8e.js";import"./shared-00e02b35.js";import"./shared-5cd33249.js";import"./shared-4a32f76a.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as t,B as r,l as o}from"./shared-cb58dfcd.js";import{g as i}from"./shared-bab2ea2c.js";import{a}from"./shared-11351c00.js";import{i as s}from"./shared-53e42a77.js";import{h as l,s as n}from"./shared-ba5c42c7.js";import{c as d}from"./shared-4e709717.js";import{h as c}from"./shared-ef4ad461.js";import{s as h}from"./shared-0aedd809.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-be442f26.js";import"./shared-d807cb20.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";let u,p,m,f,_,v,y,g,x,$,b,j,w,L,S,k,P,V,M,I,B,C,q,Z,H,D,O,R,T=e=>e;const W=a(e,"payments-api-payment-method-form");class z extends W{constructor(){super(...arguments),this.paymentPreset=null,this.getImageSrc=null,this.store=null,this.__availablePaymentMethodsLoaderId="availablePaymentMethodsLoader",this.__paymentPresetLoaderId="paymentPresetLoader",this.__storeLoaderId="storeLoader",this.__threeDSecureResponseGetValue=()=>{var e;return null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response")},this.__threeDSecureResponseSetValue=e=>{const t=e?"_require_valid_response":"",r=this.form.config_3d_secure,o=(null==r?void 0:r.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${o}${t}`})},this.__threeDSecureToggleGetValue=()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"},this.__threeDSecureToggleSetValue=e=>{var t;let r="";"all_cards"!==e&&"maestro_only"!==e||(r=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:r})},this.__threeDSecureToggleOptions=[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}]}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{paymentPreset:{attribute:"payment-preset"},getImageSrc:{attribute:!1},store:{}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,r,o,i;const a=null!==(o=null===(r=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===r?void 0:r.blocks)&&void 0!==o?o:[];let s;try{s=JSON.parse(null!==(i=e.additional_fields)&&void 0!==i?i:"{}")}catch(e){s={}}for(const e of a)for(const t of e.fields)if("optional"in t&&!t.optional&&!c(s,t.id)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid";return!0}]}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderHeader(...e){var t;return l(u||(u=T` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?l(p||(p=T``)):l(m||(m=T` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}get headerTitleOptions(){var e;return{context:this.form.type?"selected":"new",name:null===(e=this.form.helper)||void 0===e?void 0:e.name}}get headerSubtitleOptions(){if(this.href){const e=i(this.href),t=this.headerCopyIdValue;return e.startsWith("R")?{context:"regular",id:t}:{context:"hosted",id:t}}return{}}get headerCopyIdValue(){if(this.href){const e=i(this.href);return e.startsWith("R")?e.slice(1):e.slice(1).split("C")[0]}return""}renderBody(){var e;const t=null===(e=this.__paymentPresetLoader)||void 0===e?void 0:e.data,r=l(f||(f=T` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),s(null==t?void 0:t._links["fx:available_payment_methods"].href),this.__availablePaymentMethodsLoaderId,(()=>this.requestUpdate()),s(this.store),this.__storeLoaderId,(()=>this.requestUpdate()),s(this.paymentPreset),this.__paymentPresetLoaderId,(()=>this.requestUpdate()));return l(_||(_=T`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderPaymentMethodConfig():this.__renderPaymentMethodSelector(),r)}get __groupedAvailablePaymentMethods(){var e;return Object.entries(null!==(e=this.__availablePaymentMethods)&&void 0!==e?e:{}).sort(((e,t)=>e[0].localeCompare(t[0],"en"))).reduce(((e,[t,r])=>{if(r.is_deprecated)return e;const o=t.charAt(0).toUpperCase(),i=!/\w/.test(o)?"#":o,a=e.find((e=>e.name===i));return a?a.items.push({type:t,helper:r}):e.push({name:i,items:[{type:t,helper:r}]}),e}),[])}get __availablePaymentMethodsLoader(){return this.renderRoot.querySelector(`#${this.__availablePaymentMethodsLoaderId}`)}get __availablePaymentMethods(){var e,t;return null===(t=null===(e=this.__availablePaymentMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}get __paymentPresetLoader(){return this.renderRoot.querySelector(`#${this.__paymentPresetLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __liveBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==r?r:[]}get __testBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==r?r:[]}__renderPaymentMethodSelector(){const e=this.__availablePaymentMethodsLoader;return(null==e?void 0:e.data)?l(y||(y=T` <div> <section data-testid="select-method-list" class="-mt-m"> ${0} </section> </div> `),this.__groupedAvailablePaymentMethods.map((({name:e,items:t})=>l(g||(g=T` <p class="font-medium text-tertiary py-m">${0}</p> <ul class="grid grid-cols-2 gap-m"> ${0} </ul> `),e,t.map((e=>l(x||(x=T`<li>${0}</li>`),this.__renderPaymentMethodButton(e)))))))):l(v||(v=T` <foxy-spinner infer="list-spinner" state="${0}"> </foxy-spinner> `),(null==e?void 0:e.in("fail"))?"error":"busy")}__renderPaymentMethodConfig(){var e,t;return this.form.type&&["stripe_connect","square_up","quickbook_payments","amazon_mws","paypal_platform"].includes(this.form.type)?l($||($=T` <div class="flex items-start rounded border border-primary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="no_oauth_support_message"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> admin.foxycart.com </a> </p> </div> `),n(b||(b=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`))):l(j||(j=T` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> ${0} ${0} </foxy-internal-summary-control> ${0} ${0} `),(null===(e=this.form.helper)||void 0===e?void 0:e.supports_auth_only)?l(w||(w=T` <foxy-internal-switch-control infer="use-auth-only" helper-text-as-tooltip> </foxy-internal-switch-control> `)):"",(null===(t=this.form.helper)||void 0===t?void 0:t.supports_3d_secure)?l(L||(L=T` <foxy-internal-select-control layout="summary-item" infer="three-d-secure-toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> ${0} `),this.__threeDSecureToggleGetValue,this.__threeDSecureToggleSetValue,this.__threeDSecureToggleOptions,this.form.config_3d_secure?l(S||(S=T` <foxy-internal-switch-control layout="summary-item" infer="three-d-secure-response" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),this.__threeDSecureResponseGetValue,this.__threeDSecureResponseSetValue):""):"",["live","test"].map(((e,t)=>{var r,o,i,a,d,c,h,u,p,m,f,_;const v=0===t?"":`${e}-`,y=0===t?this.__liveBlocks:this.__testBlocks,g=`${e}-group`;if("live"===e&&!(null===(r=this.__storeLoader)||void 0===r?void 0:r.data))return l(k||(k=T``));if("live"===e&&!(null===(i=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===i?void 0:i.is_active))return l(P||(P=T` <foxy-internal-summary-control infer="${0}-group"> <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p><foxy-i18n infer="" key="inactive_message"></foxy-i18n></p> </div> </foxy-internal-summary-control> `),e,n(V||(V=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)));const x=!0===(null===(d=null===(a=this.__storeLoader)||void 0===a?void 0:a.data)||void 0===d?void 0:d.is_active)&&("test"===e&&!0===(null===(h=null===(c=this.__paymentPresetLoader)||void 0===c?void 0:c.data)||void 0===h?void 0:h.is_live)||"live"===e&&!1===(null===(p=null===(u=this.__paymentPresetLoader)||void 0===u?void 0:u.data)||void 0===p?void 0:p.is_live));return l(M||(M=T` <foxy-internal-summary-control helper-text="${0}" label="${0}" infer="${0}"> ${0} ${0} ${0} ${0} </foxy-internal-summary-control> `),s(x?this.t(`${g}.helper_text_inactive`):void 0),s(x?this.t(`${g}.label_inactive`):void 0),g,(null===(m=this.form.helper)||void 0===m?void 0:m.id_description)?l(I||(I=T` <foxy-internal-text-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description,v):"",(null===(f=this.form.helper)||void 0===f?void 0:f.third_party_key_description)?l(B||(B=T` <foxy-internal-password-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}third-party-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description,v):"",(null===(_=this.form.helper)||void 0===_?void 0:_.key_description)?l(C||(C=T` <foxy-internal-password-control placeholder="${0}" layout="summary-item" helper-text="" label="${0}" infer="${0}account-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description,v):"",y.map((e=>this.__renderBlock(e))))})),super.renderBody())}__renderPaymentMethodButton({type:e,helper:t}){var r,o;const i=z.defaultImageSrc,a=null!==(o=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==o?o:i,s=e=>e.currentTarget.src=i;return l(q||(q=T` <button class="${0}" ?disabled="${0}" title="${0}" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" ?hidden="${0}" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="${0}" src="${0}" alt="" @error="${0}"> <figcaption class="${0}"> <div class="font-medium">${0}&ZeroWidthSpace;</div> <div class="text-xs ${0}">${0}</div> </figcaption> </figure> </button> `),d({"relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,t.conflict?this.t("conflict_message",t.conflict):"",(()=>this.edit({type:e,helper:t})),a,!!t.conflict,s,d({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),a,s,d({"min-w-0 flex-1 truncate leading-s":!0,"text-disabled":!!t.conflict}),t.name,t.conflict?"":"text-secondary",e)}__renderBlock(e){return l(Z||(Z=T`${0}`),e.fields.map((e=>{var t,r,i;if("hidden"===e.type)return;const a=["additional-fields",e.id].join("-").replace(/_/g,"-"),s=()=>{var t,r;try{const i=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"{}");return null!==(r=o(i,e.id))&&void 0!==r?r:i.default_value}catch(t){return e.default_value}},n=t=>{var r;let o={};try{o=JSON.parse(null!==(r=this.form.additional_fields)&&void 0!==r?r:"")}catch(e){}this.edit({additional_fields:JSON.stringify(h(o,e.id,t))})},d=e.options;return l(H||(H=T` ${0} `),"checkbox"===e.type?l(D||(D=T` <foxy-internal-switch-control helper-text="${0}" label="${0}" infer="${0}" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),null!==(t=e.description)&&void 0!==t?t:"",e.name,a,s,n):"select"===e.type?l(O||(O=T` <foxy-internal-select-control placeholder="${0}" helper-text="${0}" layout="summary-item" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),this.t("default_additional_field_select_placeholder"),null!==(r=e.description)&&void 0!==r?r:"",e.name,a,d.map((({name:e,value:t})=>({label:e,value:t}))),s,n):l(R||(R=T` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(i=e.description)&&void 0!==i?i:"",e.default_value||this.t("default_additional_field_placeholder"),e.name,a,s,n))})))}}customElements.define("foxy-payments-api-payment-method-form",z);export{z as PaymentsApiPaymentMethodForm};
1
+ import"./shared-8ef0ca65.js";import"./shared-888018de.js";import"./shared-e41fced3.js";import"./shared-43637d69.js";import"./shared-63eef674.js";import"./shared-9a64bf35.js";import{I as e}from"./shared-109ec474.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as t,B as r,l as o}from"./shared-cb58dfcd.js";import{g as i}from"./shared-bab2ea2c.js";import{a}from"./shared-11351c00.js";import{i as s}from"./shared-53e42a77.js";import{h as l,s as n}from"./shared-ba5c42c7.js";import{c as d}from"./shared-4e709717.js";import{h as c}from"./shared-ef4ad461.js";import{s as h}from"./shared-0aedd809.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8b25a098.js";import"./shared-8b0f00fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-be442f26.js";import"./shared-d807cb20.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-5ef40e86.js";import"./shared-1100bca8.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";let u,p,m,f,_,v,y,g,x,$,b,j,w,L,S,k,P,V,M,I,B,C,q,Z,H,D,O,R,T=e=>e;const W=a(e,"payments-api-payment-method-form");class z extends W{constructor(){super(...arguments),this.paymentPreset=null,this.getImageSrc=null,this.store=null,this.__availablePaymentMethodsLoaderId="availablePaymentMethodsLoader",this.__paymentPresetLoaderId="paymentPresetLoader",this.__storeLoaderId="storeLoader",this.__threeDSecureResponseGetValue=()=>{var e;return null===(e=this.form.config_3d_secure)||void 0===e?void 0:e.endsWith("require_valid_response")},this.__threeDSecureResponseSetValue=e=>{const t=e?"_require_valid_response":"",r=this.form.config_3d_secure,o=(null==r?void 0:r.startsWith("all_cards"))?"all_cards":"maestro_only";this.edit({config_3d_secure:`${o}${t}`})},this.__threeDSecureToggleGetValue=()=>{const e=this.form.config_3d_secure;return(null==e?void 0:e.startsWith("all_cards"))?"all_cards":(null==e?void 0:e.startsWith("maestro_only"))?"maestro_only":"off"},this.__threeDSecureToggleSetValue=e=>{var t;let r="";"all_cards"!==e&&"maestro_only"!==e||(r=(null===(t=this.form.config_3d_secure)||void 0===t?void 0:t.endsWith("require_valid_response"))?`${e}_require_valid_response`:e),this.edit({config_3d_secure:r})},this.__threeDSecureToggleOptions=[{value:"off",label:"option_off"},{value:"all_cards",label:"option_all_cards"},{value:"maestro_only",label:"option_maestro_only"}]}static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 44 44'%3E%3Cpath fill='%23fff' d='m29.3 14 14-14H32.1l-14 14h11.2Zm2.7 9.9 12-12V.7L30.62 14.1A2 2 0 0 1 32 16v7.9ZM13.31 44h11.18L44 24.5V13.3l-12 12V28a2 2 0 0 1-2 2h-2.69l-14 14Zm-1.41 0H.7l14-14h11.2l-14 14Zm14 0h11.2l6.9-6.9V25.9L25.9 44Zm12.6 0H44v-5.5L38.5 44Z'/%3E%3Cpath fill='%23fff' d='M30 28H14v-6h16v6Zm0-10v-2H14v2h16ZM0 43.3l13.4-13.4A2 2 0 0 1 12 28v-7.9L0 32.12V43.3Z'/%3E%3Cpath fill='%23fff' d='M16.7 14H14c-1.11 0-1.99.89-1.99 2v2.7L0 30.7V19.52L19.52 0H30.7l-14 14Zm1.4-14H6.92L0 6.92V18.1L18.1 0ZM5.5 0H0v5.5L5.5 0Z'/%3E%3C/svg%3E"}static get properties(){return t(t({},super.properties),{},{paymentPreset:{attribute:"payment-preset"},getImageSrc:{attribute:!1},store:{}})}static get v8n(){return[({description:e})=>!e||e.length<=100||"description:v8n_too_long",({type:e})=>!!e||"type:v8n_required",e=>{var t,r,o,i;const a=null!==(o=null===(r=null===(t=e.helper)||void 0===t?void 0:t.additional_fields)||void 0===r?void 0:r.blocks)&&void 0!==o?o:[];let s;try{s=JSON.parse(null!==(i=e.additional_fields)&&void 0!==i?i:"{}")}catch(e){s={}}for(const e of a)for(const t of e.fields)if("optional"in t&&!t.optional&&!c(s,t.id)&&"checkbox"!==t.type)return"additional-fields:v8n_invalid";return!0}]}get hiddenSelector(){return new r(`header:copy-json ${super.hiddenSelector}`.trimEnd())}renderHeader(...e){var t;return l(u||(u=T` <div> ${0} ${0} </div> `),super.renderHeader(...e),(null===(t=this.data)||void 0===t?void 0:t.type)||!this.form.type?l(p||(p=T``)):l(m||(m=T` <vaadin-button data-testid="select-another-button" theme="tertiary-inline" @click="${0}"> <foxy-i18n infer="" key="select_another_button_label"></foxy-i18n> </vaadin-button> `),(()=>this.undo())))}get headerTitleOptions(){var e;return{context:this.form.type?"selected":"new",name:null===(e=this.form.helper)||void 0===e?void 0:e.name}}get headerSubtitleOptions(){if(this.href){const e=i(this.href),t=this.headerCopyIdValue;return e.startsWith("R")?{context:"regular",id:t}:{context:"hosted",id:t}}return{}}get headerCopyIdValue(){if(this.href){const e=i(this.href);return e.startsWith("R")?e.slice(1):e.slice(1).split("C")[0]}return""}renderBody(){var e;const t=null===(e=this.__paymentPresetLoader)||void 0===e?void 0:e.data,r=l(f||(f=T` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),s(null==t?void 0:t._links["fx:available_payment_methods"].href),this.__availablePaymentMethodsLoaderId,(()=>this.requestUpdate()),s(this.store),this.__storeLoaderId,(()=>this.requestUpdate()),s(this.paymentPreset),this.__paymentPresetLoaderId,(()=>this.requestUpdate()));return l(_||(_=T`${0}${0}${0}`),this.renderHeader(),this.form.type?this.__renderPaymentMethodConfig():this.__renderPaymentMethodSelector(),r)}get __groupedAvailablePaymentMethods(){var e;return Object.entries(null!==(e=this.__availablePaymentMethods)&&void 0!==e?e:{}).sort(((e,t)=>e[0].localeCompare(t[0],"en"))).reduce(((e,[t,r])=>{if(r.is_deprecated)return e;const o=t.charAt(0).toUpperCase(),i=!/\w/.test(o)?"#":o,a=e.find((e=>e.name===i));return a?a.items.push({type:t,helper:r}):e.push({name:i,items:[{type:t,helper:r}]}),e}),[])}get __availablePaymentMethodsLoader(){return this.renderRoot.querySelector(`#${this.__availablePaymentMethodsLoaderId}`)}get __availablePaymentMethods(){var e,t;return null===(t=null===(e=this.__availablePaymentMethodsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values}get __paymentPresetLoader(){return this.renderRoot.querySelector(`#${this.__paymentPresetLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __liveBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>e.is_live)))&&void 0!==r?r:[]}get __testBlocks(){var e,t,r;return null!==(r=null===(t=null===(e=this.form.helper)||void 0===e?void 0:e.additional_fields)||void 0===t?void 0:t.blocks.filter((e=>!e.is_live)))&&void 0!==r?r:[]}__renderPaymentMethodSelector(){const e=this.__availablePaymentMethodsLoader;return(null==e?void 0:e.data)?l(y||(y=T` <div> <section data-testid="select-method-list" class="-mt-m"> ${0} </section> </div> `),this.__groupedAvailablePaymentMethods.map((({name:e,items:t})=>l(g||(g=T` <p class="font-medium text-tertiary py-m">${0}</p> <ul class="grid grid-cols-2 gap-m"> ${0} </ul> `),e,t.map((e=>l(x||(x=T`<li>${0}</li>`),this.__renderPaymentMethodButton(e)))))))):l(v||(v=T` <foxy-spinner infer="list-spinner" state="${0}"> </foxy-spinner> `),(null==e?void 0:e.in("fail"))?"error":"busy")}__renderPaymentMethodConfig(){var e,t;return this.form.type&&["stripe_connect","square_up","quickbook_payments","amazon_mws","paypal_platform"].includes(this.form.type)?l($||($=T` <div class="flex items-start rounded border border-primary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="no_oauth_support_message"></foxy-i18n> <br> <a target="_blank" class="mt-xs inline-block rounded font-medium text-primary transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> admin.foxycart.com </a> </p> </div> `),n(b||(b=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`))):l(j||(j=T` <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> ${0} ${0} </foxy-internal-summary-control> ${0} ${0} `),(null===(e=this.form.helper)||void 0===e?void 0:e.supports_auth_only)?l(w||(w=T` <foxy-internal-switch-control infer="use-auth-only" helper-text-as-tooltip> </foxy-internal-switch-control> `)):"",(null===(t=this.form.helper)||void 0===t?void 0:t.supports_3d_secure)?l(L||(L=T` <foxy-internal-select-control layout="summary-item" infer="three-d-secure-toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-select-control> ${0} `),this.__threeDSecureToggleGetValue,this.__threeDSecureToggleSetValue,this.__threeDSecureToggleOptions,this.form.config_3d_secure?l(S||(S=T` <foxy-internal-switch-control layout="summary-item" infer="three-d-secure-response" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),this.__threeDSecureResponseGetValue,this.__threeDSecureResponseSetValue):""):"",["live","test"].map(((e,t)=>{var r,o,i,a,d,c,h,u,p,m,f,_;const v=0===t?"":`${e}-`,y=0===t?this.__liveBlocks:this.__testBlocks,g=`${e}-group`;if("live"===e&&!(null===(r=this.__storeLoader)||void 0===r?void 0:r.data))return l(k||(k=T``));if("live"===e&&!(null===(i=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===i?void 0:i.is_active))return l(P||(P=T` <foxy-internal-summary-control infer="${0}-group"> <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p><foxy-i18n infer="" key="inactive_message"></foxy-i18n></p> </div> </foxy-internal-summary-control> `),e,n(V||(V=T`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-primary" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)));const x=!0===(null===(d=null===(a=this.__storeLoader)||void 0===a?void 0:a.data)||void 0===d?void 0:d.is_active)&&("test"===e&&!0===(null===(h=null===(c=this.__paymentPresetLoader)||void 0===c?void 0:c.data)||void 0===h?void 0:h.is_live)||"live"===e&&!1===(null===(p=null===(u=this.__paymentPresetLoader)||void 0===u?void 0:u.data)||void 0===p?void 0:p.is_live));return l(M||(M=T` <foxy-internal-summary-control helper-text="${0}" label="${0}" infer="${0}"> ${0} ${0} ${0} ${0} </foxy-internal-summary-control> `),s(x?this.t(`${g}.helper_text_inactive`):void 0),s(x?this.t(`${g}.label_inactive`):void 0),g,(null===(m=this.form.helper)||void 0===m?void 0:m.id_description)?l(I||(I=T` <foxy-internal-text-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}account-id"> </foxy-internal-text-control> `),this.t("default_additional_field_placeholder"),this.form.helper.id_description,v):"",(null===(f=this.form.helper)||void 0===f?void 0:f.third_party_key_description)?l(B||(B=T` <foxy-internal-password-control placeholder="${0}" helper-text="" layout="summary-item" label="${0}" infer="${0}third-party-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.third_party_key_description,v):"",(null===(_=this.form.helper)||void 0===_?void 0:_.key_description)?l(C||(C=T` <foxy-internal-password-control placeholder="${0}" layout="summary-item" helper-text="" label="${0}" infer="${0}account-key"> </foxy-internal-password-control> `),this.t("default_additional_field_placeholder"),this.form.helper.key_description,v):"",y.map((e=>this.__renderBlock(e))))})),super.renderBody())}__renderPaymentMethodButton({type:e,helper:t}){var r,o;const i=z.defaultImageSrc,a=null!==(o=null===(r=this.getImageSrc)||void 0===r?void 0:r.call(this,e))&&void 0!==o?o:i,s=e=>e.currentTarget.src=i;return l(q||(q=T` <button class="${0}" ?disabled="${0}" title="${0}" @click="${0}"> <img class="absolute top-0 left-0 w-1-2 h-full object-cover bg-center filter saturate-200 blur-3xl" style="transform:translate3d(0,0,0)" src="${0}" alt="" ?hidden="${0}" @error="${0}"> <figure class="relative flex flex-col gap-m"> <img class="${0}" src="${0}" alt="" @error="${0}"> <figcaption class="${0}"> <div class="font-medium">${0}&ZeroWidthSpace;</div> <div class="text-xs ${0}">${0}</div> </figcaption> </figure> </button> `),d({"relative w-full block text-left p-s rounded bg-contrast-5 overflow-hidden":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"transition-colors hover-bg-contrast-10":!t.conflict,"cursor-default":!!t.conflict}),!!t.conflict,t.conflict?this.t("conflict_message",t.conflict):"",(()=>this.edit({type:e,helper:t})),a,!!t.conflict,s,d({"h-m w-m object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs":!0,"filter grayscale":!!t.conflict}),a,s,d({"min-w-0 flex-1 truncate leading-s":!0,"text-disabled":!!t.conflict}),t.name,t.conflict?"":"text-secondary",e)}__renderBlock(e){return l(Z||(Z=T`${0}`),e.fields.map((e=>{var t,r,i;if("hidden"===e.type)return;const a=["additional-fields",e.id].join("-").replace(/_/g,"-"),s=()=>{var t,r;try{const i=JSON.parse(null!==(t=this.form.additional_fields)&&void 0!==t?t:"{}");return null!==(r=o(i,e.id))&&void 0!==r?r:i.default_value}catch(t){return e.default_value}},n=t=>{var r;let o={};try{o=JSON.parse(null!==(r=this.form.additional_fields)&&void 0!==r?r:"")}catch(e){}this.edit({additional_fields:JSON.stringify(h(o,e.id,t))})},d=e.options;return l(H||(H=T` ${0} `),"checkbox"===e.type?l(D||(D=T` <foxy-internal-switch-control helper-text="${0}" label="${0}" infer="${0}" helper-text-as-tooltip .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),null!==(t=e.description)&&void 0!==t?t:"",e.name,a,s,n):"select"===e.type?l(O||(O=T` <foxy-internal-select-control placeholder="${0}" helper-text="${0}" layout="summary-item" label="${0}" infer="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),this.t("default_additional_field_select_placeholder"),null!==(r=e.description)&&void 0!==r?r:"",e.name,a,d.map((({name:e,value:t})=>({label:e,value:t}))),s,n):l(R||(R=T` <foxy-internal-text-control helper-text="${0}" placeholder="${0}" layout="summary-item" label="${0}" infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),null!==(i=e.description)&&void 0!==i?i:"",e.default_value||this.t("default_additional_field_placeholder"),e.name,a,s,n))})))}}customElements.define("foxy-payments-api-payment-method-form",z);export{z as PaymentsApiPaymentMethodForm};
@@ -1 +1 @@
1
- import"./shared-0098edce.js";import"./shared-511fcf8e.js";import"./shared-00e02b35.js";import"./shared-4a32f76a.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-payments-api-fraud-protection-card.js";import"./foxy-payments-api-fraud-protection-form.js";import"./foxy-payments-api-payment-method-card.js";import"./foxy-payments-api-payment-method-form.js";import{_ as r,B as t}from"./shared-cb58dfcd.js";import{a as o}from"./shared-11351c00.js";import{i as s}from"./shared-53e42a77.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-37348820.js";import"./shared-315d7620.js";import"./shared-6957b8e6.js";import"./shared-8ef0ca65.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./shared-e0da7113.js";import"./shared-b65d169b.js";import"./shared-5cd33249.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./foxy-nucleon-element.js";import"./shared-ef4ad461.js";import"./shared-4a4f6eb9.js";import"./shared-8b25a098.js";let a,d=e=>e;const n=o(e,"payments-api-payment-preset-form");class p extends n{constructor(){super(...arguments),this.getFraudProtectionImageSrc=null,this.getPaymentMethodImageSrc=null,this.__isPurchaseOrderEnabledGetValue=()=>{var e,r;return!!(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)&&this.form.is_purchase_order_enabled},this.__isLiveGetValue=()=>{var e,r;return!!(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)&&this.form.is_live},this.__storeLoaderId="storeLoader"}static get properties(){return r(r({},super.properties),{},{getFraudProtectionImageSrc:{attribute:!1},getPaymentMethodImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>e&&e.length<=100||"description:v8n_too_long"]}get readonlySelector(){var e,r;const o=[super.hiddenSelector.toString()];return(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)||o.unshift("general:is-live","general:is-purchase-order-enabled"),new t(o.join(" ").trim())}get hiddenSelector(){var e;const r=["header:copy-json",super.hiddenSelector.toString()],o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;return this.data||r.unshift("payment-methods","fraud-protections"),o||r.unshift("general:is-live","general:is-purchase-order-enabled"),new t(r.join(" ").trim())}renderBody(){var e,r,t,o,n,p;const m=!!(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)?"":"_inactive_store";return i(a||(a=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control helper-text="${0}" infer="is-live" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control helper-text="${0}" infer="is-purchase-order-enabled" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="payment-methods" first="${0}" limit="5" item="foxy-payments-api-payment-method-card" form="foxy-payments-api-payment-method-form" alert .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="fraud-protections" first="${0}" limit="5" item="foxy-payments-api-fraud-protection-card" form="foxy-payments-api-fraud-protection-form" alert .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.t(`general.is-live.helper_text${m}`),this.__isLiveGetValue,this.t(`general.is-purchase-order-enabled.helper_text${m}`),this.__isPurchaseOrderEnabledGetValue,s(null===(t=this.data)||void 0===t?void 0:t._links["fx:payment_methods"].href),{".getImageSrc":this.getPaymentMethodImageSrc},{".getImageSrc":this.getPaymentMethodImageSrc,"payment-preset":this.href,store:null===(o=this.data)||void 0===o?void 0:o._links["fx:store"].href},s(null===(n=this.data)||void 0===n?void 0:n._links["fx:fraud_protections"].href),{".getImageSrc":this.getFraudProtectionImageSrc},{".getImageSrc":this.getFraudProtectionImageSrc},super.renderBody(),s(null===(p=this.data)||void 0===p?void 0:p._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-payments-api-payment-preset-form",p);export{p as PaymentsApiPaymentPresetForm};
1
+ import"./shared-7097e2e1.js";import"./shared-e41fced3.js";import"./shared-43637d69.js";import"./shared-9a64bf35.js";import{I as e}from"./shared-109ec474.js";import"./foxy-payments-api-fraud-protection-card.js";import"./foxy-payments-api-fraud-protection-form.js";import"./foxy-payments-api-payment-method-card.js";import"./foxy-payments-api-payment-method-form.js";import{_ as r,B as t}from"./shared-cb58dfcd.js";import{a as o}from"./shared-11351c00.js";import{i as s}from"./shared-53e42a77.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-37348820.js";import"./shared-315d7620.js";import"./shared-6957b8e6.js";import"./shared-8ef0ca65.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-1100bca8.js";import"./shared-048d5cae.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./shared-88220d9e.js";import"./shared-b65d169b.js";import"./shared-63eef674.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./foxy-nucleon-element.js";import"./shared-ef4ad461.js";import"./shared-888018de.js";import"./shared-8b25a098.js";let a,d=e=>e;const n=o(e,"payments-api-payment-preset-form");class p extends n{constructor(){super(...arguments),this.getFraudProtectionImageSrc=null,this.getPaymentMethodImageSrc=null,this.__isPurchaseOrderEnabledGetValue=()=>{var e,r;return!!(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)&&this.form.is_purchase_order_enabled},this.__isLiveGetValue=()=>{var e,r;return!!(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)&&this.form.is_live},this.__storeLoaderId="storeLoader"}static get properties(){return r(r({},super.properties),{},{getFraudProtectionImageSrc:{attribute:!1},getPaymentMethodImageSrc:{attribute:!1}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>e&&e.length<=100||"description:v8n_too_long"]}get readonlySelector(){var e,r;const o=[super.hiddenSelector.toString()];return(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)||o.unshift("general:is-live","general:is-purchase-order-enabled"),new t(o.join(" ").trim())}get hiddenSelector(){var e;const r=["header:copy-json",super.hiddenSelector.toString()],o=null===(e=this.__storeLoader)||void 0===e?void 0:e.data;return this.data||r.unshift("payment-methods","fraud-protections"),o||r.unshift("general:is-live","general:is-purchase-order-enabled"),new t(r.join(" ").trim())}renderBody(){var e,r,t,o,n,p;const m=!!(null===(r=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.is_active)?"":"_inactive_store";return i(a||(a=d` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control helper-text="${0}" infer="is-live" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> <foxy-internal-switch-control helper-text="${0}" infer="is-purchase-order-enabled" helper-text-as-tooltip .getValue="${0}"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="payment-methods" first="${0}" limit="5" item="foxy-payments-api-payment-method-card" form="foxy-payments-api-payment-method-form" alert .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="fraud-protections" first="${0}" limit="5" item="foxy-payments-api-fraud-protection-card" form="foxy-payments-api-fraud-protection-form" alert .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.t(`general.is-live.helper_text${m}`),this.__isLiveGetValue,this.t(`general.is-purchase-order-enabled.helper_text${m}`),this.__isPurchaseOrderEnabledGetValue,s(null===(t=this.data)||void 0===t?void 0:t._links["fx:payment_methods"].href),{".getImageSrc":this.getPaymentMethodImageSrc},{".getImageSrc":this.getPaymentMethodImageSrc,"payment-preset":this.href,store:null===(o=this.data)||void 0===o?void 0:o._links["fx:store"].href},s(null===(n=this.data)||void 0===n?void 0:n._links["fx:fraud_protections"].href),{".getImageSrc":this.getFraudProtectionImageSrc},{".getImageSrc":this.getFraudProtectionImageSrc},super.renderBody(),s(null===(p=this.data)||void 0===p?void 0:p._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-payments-api-payment-preset-form",p);export{p as PaymentsApiPaymentPresetForm};
@@ -1,4 +1,4 @@
1
- import{C as e}from"./shared-6683daed.js";import{D as t,a as i}from"./shared-29f60d2f.js";import{C as a,a as s}from"./shared-243456aa.js";import{h as n,C as r,P as d}from"./shared-21e68b72.js";import{T as l,E as o}from"./shared-315d7620.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import{T as h}from"./shared-edeeb089.js";import{a as m}from"./shared-1c355fac.js";import{C as _}from"./shared-8ef0ca65.js";import"./shared-6957b8e6.js";import{C as u,c}from"./shared-c46affa4.js";import"./shared-e5546d55.js";import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as p}from"./shared-cb58dfcd.js";import"./shared-37348820.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{h as g,r as v}from"./shared-ba5c42c7.js";import{z as f,S as b,R as y,T as k,a as x}from"./shared-11351c00.js";import{c as T}from"./shared-4e709717.js";import"./shared-048d5cae.js";import{G as $}from"./shared-84eb85dd.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import{C as D}from"./shared-5afb584d.js";import{N as E}from"./shared-f83207fb.js";import{i as w}from"./shared-53e42a77.js";import{l as S}from"./shared-d0aed1c1.js";import"./shared-a587fd4b.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-cf12f33b.js";import"./shared-651c44fa.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-2aa23b5f.js";import"./shared-53e476fd.js";import"./shared-5ef40e86.js";import"./shared-a03facdf.js";import"./shared-c18f681b.js";import"./shared-343d1fd7.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";let P,C,I,M=e=>e;class V extends f{constructor(){super(...arguments),this.disabled=!1,this.items=[]}static get properties(){return p(p({},super.properties),{},{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}})}render(){return g(P||(P=M` <p class="font-lumo text-xs leading-s text-secondary"> ${0} </p> `),this.items.map((({name:e,value:t},i)=>g(C||(C=M`${0}${0} ${0}`),0===i?"":g(I||(I=M`&bull;`)),e,t))))}}
1
+ import{C as e}from"./shared-6683daed.js";import{D as t,a as i}from"./shared-29f60d2f.js";import{C as a,a as s}from"./shared-243456aa.js";import{h as n,C as r,P as d}from"./shared-21e68b72.js";import{T as l,E as o}from"./shared-315d7620.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import{T as h}from"./shared-edeeb089.js";import{a as m}from"./shared-1c355fac.js";import{C as _}from"./shared-8ef0ca65.js";import"./shared-6957b8e6.js";import{C as u,c}from"./shared-c46affa4.js";import"./shared-1100bca8.js";import"./shared-5212ef4f.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as p}from"./shared-cb58dfcd.js";import"./shared-37348820.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{h as g,r as v}from"./shared-ba5c42c7.js";import{z as f,S as b,R as y,T as k,a as x}from"./shared-11351c00.js";import{c as T}from"./shared-4e709717.js";import"./shared-048d5cae.js";import{G as $}from"./shared-84eb85dd.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import{C as D}from"./shared-5afb584d.js";import{N as E}from"./shared-f83207fb.js";import{i as w}from"./shared-53e42a77.js";import{l as S}from"./shared-d0aed1c1.js";import"./shared-a587fd4b.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-cf12f33b.js";import"./shared-651c44fa.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-2aa23b5f.js";import"./shared-53e476fd.js";import"./shared-5ef40e86.js";import"./shared-a03facdf.js";import"./shared-c18f681b.js";import"./shared-343d1fd7.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";let P,C,I,M=e=>e;class V extends f{constructor(){super(...arguments),this.disabled=!1,this.items=[]}static get properties(){return p(p({},super.properties),{},{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}})}render(){return g(P||(P=M` <p class="font-lumo text-xs leading-s text-secondary"> ${0} </p> `),this.items.map((({name:e,value:t},i)=>g(C||(C=M`${0}${0} ${0}`),0===i?"":g(I||(I=M`&bull;`)),e,t))))}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2017 Vaadin Ltd.