@primer-io/primer-js 1.9.0 → 1.9.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.
@@ -2,35 +2,6 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
- {
6
- "kind": "javascript-module",
7
- "path": "e2e/utils.ts",
8
- "declarations": [
9
- {
10
- "kind": "variable",
11
- "name": "test",
12
- "default": "chromaticTest"
13
- }
14
- ],
15
- "exports": [
16
- {
17
- "kind": "js",
18
- "name": "expect",
19
- "declaration": {
20
- "name": "expect",
21
- "package": "@chromatic-com/playwright"
22
- }
23
- },
24
- {
25
- "kind": "js",
26
- "name": "test",
27
- "declaration": {
28
- "name": "test",
29
- "module": "e2e/utils.ts"
30
- }
31
- }
32
- ]
33
- },
34
5
  {
35
6
  "kind": "javascript-module",
36
7
  "path": "dist/primer-loader.js",
@@ -139,7 +110,7 @@
139
110
  },
140
111
  {
141
112
  "kind": "variable",
142
- "name": "se",
113
+ "name": "oe",
143
114
  "default": "class extends b{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?y:u`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return y;let e;return this.variant===\"primary\"?e=\"var(--primer-color-background-outlined-default)\":(this.variant===\"secondary\"||this.variant===\"tertiary\")&&(e=\"var(--primer-color-gray-900)\"),u`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return u`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} aria-label=${this.ariaLabel?this.ariaLabel:y} >${this.renderSpinner()} ${this.flex?u`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:u`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
144
115
  },
145
116
  {
@@ -174,7 +145,7 @@
174
145
  },
175
146
  {
176
147
  "kind": "variable",
177
- "name": "le",
148
+ "name": "se",
178
149
  "default": "class extends b{constructor(){super(...arguments);this.header=\"\";this.expanded=!1;this.expandText=\"Expand\";this.collapseText=\"Collapse\";this.ariaLabel=\"\";this.buttonVariant=\"primary\";this.isExpanded=!1;this.toggleExpanded=()=>{this.isExpanded=!this.isExpanded,this.dispatchExpandedChangedEvent(this.isExpanded)}}connectedCallback(){super.connectedCallback(),this.isExpanded=this.expanded}dispatchExpandedChangedEvent(e){this.dispatchEvent(new CustomEvent(\"expanded-changed\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedChangedEvent(!0))}collapse(){this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedChangedEvent(!1))}render(){let e=this.isExpanded?this.collapseText:this.expandText,a=this.ariaLabel||this.header||e,i=this.header||e;return u`<div class=\"collapsable\"><primer-button variant=${this.buttonVariant} buttonType=\"button\" @click=${this.toggleExpanded} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${a} ><span>${i}</span></primer-button><div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" id=\"collapsable-content\" role=\"region\" aria-labelledby=\"collapsable-header\" ><div class=\"collapsable-content\"><slot></slot></div></div></div>`}}"
179
150
  },
180
151
  {
@@ -190,7 +161,7 @@
190
161
  {
191
162
  "kind": "variable",
192
163
  "name": "fe",
193
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new H(this,{task:async([e,a])=>{let i=e?.find(n=>n.type===k.KLARNA);return i?.type!==k.KLARNA||!a?V:{method:i}},args:()=>[this.primerContext?.paymentMethods,this.primerContext?.headlessUtils]});this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded||(this.selectedCategory=null,this.categoryLoading=!1,this.klarnaContainer&&(this.klarnaContainer.innerHTML=\"\"))};this.klarnaPaymentInProgress=!1}async startKlarnaPayment(){if(!(!this._setupTask.value||!this.selectedCategory||this.klarnaPaymentInProgress)){this.klarnaPaymentInProgress=!0;try{this._setupTask.value.method.setSelectedCategory(this.selectedCategory),await this._setupTask.value.method.start()}catch{}finally{this.klarnaPaymentInProgress=!1}}}async renderSelectedCategory(){if(!(!this._setupTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",this.categoryLoading=!0,await this._setupTask.value.method.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:()=>{}})}catch{}finally{this.categoryLoading=!1}}selectCategory(e){this.disabled||(this.selectedCategory=e)}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this._setupTask?.value?.method.getCategories()||[];return e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].identifier),e.length===1?y:u`<div class=\"category-selection\">${e.map(a=>u`<button class=${J({\"category-button\":!0,selected:a.identifier===this.selectedCategory,loading:this.categoryLoading&&a.identifier===this.selectedCategory})} @click=${()=>{this.selectCategory(a.identifier)}} ?disabled=${this.disabled} ><span class=${J({\"category-label\":!0,hidden:this.categoryLoading&&a.identifier===this.selectedCategory})} >${a.name}</span >${this.categoryLoading&&a.identifier===this.selectedCategory?u`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:y}</button>`)}</div>`}renderExpandedContent(){return u` ${this.renderCategorySelection()}<div class=\"klarna-category-container ${!this.categoryLoading&&this.selectedCategory?\"visible\":\"\"}\" ><div id=\"klarna-category-container\" class=\"klarna-category-content\" ></div></div><primer-payment-method-accordion-confirm-button ?disabled=${!this.selectedCategory||this.disabled} ?loading=${gt(this.primerContext?.sdkState)} @confirm=${()=>this.startKlarnaPayment()} ></primer-payment-method-accordion-confirm-button>`}render(){return this._setupTask.render({error:e=>{let a=e instanceof Error?e.message:\"Unknown error in Klarna\";return u`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({method:e})=>e?u`<primer-payment-method-accordion .type=${k.KLARNA} ?disabled=${this.disabled} .expanded=${this.isExpanded} ?suppress-blur-collapse=${this.klarnaPaymentInProgress} @expanded-change=${this.handleExpandedChange} >${this.renderExpandedContent()}</primer-payment-method-accordion>`:y})}}"
164
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new H(this,{task:async([e,a])=>{let i=e?.find(n=>n.type===I.KLARNA);return i?.type!==I.KLARNA||!a?V:{method:i}},args:()=>[this.primerContext?.paymentMethods,this.primerContext?.headlessUtils]});this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded||(this.selectedCategory=null,this.categoryLoading=!1,this.klarnaContainer&&(this.klarnaContainer.innerHTML=\"\"))};this.klarnaPaymentInProgress=!1}async startKlarnaPayment(){if(!(!this._setupTask.value||!this.selectedCategory||this.klarnaPaymentInProgress)){this.klarnaPaymentInProgress=!0;try{this._setupTask.value.method.setSelectedCategory(this.selectedCategory),await this._setupTask.value.method.start()}catch{}finally{this.klarnaPaymentInProgress=!1}}}async renderSelectedCategory(){if(!(!this._setupTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",this.categoryLoading=!0,await this._setupTask.value.method.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:()=>{}})}catch{}finally{this.categoryLoading=!1}}selectCategory(e){this.disabled||(this.selectedCategory=e)}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this._setupTask?.value?.method.getCategories()||[];return e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].identifier),e.length===1?y:u`<div class=\"category-selection\">${e.map(a=>u`<button class=${J({\"category-button\":!0,selected:a.identifier===this.selectedCategory,loading:this.categoryLoading&&a.identifier===this.selectedCategory})} @click=${()=>{this.selectCategory(a.identifier)}} ?disabled=${this.disabled} ><span class=${J({\"category-label\":!0,hidden:this.categoryLoading&&a.identifier===this.selectedCategory})} >${a.name}</span >${this.categoryLoading&&a.identifier===this.selectedCategory?u`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:y}</button>`)}</div>`}renderExpandedContent(){return u` ${this.renderCategorySelection()}<div class=\"klarna-category-container ${!this.categoryLoading&&this.selectedCategory?\"visible\":\"\"}\" ><div id=\"klarna-category-container\" class=\"klarna-category-content\" ></div></div><primer-payment-method-accordion-confirm-button ?disabled=${!this.selectedCategory||this.disabled} ?loading=${gt(this.primerContext?.sdkState)} @confirm=${()=>this.startKlarnaPayment()} ></primer-payment-method-accordion-confirm-button>`}render(){return this._setupTask.render({error:e=>{let a=e instanceof Error?e.message:\"Unknown error in Klarna\";return u`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({method:e})=>e?u`<primer-payment-method-accordion .type=${I.KLARNA} ?disabled=${this.disabled} .expanded=${this.isExpanded} ?suppress-blur-collapse=${this.klarnaPaymentInProgress} @expanded-change=${this.handleExpandedChange} >${this.renderExpandedContent()}</primer-payment-method-accordion>`:y})}}"
194
165
  },
195
166
  {
196
167
  "kind": "variable",
@@ -215,7 +186,7 @@
215
186
  {
216
187
  "kind": "variable",
217
188
  "name": "He",
218
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,a])=>{if(!e||!a)return V;let i=a.getPaymentMethodConfiguration(e);if(!i)return V;let n=Zd(e)?this.primerContext?.clientOptions?.giftCard:void 0,o=i.displayMetadata.button,s=this._getBackgroundColor(e,o,n?.background),l=this._getTextColor(s);return{backgroundColor:s,textColor:l,name:i.name,alt:n?.logoAlt??i.name,displayName:this._getDisplayName(e,o.text,n?.text),iconUrl:this._getIconUrl(e,o,s,n?.logoSrc),iconPosition:this._getIconPosition(e,o)}},args:()=>[this.type,this.primerContext?.headlessUtils]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?ro(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),A(e,{id:a})}_getBackgroundColor(e,a,i){switch(e){case k.KLARNA:case k.ADYEN_KLARNA:return a.backgroundColor.light??a.backgroundColor.colored;default:return i??a.backgroundColor.colored??a.backgroundColor.light}}_getIconUrl(e,a,i,n){if(n)return n;switch(e){case k.KLARNA:case k.ADYEN_KLARNA:return Ay;case k.PAY_NL_PAYCONIQ:return i===a.backgroundColor.light?by:Cy;case k.ADYEN_CASHAPP:return a.iconUrl.dark??a.iconUrl.colored??a.iconUrl.light;default:return e===\"TRIPLE_A\"?Ey:a.iconUrl.colored??a.iconUrl.light}}_getIconPosition(e,a){switch(e){case k.KLARNA:case k.ADYEN_KLARNA:return\"END\";default:return a.iconPositionRelativeToText||\"START\"}}_getTextColor(e){let a=e.replace(\"#\",\"\");if(a.length<6)return;let i=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),o=parseInt(a.substring(4,6),16);return isNaN(i)||isNaN(n)||isNaN(o)?void 0:(.2126*i+.7152*n+.0722*o)/255>.6?\"#000000\":\"#FFFFFF\"}_getDisplayName(e,a,i){switch(e){case k.KLARNA:return this.primerContext?.clientOptions?.klarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");case k.ADYEN_KLARNA:return this.primerContext?.clientOptions?.adyenKlarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");default:return i??this._legacyGetButtonLabel(a)}}_handleClick(){this.disabled||this.dispatchEvent(new Event(\"payment-method-click\",{bubbles:!0,composed:!0}))}render(){return this._setupTask.render({error:()=>y,complete:e=>{this.style.setProperty(\"--payment-method-button-bg-color\",e.backgroundColor),e.textColor&&this.style.setProperty(\"--payment-method-button-text-color\",e.textColor);let a={loading:gt(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return u`<primer-button @click=\"${()=>this._handleClick()}\" class=${J(a)} title=\"${A(\"Pay with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} ><img src=\"${e.iconUrl}\" alt=\"${e.alt}\" />${L(e.displayName,()=>u`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
189
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,a])=>{if(!e||!a)return V;let i=a.getPaymentMethodConfiguration(e);if(!i)return V;let n=Zd(e)?this.primerContext?.clientOptions?.giftCard:void 0,o=i.displayMetadata.button,s=this._getBackgroundColor(e,o,n?.background),l=this._getTextColor(s);return{backgroundColor:s,textColor:l,name:i.name,alt:n?.logoAlt??i.name,displayName:this._getDisplayName(e,o.text,n?.text),iconUrl:this._getIconUrl(e,o,s,n?.logoSrc),iconPosition:this._getIconPosition(e,o)}},args:()=>[this.type,this.primerContext?.headlessUtils]})}_legacyGetButtonLabel(e){if(!e)return;let a=e?ro(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),A(e,{id:a})}_getBackgroundColor(e,a,i){switch(e){case I.KLARNA:case I.ADYEN_KLARNA:return a.backgroundColor.light??a.backgroundColor.colored;default:return i??a.backgroundColor.colored??a.backgroundColor.light}}_getIconUrl(e,a,i,n){if(n)return n;switch(e){case I.KLARNA:case I.ADYEN_KLARNA:return Ay;case I.PAY_NL_PAYCONIQ:return i===a.backgroundColor.light?by:Cy;case I.ADYEN_CASHAPP:return a.iconUrl.dark??a.iconUrl.colored??a.iconUrl.light;default:return e===\"TRIPLE_A\"?Ey:a.iconUrl.colored??a.iconUrl.light}}_getIconPosition(e,a){switch(e){case I.KLARNA:case I.ADYEN_KLARNA:return\"END\";default:return a.iconPositionRelativeToText||\"START\"}}_getTextColor(e){let a=e.replace(\"#\",\"\");if(a.length<6)return;let i=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),o=parseInt(a.substring(4,6),16);return isNaN(i)||isNaN(n)||isNaN(o)?void 0:(.2126*i+.7152*n+.0722*o)/255>.6?\"#000000\":\"#FFFFFF\"}_getDisplayName(e,a,i){switch(e){case I.KLARNA:return this.primerContext?.clientOptions?.klarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");case I.ADYEN_KLARNA:return this.primerContext?.clientOptions?.adyenKlarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");default:return i??this._legacyGetButtonLabel(a)}}_handleClick(){this.disabled||this.dispatchEvent(new Event(\"payment-method-click\",{bubbles:!0,composed:!0}))}render(){return this._setupTask.render({error:()=>y,complete:e=>{this.style.setProperty(\"--payment-method-button-bg-color\",e.backgroundColor),e.textColor&&this.style.setProperty(\"--payment-method-button-text-color\",e.textColor);let a={loading:gt(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return u`<primer-button @click=\"${()=>this._handleClick()}\" class=${J(a)} title=\"${A(\"Pay with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} ><img src=\"${e.iconUrl}\" alt=\"${e.alt}\" />${L(e.displayName,()=>u`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
219
190
  },
220
191
  {
221
192
  "kind": "variable",
@@ -229,7 +200,7 @@
229
200
  },
230
201
  {
231
202
  "kind": "variable",
232
- "name": "De",
203
+ "name": "Oe",
233
204
  "default": "class extends b{constructor(){super(...arguments);this.disabled=!1}getFilteredMethods(){if(!this.primerContext?.paymentMethods)return[];let e=[...this.primerContext.paymentMethods];if(this.include){let a=this.include.split(\",\").map(i=>i.trim());e=e.filter(i=>a.includes(i.type))}if(this.exclude){let a=this.exclude.split(\",\").map(i=>i.trim());e=e.filter(i=>!a.includes(i.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?y:u`<div class=\"payment-methods-container\">${e.map(a=>u`<primer-payment-method type=\"${a.type}\" ?disabled=\"${this.disabled||this.primerContext?.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
234
205
  },
235
206
  {
@@ -239,27 +210,27 @@
239
210
  },
240
211
  {
241
212
  "kind": "variable",
242
- "name": "ae",
213
+ "name": "re",
243
214
  "default": "class extends b{constructor(){super(...arguments);this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new H(this,{task:async([e,a])=>{if(!e||!a)return V;let i=this.extractFieldConfig(e);return await this.initializeCountryOptions(),i},args:()=>[this.primerContext?.configuration??null,this.primerContext?.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let a=e.checkoutModules.find(i=>i.type===\"BILLING_ADDRESS\");if(a?.options){let i=a.options;return Object.keys(oo).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=no(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=Ln();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await xc(a)){let n=no(a);this.countryOptions=[...n.map(([o,s])=>({value:o,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){ar(this.primerContext?.telemetry,\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.primerContext?.configuration)}get defaultFieldConfig(){return Object.keys(oo).reduce((e,a)=>({...e,[a]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,a){this.formData={...this.formData,[e]:a},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let a=this.formData[e],i=this.fieldConfig[e];if(!i){delete this.errors[e];return}if(i&&(!a||a.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:A(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(oo).forEach(e=>{let a=e;this.fieldConfig[a]&&this.validateField(a)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(a=>{this.fieldConfig[a]&&this.touchedFields.add(a)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.primerContext?.headlessUtils?.setBillingAddress)try{return await this.primerContext?.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch{return!1}return!0}shouldShowError(e){let a=!!this.errors[e],i=this.dirtyFields.has(e),n=this.touchedFields.has(e);return a&&(this.submitted||i&&n)}render(){return this._initializationTask.render({pending:()=>y,error:()=>y,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),u`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${A(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${L(this.fieldConfig.countryCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${A(\"Country code\",{id:\"countryCodeLabel\"})}</primer-input-label><primer-select slot=\"input\" id=\"countryCode\" name=\"countryCode\" .value=${this.formData.countryCode||\"\"} .options=${this.countryOptions} .hasError=${this.shouldShowError(\"countryCode\")} placeholder=${A(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${L(this.shouldShowError(\"countryCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>u`<div class=\"billing-address-row\">${L(this.fieldConfig.firstName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${A(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${A(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${L(this.shouldShowError(\"firstName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.lastName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${A(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${A(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${L(this.shouldShowError(\"lastName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${L(this.fieldConfig.addressLine1,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${A(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${A(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${L(this.shouldShowError(\"addressLine1\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.addressLine2,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${A(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${A(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${L(this.shouldShowError(\"addressLine2\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.postalCode||this.fieldConfig.city,()=>u`<div class=\"billing-address-row\">${L(this.fieldConfig.postalCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${A(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${A(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${L(this.shouldShowError(\"postalCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.city,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${A(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${A(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${L(this.shouldShowError(\"city\"),()=>u`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${L(this.fieldConfig.state,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${A(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${A(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${L(this.shouldShowError(\"state\"),()=>u`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),y)})}}"
244
215
  },
245
216
  {
246
217
  "kind": "variable",
247
- "name": "ie",
218
+ "name": "ae",
248
219
  "default": "class extends b{constructor(){super();this.hasSlottedSubmit=!1;this.isEditMode=!1;this.deletePaymentMethodId=null;this.isDeleting=!1;this.errorMessage=\"\";this.animationDuration=300;this._isHandlingContextEvent=!1;this._contextVaultSubmitListener=null;this.deleteAssetConfig=null;this.handleSubmitSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasSlottedSubmit=i.length>0};this.handleToggleEditMode=e=>{this.isEditMode=e.detail,this.deletePaymentMethodId=null,this.isEditMode&&this.primerContext?.vaultItem&&this.primerContext?.vaultItem.setSelectedVaultedPaymentMethod(null)};this.handleDeletePaymentMethod=async e=>{if(this.deletePaymentMethodId=e.detail,this.deletePaymentMethodId&&this.primerContext?.vaultManager&&this.primerContext?.headlessUtils){let a=this.primerContext?.vaultManager.vaultedPaymentMethods.find(i=>i.id===this.deletePaymentMethodId);a&&(this.deleteAssetConfig=await Qa(a,this.primerContext?.headlessUtils,this.primerContext?.vaultManager))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.primerContext?.vaultManager?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=A(\"Something went wrong. Please try again.\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.primerContext?.vaultManager.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:A(\"Something went wrong. Please try again.\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let a=e.detail?.error;this.errorMessage=a instanceof Error?a.message:A(\"Your payment could not be processed. Please try again.\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitVaultPayment())};this.handleDirectSubmit=()=>{this.submitVaultPayment()};this.handleContextVaultSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitVaultPayment())}finally{this._isHandlingContextEvent=!1}}};new ur(this,{defaultOptions:{keyframeOptions:{duration:Number(getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-duration\").trim().replace(\"ms\",\"\")),easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim()}}})}getAnimationConfig(){return{keyframeOptions:{duration:this.animationDuration,easing:getComputedStyle(document.documentElement).getPropertyValue(\"--primer-animation-easing\").trim(),fill:\"both\"}}}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitVaultPayment(){if(this.primerContext?.vaultManager)try{await this.primerContext?.vaultManager.startVaultedPaymentFlow()}catch(e){this.dispatchEvent(new CustomEvent(\"primer-vault-payment-error\",{detail:{error:e},bubbles:!0,composed:!0}))}}getPaymentMethodName(e){if(!this.primerContext?.vaultManager)return\"\";let a=this.primerContext?.vaultManager.vaultedPaymentMethods.find(i=>i.id===e);if(!a)return\"\";try{return lo(a,this.primerContext?.telemetry).description||\"\"}catch{return\"\"}}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextVaultSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextVaultSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:vault-submit\",this._contextVaultSubmitListener)}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this._contextVaultSubmitListener=e=>{this.handleContextVaultSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:vault-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}renderLoadingOverlay(){return u`<div class=\"loading-overlay\" ${Mt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ><primer-spinner size=\"medium\" color=\"var(--primer-color-loader)\" ></primer-spinner></div>`}renderDeleteConfirmation(){if(!this.deletePaymentMethodId||!this.deleteAssetConfig)return y;let e=this.getPaymentMethodName(this.deletePaymentMethodId);return u`<div class=\"delete-confirmation-container\"><primer-button disabled variant=\"secondary\"><primer-payment-method-content .assetConfig=${this.deleteAssetConfig} ></primer-payment-method-content></primer-button><primer-vault-delete-confirmation .isDeleting=${this.isDeleting} .paymentMethodId=${this.deletePaymentMethodId} .paymentMethodName=${e} @confirm-delete=${this.handleConfirmDelete} @cancel-delete=${this.handleCancelDelete} ${Mt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-delete-confirmation></div>`}renderPaymentMethodItem(e){return this.deletePaymentMethodId===e.id?y:u`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${Mt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.primerContext?.vaultManager?.vaultedPaymentMethods||[],a=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return u`<div class=\"payment-methods-list\">${e.map(i=>this.renderPaymentMethodItem(i))} ${L(a,()=>u`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Mt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${L(!this.hasSlottedSubmit,()=>u`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>y)}</div>`}render(){if(!this.primerContext?.vaultManager?.enabled||this.primerContext?.vaultManager?.headless)return y;let e=this.primerContext?.vaultManager.vaultedPaymentMethods.length>0,a=this.primerContext?.vaultManager.isLoading,i=this.primerContext?.vaultManager.isUpdating;return u` ${L(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>y,()=>u`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${i?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${L(this.errorMessage,()=>u`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Mt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>y)}<div class=\"vault-manager-content\">${L(!a&&!e,()=>u`<div class=\"content-container\"><primer-vault-empty-state ${Mt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>y)} ${L(!a&&e,()=>u`<div class=\"content-container\">${L(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>y)}</div>${L(i,()=>this.renderLoadingOverlay(),()=>y)}</div></slot>`)} `}}"
249
220
  },
250
221
  {
251
222
  "kind": "variable",
252
- "name": "Ie",
253
- "default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,a,i])=>await Qa(e,a,i),args:()=>[this.paymentMethod,this.primerContext?.headlessUtils,this.primerContext?.vaultManager]});this.handleClick=()=>{this.isEditMode||!this.primerContext?.vaultManager||!this.paymentMethod||(this.isSelected()?this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(null):this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))}}isSelected(){if(!this.primerContext?.vaultManager||!this.paymentMethod)return!1;let e=this.primerContext?.vaultItem?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>y,complete:e=>{let a=this.isSelected()?\"checked\":\"default\",i=!1,n=e?.description;return u`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${a} .flex=${i} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${L(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>u`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\">${A(\"Input the card CVV for a secure payment\",{id:\"vaultCvvRecapturePrompt\"})}</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>y)}</primer-button>${this.isEditMode?u`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${A(\"Delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:y}</div></div>`}})}}"
223
+ "name": "ke",
224
+ "default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,a,i])=>await Qa(e,a,i),args:()=>[this.paymentMethod,this.primerContext?.headlessUtils,this.primerContext?.vaultManager]});this.handleClick=()=>{this.isEditMode||!this.primerContext?.vaultManager||!this.paymentMethod||(this.isSelected()?this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(null):this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))};this.handleCvvRowClick=e=>{e.stopPropagation()}}isSelected(){if(!this.primerContext?.vaultManager||!this.paymentMethod)return!1;let e=this.primerContext?.vaultItem?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod.id}render(){return this._getAssetsTask.render({error:()=>y,complete:e=>{let a=this.isSelected()?\"checked\":\"default\",i=!1,n=e?.description;return u`<div class=\"payment-method-wrapper\"><div class=\"payment-method-container\"><primer-button variant=\"secondary\" class=\"payment-method-button ${e.shouldShowCVV?\"with-cvv\":\"\"}\" selectable ?disabled=${this.isEditMode} selectionState=${a} .flex=${i} @click=${this.handleClick} ><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${L(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>u`<div class=\"payment-method-row mt-2\" @click=${this.handleCvvRowClick} ><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\">${A(\"Input the card CVV for a secure payment\",{id:\"vaultCvvRecapturePrompt\"})}</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>y)}</primer-button>${this.isEditMode?u`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${A(\"Delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:y}</div></div>`}})}}"
254
225
  },
255
226
  {
256
227
  "kind": "variable",
257
- "name": "Oe",
228
+ "name": "De",
258
229
  "default": "class extends b{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return u`<div class=\"vault-manager-header\"><h3>${A(\"Previously used:\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?u`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?A(\"Confirm\",{id:\"confirm\"}):A(\"Edit saved payment methods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?u`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:u`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:y}</div>`}}"
259
230
  },
260
231
  {
261
232
  "kind": "variable",
262
- "name": "ke",
233
+ "name": "Ie",
263
234
  "default": "class extends b{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return u`<div class=\"delete-confirmation\"><p class=\"delete-confirmation-text\"> Are you sure you want to delete this payment method? </p><div class=\"delete-actions\"><primer-button variant=\"secondary\" @click=${this.handleCancelClick} ?disabled=${this.isDeleting} >${A(\"Cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?A(\"Deleting\",{id:\"deleting\"}):A(\"Yes, delete it\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
264
235
  },
265
236
  {
@@ -279,8 +250,8 @@
279
250
  },
280
251
  {
281
252
  "kind": "variable",
282
- "name": "re",
283
- "default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.cvvInputIsDirty=!1;this.cvvInputIsBlurred=!1;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new H(this,{task:([e,a])=>!e||!a||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||a.createCvvInput===null?V:{network:e.paymentInstrumentData.network,createCvvInput:a.createCvvInput},args:()=>[this.paymentMethod,this.primerContext?.vaultManager]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new H(this,{task:async([e])=>{if(!e)return V;await this.updateComplete;let a=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!a)return;let i=Zr(this.primerContext?.computedStyles??null),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:A(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.primerContext?.vaultItem?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.primerContext?.vaultItem?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.primerContext?.vaultItem||(this.cvvInputIsDirty=!0,this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.cvvInput&&(this.cvvInputIsBlurred=!0,this.cvvError=this.cvvInput.metadata.errorCode||null,this.isFocused=!1)}onFocus(){this.isFocused=!0}render(){return this._setupCVVIframe.render({error:()=>y,complete:()=>u`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&(this.primerContext?.vaultItem?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred)} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" id=\"${this.cvvContainerId}\"></div>${L(this.cvvError&&(this.primerContext?.vaultItem?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>u`<primer-input-error slot=\"error\">${A(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
253
+ "name": "le",
254
+ "default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new H(this,{task:([e,a])=>!e||!a||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||a.createCvvInput===null?V:{network:e.paymentInstrumentData.network,createCvvInput:a.createCvvInput},args:()=>[this.paymentMethod,this.primerContext?.vaultManager]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new H(this,{task:async([e])=>{if(!e)return V;await this.updateComplete;let a=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!a)return;let i=Zr(this.primerContext?.computedStyles??null),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:A(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.primerContext?.vaultItem?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.primerContext?.vaultItem?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.primerContext?.vaultItem||(this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.isFocused=!1}onFocus(){this.isFocused=!0}render(){return this._setupCVVIframe.render({error:()=>y,complete:()=>u`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.cvvError&&!!this.primerContext?.vaultItem?.formIsDirty} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" class=\"cvv-input-slot\" id=\"${this.cvvContainerId}\" ></div><div slot=\"error\" class=\"cvv-error-slot\">${L(this.cvvError&&this.primerContext?.vaultItem?.formIsDirty,()=>u`<primer-input-error>${A(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</div></primer-input-wrapper></div>`})}}"
284
255
  },
285
256
  {
286
257
  "kind": "variable",
@@ -290,27 +261,27 @@
290
261
  {
291
262
  "kind": "variable",
292
263
  "name": "Ce",
293
- "default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new ht(this,{context:mr,initialValue:null});this.eventsController=new tr(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new H(this,{task:([e])=>{let a=e?.find(l=>l.type===k.PAYMENT_CARD);if(!a)return V;let{cardNumber:i,cardExpiryDate:n,cardSecurityCode:o,cardholderName:s}=a.iframes;return this.cardFormProvider.setValue({cardholderNameInput:s,cardNumberInput:i,expiryInput:n,cvvInput:o,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate().then(c=>{let h=c?.validationErrors?.find(M=>M.name===rp.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:h?.message||h?.error||null,errorCode:h?.message||h?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>a.validate(),submit:l=>a.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let p=c.field||c.name,h=c.message||c.error,g=rp[p];if(g){let M=this.inputControllers.get(g);if(M){let _={valid:!1,error:h,errorCode:h};M.updateMetaFromValidation(_)}}})},registerInputController:(l,c)=>{this.inputControllers.set(l,c)},unregisterInputController:l=>{this.inputControllers.delete(l)},onUserInteraction:()=>{this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.primerContext?.paymentMethods]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"context\")){let i=e.get(\"context\")?.events??null;i?.host&&this._contextCardSubmitListener&&i.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),a=this.inputControllers.get(\"expire\"),i=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=a?.meta?.dirty===!0,s=i?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value,a=this.primerContext?.sdkState.isProcessing;if(!e||this.disabled||a)return;this.primerContext?.setProcessing?.(!0),this.formErrorMessage=null,e.setSubmissionState?.(!0);let i=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),n=!0;i&&(n=await i.validateForSubmission());let o=await e.validate?.();if(o?.valid&&n){if(i&&!await i.submitToSDK()){let p=A(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=p,this.primerContext?.setProcessing?.(!1),this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:p}]);return}let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s);let l=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(l)}else{this.primerContext?.setProcessing?.(!1);let s=o?.validationErrors;e.propagateValidationErrors?.(s||[]),this.cardFormProvider.setValue({...e,errors:s}),this.eventsController.dispatchFormSubmitErrors(s)}}render(){return this.setupCardFormTask.status===vt.ERROR||this.setupCardFormTask.status===vt.INITIAL?y:u`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>L(this.hasAssignedContent,()=>y,()=>u`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${L(this.shouldShowCardholderName,()=>u`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>y)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
264
+ "default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new ht(this,{context:mr,initialValue:null});this.eventsController=new tr(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new H(this,{task:([e])=>{let a=e?.find(l=>l.type===I.PAYMENT_CARD);if(!a)return V;let{cardNumber:i,cardExpiryDate:n,cardSecurityCode:o,cardholderName:s}=a.iframes;return this.cardFormProvider.setValue({cardholderNameInput:s,cardNumberInput:i,expiryInput:n,cvvInput:o,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate().then(c=>{let h=c?.validationErrors?.find(M=>M.name===rp.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:h?.message||h?.error||null,errorCode:h?.message||h?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>a.validate(),submit:l=>a.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let p=c.field||c.name,h=c.message||c.error,g=rp[p];if(g){let M=this.inputControllers.get(g);if(M){let _={valid:!1,error:h,errorCode:h};M.updateMetaFromValidation(_)}}})},registerInputController:(l,c)=>{this.inputControllers.set(l,c)},unregisterInputController:l=>{this.inputControllers.delete(l)},onUserInteraction:()=>{this.clearStaleVaultSelection(),this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.primerContext?.paymentMethods]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"context\")){let i=e.get(\"context\")?.events??null;i?.host&&this._contextCardSubmitListener&&i.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}clearStaleVaultSelection(){this.primerContext?.vaultItem?.selectedVaultedPaymentMethod&&this.primerContext.vaultItem.setSelectedVaultedPaymentMethod(null)}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),a=this.inputControllers.get(\"expire\"),i=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=a?.meta?.dirty===!0,s=i?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value,a=this.primerContext?.sdkState.isProcessing;if(!e||this.disabled||a)return;this.primerContext?.setProcessing?.(!0),this.formErrorMessage=null,e.setSubmissionState?.(!0);let i=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),n=!0;i&&(n=await i.validateForSubmission());let o=await e.validate?.();if(o?.valid&&n){if(i&&!await i.submitToSDK()){let p=A(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=p,this.primerContext?.setProcessing?.(!1),this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:p}]);return}let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s);let l=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(l)}else{this.primerContext?.setProcessing?.(!1);let s=o?.validationErrors;e.propagateValidationErrors?.(s||[]),this.cardFormProvider.setValue({...e,errors:s}),this.eventsController.dispatchFormSubmitErrors(s)}}render(){return this.setupCardFormTask.status===vt.ERROR||this.setupCardFormTask.status===vt.INITIAL?y:u`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>L(this.hasAssignedContent,()=>y,()=>u`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${L(this.shouldShowCardholderName,()=>u`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>y)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
294
265
  },
295
266
  {
296
267
  "kind": "variable",
297
268
  "name": "nt",
298
- "default": "class extends ne{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:a}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(a)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===vt.ERROR)return y;let e=this.getError();return u`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${L(!this.cardFormContext?.hideLabels,()=>u`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>y)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${L(e,a=>u`<primer-input-error slot=\"error\">${A(a,{id:a})}</primer-input-error>`,()=>y)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
269
+ "default": "class extends ie{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:a}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(a)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===vt.ERROR)return y;let e=this.getError();return u`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${L(!this.cardFormContext?.hideLabels,()=>u`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>y)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${L(e,a=>u`<primer-input-error slot=\"error\">${A(a,{id:a})}</primer-input-error>`,()=>y)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
299
270
  },
300
271
  {
301
272
  "kind": "variable",
302
273
  "name": "ot",
303
- "default": "class extends ne{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
274
+ "default": "class extends ie{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
304
275
  },
305
276
  {
306
277
  "kind": "variable",
307
278
  "name": "st",
308
- "default": "class extends ne{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
279
+ "default": "class extends ie{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
309
280
  },
310
281
  {
311
282
  "kind": "variable",
312
283
  "name": "lt",
313
- "default": "class extends ne{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
284
+ "default": "class extends ie{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
314
285
  },
315
286
  {
316
287
  "kind": "variable",
@@ -359,7 +330,7 @@
359
330
  },
360
331
  {
361
332
  "kind": "function",
362
- "name": "SD"
333
+ "name": "SO"
363
334
  }
364
335
  ],
365
336
  "exports": [
@@ -399,7 +370,7 @@
399
370
  "kind": "js",
400
371
  "name": "BillingAddress",
401
372
  "declaration": {
402
- "name": "ae",
373
+ "name": "re",
403
374
  "module": "dist/primer-loader.js"
404
375
  }
405
376
  },
@@ -415,7 +386,7 @@
415
386
  "kind": "js",
416
387
  "name": "Button",
417
388
  "declaration": {
418
- "name": "se",
389
+ "name": "oe",
419
390
  "module": "dist/primer-loader.js"
420
391
  }
421
392
  },
@@ -487,7 +458,7 @@
487
458
  "kind": "js",
488
459
  "name": "Collapsable",
489
460
  "declaration": {
490
- "name": "le",
461
+ "name": "se",
491
462
  "module": "dist/primer-loader.js"
492
463
  }
493
464
  },
@@ -583,7 +554,7 @@
583
554
  "kind": "js",
584
555
  "name": "PaymentMethodContainer",
585
556
  "declaration": {
586
- "name": "De",
557
+ "name": "Oe",
587
558
  "module": "dist/primer-loader.js"
588
559
  }
589
560
  },
@@ -711,7 +682,7 @@
711
682
  "kind": "js",
712
683
  "name": "VaultCvvInput",
713
684
  "declaration": {
714
- "name": "re",
685
+ "name": "le",
715
686
  "module": "dist/primer-loader.js"
716
687
  }
717
688
  },
@@ -719,7 +690,7 @@
719
690
  "kind": "js",
720
691
  "name": "VaultDeleteConfirmation",
721
692
  "declaration": {
722
- "name": "ke",
693
+ "name": "Ie",
723
694
  "module": "dist/primer-loader.js"
724
695
  }
725
696
  },
@@ -743,7 +714,7 @@
743
714
  "kind": "js",
744
715
  "name": "VaultManager",
745
716
  "declaration": {
746
- "name": "ie",
717
+ "name": "ae",
747
718
  "module": "dist/primer-loader.js"
748
719
  }
749
720
  },
@@ -751,7 +722,7 @@
751
722
  "kind": "js",
752
723
  "name": "VaultManagerHeader",
753
724
  "declaration": {
754
- "name": "Oe",
725
+ "name": "De",
755
726
  "module": "dist/primer-loader.js"
756
727
  }
757
728
  },
@@ -759,7 +730,7 @@
759
730
  "kind": "js",
760
731
  "name": "VaultPaymentMethodItem",
761
732
  "declaration": {
762
- "name": "Ie",
733
+ "name": "ke",
763
734
  "module": "dist/primer-loader.js"
764
735
  }
765
736
  },
@@ -807,12 +778,41 @@
807
778
  "kind": "js",
808
779
  "name": "loadPrimer",
809
780
  "declaration": {
810
- "name": "SD",
781
+ "name": "SO",
811
782
  "module": "dist/primer-loader.js"
812
783
  }
813
784
  }
814
785
  ]
815
786
  },
787
+ {
788
+ "kind": "javascript-module",
789
+ "path": "e2e/utils.ts",
790
+ "declarations": [
791
+ {
792
+ "kind": "variable",
793
+ "name": "test",
794
+ "default": "chromaticTest"
795
+ }
796
+ ],
797
+ "exports": [
798
+ {
799
+ "kind": "js",
800
+ "name": "expect",
801
+ "declaration": {
802
+ "name": "expect",
803
+ "package": "@chromatic-com/playwright"
804
+ }
805
+ },
806
+ {
807
+ "kind": "js",
808
+ "name": "test",
809
+ "declaration": {
810
+ "name": "test",
811
+ "module": "e2e/utils.ts"
812
+ }
813
+ }
814
+ ]
815
+ },
816
816
  {
817
817
  "kind": "javascript-module",
818
818
  "path": "src/consts.ts",
@@ -1664,197 +1664,6 @@
1664
1664
  }
1665
1665
  ]
1666
1666
  },
1667
- {
1668
- "kind": "javascript-module",
1669
- "path": "e2e/mocks/billing-address.ts",
1670
- "declarations": [
1671
- {
1672
- "kind": "variable",
1673
- "name": "CONFIGURATION_RESPONSE",
1674
- "type": {
1675
- "text": "object"
1676
- },
1677
- "default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
1678
- },
1679
- {
1680
- "kind": "variable",
1681
- "name": "CARD_NUMBER",
1682
- "type": {
1683
- "text": "string"
1684
- },
1685
- "default": "'4242 4242 4242 4242'"
1686
- },
1687
- {
1688
- "kind": "function",
1689
- "name": "mockBinData",
1690
- "parameters": [
1691
- {
1692
- "name": "page",
1693
- "type": {
1694
- "text": "Page"
1695
- }
1696
- }
1697
- ]
1698
- },
1699
- {
1700
- "kind": "function",
1701
- "name": "mockPaymentInstruments",
1702
- "parameters": [
1703
- {
1704
- "name": "page",
1705
- "type": {
1706
- "text": "Page"
1707
- }
1708
- }
1709
- ]
1710
- },
1711
- {
1712
- "kind": "function",
1713
- "name": "mockPayments",
1714
- "parameters": [
1715
- {
1716
- "name": "page",
1717
- "type": {
1718
- "text": "Page"
1719
- }
1720
- }
1721
- ]
1722
- }
1723
- ],
1724
- "exports": [
1725
- {
1726
- "kind": "js",
1727
- "name": "CONFIGURATION_RESPONSE",
1728
- "declaration": {
1729
- "name": "CONFIGURATION_RESPONSE",
1730
- "module": "e2e/mocks/billing-address.ts"
1731
- }
1732
- },
1733
- {
1734
- "kind": "js",
1735
- "name": "CARD_NUMBER",
1736
- "declaration": {
1737
- "name": "CARD_NUMBER",
1738
- "module": "e2e/mocks/billing-address.ts"
1739
- }
1740
- },
1741
- {
1742
- "kind": "js",
1743
- "name": "mockBinData",
1744
- "declaration": {
1745
- "name": "mockBinData",
1746
- "module": "e2e/mocks/billing-address.ts"
1747
- }
1748
- },
1749
- {
1750
- "kind": "js",
1751
- "name": "mockPaymentInstruments",
1752
- "declaration": {
1753
- "name": "mockPaymentInstruments",
1754
- "module": "e2e/mocks/billing-address.ts"
1755
- }
1756
- },
1757
- {
1758
- "kind": "js",
1759
- "name": "mockPayments",
1760
- "declaration": {
1761
- "name": "mockPayments",
1762
- "module": "e2e/mocks/billing-address.ts"
1763
- }
1764
- }
1765
- ]
1766
- },
1767
- {
1768
- "kind": "javascript-module",
1769
- "path": "e2e/mocks/paypal.ts",
1770
- "declarations": [
1771
- {
1772
- "kind": "variable",
1773
- "name": "CONFIGURATION_RESPONSE",
1774
- "type": {
1775
- "text": "object"
1776
- },
1777
- "default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
1778
- }
1779
- ],
1780
- "exports": [
1781
- {
1782
- "kind": "js",
1783
- "name": "CONFIGURATION_RESPONSE",
1784
- "declaration": {
1785
- "name": "CONFIGURATION_RESPONSE",
1786
- "module": "e2e/mocks/paypal.ts"
1787
- }
1788
- }
1789
- ]
1790
- },
1791
- {
1792
- "kind": "javascript-module",
1793
- "path": "e2e/mocks/shared.ts",
1794
- "declarations": [
1795
- {
1796
- "kind": "function",
1797
- "name": "mockConfigurationCall",
1798
- "parameters": [
1799
- {
1800
- "name": "page",
1801
- "type": {
1802
- "text": "Page"
1803
- }
1804
- },
1805
- {
1806
- "name": "config",
1807
- "type": {
1808
- "text": "unknown"
1809
- }
1810
- }
1811
- ]
1812
- },
1813
- {
1814
- "kind": "function",
1815
- "name": "mockDemoUrl",
1816
- "parameters": [
1817
- {
1818
- "name": "primerCheckoutOptions",
1819
- "optional": true,
1820
- "type": {
1821
- "text": "PrimerCheckoutOptions"
1822
- }
1823
- }
1824
- ]
1825
- }
1826
- ],
1827
- "exports": [
1828
- {
1829
- "kind": "js",
1830
- "name": "mockConfigurationCall",
1831
- "declaration": {
1832
- "name": "mockConfigurationCall",
1833
- "module": "e2e/mocks/shared.ts"
1834
- }
1835
- },
1836
- {
1837
- "kind": "js",
1838
- "name": "mockDemoUrl",
1839
- "declaration": {
1840
- "name": "mockDemoUrl",
1841
- "module": "e2e/mocks/shared.ts"
1842
- }
1843
- }
1844
- ]
1845
- },
1846
- {
1847
- "kind": "javascript-module",
1848
- "path": "e2e/tests/card-form-billing-address.spec.ts",
1849
- "declarations": [],
1850
- "exports": []
1851
- },
1852
- {
1853
- "kind": "javascript-module",
1854
- "path": "e2e/tests/paypal.spec.ts",
1855
- "declarations": [],
1856
- "exports": []
1857
- },
1858
1667
  {
1859
1668
  "kind": "javascript-module",
1860
1669
  "path": "dist/chunks/ar.E4O36EC6.js",
@@ -2988,6 +2797,197 @@
2988
2797
  }
2989
2798
  ]
2990
2799
  },
2800
+ {
2801
+ "kind": "javascript-module",
2802
+ "path": "e2e/mocks/billing-address.ts",
2803
+ "declarations": [
2804
+ {
2805
+ "kind": "variable",
2806
+ "name": "CONFIGURATION_RESPONSE",
2807
+ "type": {
2808
+ "text": "object"
2809
+ },
2810
+ "default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
2811
+ },
2812
+ {
2813
+ "kind": "variable",
2814
+ "name": "CARD_NUMBER",
2815
+ "type": {
2816
+ "text": "string"
2817
+ },
2818
+ "default": "'4242 4242 4242 4242'"
2819
+ },
2820
+ {
2821
+ "kind": "function",
2822
+ "name": "mockBinData",
2823
+ "parameters": [
2824
+ {
2825
+ "name": "page",
2826
+ "type": {
2827
+ "text": "Page"
2828
+ }
2829
+ }
2830
+ ]
2831
+ },
2832
+ {
2833
+ "kind": "function",
2834
+ "name": "mockPaymentInstruments",
2835
+ "parameters": [
2836
+ {
2837
+ "name": "page",
2838
+ "type": {
2839
+ "text": "Page"
2840
+ }
2841
+ }
2842
+ ]
2843
+ },
2844
+ {
2845
+ "kind": "function",
2846
+ "name": "mockPayments",
2847
+ "parameters": [
2848
+ {
2849
+ "name": "page",
2850
+ "type": {
2851
+ "text": "Page"
2852
+ }
2853
+ }
2854
+ ]
2855
+ }
2856
+ ],
2857
+ "exports": [
2858
+ {
2859
+ "kind": "js",
2860
+ "name": "CONFIGURATION_RESPONSE",
2861
+ "declaration": {
2862
+ "name": "CONFIGURATION_RESPONSE",
2863
+ "module": "e2e/mocks/billing-address.ts"
2864
+ }
2865
+ },
2866
+ {
2867
+ "kind": "js",
2868
+ "name": "CARD_NUMBER",
2869
+ "declaration": {
2870
+ "name": "CARD_NUMBER",
2871
+ "module": "e2e/mocks/billing-address.ts"
2872
+ }
2873
+ },
2874
+ {
2875
+ "kind": "js",
2876
+ "name": "mockBinData",
2877
+ "declaration": {
2878
+ "name": "mockBinData",
2879
+ "module": "e2e/mocks/billing-address.ts"
2880
+ }
2881
+ },
2882
+ {
2883
+ "kind": "js",
2884
+ "name": "mockPaymentInstruments",
2885
+ "declaration": {
2886
+ "name": "mockPaymentInstruments",
2887
+ "module": "e2e/mocks/billing-address.ts"
2888
+ }
2889
+ },
2890
+ {
2891
+ "kind": "js",
2892
+ "name": "mockPayments",
2893
+ "declaration": {
2894
+ "name": "mockPayments",
2895
+ "module": "e2e/mocks/billing-address.ts"
2896
+ }
2897
+ }
2898
+ ]
2899
+ },
2900
+ {
2901
+ "kind": "javascript-module",
2902
+ "path": "e2e/mocks/paypal.ts",
2903
+ "declarations": [
2904
+ {
2905
+ "kind": "variable",
2906
+ "name": "CONFIGURATION_RESPONSE",
2907
+ "type": {
2908
+ "text": "object"
2909
+ },
2910
+ "default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
2911
+ }
2912
+ ],
2913
+ "exports": [
2914
+ {
2915
+ "kind": "js",
2916
+ "name": "CONFIGURATION_RESPONSE",
2917
+ "declaration": {
2918
+ "name": "CONFIGURATION_RESPONSE",
2919
+ "module": "e2e/mocks/paypal.ts"
2920
+ }
2921
+ }
2922
+ ]
2923
+ },
2924
+ {
2925
+ "kind": "javascript-module",
2926
+ "path": "e2e/mocks/shared.ts",
2927
+ "declarations": [
2928
+ {
2929
+ "kind": "function",
2930
+ "name": "mockConfigurationCall",
2931
+ "parameters": [
2932
+ {
2933
+ "name": "page",
2934
+ "type": {
2935
+ "text": "Page"
2936
+ }
2937
+ },
2938
+ {
2939
+ "name": "config",
2940
+ "type": {
2941
+ "text": "unknown"
2942
+ }
2943
+ }
2944
+ ]
2945
+ },
2946
+ {
2947
+ "kind": "function",
2948
+ "name": "mockDemoUrl",
2949
+ "parameters": [
2950
+ {
2951
+ "name": "primerCheckoutOptions",
2952
+ "optional": true,
2953
+ "type": {
2954
+ "text": "PrimerCheckoutOptions"
2955
+ }
2956
+ }
2957
+ ]
2958
+ }
2959
+ ],
2960
+ "exports": [
2961
+ {
2962
+ "kind": "js",
2963
+ "name": "mockConfigurationCall",
2964
+ "declaration": {
2965
+ "name": "mockConfigurationCall",
2966
+ "module": "e2e/mocks/shared.ts"
2967
+ }
2968
+ },
2969
+ {
2970
+ "kind": "js",
2971
+ "name": "mockDemoUrl",
2972
+ "declaration": {
2973
+ "name": "mockDemoUrl",
2974
+ "module": "e2e/mocks/shared.ts"
2975
+ }
2976
+ }
2977
+ ]
2978
+ },
2979
+ {
2980
+ "kind": "javascript-module",
2981
+ "path": "e2e/tests/card-form-billing-address.spec.ts",
2982
+ "declarations": [],
2983
+ "exports": []
2984
+ },
2985
+ {
2986
+ "kind": "javascript-module",
2987
+ "path": "e2e/tests/paypal.spec.ts",
2988
+ "declarations": [],
2989
+ "exports": []
2990
+ },
2991
2991
  {
2992
2992
  "kind": "javascript-module",
2993
2993
  "path": "src/__tests__/setup.ts",
@@ -10060,9 +10060,19 @@
10060
10060
  "name": "setupCardFormTask",
10061
10061
  "privacy": "private",
10062
10062
  "readonly": true,
10063
- "default": "new Task(this, { task: ([methods]) => { const method = methods?.find( (pm) => pm.type === PaymentMethodType.PAYMENT_CARD, ); if (!method) { return initialState; } const { cardNumber, cardExpiryDate, cardSecurityCode, cardholderName } = method.iframes; this.cardFormProvider.setValue({ cardholderNameInput: cardholderName, cardNumberInput: cardNumber, expiryInput: cardExpiryDate, cvvInput: cardSecurityCode, setCardholderName: (val: string) => { method.setCardholderName(val); if (this.shouldRequireCardholderName) { void method.validate().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => method.validate(), submit: (args) => method.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) { return; } errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.primerContext?.paymentMethods], })",
10063
+ "default": "new Task(this, { task: ([methods]) => { const method = methods?.find( (pm) => pm.type === PaymentMethodType.PAYMENT_CARD, ); if (!method) { return initialState; } const { cardNumber, cardExpiryDate, cardSecurityCode, cardholderName } = method.iframes; this.cardFormProvider.setValue({ cardholderNameInput: cardholderName, cardNumberInput: cardNumber, expiryInput: cardExpiryDate, cvvInput: cardSecurityCode, setCardholderName: (val: string) => { method.setCardholderName(val); if (this.shouldRequireCardholderName) { void method.validate().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => method.validate(), submit: (args) => method.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) { return; } errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.clearStaleVaultSelection(); this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.primerContext?.paymentMethods], })",
10064
10064
  "description": "Task to set up the card form with hosted inputs"
10065
10065
  },
10066
+ {
10067
+ "kind": "method",
10068
+ "name": "clearStaleVaultSelection",
10069
+ "privacy": "private",
10070
+ "return": {
10071
+ "type": {
10072
+ "text": "void"
10073
+ }
10074
+ }
10075
+ },
10066
10076
  {
10067
10077
  "kind": "method",
10068
10078
  "name": "sendPaymentMethodSelectionEvent",
@@ -16363,24 +16373,6 @@
16363
16373
  "privacy": "private",
16364
16374
  "default": "null"
16365
16375
  },
16366
- {
16367
- "kind": "field",
16368
- "name": "cvvInputIsDirty",
16369
- "type": {
16370
- "text": "boolean"
16371
- },
16372
- "privacy": "private",
16373
- "default": "false"
16374
- },
16375
- {
16376
- "kind": "field",
16377
- "name": "cvvInputIsBlurred",
16378
- "type": {
16379
- "text": "boolean"
16380
- },
16381
- "privacy": "private",
16382
- "default": "false"
16383
- },
16384
16376
  {
16385
16377
  "kind": "field",
16386
16378
  "name": "cvvInput",
@@ -17031,6 +17023,11 @@
17031
17023
  "name": "handleDeleteClick",
17032
17024
  "privacy": "private",
17033
17025
  "description": "Dispatch delete event"
17026
+ },
17027
+ {
17028
+ "kind": "field",
17029
+ "name": "handleCvvRowClick",
17030
+ "privacy": "private"
17034
17031
  }
17035
17032
  ],
17036
17033
  "attributes": [