@primer-io/primer-js 1.6.3 → 1.8.0

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",
@@ -98,239 +69,244 @@
98
69
  },
99
70
  {
100
71
  "kind": "variable",
101
- "name": "ee",
102
- "default": "class extends b{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.darkMode=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=()=>{this.open=!1,this.removeEventListener(\"primer:dialog-close\",e)};this.addEventListener(\"primer:dialog-close\",e),this.dialog.startExitAnimation()}connectedCallback(){super.connectedCallback(),this.darkMode&&this.classList.add(\"primer-dark-theme\"),this.open||this.openDialog()}updated(e){super.updated(e),e.has(\"darkMode\")&&(this.darkMode?this.classList.add(\"primer-dark-theme\"):this.classList.remove(\"primer-dark-theme\")),e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return this.open?u`<primer-dialog class=\"${this.darkMode?\"primer-dark-theme\":\"\"}\" .open=${this.open} size=${this.size} .showCloseButton=${this.showCloseButton} @primer:dialog-close=\"${()=>{this.open=!1}}\" ><slot></slot>${this.cta?u`<primer-button @click=${this.cta.onClick} class=\"cta-button\">${this.cta.icon?u`<primer-icon name=\"${this.cta.icon}\" size=\"sm\" color=\"var(--primer-color-background-outlined-default)\" ></primer-icon>`:f} ${this.cta.label}</primer-button>`:f}</primer-dialog>`:f}}"
72
+ "name": "X",
73
+ "default": "class extends b{constructor(){super(...arguments);this.size=\"large\";this.showCloseButton=!1;this.darkMode=!1;this.open=!1}openDialog(){this.open=!0}closeDialog(){let e=()=>{this.open=!1,this.removeEventListener(\"primer:dialog-close\",e)};this.addEventListener(\"primer:dialog-close\",e),this.dialog.startExitAnimation()}connectedCallback(){super.connectedCallback(),this.darkMode&&this.classList.add(\"primer-dark-theme\"),this.open||this.openDialog()}updated(e){super.updated(e),e.has(\"darkMode\")&&(this.darkMode?this.classList.add(\"primer-dark-theme\"):this.classList.remove(\"primer-dark-theme\")),e.has(\"open\")&&this.open&&this.onOpen&&this.onOpen(),e.has(\"open\")&&this.open&&this.onContentRendered&&this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.onContentRendered?.()})})}render(){return this.open?u`<primer-dialog class=\"${this.darkMode?\"primer-dark-theme\":\"\"}\" .open=${this.open} size=${this.size} .showCloseButton=${this.showCloseButton} @primer:dialog-close=\"${()=>{this.open=!1}}\" ><slot></slot>${this.cta?u`<primer-button @click=${this.cta.onClick} class=\"cta-button\">${this.cta.icon?u`<primer-icon name=\"${this.cta.icon}\" size=\"sm\" color=\"var(--primer-color-background-outlined-default)\" ></primer-icon>`:y} ${this.cta.label}</primer-button>`:y}</primer-dialog>`:y}}"
103
74
  },
104
75
  {
105
76
  "kind": "variable",
106
- "name": "ve",
107
- "default": "class extends b{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this._jsInitialized=!1;this.previousLoadingState=!0;this.hasAssignedContent=!1;this._loadingTimeoutId=null;this._eventListenerController=null;this._classObserver=null;this.locale=nr(Ra());this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()};this.sdkContextController=new va(this),this.primerEventsController=new rr(this),this.styleProcessingController=new ba(this),this.vaultManagerController=new Pr(this),this.headlessSdkController=new ja(this)}set jsInitialized(e){this.requestUpdate(),this._jsInitialized=e}get jsInitialized(){return this._jsInitialized}get primerJS(){return this.headlessSdkController?.primerJSInstance??void 0}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:vault-submit\",this.handleExternalVaultSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:show-other-payments-toggle\",this.handleExternalShowOtherPaymentsToggle.bind(this),{signal:this._eventListenerController.signal}),this._classObserver=new MutationObserver(()=>{this.requestUpdate()}),this._classObserver.observe(this,{attributes:!0,attributeFilter:[\"class\"]})}attributeChangedCallback(e,a,i){e===gg.CUSTOM_STYLES?this.styleProcessingController.processCustomStyles(i):super.attributeChangedCallback(e,a,i)}disconnectedCallback(){this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null),this.sdkContextController.contextProvider.value.sdkState?.isLoading&&this.sdkContextController.setSdkState({isLoading:!1}),this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),this._classObserver&&(this._classObserver.disconnect(),this._classObserver=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(An(this.options?.locale)?this.locale=nr(this.options?.locale):B.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),Sn(this.locale))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.checkLoadingStateChange()}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}handleExternalVaultSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:vault-submit\",e.detail)}handleExternalShowOtherPaymentsToggle(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:show-other-payments-toggle\",e.detail)}checkLoadingStateChange(){let e=this.sdkContextController.contextProvider.value.sdkState.isLoading||!1;if(this.previousLoadingState&&!e){this.jsInitialized=!0;let a=this.sdkContextController.contextProvider.value.telemetry;a?.analytics.sendEvent({eventName:\"CHECKOUT_FLOW_STARTED\"});let i=a?.getSdkInitStartTime();a?.remoteLog.checkoutInitialized(i?Date.now()-i:void 0)}this.previousLoadingState=e,e&&!this._loadingTimeoutId?this._loadingTimeoutId=window.setTimeout(()=>{this.sdkContextController.contextProvider.value.sdkState.isLoading&&(B.warn(\"Loading timeout in component, forcing completion\"),this.sdkContextController.setSdkState({isLoading:!1}),this.jsInitialized=!0),this._loadingTimeoutId=null},1e4):!e&&this._loadingTimeoutId&&(window.clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null)}render(){let e=this.sdkContextController.contextProvider.value.sdkState,a=e.isLoading,i=e.primerJsError,n=!a&&!i;return u` ${w(i,()=>u`<primer-checkout-error></primer-checkout-error>`)}<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${w(this.hasAssignedContent||!n,()=>f,()=>u`<primer-main></primer-main>`)} `}addEventListener(e,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
77
+ "name": "Me",
78
+ "default": "class extends b{constructor(){super();this.customStyles=\"\";this.clientToken=\"\";this.options={};this.disableLoader=!1;this.jsInitialized=!1;this.hasAssignedContent=!1;this._eventListenerController=null;this._classObserver=null;this.locale=ar(xi());this.onSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=a.length>0,this.requestUpdate()};this.sdkContextController=new vi(this),this.primerEventsController=new tr(this),this.styleProcessingController=new Si(this),this.vaultManagerController=new Nr(this),this.headlessSdkController=new Zi(this)}get primerJS(){return this.headlessSdkController?.primerJSInstance??void 0}connectedCallback(){super.connectedCallback(),this.sdkContextController.setEventsController(this.primerEventsController),this._eventListenerController=new AbortController,document.addEventListener(\"primer:card-submit\",this.handleExternalCardSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:vault-submit\",this.handleExternalVaultSubmit.bind(this),{signal:this._eventListenerController.signal}),document.addEventListener(\"primer:show-other-payments-toggle\",this.handleExternalShowOtherPaymentsToggle.bind(this),{signal:this._eventListenerController.signal}),this._classObserver=new MutationObserver(()=>{this.requestUpdate()}),this._classObserver.observe(this,{attributes:!0,attributeFilter:[\"class\"]})}attributeChangedCallback(e,i,a){e===\"custom-styles\"?this.styleProcessingController.processCustomStyles(a):super.attributeChangedCallback(e,i,a)}disconnectedCallback(){this._eventListenerController&&(this._eventListenerController.abort(),this._eventListenerController=null),this._classObserver&&(this._classObserver.disconnect(),this._classObserver=null),super.disconnectedCallback()}willUpdate(e){e.has(\"options\")&&(this.options?.locale&&(Rn(this.options?.locale)?this.locale=ar(this.options?.locale):x.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),wn(this.locale))}updated(){let e=getComputedStyle(this);this.sdkContextController.setComputedStyles(e),this.jsInitialized=!this.sdkContextController.contextProvider.value.sdkState.isLoading}handleExternalCardSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:card-submit\",e.detail)}handleExternalVaultSubmit(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:vault-submit\",e.detail)}handleExternalShowOtherPaymentsToggle(e){this._eventListenerController?.signal.aborted||e.target!==this&&this.primerEventsController.dispatchEvent(\"primer:show-other-payments-toggle\",e.detail)}render(){return u`<slot name=\"main\" @slotchange=${this.onSlotChange}></slot>${L(!this.hasAssignedContent,()=>u`<primer-main></primer-main>`)} `}addEventListener(e,i,a){super.addEventListener(e,i,a)}removeEventListener(e,i,a){super.removeEventListener(e,i,a)}}"
108
79
  },
109
80
  {
110
81
  "kind": "function",
111
- "name": "Wl"
82
+ "name": "vd"
112
83
  },
113
84
  {
114
85
  "kind": "function",
115
- "name": "Jl"
86
+ "name": "Sd"
116
87
  },
117
88
  {
118
89
  "kind": "function",
119
- "name": "Cg"
90
+ "name": "oy"
120
91
  },
121
92
  {
122
93
  "kind": "function",
123
- "name": "Sg"
94
+ "name": "sy"
124
95
  },
125
96
  {
126
97
  "kind": "variable",
127
- "name": "He",
128
- "default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in Vn)return Vn[this.size];let e=parseInt(this.size,10);return isNaN(e)?Vn.medium:e}render(){let e=this.getSize(),a=20,i=`0 0 ${a} ${a}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),u`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${i}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
98
+ "name": "Ke",
99
+ "default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-loader)\";this.size=\"medium\";this.compact=!1}getSize(){if(this.size in qn)return qn[this.size];let e=parseInt(this.size,10);return isNaN(e)?qn.medium:e}render(){let e=this.getSize(),i=20,a=`0 0 ${i} ${i}`;return this.style.setProperty(\"--spinner-color\",this.color),this.style.setProperty(\"--spinner-size\",`${e}px`),u`<div class=\"spinner-container ${this.compact?\"compact\":\"\"}\"><svg class=\"spinner\" width=\"${e}\" height=\"${e}\" viewBox=\"${a}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"status\" aria-label=\"Loading\" ><path d=\"M4.27827 10.002C4.27827 6.84166 6.84019 4.27973 10.0005 4.27973C10.7676 4.27973 11.3894 3.6579 11.3894 2.89084C11.3894 2.12378 10.7676 1.50195 10.0005 1.50195C5.30607 1.50195 1.50049 5.30753 1.50049 10.002C1.50049 14.6964 5.30607 18.502 10.0005 18.502C14.6949 18.502 18.5005 14.6964 18.5005 10.002C18.5005 9.23489 17.8787 8.61306 17.1116 8.61306C16.3445 8.61306 15.7227 9.23489 15.7227 10.002C15.7227 13.1622 13.1608 15.7242 10.0005 15.7242C6.84019 15.7242 4.27827 13.1622 4.27827 10.002Z\" fill=\"currentColor\" class=\"path\" /></svg></div>`}}"
129
100
  },
130
101
  {
131
102
  "kind": "variable",
132
- "name": "$e",
133
- "default": "class extends b{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let a=this.findSlottedPrimerInput();a?a.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),a=e.find(i=>i.tagName.toLowerCase()===\"primer-input\");if(a)return a;for(let i of e){let n=i.querySelector(\"primer-input\");if(n)return n}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return u`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${W(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
103
+ "name": "Fe",
104
+ "default": "class extends b{constructor(){super(...arguments);this.focusWithin=!1;this.hasError=!1;this.handleWrapperClick=e=>{if(e.target!==e.currentTarget)return;let i=this.findSlottedPrimerInput();i?i.focus():this.dispatchEvent(new CustomEvent(\"wrapper-click\",{bubbles:!0,composed:!0}))}}findSlottedPrimerInput(){if(!this.inputSlot)return null;let e=this.inputSlot.assignedElements({flatten:!0}),i=e.find(a=>a.tagName.toLowerCase()===\"primer-input\");if(i)return i;for(let a of e){let n=a.querySelector(\"primer-input\");if(n)return n}return null}render(){let e={\"input-slot\":!0,\"focus-within\":this.focusWithin};return u`<div class=\"input-wrapper\"><slot name=\"label\"></slot><div class=\"${J(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
134
105
  },
135
106
  {
136
107
  "kind": "variable",
137
- "name": "nt",
108
+ "name": "tt",
138
109
  "default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.disabled=!1}render(){return u`<label for=${this.for}><slot></slot></label>`}}"
139
110
  },
140
111
  {
141
112
  "kind": "variable",
142
- "name": "ue",
143
- "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?f:u`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return f;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:f} >${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>`}}"
113
+ "name": "se",
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
  {
146
117
  "kind": "variable",
147
- "name": "ot",
118
+ "name": "rt",
148
119
  "default": "class extends b{constructor(){super(...arguments);this.for=\"\";this.active=!0}render(){return u`<span class=\"error\" role=\"alert\" aria-live=\"polite\" id=\"${this.for||\"\"}\" ><slot></slot></span>`}}"
149
120
  },
150
121
  {
151
122
  "kind": "variable",
152
- "name": "Ye",
153
- "default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Za[this.name]:null;return u`<div style=\"--internal-icon-color: ${this.color}\">${e||u`<slot></slot>`}</div>`}}"
123
+ "name": "Ue",
124
+ "default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Wi[this.name]:null;return u`<div style=\"--internal-icon-color: ${this.color}\">${e||u`<slot></slot>`}</div>`}}"
154
125
  },
155
126
  {
156
127
  "kind": "variable",
157
- "name": "st",
128
+ "name": "it",
158
129
  "default": "class extends b{constructor(){super(...arguments);this.type=\"complete\"}render(){return this.type===\"complete\"?u`<primer-icon size=\"lg\" name=\"successful-check\" color=\"var(--primer-color-icon-positive)\" ></primer-icon><p>Checkout complete!</p><p class=\"secondary\"> You'll be redirected to the order confirmation page soon. </p>`:u`<primer-icon size=\"lg\" name=\"failure-icon\" color=\"var(--primer-color-icon-negative)\" ></primer-icon><p>Payment failed</p>${this.description?u`<p class=\"secondary\">${this.description}</p>`:u`<p class=\"secondary\">Something went wrong.</p>`} `}}"
159
130
  },
160
131
  {
161
132
  "kind": "variable",
162
133
  "name": "$",
163
- "default": "class extends b{constructor(){super(...arguments);this.value=\"\";this.placeholder=\"\";this.disabled=!1;this.name=\"\";this.type=\"text\";this.required=!1;this.readonly=!1;this.pattern=\"\";this.min=\"\";this.max=\"\";this.step=\"\";this.autocomplete=\"\";this._id=\"\";this.hasFocus=!1;this.hasError=!1;this.handleInput=e=>{e.stopPropagation();let a=e.target;this.value=a.value;let i=new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(i)};this.handleChange=e=>{e.stopPropagation();let a=e.target;this.value=a.value;let i=new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(i)};this.handleFocus=()=>{this.hasFocus=!0,this.dispatchEvent(new FocusEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.hasFocus=!1,this.dispatchEvent(new FocusEvent(\"blur\",{bubbles:!0,composed:!0}))};this.handleInvalid=e=>{e.stopPropagation(),this.hasError=!0,this.dispatchEvent(new Event(\"invalid\",{bubbles:!0,composed:!0}))}}get id(){return this._id}set id(e){this._id=e,this.setAttribute(\"id\",e)}focus(e){this.inputElement?.focus(e)}blur(){this.inputElement?.blur()}select(){this.inputElement?.select()}setSelectionRange(e,a,i){this.inputElement?.setSelectionRange(e,a,i)}get validity(){return this.inputElement?.validity||{}}get validationMessage(){return this.inputElement?.validationMessage||\"\"}checkValidity(){return this.inputElement?.checkValidity()||!1}reportValidity(){return this.inputElement?.reportValidity()||!1}render(){let e={input:!0,\"input--focused\":this.hasFocus,\"input--disabled\":this.disabled,\"input--error\":this.hasError,\"input--readonly\":this.readonly},a=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(\" \");return u`<input part=\"input\" class=${a} .value=${this.value} .type=${this.type} ?disabled=${this.disabled} ?required=${this.required} ?readonly=${this.readonly} placeholder=${this.placeholder} pattern=${this.pattern} minlength=${this.minlength??\"\"} maxlength=${this.maxlength??\"\"} min=${this.min} max=${this.max} step=${this.step} autocomplete=${this.autocomplete} name=${this.name} id=${this.id} @input=${this.handleInput} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} @invalid=${this.handleInvalid} />`}addEventListener(e,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
134
+ "default": "class extends b{constructor(){super(...arguments);this.value=\"\";this.placeholder=\"\";this.disabled=!1;this.name=\"\";this.type=\"text\";this.required=!1;this.readonly=!1;this.pattern=\"\";this.min=\"\";this.max=\"\";this.step=\"\";this.autocomplete=\"\";this._id=\"\";this.hasFocus=!1;this.hasError=!1;this.handleInput=e=>{e.stopPropagation();let i=e.target;this.value=i.value;let a=new CustomEvent(\"input\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(a)};this.handleChange=e=>{e.stopPropagation();let i=e.target;this.value=i.value;let a=new CustomEvent(\"change\",{detail:this.value,bubbles:!0,composed:!0});this.dispatchEvent(a)};this.handleFocus=()=>{this.hasFocus=!0,this.dispatchEvent(new FocusEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.hasFocus=!1,this.dispatchEvent(new FocusEvent(\"blur\",{bubbles:!0,composed:!0}))};this.handleInvalid=e=>{e.stopPropagation(),this.hasError=!0,this.dispatchEvent(new Event(\"invalid\",{bubbles:!0,composed:!0}))}}get id(){return this._id}set id(e){this._id=e,this.setAttribute(\"id\",e)}focus(e){this.inputElement?.focus(e)}blur(){this.inputElement?.blur()}select(){this.inputElement?.select()}setSelectionRange(e,i,a){this.inputElement?.setSelectionRange(e,i,a)}get validity(){return this.inputElement?.validity||{}}get validationMessage(){return this.inputElement?.validationMessage||\"\"}checkValidity(){return this.inputElement?.checkValidity()||!1}reportValidity(){return this.inputElement?.reportValidity()||!1}render(){let e={input:!0,\"input--focused\":this.hasFocus,\"input--disabled\":this.disabled,\"input--error\":this.hasError,\"input--readonly\":this.readonly},i=Object.entries(e).filter(([,a])=>a).map(([a])=>a).join(\" \");return u`<input part=\"input\" class=${i} .value=${this.value} .type=${this.type} ?disabled=${this.disabled} ?required=${this.required} ?readonly=${this.readonly} placeholder=${this.placeholder} pattern=${this.pattern} minlength=${this.minlength??\"\"} maxlength=${this.maxlength??\"\"} min=${this.min} max=${this.max} step=${this.step} autocomplete=${this.autocomplete} name=${this.name} id=${this.id} @input=${this.handleInput} @change=${this.handleChange} @focus=${this.handleFocus} @blur=${this.handleBlur} @invalid=${this.handleInvalid} />`}addEventListener(e,i,a){super.addEventListener(e,i,a)}removeEventListener(e,i,a){super.removeEventListener(e,i,a)}}"
164
135
  },
165
136
  {
166
137
  "kind": "variable",
167
- "name": "re",
168
- "default": "class extends b{constructor(){super(...arguments);this.prefix=\"+351\";this.value=\"\";this.placeholder=\"\";this.inputId=\"primer-pt-phone-number-input\";this.maxLength=15;this.minLength=9;this.disabled=!1;this.hasErrors=!1;this.handleInput=e=>{e.stopPropagation();let a=e.target,n=a.value.replace(/\\D/g,\"\").slice(0,this.maxLocalDigits);a.value!==n&&(a.value=n),this.dispatchValueEvent(\"input\",n)};this.handleChange=e=>{e.stopPropagation();let i=e.target.value.replace(/\\D/g,\"\");this.dispatchValueEvent(\"change\",i)};this.handleHostClick=()=>{this.inputEl?.focus()}}get localDigits(){let a=(this.value==null?\"\":String(this.value)).replace(/[^\\d+]/g,\"\");return a.startsWith(this.prefix)?a.slice(this.prefix.length):a.replace(/^\\+/,\"\")}get maxLocalDigits(){return Math.max(this.maxLength-this.prefix.length,0)}updated(e){if(!e.has(\"value\")&&!e.has(\"prefix\"))return;let a=this.inputEl;if(!a)return;let i=this.localDigits;a.value!==i&&(a.value=i)}dispatchValueEvent(e,a){let i=a.length?`${this.prefix}${a}`:\"\";this.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0,composed:!0}))}focus(){this.inputEl?.focus()}render(){return u`<div @click=${this.handleHostClick} style=\"display: contents;\"><span class=\"flag\" aria-hidden=\"true\">${Mg}</span><span class=\"prefix\">${this.prefix}</span><input id=${this.inputId} type=\"tel\" inputmode=\"numeric\" autocomplete=\"tel-national\" ?disabled=${this.disabled} placeholder=${this.placeholder} @input=${this.handleInput} @change=${this.handleChange} /></div>`}}"
138
+ "name": "te",
139
+ "default": "class extends b{constructor(){super(...arguments);this.prefix=\"+351\";this.value=\"\";this.placeholder=\"\";this.inputId=\"primer-pt-phone-number-input\";this.maxLength=15;this.minLength=9;this.disabled=!1;this.hasErrors=!1;this.handleInput=e=>{e.stopPropagation();let i=e.target,n=i.value.replace(/\\D/g,\"\").slice(0,this.maxLocalDigits);i.value!==n&&(i.value=n),this.dispatchValueEvent(\"input\",n)};this.handleChange=e=>{e.stopPropagation();let a=e.target.value.replace(/\\D/g,\"\");this.dispatchValueEvent(\"change\",a)};this.handleHostClick=()=>{this.inputEl?.focus()}}get localDigits(){let i=(this.value==null?\"\":String(this.value)).replace(/[^\\d+]/g,\"\");return i.startsWith(this.prefix)?i.slice(this.prefix.length):i.replace(/^\\+/,\"\")}get maxLocalDigits(){return Math.max(this.maxLength-this.prefix.length,0)}updated(e){if(!e.has(\"value\")&&!e.has(\"prefix\"))return;let i=this.inputEl;if(!i)return;let a=this.localDigits;i.value!==a&&(i.value=a)}dispatchValueEvent(e,i){let a=i.length?`${this.prefix}${i}`:\"\";this.dispatchEvent(new CustomEvent(e,{detail:a,bubbles:!0,composed:!0}))}focus(){this.inputEl?.focus()}render(){return u`<div @click=${this.handleHostClick} style=\"display: contents;\"><span class=\"flag\" aria-hidden=\"true\">${cy}</span><span class=\"prefix\">${this.prefix}</span><input id=${this.inputId} type=\"tel\" inputmode=\"numeric\" autocomplete=\"tel-national\" ?disabled=${this.disabled} placeholder=${this.placeholder} @input=${this.handleInput} @change=${this.handleChange} /></div>`}}"
169
140
  },
170
141
  {
171
142
  "kind": "variable",
172
- "name": "be",
173
- "default": "class extends b{constructor(){super(...arguments);this.name=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[];this.handleChange=e=>{let i=e.target.value;this.dispatchEvent(new CustomEvent(\"change\",{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:i,bubbles:!0,composed:!0}))};this.handleFocus=()=>{this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))};this.stopNativeEvent=e=>{e.stopPropagation()}}renderSelectOptions(){let e=[];for(let a of this.options)e.push(u`<option value=${a.value} ?selected=${this.value===a.value} >${a.label}</option>`);return e}render(){return u`<select id=${this.id} name=${this.name} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @input=${this.stopNativeEvent} @focus=${this.handleFocus} @blur=${this.handleBlur} aria-invalid=${this.hasError?\"true\":\"false\"} ><option value=\"\" disabled ?selected=${!this.value}>${this.placeholder||\"Select an option\"}</option>${this.renderSelectOptions()}</select>`}}"
143
+ "name": "ye",
144
+ "default": "class extends b{constructor(){super(...arguments);this.name=\"\";this.value=\"\";this.disabled=!1;this.hasError=!1;this.placeholder=\"\";this.options=[];this.handleChange=e=>{let a=e.target.value;this.dispatchEvent(new CustomEvent(\"change\",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"input\",{detail:a,bubbles:!0,composed:!0}))};this.handleFocus=()=>{this.dispatchEvent(new CustomEvent(\"focus\",{bubbles:!0,composed:!0}))};this.handleBlur=()=>{this.dispatchEvent(new CustomEvent(\"blur\",{bubbles:!0,composed:!0}))};this.stopNativeEvent=e=>{e.stopPropagation()}}renderSelectOptions(){let e=[];for(let i of this.options)e.push(u`<option value=${i.value} ?selected=${this.value===i.value} >${i.label}</option>`);return e}render(){return u`<select id=${this.id} name=${this.name} ?disabled=${this.disabled} ?required=${!this.value} @change=${this.handleChange} @input=${this.stopNativeEvent} @focus=${this.handleFocus} @blur=${this.handleBlur} aria-invalid=${this.hasError?\"true\":\"false\"} ><option value=\"\" disabled ?selected=${!this.value}>${this.placeholder||\"Select an option\"}</option>${this.renderSelectOptions()}</select>`}}"
174
145
  },
175
146
  {
176
147
  "kind": "variable",
177
- "name": "pe",
178
- "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>`}}"
148
+ "name": "le",
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,i=this.ariaLabel||this.header||e,a=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=${i} ><span>${a}</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
  {
181
152
  "kind": "variable",
182
- "name": "ze",
183
- "default": "class extends b{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return f;let e={\"error-message\":!0,hidden:!this.visible};return u`<div part=\"error-message\" class=${W(e)} aria-live=\"assertive\" aria-atomic=\"true\" ><div part=\"error-icon\" class=\"error-icon\"><primer-icon name=\"failure-icon\" size=\"sm\" color=\"var(--primer-color-icon-negative)\" ></primer-icon></div><div part=\"error-content\" class=\"error-content\">${this.message}</div></div>`}}"
153
+ "name": "Ve",
154
+ "default": "class extends b{constructor(){super();this.message=\"\";this.visible=!1;this._role=\"alert\";this.showMessage=!1;this.role=\"alert\"}get role(){return this._role}set role(e){this._role=e,this.setAttribute(\"role\",e)}updated(e){e.has(\"visible\")&&this.handleVisibilityChange()}handleVisibilityChange(){this.visible?(this.showMessage=!0,this.setAttribute(\"aria-hidden\",\"false\")):setTimeout(()=>{this.showMessage=!1,this.setAttribute(\"aria-hidden\",\"true\")},200)}render(){if(!this.showMessage&&!this.visible)return y;let e={\"error-message\":!0,hidden:!this.visible};return u`<div part=\"error-message\" class=${J(e)} aria-live=\"assertive\" aria-atomic=\"true\" ><div part=\"error-icon\" class=\"error-icon\"><primer-icon name=\"failure-icon\" size=\"sm\" color=\"var(--primer-color-icon-negative)\" ></primer-icon></div><div part=\"error-content\" class=\"error-content\">${this.message}</div></div>`}}"
184
155
  },
185
156
  {
186
157
  "kind": "variable",
187
- "name": "xe",
188
- "default": "class extends b{constructor(){super(...arguments);this.size=\"flex\";this.showCloseButton=!0;this._animationState=\"entering\";this._isVisible=!1;this._handleCloseClick=()=>{this._startExitAnimation()}}startExitAnimation(){this._startExitAnimation()}connectedCallback(){super.connectedCallback(),document.body.style.overflow=\"hidden\",this._startEnterAnimation()}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow=\"\",this._animationTimeout&&clearTimeout(this._animationTimeout)}_startEnterAnimation(){this._animationState=\"entering\",this._isVisible=!0,requestAnimationFrame(()=>{this._animationTimeout=window.setTimeout(()=>{this._animationState=\"entered\",this.dispatchEvent(new CustomEvent(\"primer:dialog-open\",{bubbles:!0,composed:!0}))},500)})}_startExitAnimation(){this._animationTimeout&&clearTimeout(this._animationTimeout),this._animationState=\"exiting\",this._animationTimeout=window.setTimeout(()=>{this._animationState=\"exited\",this._isVisible=!1,this.dispatchEvent(new CustomEvent(\"primer:dialog-close\",{bubbles:!0,composed:!0}))},500)}render(){return this._isVisible?u`<div class=${W({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${W({dialog:!0,[this.size]:!0,\"dialog--entering\":this._animationState===\"entering\",\"dialog--entered\":this._animationState===\"entered\",\"dialog--exiting\":this._animationState===\"exiting\"})} ><div class=\"header\">${this.showCloseButton?u`<primer-button class=\"close\" variant=\"tertiary\" @click=${this._handleCloseClick} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:\"\"}</div><div class=\"content\"><slot></slot></div></div></div>`:u``}}"
158
+ "name": "Re",
159
+ "default": "class extends b{constructor(){super(...arguments);this.size=\"flex\";this.showCloseButton=!0;this._animationState=\"entering\";this._isVisible=!1;this._handleCloseClick=()=>{this._startExitAnimation()}}startExitAnimation(){this._startExitAnimation()}connectedCallback(){super.connectedCallback(),document.body.style.overflow=\"hidden\",this._startEnterAnimation()}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow=\"\",this._animationTimeout&&clearTimeout(this._animationTimeout)}_startEnterAnimation(){this._animationState=\"entering\",this._isVisible=!0,requestAnimationFrame(()=>{this._animationTimeout=window.setTimeout(()=>{this._animationState=\"entered\",this.dispatchEvent(new CustomEvent(\"primer:dialog-open\",{bubbles:!0,composed:!0}))},500)})}_startExitAnimation(){this._animationTimeout&&clearTimeout(this._animationTimeout),this._animationState=\"exiting\",this._animationTimeout=window.setTimeout(()=>{this._animationState=\"exited\",this._isVisible=!1,this.dispatchEvent(new CustomEvent(\"primer:dialog-close\",{bubbles:!0,composed:!0}))},500)}render(){return this._isVisible?u`<div class=${J({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${J({dialog:!0,[this.size]:!0,\"dialog--entering\":this._animationState===\"entering\",\"dialog--entered\":this._animationState===\"entered\",\"dialog--exiting\":this._animationState===\"exiting\"})} ><div class=\"header\">${this.showCloseButton?u`<primer-button class=\"close\" variant=\"tertiary\" @click=${this._handleCloseClick} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:\"\"}</div><div class=\"content\"><slot></slot></div></div></div>`:u``}}"
189
160
  },
190
161
  {
191
162
  "kind": "variable",
192
- "name": "Ce",
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||!a?V:{manager:i.manager}},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{await this._setupTask.value.manager.start({paymentMethodCategoryId:this.selectedCategory})}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.manager.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.primerContext?.klarnaCategories?.categories||[];return this.primerContext?.klarnaCategories?.isLoading||!1?u`<div class=\"loading\"><primer-spinner size=\"small\"></primer-spinner></div>`:(e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].id),e.length===1?f:u`<div class=\"category-selection\">${e.map(i=>u`<button class=${W({\"category-button\":!0,selected:i.id===this.selectedCategory,loading:this.categoryLoading&&i.id===this.selectedCategory})} @click=${()=>{this.selectCategory(i.id)}} ?disabled=${this.disabled} ><span class=${W({\"category-label\":!0,hidden:this.categoryLoading&&i.id===this.selectedCategory})} >${i.name}</span >${this.categoryLoading&&i.id===this.selectedCategory?u`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:f}</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=${Ct(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:({manager: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>`:f})}}"
163
+ "name": "fe",
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,i])=>{let a=e?.find(n=>n.type===w.KLARNA);return a?.type!==w.KLARNA||!i?V:{method:a}},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(i=>u`<button class=${J({\"category-button\":!0,selected:i.identifier===this.selectedCategory,loading:this.categoryLoading&&i.identifier===this.selectedCategory})} @click=${()=>{this.selectCategory(i.identifier)}} ?disabled=${this.disabled} ><span class=${J({\"category-label\":!0,hidden:this.categoryLoading&&i.identifier===this.selectedCategory})} >${i.name}</span >${this.categoryLoading&&i.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=${yt(this.primerContext?.sdkState)} @confirm=${()=>this.startKlarnaPayment()} ></primer-payment-method-accordion-confirm-button>`}render(){return this._setupTask.render({error:e=>{let i=e instanceof Error?e.message:\"Unknown error in Klarna\";return u`<div class=\"error\"> Error loading Klarna: ${i}</div>`},complete:({method:e})=>e?u`<primer-payment-method-accordion .type=${w.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",
197
- "name": "Be",
198
- "default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=Hr();this.renderButtonTask=new H(this,{args:()=>[this.paymentMethod],task:async([e])=>{if(!e)return V;await this.updateComplete;let a=e.manager.createButton(),i=this.buttonContainerRef.value;if(!i)throw new Q({origin:\"integration\",message:\"Button container not found\",code:Ns.CONTAINER_NOT_FOUND});let n=e.type===\"GOOGLE_PAY\"?{shadowRoot:this.shadowRoot}:e.type===\"APPLE_PAY\"?{buttonHeight:gd(i)}:{buttonHeight:Ng(gd(this))};return await a.render(i,{style:n}),this.disabled&&await a.setDisabled(this.disabled),a}})}attributeChangedCallback(e,a,i){if(super.attributeChangedCallback(e,a,i),e===\"disabled\"&&a!==i){let n=i!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}willUpdate(e){e.has(\"paymentMethod\")&&(this.type=this.paymentMethod?.type)}render(){return u`<div class=\"native-button-container\" ${pr(this.buttonContainerRef)} ></div>`}}"
168
+ "name": "xe",
169
+ "default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=Yr();this.renderButtonTask=new H(this,{args:()=>[this.paymentMethod],task:async([e])=>{if(!e)return V;await this.updateComplete;let i=this.buttonContainerRef.value;if(!i)throw new j({origin:\"integration\",message:\"Button container not found\",code:bi.CONTAINER_NOT_FOUND});let a=e.type===\"GOOGLE_PAY\"?{shadowRoot:this.shadowRoot}:e.type===\"APPLE_PAY\"?{buttonHeight:Gd(i)}:{buttonHeight:gy(Gd(this))};return await e.render(i,{style:a}),this.disabled&&await e.setDisabled(this.disabled),e}})}attributeChangedCallback(e,i,a){if(super.attributeChangedCallback(e,i,a),e===\"disabled\"&&i!==a){let n=a!==null,o=this.renderButtonTask.value;o&&o.setDisabled(n)}}willUpdate(e){e.has(\"paymentMethod\")&&(this.type=this.paymentMethod?.type)}render(){return u`<div class=\"native-button-container\" ${pr(this.buttonContainerRef)} ></div>`}}"
199
170
  },
200
171
  {
201
172
  "kind": "variable",
202
- "name": "Se",
203
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.handleExpandedChange=async e=>{if(this.disabled)return;if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState!==\"collapsed\")return;if(!this.paymentMethod?.manager){this.errorMessage=T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",B.error(\"Manager not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let a=e.target,i=a.value,o=i.replace(/\\D/g,\"\").slice(0,6);i!==o&&(a.value=o),this.blikCode=o,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),o.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}startPollingTimer(){this.pollingDuration=0,this.pollingTimer=window.setInterval(()=>{this.pollingDuration+=1},1e3)}stopPollingTimer(){this.pollingTimer!==null&&(window.clearInterval(this.pollingTimer),this.pollingTimer=null),this.pollingDuration=0}async submitBlikCode(){if(this.currentState===\"loading\")return;if(this.blikCode.length!==6){this.errorMessage=T(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod?.manager;if(!e){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",B.error(\"BLIK manager not available via loadManagerTask\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{await e.start({blikCode:this.blikCode}),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(a){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:T(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return u`<div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${T(\"getCodeFromBankingApp\",{id:\"getCodeFromBankingApp\"})}</label><input id=\"blik-code\" type=\"text\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" class=\"blik-input\" .value=\"${this.blikCode}\" @input=\"${this.handleInput}\" ?disabled=\"${this.disabled}\" placeholder=\"000000\" aria-label=\"${T(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div>`}renderLoading(){return u`<div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?u`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:f}</div>`}renderError(){return u`<div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${T(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return f}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():f}</primer-payment-method-accordion>`}}"
173
+ "name": "ve",
174
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.blikCode=\"\";this.errorMessage=\"\";this.pollingDuration=0;this.pollingTimer=null;this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod){this.errorMessage=M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",x.error(\"Payment method not available when expanding BLIK form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.blikCode=\"\",this.errorMessage=\"\",this.stopPollingTimer()};this.handleInput=e=>{let i=e.target,a=i.value,o=a.replace(/\\D/g,\"\").slice(0,6);a!==o&&(i.value=o),this.blikCode=o,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\"),o.length===6&&this.submitBlikCode()};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.blikCode=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"#blik-code\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}startPollingTimer(){this.pollingDuration=0,this.pollingTimer=window.setInterval(()=>{this.pollingDuration+=1},1e3)}stopPollingTimer(){this.pollingTimer!==null&&(window.clearInterval(this.pollingTimer),this.pollingTimer=null),this.pollingDuration=0}async submitBlikCode(){if(this.currentState!==\"loading\"){if(this.blikCode.length!==6){this.errorMessage=M(\"sixDigitCodeErrorTooShort\",{id:\"sixDigitCodeErrorTooShort\"}),this.currentState=\"error\";return}if(!this.paymentMethod){this.errorMessage=\"BLIK payment method not initialized\",this.currentState=\"error\",x.error(\"BLIK payment method not available\");return}this.currentState=\"loading\",this.errorMessage=\"\",this.startPollingTimer();try{this.paymentMethod.setBlikCode(this.blikCode),await this.paymentMethod.start(),this.stopPollingTimer(),this.currentState=\"collapsed\",this.blikCode=\"\"}catch(e){this.stopPollingTimer(),this.currentState=\"error\",this.errorMessage=e instanceof Error?e.message:M(\"tokenizationError\",{id:\"tokenizationError\"})}}}renderExpandedInput(){return u`<div class=\"blik-input-wrapper\"><label for=\"blik-code\" class=\"blik-label\">${M(\"getCodeFromBankingApp\",{id:\"getCodeFromBankingApp\"})}</label><input id=\"blik-code\" type=\"text\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" class=\"blik-input\" .value=\"${this.blikCode}\" @input=\"${this.handleInput}\" ?disabled=\"${this.disabled}\" placeholder=\"000000\" aria-label=\"${M(\"sixDigitCodeLabel\",{id:\"sixDigitCodeLabel\"})}\" autocomplete=\"off\" spellcheck=\"false\" /></div>`}renderLoading(){return u`<div class=\"blik-loading\"><primer-spinner size=\"medium\"></primer-spinner>${this.pollingDuration>30?u`<div class=\"blik-timeout-warning\"> This is taking longer than expected... </div>`:y}</div>`}renderError(){return u`<div class=\"blik-error\"><div class=\"blik-error-message\" role=\"alert\">${this.errorMessage||M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"blik-retry-button\" @click=\"${this.handleRetry}\" ?disabled=\"${this.disabled}\" >${M(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return y}}disconnectedCallback(){super.disconnectedCallback(),this.stopPollingTimer()}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():y}</primer-payment-method-accordion>`}}"
204
175
  },
205
176
  {
206
177
  "kind": "variable",
207
- "name": "Ie",
208
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.phoneNumber=\"\";this.errorMessage=\"\";this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod?.manager){this.errorMessage=T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",B.error(\"Manager not available when expanding MB WAY form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.phoneNumber=\"\",this.errorMessage=\"\"};this.handleInput=e=>{this.phoneNumber=e.detail,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\")};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.phoneNumber=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}get isPhoneValid(){return this.phoneNumber.length>=bd&&this.phoneNumber.length<=Cd&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(this.currentState===\"loading\")return;if(!this.isPhoneValid){this.errorMessage=T(\"telephoneNumberErrorTooShort\",{id:\"telephoneNumberErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod?.manager;if(!e){this.errorMessage=\"MB WAY payment method not initialized\",this.currentState=\"error\",B.error(\"MB WAY manager not available\");return}this.currentState=\"loading\",this.errorMessage=\"\";try{await e.start({phoneNumber:this.phoneNumber}),this.currentState=\"collapsed\",this.phoneNumber=\"\"}catch(a){this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:T(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return u`<div class=\"mbway-input-wrapper\"><label class=\"mbway-label\" for=\"primer-mbway-phone\">${T(\"telephoneNumberLabel\",{id:\"telephoneNumberLabel\"})}</label><primer-pt-phone-number-input input-id=\"primer-mbway-phone\" .value=${this.phoneNumber} .placeholder=${T(\"telephoneNumberPlaceholder\",{id:\"telephoneNumberPlaceholder\"})} .maxLength=${Cd} .minLength=${bd} ?disabled=${this.disabled} ?has-errors=${!!this.errorMessage} @input=${this.handleInput} ></primer-pt-phone-number-input><button class=\"mbway-submit-button\" @click=${()=>void this.submit()} ?disabled=${this.disabled||!this.isPhoneValid} >${T(\"pay\",{id:\"pay\"})}</button></div>`}renderLoading(){let e=T(\"Complete your payment in {appName}\",{id:\"completeYourPaymentInTheApp\"}).replace(\"{appName}\",\"MB WAY\");return u`<div class=\"mbway-loading\"><primer-spinner size=\"medium\"></primer-spinner><div class=\"mbway-loading-message\">${e}</div></div>`}renderError(){return u`<div class=\"mbway-error\"><div class=\"mbway-error-message\" role=\"alert\">${this.errorMessage||T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"mbway-retry-button\" @click=${this.handleRetry} ?disabled=${this.disabled} >${T(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return f}}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():f}</primer-payment-method-accordion>`}}"
178
+ "name": "Pe",
179
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.currentState=\"collapsed\";this.phoneNumber=\"\";this.errorMessage=\"\";this.handleExpandedChange=async e=>{if(!this.disabled){if(!e.detail.expanded){this.handleCollapse();return}if(this.currentState===\"collapsed\"){if(!this.paymentMethod){this.errorMessage=M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"}),this.currentState=\"error\",x.error(\"Payment method not available when expanding MB WAY form\");return}this.currentState=\"expanded-input\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}};this.handleCollapse=()=>{this.currentState=\"collapsed\",this.phoneNumber=\"\",this.errorMessage=\"\"};this.handleInput=e=>{this.phoneNumber=e.detail,this.currentState===\"error\"&&(this.currentState=\"expanded-input\",this.errorMessage=\"\")};this.handleRetry=async()=>{this.currentState=\"expanded-input\",this.errorMessage=\"\",this.phoneNumber=\"\",await this.updateComplete,this.shadowRoot?.querySelector(\"primer-pt-phone-number-input\")?.focus()}}get isExpanded(){return this.currentState!==\"collapsed\"}get isPhoneValid(){return this.phoneNumber.length>=Vd&&this.phoneNumber.length<=Hd&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(this.currentState===\"loading\")return;if(!this.isPhoneValid){this.errorMessage=M(\"telephoneNumberErrorTooShort\",{id:\"telephoneNumberErrorTooShort\"}),this.currentState=\"error\";return}let e=this.paymentMethod;if(!e){this.errorMessage=\"MB WAY payment method not initialized\",this.currentState=\"error\",x.error(\"MB WAY payment method not available\");return}this.currentState=\"loading\",this.errorMessage=\"\";try{e.setPhoneNumber(this.phoneNumber),await e.start(),this.currentState=\"collapsed\",this.phoneNumber=\"\"}catch(i){this.currentState=\"error\",this.errorMessage=i instanceof Error?i.message:M(\"tokenizationError\",{id:\"tokenizationError\"})}}renderExpandedInput(){return u`<div class=\"mbway-input-wrapper\"><label class=\"mbway-label\" for=\"primer-mbway-phone\">${M(\"telephoneNumberLabel\",{id:\"telephoneNumberLabel\"})}</label><primer-pt-phone-number-input input-id=\"primer-mbway-phone\" .value=${this.phoneNumber} .placeholder=${M(\"telephoneNumberPlaceholder\",{id:\"telephoneNumberPlaceholder\"})} .maxLength=${Hd} .minLength=${Vd} ?disabled=${this.disabled} ?has-errors=${!!this.errorMessage} @input=${this.handleInput} ></primer-pt-phone-number-input><button class=\"mbway-submit-button\" @click=${()=>void this.submit()} ?disabled=${this.disabled||!this.isPhoneValid} >${M(\"pay\",{id:\"pay\"})}</button></div>`}renderLoading(){let e=M(\"Complete your payment in {appName}\",{id:\"completeYourPaymentInTheApp\"}).replace(\"{appName}\",\"MB WAY\");return u`<div class=\"mbway-loading\"><primer-spinner size=\"medium\"></primer-spinner><div class=\"mbway-loading-message\">${e}</div></div>`}renderError(){return u`<div class=\"mbway-error\"><div class=\"mbway-error-message\" role=\"alert\">${this.errorMessage||M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}</div><button class=\"mbway-retry-button\" @click=${this.handleRetry} ?disabled=${this.disabled} >${M(\"retry_button\",{id:\"retry_button\"})}</button></div>`}renderExpandedState(){switch(this.currentState){case\"expanded-input\":return this.renderExpandedInput();case\"loading\":return this.renderLoading();case\"error\":return this.renderError();default:return y}}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled} .expanded=${this.isExpanded} @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderExpandedState():y}</primer-payment-method-accordion>`}}"
209
180
  },
210
181
  {
211
182
  "kind": "variable",
212
- "name": "Ee",
213
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.isExpanded=!1;this.isLoading=!1;this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded?this.loadQRCode():(this.paymentMethod?.manager.stop(),this.qrCodeUrl=void 0,this.isLoading=!1)}}disconnectedCallback(){super.disconnectedCallback(),this.isExpanded&&this.paymentMethod?.manager.stop()}async loadQRCode(){!this.paymentMethod?.manager||this.isLoading||(this.isLoading=!0,await this.paymentMethod.manager.start({onQRCodeReceived:e=>{this.qrCodeUrl=e,this.isLoading=!1}}))}willUpdate(e){e.has(\"primerContext\")&&this.isLoading&&this.isExpanded&&this.primerContext?.sdkState.paymentFailure&&(this.isLoading=!1,this.isExpanded=!1,this.qrCodeUrl=void 0)}renderQRCode(){return this.isLoading?u`<div class=\"qrcode-loading\"><primer-spinner size=\"medium\"></primer-spinner></div>`:u`<div class=\"qrcode-content\"><div class=\"qrcode-labels\"><h3 class=\"qrcode-title\">${T(\"scanToPay\",{id:\"scanToPay\"})}</h3><p class=\"qrcode-description\">${T(\"uploadScreenshot\",{id:\"uploadScreenshot\"})}</p></div><div class=\"qrcode-image\">${this.qrCodeUrl?u`<img src=${this.qrCodeUrl} alt=${T(\"qrCode\",{id:\"qrCode\"})} />`:f}</div></div>`}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled&&!this.isExpanded} ?loading=${this.isLoading} .expanded=${this.isExpanded} suppress-blur-collapse @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderQRCode():f}</primer-payment-method-accordion>`}}"
183
+ "name": "Se",
184
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.isExpanded=!1;this.isLoading=!1;this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded?this.loadQRCode():(this.paymentMethod?.stop(),this.qrCodeUrl=void 0,this.isLoading=!1)}}disconnectedCallback(){super.disconnectedCallback(),this.isExpanded&&this.paymentMethod?.stop()}async loadQRCode(){!this.paymentMethod||this.isLoading||(this.isLoading=!0,this.paymentMethod.setOnQRCodeReceived(e=>{this.qrCodeUrl=e,this.isLoading=!1}),await this.paymentMethod.start())}willUpdate(e){e.has(\"primerContext\")&&this.isLoading&&this.isExpanded&&this.primerContext?.sdkState.paymentFailure&&(this.isLoading=!1,this.isExpanded=!1,this.qrCodeUrl=void 0)}renderQRCode(){return this.isLoading?u`<div class=\"qrcode-loading\"><primer-spinner size=\"medium\"></primer-spinner></div>`:u`<div class=\"qrcode-content\"><div class=\"qrcode-labels\"><h3 class=\"qrcode-title\">${M(\"scanToPay\",{id:\"scanToPay\"})}</h3><p class=\"qrcode-description\">${M(\"uploadScreenshot\",{id:\"uploadScreenshot\"})}</p></div><div class=\"qrcode-image\">${this.qrCodeUrl?u`<img src=${this.qrCodeUrl} alt=${M(\"qrCode\",{id:\"qrCode\"})} />`:y}</div></div>`}render(){return u`<primer-payment-method-accordion .type=${this.paymentMethod?.type} ?disabled=${this.disabled&&!this.isExpanded} ?loading=${this.isLoading} .expanded=${this.isExpanded} suppress-blur-collapse @expanded-change=${this.handleExpandedChange} >${this.isExpanded?this.renderQRCode():y}</primer-payment-method-accordion>`}}"
214
185
  },
215
186
  {
216
187
  "kind": "variable",
217
- "name": "De",
218
- "default": "class extends b{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.isActive=!1;this.handleClick=()=>{this.disabled||this.primerContext?.paymentMethods?.find(a=>a.type===this.type)?.managerType===\"CARD\"||this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}}updated(){let e=!!this.primerContext?.sdkState?.isProcessing;this.toggleAttribute(\"processing-inactive\",e&&!this.isActive)}render(){if(!this.type)return f;let e=this.primerContext?.paymentMethods.find(i=>i.type===this.type);if(!e)return f;let a;switch(e?.managerType){case\"CARD\":a=u`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":a=u`<primer-native-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-native-payment>`;break;case\"QRCODE\":a=u`<primer-qrcode .paymentMethod=${e} ?disabled=${this.disabled} ></primer-qrcode>`;break;case\"BLIK\":a=u`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`;break;case\"REDIRECT\":a=u`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":a=u`<primer-klarna ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ADYEN_KLARNA\":a=u`<primer-adyen-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-klarna>`;break;case\"MBWAY\":a=u`<primer-adyen-mbway .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-mbway>`;break;default:return f}return u`<div @click=${this.handleClick} @expanded-change=${i=>{this.isActive=i.detail.expanded}} >${a}</div>`}}"
188
+ "name": "He",
189
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,i])=>{if(!e||!i)return V;let a=i.getPaymentMethodConfiguration(e);if(!a)return V;let n=Yd(e)?this.primerContext?.clientOptions?.giftCard:void 0,o=a.displayMetadata.button,s=this._getBackgroundColor(e,o,n?.background),l=this._getTextColor(s);return{backgroundColor:s,textColor:l,name:a.name,alt:n?.logoAlt??a.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 i=e?eo(e):\"\";return i===\"payWith\"&&(i=\"pay_with\"),M(i,{id:i})}_getBackgroundColor(e,i,a){switch(e){case w.KLARNA:case w.ADYEN_KLARNA:return i.backgroundColor.light??i.backgroundColor.colored;default:return a??i.backgroundColor.colored??i.backgroundColor.light}}_getIconUrl(e,i,a,n){if(n)return n;switch(e){case w.KLARNA:case w.ADYEN_KLARNA:return Cy;case w.PAY_NL_PAYCONIQ:return a===i.backgroundColor.light?vy:Sy;case w.ADYEN_CASHAPP:return i.iconUrl.dark??i.iconUrl.colored??i.iconUrl.light;default:return e===\"TRIPLE_A\"?by:i.iconUrl.colored??i.iconUrl.light}}_getIconPosition(e,i){switch(e){case w.KLARNA:case w.ADYEN_KLARNA:return\"END\";default:return i.iconPositionRelativeToText||\"START\"}}_getTextColor(e){let i=e.replace(\"#\",\"\");if(i.length<6)return;let a=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);return isNaN(a)||isNaN(n)||isNaN(o)?void 0:(.2126*a+.7152*n+.0722*o)/255>.6?\"#000000\":\"#FFFFFF\"}_getDisplayName(e,i,a){switch(e){case w.KLARNA:return this.primerContext?.clientOptions?.klarna?.buttonOptions?.text??a??this._legacyGetButtonLabel(i)??this._legacyGetButtonLabel(\"Pay with\");case w.ADYEN_KLARNA:return this.primerContext?.clientOptions?.adyenKlarna?.buttonOptions?.text??a??this._legacyGetButtonLabel(i)??this._legacyGetButtonLabel(\"Pay with\");default:return a??this._legacyGetButtonLabel(i)}}_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 i={loading:yt(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return u`<primer-button @click=\"${()=>this._handleClick()}\" class=${J(i)} title=\"${M(\"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",
222
- "name": "_e",
223
- "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?f: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>`}}"
193
+ "name": "$e",
194
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod||this.primerContext?.sdkState.isProcessing||(this.primerContext?.setProcessing?.(!0),this.paymentMethod.start())}render(){return u`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
224
195
  },
225
196
  {
226
197
  "kind": "variable",
227
- "name": "je",
228
- "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=Md(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?Yn(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),T(a,{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 Dg;case k.PAY_NL_PAYCONIQ:return i===a.backgroundColor.light?Rg:xg;case k.ADYEN_CASHAPP:return a.iconUrl.dark??a.iconUrl.colored??a.iconUrl.light;default:return e===\"TRIPLE_A\"?Bg: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:()=>f,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:Ct(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return u`<primer-button @click=\"${()=>this._handleClick()}\" class=${W(a)} title=\"${T(\"pay_with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} ><img src=\"${e.iconUrl}\" alt=\"${e.alt}\" />${w(e.displayName,()=>u`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
198
+ "name": "Be",
199
+ "default": "class extends b{constructor(){super(...arguments);this.type=void 0;this.disabled=!1;this.isActive=!1;this.handleClick=()=>{this.disabled||this.primerContext?.paymentMethods?.find(i=>i.type===this.type)?.managerType===\"CARD\"||this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:this.type})}}updated(){let e=!!this.primerContext?.sdkState?.isProcessing;this.toggleAttribute(\"processing-inactive\",e&&!this.isActive)}render(){if(!this.type)return y;let e=this.primerContext?.paymentMethods.find(a=>a.type===this.type);if(!e)return y;let i;switch(e?.managerType){case\"CARD\":i=u`<primer-card-form ?disabled=${this.disabled} ></primer-card-form>`;break;case\"NATIVE\":i=u`<primer-native-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-native-payment>`;break;case\"QRCODE\":i=u`<primer-qrcode .paymentMethod=${e} ?disabled=${this.disabled} ></primer-qrcode>`;break;case\"BLIK\":i=u`<primer-blik .paymentMethod=${e} ?disabled=${this.disabled} ></primer-blik>`;break;case\"BACKEND_DRIVEN\":i=u`<primer-backend-driven .paymentMethod=${e} ?disabled=${this.disabled} ></primer-backend-driven>`;break;case\"REDIRECT\":i=u`<primer-redirect-payment .paymentMethod=${e} ?disabled=${this.disabled} ></primer-redirect-payment>`;break;case\"KLARNA\":i=u`<primer-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-klarna>`;break;case\"ADYEN_KLARNA\":i=u`<primer-adyen-klarna .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-klarna>`;break;case\"MBWAY\":i=u`<primer-adyen-mbway .paymentMethod=${e} ?disabled=${this.disabled} ></primer-adyen-mbway>`;break;default:return y}return u`<div @click=${this.handleClick} @expanded-change=${a=>{this.isActive=a.detail.expanded}} >${i}</div>`}}"
229
200
  },
230
201
  {
231
202
  "kind": "variable",
232
- "name": "Ze",
233
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod?.manager||this.primerContext?.sdkState.isProcessing||(this.primerContext?.setProcessing?.(!0),this.paymentMethod.manager.start())}render(){return u`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
203
+ "name": "Oe",
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 i=this.include.split(\",\").map(a=>a.trim());e=e.filter(a=>i.includes(a.type))}if(this.exclude){let i=this.exclude.split(\",\").map(a=>a.trim());e=e.filter(a=>!i.includes(a.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?y:u`<div class=\"payment-methods-container\">${e.map(i=>u`<primer-payment-method type=\"${i.type}\" ?disabled=\"${this.disabled||this.primerContext?.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
234
205
  },
235
206
  {
236
207
  "kind": "variable",
237
- "name": "oe",
238
- "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(Wn).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=Zn(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=En();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await lc(a)){let n=Zn(a);this.countryOptions=[...n.map(([o,s])=>({value:o,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){ir(this.primerContext?.telemetry,\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.primerContext?.configuration)}get defaultFieldConfig(){return Object.keys(Wn).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]:T(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(Wn).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:()=>f,error:()=>f,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),u`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${T(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${w(this.fieldConfig.countryCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${T(\"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=${T(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${w(this.shouldShowError(\"countryCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>u`<div class=\"billing-address-row\">${w(this.fieldConfig.firstName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${T(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${T(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${w(this.shouldShowError(\"firstName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.lastName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${T(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${T(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${w(this.shouldShowError(\"lastName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${w(this.fieldConfig.addressLine1,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${T(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${T(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${w(this.shouldShowError(\"addressLine1\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.addressLine2,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${T(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${T(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${w(this.shouldShowError(\"addressLine2\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.postalCode||this.fieldConfig.city,()=>u`<div class=\"billing-address-row\">${w(this.fieldConfig.postalCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${T(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${T(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${w(this.shouldShowError(\"postalCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${w(this.fieldConfig.city,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${T(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${T(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${w(this.shouldShowError(\"city\"),()=>u`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${w(this.fieldConfig.state,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${T(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${T(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${w(this.shouldShowError(\"state\"),()=>u`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),f)})}}"
208
+ "name": "ze",
209
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1}_handleClick(){this.disabled||!this.paymentMethod||this.primerContext?.sdkState.isProcessing||(this.primerContext?.setProcessing?.(!0),this.paymentMethod.start())}render(){return u`<primer-payment-method-button .type=${this.paymentMethod?.type} ?disabled=${this.disabled} @payment-method-click=${()=>this._handleClick()} ></primer-payment-method-button>`}}"
239
210
  },
240
211
  {
241
212
  "kind": "variable",
242
- "name": "se",
243
- "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=T(\"something_went_wrong_error\",{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:T(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let a=e.detail?.error;this.errorMessage=a instanceof Error?a.message:T(\"payment_processing_error\",{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 mr(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 qn(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\" ${Nt({...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 f;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} ${Nt({...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?f:u`<primer-vault-payment-method-item .paymentMethod=${e} .isEditMode=${this.isEditMode} @delete-payment-method=${this.handleDeletePaymentMethod} ${Nt({...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))} ${w(a,()=>u`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${w(!this.hasSlottedSubmit,()=>u`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>f)}</div>`}render(){if(!this.primerContext?.vaultManager?.enabled||this.primerContext?.vaultManager?.headless)return f;let e=this.primerContext?.vaultManager.vaultedPaymentMethods.length>0,a=this.primerContext?.vaultManager.isLoading,i=this.primerContext?.vaultManager.isUpdating;return u` ${w(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>f,()=>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>${w(this.errorMessage,()=>u`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>f)}<div class=\"vault-manager-content\">${w(!a&&!e,()=>u`<div class=\"content-container\"><primer-vault-empty-state ${Nt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>f)} ${w(!a&&e,()=>u`<div class=\"content-container\">${w(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>f)}</div>${w(i,()=>this.renderLoadingOverlay(),()=>f)}</div></slot>`)} `}}"
213
+ "name": "ie",
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,i])=>{if(!e||!i)return V;let a=this.extractFieldConfig(e);return await this.initializeCountryOptions(),a},args:()=>[this.primerContext?.configuration??null,this.primerContext?.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let i=e.checkoutModules.find(a=>a.type===\"BILLING_ADDRESS\");if(i?.options){let a=i.options;return Object.keys(ao).reduce((n,o)=>({...n,[o]:a[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=io(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let i=Ln();if(i===\"en\"||i===\"en-GB\"||i.startsWith(\"en-\"))return;if(await Lc(i)){let n=io(i);this.countryOptions=[...n.map(([o,s])=>({value:o,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){ir(this.primerContext?.telemetry,\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.primerContext?.configuration)}get defaultFieldConfig(){return Object.keys(ao).reduce((e,i)=>({...e,[i]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,i){this.formData={...this.formData,[e]:i},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 i=this.formData[e],a=this.fieldConfig[e];if(!a){delete this.errors[e];return}if(a&&(!i||i.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:M(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(ao).forEach(e=>{let i=e;this.fieldConfig[i]&&this.validateField(i)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(i=>{this.fieldConfig[i]&&this.touchedFields.add(i)});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 i=!!this.errors[e],a=this.dirtyFields.has(e),n=this.touchedFields.has(e);return i&&(this.submitted||a&&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\">${M(\"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\">${M(\"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=${M(\"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\">${M(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${M(\"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\">${M(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${M(\"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\">${M(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${M(\"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\">${M(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${M(\"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\">${M(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${M(\"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\">${M(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${M(\"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\">${M(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${M(\"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": "Ne",
248
- "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:()=>f,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>${w(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\"> Input the card CVV for a secure payment</span ></span><span class=\"cell-2\"><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>f)}</primer-button>${this.isEditMode?u`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${T(\"delete\",{id:\"delete\"})} ${n}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:f}</div></div>`}})}}"
218
+ "name": "ae",
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 a=e.target.assignedNodes({flatten:!0});this.hasSlottedSubmit=a.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 i=this.primerContext?.vaultManager.vaultedPaymentMethods.find(a=>a.id===this.deletePaymentMethodId);i&&(this.deleteAssetConfig=await Qi(i,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=M(\"something_went_wrong_error\",{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:M(\"something_went_wrong_error\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let i=e.detail?.error;this.errorMessage=i instanceof Error?i.message:M(\"payment_processing_error\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let a=e.target.closest(\"button, primer-button\");if(!a)return;let n=a;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 i=e.tagName.toLowerCase(),a=i===\"button\",n=i===\"primer-button\";return a&&(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 i=this.primerContext?.vaultManager.vaultedPaymentMethods.find(a=>a.id===e);if(!i)return\"\";try{return oo(i,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\" ${Tt({...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} ${Tt({...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} ${Tt({...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||[],i=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return u`<div class=\"payment-methods-list\">${e.map(a=>this.renderPaymentMethodItem(a))} ${L(i,()=>u`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Tt({...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,i=this.primerContext?.vaultManager.isLoading,a=this.primerContext?.vaultManager.isUpdating;return u` ${L(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>y,()=>u`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${a?\"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} ${Tt({...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(!i&&!e,()=>u`<div class=\"content-container\"><primer-vault-empty-state ${Tt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>y)} ${L(!i&&e,()=>u`<div class=\"content-container\">${L(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>y)}</div>${L(a,()=>this.renderLoadingOverlay(),()=>y)}</div></slot>`)} `}}"
249
220
  },
250
221
  {
251
222
  "kind": "variable",
252
- "name": "Oe",
253
- "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>${T(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?u`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?T(\"confirm\",{id:\"confirm\"}):T(\"editPaymentMethods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?u`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:u`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:f}</div>`}}"
223
+ "name": "Ie",
224
+ "default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,i,a])=>await Qi(e,i,a),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 i=this.isSelected()?\"checked\":\"default\",a=!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=${i} .flex=${a} @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\"> Input the card CVV for a secure payment</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=${`${M(\"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": "we",
258
- "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} >${T(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?T(\"deleting\",{id:\"deleting\"}):T(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
228
+ "name": "De",
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>${M(\"previouslyUsed\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?u`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?M(\"confirm\",{id:\"confirm\"}):M(\"editPaymentMethods\",{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": "lt",
263
- "default": "class extends b{render(){return u`<div class=\"empty-state\"><p>${T(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
233
+ "name": "ke",
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} >${M(\"cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?M(\"deleting\",{id:\"deleting\"}):M(\"confirmVaultedPaymentMethodDeletion\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
264
235
  },
265
236
  {
266
237
  "kind": "variable",
267
- "name": "We",
268
- "default": "class extends b{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return u`<div class=\"error-message\"><div class=\"error-content\"><primer-icon name=\"warning\" size=\"sm\" color=\"var(--primer-color-red-500)\" ></primer-icon><p>${this.errorMessage}</p></div><button @click=${this.handleDismiss} aria-label=${T(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
238
+ "name": "at",
239
+ "default": "class extends b{render(){return u`<div class=\"empty-state\"><p>${M(\"savedPaymentMethodsEmpty\",{id:\"savedPaymentMethodsEmpty\"})}</p></div>`}}"
269
240
  },
270
241
  {
271
242
  "kind": "variable",
272
- "name": "Ae",
273
- "default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.primerContext?.vaultManager?.startVaultedPaymentFlow()}catch(a){let i=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:a}});this.dispatchEvent(i)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:T(\"pay\",{id:\"pay\"})}set buttonText(e){let a=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",a)}get isButtonDisabled(){return!!(this.disabled||!this.primerContext?.vaultItem?.selectedVaultedPaymentMethod||this.primerContext?.vaultManager?.isLoading)}render(){let e=this.primerContext?.clientOptions?.submitButton?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,a=e?` ${e}`:f;return u`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${Ct(this.primerContext?.sdkState)} data-submit >${this.buttonText}${a}</primer-button>`}}"
243
+ "name": "Ye",
244
+ "default": "class extends b{constructor(){super(...arguments);this.errorMessage=\"\";this.handleDismiss=()=>{this.dispatchEvent(new CustomEvent(\"close-error\",{bubbles:!0,composed:!0}))}}render(){return u`<div class=\"error-message\"><div class=\"error-content\"><primer-icon name=\"warning\" size=\"sm\" color=\"var(--primer-color-red-500)\" ></primer-icon><p>${this.errorMessage}</p></div><button @click=${this.handleDismiss} aria-label=${M(\"closeErrorMessage\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
274
245
  },
275
246
  {
276
247
  "kind": "variable",
277
- "name": "ae",
278
- "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=$r(this.primerContext?.computedStyles??null),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:T(\"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:()=>f,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>${w(this.cvvError&&(this.primerContext?.vaultItem?.formIsDirty||this.cvvInputIsDirty&&this.cvvInputIsBlurred),()=>u`<primer-input-error slot=\"error\">${T(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
248
+ "name": "be",
249
+ "default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.variant=\"primary\";this.disabled=!1;this.handleClick=async e=>{if(e.preventDefault(),!this.isButtonDisabled)try{await this.primerContext?.vaultManager?.startVaultedPaymentFlow()}catch(i){let a=new CustomEvent(\"primer-vault-payment-error\",{bubbles:!0,composed:!0,detail:{error:i}});this.dispatchEvent(a)}}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:M(\"pay\",{id:\"pay\"})}set buttonText(e){let i=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",i)}get isButtonDisabled(){return!!(this.disabled||!this.primerContext?.vaultItem?.selectedVaultedPaymentMethod||this.primerContext?.vaultManager?.isLoading)}render(){let e=this.primerContext?.clientOptions?.submitButton?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,i=e?` ${e}`:y;return u`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${yt(this.primerContext?.sdkState)} data-submit >${this.buttonText}${i}</primer-button>`}}"
279
250
  },
280
251
  {
281
252
  "kind": "variable",
282
- "name": "Je",
283
- "default": "class extends b{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return f;let e=this.assetConfig.description,a=this.assetConfig.icon,i=w(this.assetConfig.icon,()=>u`<img class=\"payment-method-icon\" src=${a} alt=${e} />`,()=>u`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${i}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></span></div></span>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?u`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${i}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${i}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${i}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:this.assetConfig.type===\"GOOGLE_PAY\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\">${i}<span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:f}}"
253
+ "name": "re",
254
+ "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,i])=>!e||!i||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||i.createCvvInput===null?V:{network:e.paymentInstrumentData.network,createCvvInput:i.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 i=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!i)return;let a=jr(this.primerContext?.computedStyles??null),n=a?{input:{base:a}}:void 0,o={cardNetwork:e.network,container:i,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:M(\"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\">${M(this.cvvError,{id:this.cvvError})}</primer-input-error>`)}</primer-input-wrapper></div>`})}}"
284
255
  },
285
256
  {
286
257
  "kind": "variable",
287
- "name": "Me",
288
- "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 bt(this,{context:hr,initialValue:null});this.eventsController=new rr(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)?.manager;if(!a)return V;let i=a.createHostedInputs(),{cardNumberInput:n,expiryInput:o,cvvInput:s}=i;return this.cardFormProvider.setValue({cardholderNameInput:i.cardholderNameInput,cardNumberInput:n,expiryInput:o,cvvInput:s,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate?.().then(c=>{let m=c?.validationErrors?.find(S=>S.name===Lc.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:m?.message||m?.error||null,errorCode:m?.message||m?.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,m=c.message||c.error,g=Lc[p];if(g){let S=this.inputControllers.get(g);if(S){let A={valid:!1,error:m,errorCode:m};S.updateMetaFromValidation(A)}}})},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=T(\"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===At.ERROR||this.setupCardFormTask.status===At.INITIAL?f:u`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>w(this.hasAssignedContent,()=>f,()=>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>${w(this.shouldShowCardholderName,()=>u`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>f)}<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>`}}"
258
+ "name": "je",
259
+ "default": "class extends b{constructor(){super(...arguments);this.assetConfig=null}render(){if(!this.assetConfig)return y;let e=this.assetConfig.description,i=this.assetConfig.icon,a=L(this.assetConfig.icon,()=>u`<img class=\"payment-method-icon\" src=${i} alt=${e} />`,()=>u`<div class=\"payment-method-icon payment-method-icon-generic\"><primer-icon name=\"payment-card\" size=\"sm\"></primer-icon></div>`);return this.assetConfig.type===\"paypal\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></span></div></span>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType!==\"ACH\"?u`<div class=\"payment-method-card-other\"><div class=\"left-column\"><div class=\"payment-method-header\">${this.assetConfig.fullName}</div><div class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.paymentMethodType}</span ></div></div><div class=\"payment-method-right-column-text\">${this.assetConfig.email||`\\u2022\\u2022\\u2022\\u2022 ${this.assetConfig.last4}`}</div></div>`:this.assetConfig.type===\"other\"&&this.assetConfig.paymentMethodType===\"ACH\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.fullName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.bankName}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.accountType}</span ></div></span>`:this.assetConfig.type===\"card\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\"><span class=\"payment-method-header\" >${this.assetConfig.cardholderName}</span ><span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"flex\">${a}<span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ></span><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:this.assetConfig.type===\"GOOGLE_PAY\"?u`<span class=\"payment-method-card\"><div class=\"payment-method-row\">${a}<span class=\"payment-method-header cell-2\" >•••• ${this.assetConfig.last4}</span ></div><div class=\"payment-method-row\"><span class=\"payment-method-subtitle\" >${this.assetConfig.network}</span ><span class=\"payment-method-subtitle cell-2\" >${this.assetConfig.expiresDate}</span ></div></span>`:y}}"
289
260
  },
290
261
  {
291
262
  "kind": "variable",
292
- "name": "dt",
293
- "default": "class extends le{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===At.ERROR)return f;let e=this.getError();return u`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${w(!this.cardFormContext?.hideLabels,()=>u`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>f)}<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>${w(e,a=>u`<primer-input-error slot=\"error\">${T(a,{id:a})}</primer-input-error>`,()=>f)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
263
+ "name": "Ce",
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 gt(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 i=e?.find(l=>l.type===w.PAYMENT_CARD);if(!i)return V;let{cardNumber:a,cardExpiryDate:n,cardSecurityCode:o,cardholderName:s}=i.iframes;return this.cardFormProvider.setValue({cardholderNameInput:s,cardNumberInput:a,expiryInput:n,cvvInput:o,setCardholderName:l=>{i.setCardholderName(l),this.shouldRequireCardholderName&&i.validate().then(c=>{let h=c?.validationErrors?.find(A=>A.name===ep.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:()=>i.validate(),submit:l=>i.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=ep[p];if(g){let A=this.inputControllers.get(g);if(A){let _={valid:!1,error:h,errorCode:h};A.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 a=e.target.closest(\"button, primer-button\");if(!a)return;let n=a;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 a=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=a.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 a=e.get(\"context\")?.events??null;a?.host&&this._contextCardSubmitListener&&a.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\"),i=this.inputControllers.get(\"expire\"),a=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=i?.meta?.dirty===!0,s=a?.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 i=e.tagName.toLowerCase(),a=i===\"button\",n=i===\"primer-button\";return a&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value,i=this.primerContext?.sdkState.isProcessing;if(!e||this.disabled||i)return;this.primerContext?.setProcessing?.(!0),this.formErrorMessage=null,e.setSubmissionState?.(!0);let a=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),n=!0;a&&(n=await a.validateForSubmission());let o=await e.validate?.();if(o?.valid&&n){if(a&&!await a.submitToSDK()){let p=M(\"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===St.ERROR||this.setupCardFormTask.status===St.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
- "name": "ct",
298
- "default": "class extends le{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
268
+ "name": "nt",
269
+ "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:i}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(i)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===St.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,i=>u`<primer-input-error slot=\"error\">${M(i,{id:i})}</primer-input-error>`,()=>y)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
270
+ },
271
+ {
272
+ "kind": "variable",
273
+ "name": "ot",
274
+ "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()}}"
299
275
  },
300
276
  {
301
277
  "kind": "variable",
302
- "name": "ut",
303
- "default": "class extends le{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()}}"
278
+ "name": "st",
279
+ "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()}}"
304
280
  },
305
281
  {
306
282
  "kind": "variable",
307
- "name": "pt",
308
- "default": "class extends le{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()}}"
283
+ "name": "lt",
284
+ "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()}}"
309
285
  },
310
286
  {
311
287
  "kind": "variable",
312
- "name": "me",
313
- "default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.cardFormContext=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let a=new CustomEvent(\"primer:card-submit\",{bubbles:!0,composed:!0,detail:{source:\"primer-card-form-submit\"}});this.dispatchEvent(a)}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:T(\"pay\",{id:\"pay\"})}set buttonText(e){let a=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",a)}get submitButtonConfig(){return this.primerContext?.clientOptions?.submitButton??null}get shouldShowBuiltInButton(){return this.submitButtonConfig?.useBuiltInButton??!0}render(){if(!this.shouldShowBuiltInButton)return f;let e=this.submitButtonConfig?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,a=e?` ${e}`:f,i=this.disabled||this.cardFormContext?.disabled||!1;return u`<primer-button type=\"submit\" variant=${this.variant} ?disabled=${i} @click=${this.handleClick} .loading=${Ct(this.primerContext?.sdkState)} data-submit >${this.buttonText}${a}</primer-button>`}}"
288
+ "name": "de",
289
+ "default": "class extends b{constructor(){super(...arguments);this._userAssignedProps=new Set;this._internalButtonText=\"\";this.cardFormContext=null;this.variant=\"primary\";this.disabled=!1;this.handleClick=e=>{if(e.preventDefault(),this.disabled)return;this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_SUBMITTED\",paymentMethod:\"PAYMENT_CARD\"});let i=new CustomEvent(\"primer:card-submit\",{bubbles:!0,composed:!0,detail:{source:\"primer-card-form-submit\"}});this.dispatchEvent(i)}}get buttonText(){return this._userAssignedProps.has(\"buttonText\")?this._internalButtonText:M(\"pay\",{id:\"pay\"})}set buttonText(e){let i=this.buttonText;e!==\"\"?(this._userAssignedProps.add(\"buttonText\"),this._internalButtonText=e):(this._userAssignedProps.delete(\"buttonText\"),this._internalButtonText=\"\"),this.requestUpdate(\"buttonText\",i)}get submitButtonConfig(){return this.primerContext?.clientOptions?.submitButton??null}get shouldShowBuiltInButton(){return this.submitButtonConfig?.useBuiltInButton??!0}render(){if(!this.shouldShowBuiltInButton)return y;let e=this.submitButtonConfig?.amountVisible?this.primerContext?.headlessUtils?.getUIOrderAmount():null,i=e?` ${e}`:y,a=this.disabled||this.cardFormContext?.disabled||!1;return u`<primer-button type=\"submit\" variant=${this.variant} ?disabled=${a} @click=${this.handleClick} .loading=${yt(this.primerContext?.sdkState)} data-submit >${this.buttonText}${i}</primer-button>`}}"
314
290
  },
315
291
  {
316
292
  "kind": "variable",
317
- "name": "he",
318
- "default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Hr();this.dropdownRef=Hr();this.networkOptionRefs=[];this.toggleDropdown=e=>{this.isKeyboardNavigation=!1,e.stopPropagation(),this.getSelectableNetworks().length>1&&(this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))};this.handleClickOutside=e=>{this.isDropdownOpen&&(this.contains(e.target)||(this.isDropdownOpen=!1,this.isKeyboardNavigation=!1))};this.handleMouseMove=()=>{this.isKeyboardNavigation&&(this.isKeyboardNavigation=!1)};this.handleKeyDown=e=>{if(!(!(this.getSelectableNetworks().length>1)||!(this.contains(e.target)||this===e.target||this.isDropdownOpen&&e.target===document.body)))switch(this.isKeyboardNavigation=!0,e.key){case\"ArrowDown\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex+1)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"ArrowUp\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex-1+this.getSelectableNetworks().length)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Enter\":case\" \":this.isDropdownOpen&&this.focusedNetworkIndex>=0?(e.preventDefault(),this.selectNetwork(e,this.getSelectableNetworks()[this.focusedNetworkIndex])):!this.isDropdownOpen&&this.buttonRef.value===document.activeElement&&(e.preventDefault(),this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Escape\":this.isDropdownOpen&&(e.preventDefault(),this.isDropdownOpen=!1,this.buttonRef.value?.focus());break;case\"Tab\":this.isDropdownOpen&&(this.isDropdownOpen=!1);break}};this.handleDocumentKeyDown=e=>{this.isDropdownOpen&&this.handleKeyDown(e)}}getNetworkIconUrl(e){return this.primerContext?.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}renderDefaultCardIcon(){return u`<div class=\"network-icon\">${Za[\"payment-card\"]}</div>`}getSelectableNetworks(){return this.primerContext?.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.primerContext?.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let a=this.getSelectableNetworks().findIndex(i=>i.network===e.network);return a>=0?a:0}selectNetwork(e,a){e.stopPropagation(),this.selectedCardNetwork=a,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.primerContext?.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:a.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,a){this.networkOptionRefs[a]=e}connectedCallback(){super.connectedCallback(),setTimeout(()=>{document.addEventListener(\"click\",this.handleClickOutside),document.addEventListener(\"mousemove\",this.handleMouseMove),this.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keydown\",this.handleDocumentKeyDown)},0)}disconnectedCallback(){document.removeEventListener(\"click\",this.handleClickOutside),document.removeEventListener(\"keydown\",this.handleDocumentKeyDown),document.removeEventListener(\"mousemove\",this.handleMouseMove),this.removeEventListener(\"keydown\",this.handleKeyDown),super.disconnectedCallback()}render(){if(this.primerContext?.cardNetworks?.isLoading)return u`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return this.renderDefaultCardIcon();let a=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!a)return this.renderDefaultCardIcon();let i=e.length>1;return i&&!lu(e.map(o=>o.network))?u`<div class=\"network-selector-inline\">${e.map(o=>u`<div class=\"network-icon-container\"><img class=\"network-icon\" src=${this.getNetworkIconUrl(o)??\"\"} alt=${o.displayName} /></div>`)}</div>`:u`<button ${pr(this.buttonRef)} class=\"network-selector ${i?\"\":\"static\"}\" tabindex=${i?\"0\":\"-1\"} @click=${this.toggleDropdown} @keydown=${o=>{(o.key===\" \"||o.key===\"Enter\")&&i&&(o.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${i?`Selected card network: ${a.displayName}. Click to change.`:`Card network: ${a.displayName}`} aria-expanded=${i?this.isDropdownOpen:f} aria-haspopup=${i?\"true\":f} aria-controls=${i?\"network-dropdown\":f} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(a)} alt=${a.displayName} />${w(i,()=>u`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>f)}</button>${w(this.isDropdownOpen,()=>u`<div ${pr(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((o,s)=>u`<div ${pr(l=>this.setNetworkOptionRef(l,s))} class=\"network-option ${this.isKeyboardNavigation&&s===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${l=>this.selectNetwork(l,o)} @keydown=${l=>{(l.key===\"Enter\"||l.key===\" \")&&this.selectNetwork(l,o)}} role=\"option\" aria-selected=${o.network===a.network} tabindex=\"${s===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(o)} alt=${o.displayName} /><span class=\"network-name\">${o.displayName}</span>${w(o.network===a.network,()=>u`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>f)}</div>`)}</div>`,()=>f)} `}}"
293
+ "name": "ce",
294
+ "default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Yr();this.dropdownRef=Yr();this.networkOptionRefs=[];this.toggleDropdown=e=>{this.isKeyboardNavigation=!1,e.stopPropagation(),this.getSelectableNetworks().length>1&&(this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))};this.handleClickOutside=e=>{this.isDropdownOpen&&(this.contains(e.target)||(this.isDropdownOpen=!1,this.isKeyboardNavigation=!1))};this.handleMouseMove=()=>{this.isKeyboardNavigation&&(this.isKeyboardNavigation=!1)};this.handleKeyDown=e=>{if(!(!(this.getSelectableNetworks().length>1)||!(this.contains(e.target)||this===e.target||this.isDropdownOpen&&e.target===document.body)))switch(this.isKeyboardNavigation=!0,e.key){case\"ArrowDown\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex+1)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"ArrowUp\":e.preventDefault(),this.isDropdownOpen?(this.focusedNetworkIndex=(this.focusedNetworkIndex-1+this.getSelectableNetworks().length)%this.getSelectableNetworks().length,this.focusNetworkOption()):(this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Enter\":case\" \":this.isDropdownOpen&&this.focusedNetworkIndex>=0?(e.preventDefault(),this.selectNetwork(e,this.getSelectableNetworks()[this.focusedNetworkIndex])):!this.isDropdownOpen&&this.buttonRef.value===document.activeElement&&(e.preventDefault(),this.isDropdownOpen=!0,this.focusedNetworkIndex=this.getSelectedNetworkIndex());break;case\"Escape\":this.isDropdownOpen&&(e.preventDefault(),this.isDropdownOpen=!1,this.buttonRef.value?.focus());break;case\"Tab\":this.isDropdownOpen&&(this.isDropdownOpen=!1);break}};this.handleDocumentKeyDown=e=>{this.isDropdownOpen&&this.handleKeyDown(e)}}getNetworkIconUrl(e){return this.primerContext?.headlessUtils?.getCardNetworkAsset(e.network)?.cardUrl}renderDefaultCardIcon(){return u`<div class=\"network-icon\">${Wi[\"payment-card\"]}</div>`}getSelectableNetworks(){return this.primerContext?.cardNetworks?.selectableCardNetworks||[]}getDetectedNetwork(){return this.selectedCardNetwork??(this.primerContext?.cardNetworks?.detectedCardNetwork||null)}getSelectedNetworkIndex(){let e=this.getDetectedNetwork();if(!e)return 0;let i=this.getSelectableNetworks().findIndex(a=>a.network===e.network);return i>=0?i:0}selectNetwork(e,i){e.stopPropagation(),this.selectedCardNetwork=i,this.isDropdownOpen=!1,this.buttonRef.value?.focus(),this.primerContext?.cardNetworks&&this.dispatchEvent(new CustomEvent(\"network-selected\",{detail:{network:i.network},bubbles:!0,composed:!0}))}focusNetworkOption(){requestAnimationFrame(()=>{this.networkOptionRefs[this.focusedNetworkIndex]&&this.networkOptionRefs[this.focusedNetworkIndex].focus()})}setNetworkOptionRef(e,i){this.networkOptionRefs[i]=e}connectedCallback(){super.connectedCallback(),setTimeout(()=>{document.addEventListener(\"click\",this.handleClickOutside),document.addEventListener(\"mousemove\",this.handleMouseMove),this.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keydown\",this.handleDocumentKeyDown)},0)}disconnectedCallback(){document.removeEventListener(\"click\",this.handleClickOutside),document.removeEventListener(\"keydown\",this.handleDocumentKeyDown),document.removeEventListener(\"mousemove\",this.handleMouseMove),this.removeEventListener(\"keydown\",this.handleKeyDown),super.disconnectedCallback()}render(){if(this.primerContext?.cardNetworks?.isLoading)return u`<primer-spinner size=\"small\" compact></primer-spinner>`;let e=this.getSelectableNetworks();if(!this.getDetectedNetwork()&&e.length===0)return this.renderDefaultCardIcon();let i=this.getDetectedNetwork()||(e.length>0?e[0]:null);if(!i)return this.renderDefaultCardIcon();let a=e.length>1;return a&&!Lp(e.map(o=>o.network))?u`<div class=\"network-selector-inline\">${e.map(o=>u`<div class=\"network-icon-container\"><img class=\"network-icon\" src=${this.getNetworkIconUrl(o)??\"\"} alt=${o.displayName} /></div>`)}</div>`:u`<button ${pr(this.buttonRef)} class=\"network-selector ${a?\"\":\"static\"}\" tabindex=${a?\"0\":\"-1\"} @click=${this.toggleDropdown} @keydown=${o=>{(o.key===\" \"||o.key===\"Enter\")&&a&&(o.preventDefault(),this.isDropdownOpen=!this.isDropdownOpen,this.isDropdownOpen&&(this.focusedNetworkIndex=this.getSelectedNetworkIndex()))}} aria-label=${a?`Selected card network: ${i.displayName}. Click to change.`:`Card network: ${i.displayName}`} aria-expanded=${a?this.isDropdownOpen:y} aria-haspopup=${a?\"true\":y} aria-controls=${a?\"network-dropdown\":y} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(i)} alt=${i.displayName} />${L(a,()=>u`<primer-icon class=\"caret ${this.isDropdownOpen?\"open\":\"\"}\" size=\"sm\" name=\"chevron-down\" ></primer-icon>`,()=>y)}</button>${L(this.isDropdownOpen,()=>u`<div ${pr(this.dropdownRef)} id=\"network-dropdown\" class=\"dropdown open\" role=\"listbox\" aria-label=\"Select card network\" >${e.map((o,s)=>u`<div ${pr(l=>this.setNetworkOptionRef(l,s))} class=\"network-option ${this.isKeyboardNavigation&&s===this.focusedNetworkIndex?\"focused\":\"\"}\" @click=${l=>this.selectNetwork(l,o)} @keydown=${l=>{(l.key===\"Enter\"||l.key===\" \")&&this.selectNetwork(l,o)}} role=\"option\" aria-selected=${o.network===i.network} tabindex=\"${s===this.focusedNetworkIndex?\"0\":\"-1\"}\" ><img class=\"network-option-icon\" src=${this.getNetworkIconUrl(o)} alt=${o.displayName} /><span class=\"network-name\">${o.displayName}</span>${L(o.network===i.network,()=>u`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>y)}</div>`)}</div>`,()=>y)} `}}"
319
295
  },
320
296
  {
321
297
  "kind": "variable",
322
- "name": "Ge",
323
- "default": "class extends b{constructor(){super(...arguments);this.hasSlottedToggle=!1;this.isExpanded=!1;this._isHandlingContextEvent=!1;this._contextToggleListener=null;this.handleToggleSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasSlottedToggle=i.length>0};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isToggleButton(n)&&(e.preventDefault(),this.toggleAccordion())};this.handleDirectToggle=e=>{let a=e.detail?.action;a===\"expand\"?this.expand():a===\"collapse\"?this.collapse():this.toggleAccordion()};this.handleContextToggle=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{if(e.target!==this){e.stopPropagation();let a=e.detail?.action;a===\"expand\"?this.expand():a===\"collapse\"?this.collapse():this.toggleAccordion()}}finally{this._isHandlingContextEvent=!1}}}}isToggleButton(e){let a=this.shadowRoot?.querySelector('slot[name=\"show-other-payments-toggle-button\"]');return a?a.assignedElements({flatten:!0}).some(n=>n===e||n.contains(e)):!1}toggleAccordion(){this.hasSlottedToggle?(this.isExpanded=!this.isExpanded,this.dispatchExpandedEvent(this.isExpanded)):this.collapsableElement&&(this.collapsableElement.isExpanded?this.collapsableElement.collapse():this.collapsableElement.expand())}dispatchExpandedEvent(e){this.dispatchEvent(new CustomEvent(\"primer:show-other-payments-toggled\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.hasSlottedToggle?this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedEvent(!0)):this.collapsableElement?.expand()}collapse(){this.hasSlottedToggle?this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedEvent(!1)):this.collapsableElement?.collapse()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.addEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.removeEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}connectedCallback(){super.connectedCallback(),this.isExpanded=this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0,this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this._contextToggleListener=e=>{this.handleContextToggle(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this.cleanupContextEventListeners(),super.disconnectedCallback()}render(){if(this.primerContext?.vaultManager?.isLoading)return f;let e=this.primerContext?.vaultManager?.showEmptyState||this.primerContext?.vaultManager?.vaultedPaymentMethods.length;return!this.primerContext?.vaultManager||!this.primerContext?.vaultManager.enabled||this.primerContext?.vaultManager.headless||!e?u`<slot name=\"other-payments\"></slot>`:u`<div class=\"other-payment-methods-container\"><slot name=\"show-other-payments-toggle-button\" @slotchange=${this.handleToggleSlotChange} ></slot>${w(!this.hasSlottedToggle,()=>u`<primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${T(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable>`,()=>u`<div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" role=\"region\" aria-labelledby=\"custom-toggle-button\" ><div class=\"collapsable-content\"><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></div></div>`)}</div>`}}"
298
+ "name": "_e",
299
+ "default": "class extends b{constructor(){super(...arguments);this.hasSlottedToggle=!1;this.isExpanded=!1;this._isHandlingContextEvent=!1;this._contextToggleListener=null;this.handleToggleSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasSlottedToggle=a.length>0};this.handleSlotButtonClick=e=>{let a=e.target.closest(\"button, primer-button\");if(!a)return;let n=a;this.isToggleButton(n)&&(e.preventDefault(),this.toggleAccordion())};this.handleDirectToggle=e=>{let i=e.detail?.action;i===\"expand\"?this.expand():i===\"collapse\"?this.collapse():this.toggleAccordion()};this.handleContextToggle=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{if(e.target!==this){e.stopPropagation();let i=e.detail?.action;i===\"expand\"?this.expand():i===\"collapse\"?this.collapse():this.toggleAccordion()}}finally{this._isHandlingContextEvent=!1}}}}isToggleButton(e){let i=this.shadowRoot?.querySelector('slot[name=\"show-other-payments-toggle-button\"]');return i?i.assignedElements({flatten:!0}).some(n=>n===e||n.contains(e)):!1}toggleAccordion(){this.hasSlottedToggle?(this.isExpanded=!this.isExpanded,this.dispatchExpandedEvent(this.isExpanded)):this.collapsableElement&&(this.collapsableElement.isExpanded?this.collapsableElement.collapse():this.collapsableElement.expand())}dispatchExpandedEvent(e){this.dispatchEvent(new CustomEvent(\"primer:show-other-payments-toggled\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.hasSlottedToggle?this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedEvent(!0)):this.collapsableElement?.expand()}collapse(){this.hasSlottedToggle?this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedEvent(!1)):this.collapsableElement?.collapse()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.addEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextToggleListener&&this.primerContext?.events.host.removeEventListener(\"primer:show-other-payments-toggle\",this._contextToggleListener)}connectedCallback(){super.connectedCallback(),this.isExpanded=this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0,this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this._contextToggleListener=e=>{this.handleContextToggle(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:show-other-payments-toggle\",this.handleDirectToggle),this.cleanupContextEventListeners(),super.disconnectedCallback()}render(){if(this.primerContext?.vaultManager?.isLoading)return y;let e=this.primerContext?.vaultManager?.showEmptyState||this.primerContext?.vaultManager?.vaultedPaymentMethods.length;return!this.primerContext?.vaultManager||!this.primerContext?.vaultManager.enabled||this.primerContext?.vaultManager.headless||!e?u`<slot name=\"other-payments\"></slot>`:u`<div class=\"other-payment-methods-container\"><slot name=\"show-other-payments-toggle-button\" @slotchange=${this.handleToggleSlotChange} ></slot>${L(!this.hasSlottedToggle,()=>u`<primer-collapsable buttonVariant=\"secondary\" .expanded=\"${this.primerContext?.vaultManager?.vaultedPaymentMethods.length===0}\" .header=\"${M(\"navigateToPaymentMethods\",{id:\"navigateToPaymentMethods\"})}\" ><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></primer-collapsable>`,()=>u`<div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" role=\"region\" aria-labelledby=\"custom-toggle-button\" ><div class=\"collapsable-content\"><div class=\"other-payment-methods-content\"><slot name=\"other-payments\"></slot></div></div></div>`)}</div>`}}"
324
300
  },
325
301
  {
326
302
  "kind": "variable",
327
- "name": "Le",
303
+ "name": "Ne",
328
304
  "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.expanded=!1;this.suppressBlurCollapse=!1;this.loading=!1;this._handleDocumentClick=e=>{this.expanded&&(this.suppressBlurCollapse||this.loading||e.composedPath().includes(this)||this._collapseFromOutsideInteraction())};this._handleWindowBlur=()=>{!this.expanded||this.suppressBlurCollapse||this.loading||setTimeout(()=>{document.hasFocus()&&this._collapseFromOutsideInteraction()},100)}}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),window.addEventListener(\"blur\",this._handleWindowBlur)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),window.removeEventListener(\"blur\",this._handleWindowBlur)}_collapseFromOutsideInteraction(){this.expanded&&(this.expanded=!1,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:!1},bubbles:!0,composed:!0})))}_handleButtonClick(){this.disabled||this.loading||(this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent(\"expanded-change\",{detail:{expanded:this.expanded},bubbles:!0,composed:!0})))}render(){return u`<div class=\"container ${this.expanded?\"expanded\":\"\"}\"><primer-payment-method-button .type=${this.type} ?disabled=${this.disabled||this.loading} @payment-method-click=${()=>this._handleButtonClick()} ></primer-payment-method-button><div class=\"expanded-content\"><div class=\"content-wrapper\"><slot></slot></div></div></div>`}}"
329
305
  },
330
306
  {
331
307
  "kind": "variable",
332
- "name": "mt",
333
- "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return u`<button class=${W({loading:this.loading})} ?disabled=${this.disabled||this.loading} @click=${()=>this.dispatchEvent(new Event(\"confirm\",{bubbles:!0,composed:!0}))} >${this.loading?u`<primer-spinner size=\"small\" compact></primer-spinner>`:T(\"confirm\",{id:\"confirm\"})}</button>`}}"
308
+ "name": "dt",
309
+ "default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return u`<button class=${J({loading:this.loading})} ?disabled=${this.disabled||this.loading} @click=${()=>this.dispatchEvent(new Event(\"confirm\",{bubbles:!0,composed:!0}))} >${this.loading?u`<primer-spinner size=\"small\" compact></primer-spinner>`:M(\"confirm\",{id:\"confirm\"})}</button>`}}"
334
310
  },
335
311
  {
336
312
  "kind": "variable",
@@ -339,22 +315,22 @@
339
315
  },
340
316
  {
341
317
  "kind": "variable",
342
- "name": "Zt",
318
+ "name": "zt",
343
319
  "default": "class extends b{render(){return u`<primer-checkout-state type=\"failure\" description=${this.primerContext?.sdkState?.primerJsError?.message||\"\"} ></primer-checkout-state>`}}"
344
320
  },
345
321
  {
346
322
  "kind": "variable",
347
- "name": "ht",
348
- "default": "class extends b{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.primerContext?.sdkState||this.primerContext.sdkState.isProcessing?!1:!!(this.primerContext.sdkState.paymentFailure&&this.showProcessingErrors)}render(){return this.primerContext?.sdkState?u`<primer-error-message message=\"${T(this.primerContext.sdkState.paymentFailure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:f}}"
323
+ "name": "ct",
324
+ "default": "class extends b{constructor(){super(...arguments);this.showProcessingErrors=!0}get shouldShowError(){return!this.primerContext?.sdkState||this.primerContext.sdkState.isProcessing?!1:!!(this.primerContext.sdkState.paymentFailure&&this.showProcessingErrors)}render(){return this.primerContext?.sdkState?u`<primer-error-message message=\"${M(this.primerContext.sdkState.paymentFailure?.message??\"\",{id:\"tokenizationError\"})}\" ?visible=\"${this.shouldShowError}\" ></primer-error-message>`:y}}"
349
325
  },
350
326
  {
351
327
  "kind": "variable",
352
- "name": "Bt",
353
- "default": "class extends b{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()}}render(){return this.primerContext?.sdkState?.isLoading?f:this.primerContext?.sdkState?.isSuccessful?u`<slot name=\"checkout-complete\"><primer-checkout-complete></primer-checkout-complete></slot>`:u`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${w(this.hasAssignedContent,()=>f,()=>u`<div class=${W({\"primer-is-processing\":!!this.primerContext?.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.primerContext?.paymentMethods?.map(e=>u`<primer-payment-method type=${e.type} ?disabled=${this.primerContext?.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
328
+ "name": "wt",
329
+ "default": "class extends b{constructor(){super(...arguments);this.hasAssignedContent=!1;this.onSlotChange=e=>{let a=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=a.length>0,this.requestUpdate()}}render(){return this.primerContext?.sdkState?.isLoading?y:this.primerContext?.sdkState?.primerJsError?u`<slot name=\"checkout-error\"><primer-checkout-state type=\"failure\" description=${this.primerContext.sdkState.primerJsError.message||\"\"} ></primer-checkout-state></slot>`:this.primerContext?.sdkState?.isSuccessful?u`<slot name=\"checkout-complete\"><primer-checkout-state type=\"complete\"></primer-checkout-state></slot>`:u`<slot name=\"payments\" @slotchange=${this.onSlotChange}></slot>${L(this.hasAssignedContent,()=>y,()=>u`<div class=${J({\"primer-is-processing\":!!this.primerContext?.sdkState?.isProcessing})} ><primer-vault-manager></primer-vault-manager><primer-show-other-payments><div slot=\"other-payments\" class=\"primer-main-list\">${this.primerContext?.paymentMethods.map(e=>u`<primer-payment-method type=${e.type} ?disabled=${this.primerContext?.clientOptions?.disabledPayments===!0} ></primer-payment-method>`)}</div></primer-show-other-payments><primer-error-message-container></primer-error-message-container></div>`)} `}}"
354
330
  },
355
331
  {
356
332
  "kind": "function",
357
- "name": "yB"
333
+ "name": "gO"
358
334
  }
359
335
  ],
360
336
  "exports": [
@@ -378,7 +354,15 @@
378
354
  "kind": "js",
379
355
  "name": "AdyenMbway",
380
356
  "declaration": {
381
- "name": "Ie",
357
+ "name": "Pe",
358
+ "module": "dist/primer-loader.js"
359
+ }
360
+ },
361
+ {
362
+ "kind": "js",
363
+ "name": "BackendDriven",
364
+ "declaration": {
365
+ "name": "$e",
382
366
  "module": "dist/primer-loader.js"
383
367
  }
384
368
  },
@@ -386,7 +370,7 @@
386
370
  "kind": "js",
387
371
  "name": "BillingAddress",
388
372
  "declaration": {
389
- "name": "oe",
373
+ "name": "ie",
390
374
  "module": "dist/primer-loader.js"
391
375
  }
392
376
  },
@@ -394,7 +378,7 @@
394
378
  "kind": "js",
395
379
  "name": "Blik",
396
380
  "declaration": {
397
- "name": "Se",
381
+ "name": "ve",
398
382
  "module": "dist/primer-loader.js"
399
383
  }
400
384
  },
@@ -402,7 +386,7 @@
402
386
  "kind": "js",
403
387
  "name": "Button",
404
388
  "declaration": {
405
- "name": "ue",
389
+ "name": "se",
406
390
  "module": "dist/primer-loader.js"
407
391
  }
408
392
  },
@@ -410,7 +394,7 @@
410
394
  "kind": "js",
411
395
  "name": "CardForm",
412
396
  "declaration": {
413
- "name": "Me",
397
+ "name": "Ce",
414
398
  "module": "dist/primer-loader.js"
415
399
  }
416
400
  },
@@ -418,7 +402,7 @@
418
402
  "kind": "js",
419
403
  "name": "CardFormCVV",
420
404
  "declaration": {
421
- "name": "ct",
405
+ "name": "ot",
422
406
  "module": "dist/primer-loader.js"
423
407
  }
424
408
  },
@@ -426,7 +410,7 @@
426
410
  "kind": "js",
427
411
  "name": "CardFormCardNetworkSelector",
428
412
  "declaration": {
429
- "name": "he",
413
+ "name": "ce",
430
414
  "module": "dist/primer-loader.js"
431
415
  }
432
416
  },
@@ -434,7 +418,7 @@
434
418
  "kind": "js",
435
419
  "name": "CardFormCardNumber",
436
420
  "declaration": {
437
- "name": "dt",
421
+ "name": "nt",
438
422
  "module": "dist/primer-loader.js"
439
423
  }
440
424
  },
@@ -442,7 +426,7 @@
442
426
  "kind": "js",
443
427
  "name": "CardFormError",
444
428
  "declaration": {
445
- "name": "ot",
429
+ "name": "rt",
446
430
  "module": "dist/primer-loader.js"
447
431
  }
448
432
  },
@@ -450,7 +434,7 @@
450
434
  "kind": "js",
451
435
  "name": "CardFormExpiry",
452
436
  "declaration": {
453
- "name": "ut",
437
+ "name": "st",
454
438
  "module": "dist/primer-loader.js"
455
439
  }
456
440
  },
@@ -458,7 +442,7 @@
458
442
  "kind": "js",
459
443
  "name": "CardFormName",
460
444
  "declaration": {
461
- "name": "pt",
445
+ "name": "lt",
462
446
  "module": "dist/primer-loader.js"
463
447
  }
464
448
  },
@@ -466,7 +450,7 @@
466
450
  "kind": "js",
467
451
  "name": "CardFormSubmit",
468
452
  "declaration": {
469
- "name": "me",
453
+ "name": "de",
470
454
  "module": "dist/primer-loader.js"
471
455
  }
472
456
  },
@@ -474,7 +458,7 @@
474
458
  "kind": "js",
475
459
  "name": "Collapsable",
476
460
  "declaration": {
477
- "name": "pe",
461
+ "name": "le",
478
462
  "module": "dist/primer-loader.js"
479
463
  }
480
464
  },
@@ -482,7 +466,7 @@
482
466
  "kind": "js",
483
467
  "name": "Dialog",
484
468
  "declaration": {
485
- "name": "xe",
469
+ "name": "Re",
486
470
  "module": "dist/primer-loader.js"
487
471
  }
488
472
  },
@@ -490,7 +474,7 @@
490
474
  "kind": "js",
491
475
  "name": "ErrorMessage",
492
476
  "declaration": {
493
- "name": "ze",
477
+ "name": "Ve",
494
478
  "module": "dist/primer-loader.js"
495
479
  }
496
480
  },
@@ -498,7 +482,7 @@
498
482
  "kind": "js",
499
483
  "name": "ErrorMessageContainer",
500
484
  "declaration": {
501
- "name": "ht",
485
+ "name": "ct",
502
486
  "module": "dist/primer-loader.js"
503
487
  }
504
488
  },
@@ -514,7 +498,7 @@
514
498
  "kind": "js",
515
499
  "name": "InputLabel",
516
500
  "declaration": {
517
- "name": "nt",
501
+ "name": "tt",
518
502
  "module": "dist/primer-loader.js"
519
503
  }
520
504
  },
@@ -522,7 +506,7 @@
522
506
  "kind": "js",
523
507
  "name": "InputWrapper",
524
508
  "declaration": {
525
- "name": "$e",
509
+ "name": "Fe",
526
510
  "module": "dist/primer-loader.js"
527
511
  }
528
512
  },
@@ -530,7 +514,7 @@
530
514
  "kind": "js",
531
515
  "name": "NativePayment",
532
516
  "declaration": {
533
- "name": "Be",
517
+ "name": "xe",
534
518
  "module": "dist/primer-loader.js"
535
519
  }
536
520
  },
@@ -538,7 +522,7 @@
538
522
  "kind": "js",
539
523
  "name": "PaymentMethod",
540
524
  "declaration": {
541
- "name": "De",
525
+ "name": "Be",
542
526
  "module": "dist/primer-loader.js"
543
527
  }
544
528
  },
@@ -546,7 +530,7 @@
546
530
  "kind": "js",
547
531
  "name": "PaymentMethodAccordion",
548
532
  "declaration": {
549
- "name": "Le",
533
+ "name": "Ne",
550
534
  "module": "dist/primer-loader.js"
551
535
  }
552
536
  },
@@ -554,7 +538,7 @@
554
538
  "kind": "js",
555
539
  "name": "PaymentMethodAccordionConfirmButton",
556
540
  "declaration": {
557
- "name": "mt",
541
+ "name": "dt",
558
542
  "module": "dist/primer-loader.js"
559
543
  }
560
544
  },
@@ -562,7 +546,7 @@
562
546
  "kind": "js",
563
547
  "name": "PaymentMethodButton",
564
548
  "declaration": {
565
- "name": "je",
549
+ "name": "He",
566
550
  "module": "dist/primer-loader.js"
567
551
  }
568
552
  },
@@ -570,7 +554,7 @@
570
554
  "kind": "js",
571
555
  "name": "PaymentMethodContainer",
572
556
  "declaration": {
573
- "name": "_e",
557
+ "name": "Oe",
574
558
  "module": "dist/primer-loader.js"
575
559
  }
576
560
  },
@@ -578,7 +562,7 @@
578
562
  "kind": "js",
579
563
  "name": "PaymentMethodContentComponent",
580
564
  "declaration": {
581
- "name": "Je",
565
+ "name": "je",
582
566
  "module": "dist/primer-loader.js"
583
567
  }
584
568
  },
@@ -586,7 +570,7 @@
586
570
  "kind": "js",
587
571
  "name": "PortalDialog",
588
572
  "declaration": {
589
- "name": "ee",
573
+ "name": "X",
590
574
  "module": "dist/primer-loader.js"
591
575
  }
592
576
  },
@@ -602,7 +586,7 @@
602
586
  "kind": "js",
603
587
  "name": "PrimerCheckoutComponent",
604
588
  "declaration": {
605
- "name": "ve",
589
+ "name": "Me",
606
590
  "module": "dist/primer-loader.js"
607
591
  }
608
592
  },
@@ -610,7 +594,7 @@
610
594
  "kind": "js",
611
595
  "name": "PrimerCheckoutFailure",
612
596
  "declaration": {
613
- "name": "Zt",
597
+ "name": "zt",
614
598
  "module": "dist/primer-loader.js"
615
599
  }
616
600
  },
@@ -618,7 +602,7 @@
618
602
  "kind": "js",
619
603
  "name": "PrimerCheckoutState",
620
604
  "declaration": {
621
- "name": "st",
605
+ "name": "it",
622
606
  "module": "dist/primer-loader.js"
623
607
  }
624
608
  },
@@ -626,7 +610,7 @@
626
610
  "kind": "js",
627
611
  "name": "PrimerIcon",
628
612
  "declaration": {
629
- "name": "Ye",
613
+ "name": "Ue",
630
614
  "module": "dist/primer-loader.js"
631
615
  }
632
616
  },
@@ -634,7 +618,7 @@
634
618
  "kind": "js",
635
619
  "name": "PrimerKlarna",
636
620
  "declaration": {
637
- "name": "Ce",
621
+ "name": "fe",
638
622
  "module": "dist/primer-loader.js"
639
623
  }
640
624
  },
@@ -642,7 +626,7 @@
642
626
  "kind": "js",
643
627
  "name": "PrimerMain",
644
628
  "declaration": {
645
- "name": "Bt",
629
+ "name": "wt",
646
630
  "module": "dist/primer-loader.js"
647
631
  }
648
632
  },
@@ -650,7 +634,7 @@
650
634
  "kind": "js",
651
635
  "name": "PtPhoneNumberInput",
652
636
  "declaration": {
653
- "name": "re",
637
+ "name": "te",
654
638
  "module": "dist/primer-loader.js"
655
639
  }
656
640
  },
@@ -658,7 +642,7 @@
658
642
  "kind": "js",
659
643
  "name": "QRCode",
660
644
  "declaration": {
661
- "name": "Ee",
645
+ "name": "Se",
662
646
  "module": "dist/primer-loader.js"
663
647
  }
664
648
  },
@@ -666,7 +650,7 @@
666
650
  "kind": "js",
667
651
  "name": "RedirectPayment",
668
652
  "declaration": {
669
- "name": "Ze",
653
+ "name": "ze",
670
654
  "module": "dist/primer-loader.js"
671
655
  }
672
656
  },
@@ -674,7 +658,7 @@
674
658
  "kind": "js",
675
659
  "name": "Select",
676
660
  "declaration": {
677
- "name": "be",
661
+ "name": "ye",
678
662
  "module": "dist/primer-loader.js"
679
663
  }
680
664
  },
@@ -682,7 +666,7 @@
682
666
  "kind": "js",
683
667
  "name": "ShowOtherPayments",
684
668
  "declaration": {
685
- "name": "Ge",
669
+ "name": "_e",
686
670
  "module": "dist/primer-loader.js"
687
671
  }
688
672
  },
@@ -690,7 +674,7 @@
690
674
  "kind": "js",
691
675
  "name": "Spinner",
692
676
  "declaration": {
693
- "name": "He",
677
+ "name": "Ke",
694
678
  "module": "dist/primer-loader.js"
695
679
  }
696
680
  },
@@ -698,7 +682,7 @@
698
682
  "kind": "js",
699
683
  "name": "VaultCvvInput",
700
684
  "declaration": {
701
- "name": "ae",
685
+ "name": "re",
702
686
  "module": "dist/primer-loader.js"
703
687
  }
704
688
  },
@@ -706,7 +690,7 @@
706
690
  "kind": "js",
707
691
  "name": "VaultDeleteConfirmation",
708
692
  "declaration": {
709
- "name": "we",
693
+ "name": "ke",
710
694
  "module": "dist/primer-loader.js"
711
695
  }
712
696
  },
@@ -714,7 +698,7 @@
714
698
  "kind": "js",
715
699
  "name": "VaultEmptyState",
716
700
  "declaration": {
717
- "name": "lt",
701
+ "name": "at",
718
702
  "module": "dist/primer-loader.js"
719
703
  }
720
704
  },
@@ -722,7 +706,7 @@
722
706
  "kind": "js",
723
707
  "name": "VaultErrorMessage",
724
708
  "declaration": {
725
- "name": "We",
709
+ "name": "Ye",
726
710
  "module": "dist/primer-loader.js"
727
711
  }
728
712
  },
@@ -730,7 +714,7 @@
730
714
  "kind": "js",
731
715
  "name": "VaultManager",
732
716
  "declaration": {
733
- "name": "se",
717
+ "name": "ae",
734
718
  "module": "dist/primer-loader.js"
735
719
  }
736
720
  },
@@ -738,7 +722,7 @@
738
722
  "kind": "js",
739
723
  "name": "VaultManagerHeader",
740
724
  "declaration": {
741
- "name": "Oe",
725
+ "name": "De",
742
726
  "module": "dist/primer-loader.js"
743
727
  }
744
728
  },
@@ -746,7 +730,7 @@
746
730
  "kind": "js",
747
731
  "name": "VaultPaymentMethodItem",
748
732
  "declaration": {
749
- "name": "Ne",
733
+ "name": "Ie",
750
734
  "module": "dist/primer-loader.js"
751
735
  }
752
736
  },
@@ -754,7 +738,7 @@
754
738
  "kind": "js",
755
739
  "name": "VaultPaymentSubmit",
756
740
  "declaration": {
757
- "name": "Ae",
741
+ "name": "be",
758
742
  "module": "dist/primer-loader.js"
759
743
  }
760
744
  },
@@ -762,7 +746,7 @@
762
746
  "kind": "js",
763
747
  "name": "injectDarkTheme",
764
748
  "declaration": {
765
- "name": "Sg",
749
+ "name": "sy",
766
750
  "module": "dist/primer-loader.js"
767
751
  }
768
752
  },
@@ -770,7 +754,7 @@
770
754
  "kind": "js",
771
755
  "name": "injectLightTheme",
772
756
  "declaration": {
773
- "name": "Cg",
757
+ "name": "oy",
774
758
  "module": "dist/primer-loader.js"
775
759
  }
776
760
  },
@@ -778,7 +762,7 @@
778
762
  "kind": "js",
779
763
  "name": "injectLoaderStyles",
780
764
  "declaration": {
781
- "name": "Wl",
765
+ "name": "vd",
782
766
  "module": "dist/primer-loader.js"
783
767
  }
784
768
  },
@@ -786,7 +770,7 @@
786
770
  "kind": "js",
787
771
  "name": "injectThemeStyles",
788
772
  "declaration": {
789
- "name": "Jl",
773
+ "name": "Sd",
790
774
  "module": "dist/primer-loader.js"
791
775
  }
792
776
  },
@@ -794,12 +778,41 @@
794
778
  "kind": "js",
795
779
  "name": "loadPrimer",
796
780
  "declaration": {
797
- "name": "yB",
781
+ "name": "gO",
798
782
  "module": "dist/primer-loader.js"
799
783
  }
800
784
  }
801
785
  ]
802
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
+ },
803
816
  {
804
817
  "kind": "javascript-module",
805
818
  "path": "src/consts.ts",
@@ -981,6 +994,22 @@
981
994
  "module": "./contexts/context"
982
995
  }
983
996
  },
997
+ {
998
+ "kind": "js",
999
+ "name": "SdkError",
1000
+ "declaration": {
1001
+ "name": "SdkError",
1002
+ "package": "@primer-io/sdk-core"
1003
+ }
1004
+ },
1005
+ {
1006
+ "kind": "js",
1007
+ "name": "SdkErrorOrigin",
1008
+ "declaration": {
1009
+ "name": "SdkErrorOrigin",
1010
+ "package": "@primer-io/sdk-core"
1011
+ }
1012
+ },
984
1013
  {
985
1014
  "kind": "js",
986
1015
  "name": "PaymentApprovalRequiredData",
@@ -1040,13 +1069,6 @@
1040
1069
  "description": "PrimerCheckoutComponent implements the main checkout experience.\nThis component includes a CSS-only loader that displays before the JavaScript\nis fully loaded, ensuring users see a loading indicator immediately.\n\nThe loader can be disabled by:\n1. Adding the 'loader-disabled' attribute to the component\n2. Setting the CSS custom property --primer-loader-disabled: 1",
1041
1070
  "name": "PrimerCheckoutComponent",
1042
1071
  "members": [
1043
- {
1044
- "kind": "field",
1045
- "name": "jsInitialized",
1046
- "type": {
1047
- "text": "boolean"
1048
- }
1049
- },
1050
1072
  {
1051
1073
  "kind": "field",
1052
1074
  "name": "primerJS",
@@ -1092,7 +1114,7 @@
1092
1114
  },
1093
1115
  {
1094
1116
  "kind": "field",
1095
- "name": "_jsInitialized",
1117
+ "name": "jsInitialized",
1096
1118
  "type": {
1097
1119
  "text": "boolean"
1098
1120
  },
@@ -1109,15 +1131,6 @@
1109
1131
  "text": "HTMLSlotElement"
1110
1132
  }
1111
1133
  },
1112
- {
1113
- "kind": "field",
1114
- "name": "previousLoadingState",
1115
- "type": {
1116
- "text": "boolean"
1117
- },
1118
- "privacy": "private",
1119
- "default": "true"
1120
- },
1121
1134
  {
1122
1135
  "kind": "field",
1123
1136
  "name": "hasAssignedContent",
@@ -1127,15 +1140,6 @@
1127
1140
  "privacy": "private",
1128
1141
  "default": "false"
1129
1142
  },
1130
- {
1131
- "kind": "field",
1132
- "name": "_loadingTimeoutId",
1133
- "type": {
1134
- "text": "number | null"
1135
- },
1136
- "privacy": "private",
1137
- "default": "null"
1138
- },
1139
1143
  {
1140
1144
  "kind": "field",
1141
1145
  "name": "_eventListenerController",
@@ -1263,17 +1267,6 @@
1263
1267
  ],
1264
1268
  "description": "Handle external primer:show-other-payments-toggle events by forwarding them through the events controller\nUses AbortController signal to prevent circular event loops more safely"
1265
1269
  },
1266
- {
1267
- "kind": "method",
1268
- "name": "checkLoadingStateChange",
1269
- "privacy": "private",
1270
- "return": {
1271
- "type": {
1272
- "text": "void"
1273
- }
1274
- },
1275
- "description": "Check if the loading state has changed and update the CSS loader visibility accordingly.\nThis method is called after each update cycle to detect when loading is complete."
1276
- },
1277
1270
  {
1278
1271
  "kind": "method",
1279
1272
  "name": "addEventListener",
@@ -1607,7 +1600,7 @@
1607
1600
  },
1608
1601
  "default": "false",
1609
1602
  "description": "Whether the component has completed initialization and loading\nThis is used to control the CSS-only loader visibility",
1610
- "fieldName": "_jsInitialized"
1603
+ "fieldName": "jsInitialized"
1611
1604
  }
1612
1605
  ],
1613
1606
  "superclass": {
@@ -1673,227 +1666,36 @@
1673
1666
  },
1674
1667
  {
1675
1668
  "kind": "javascript-module",
1676
- "path": "e2e/mocks/billing-address.ts",
1669
+ "path": "dist/chunks/ar.BIHRX5RF.js",
1677
1670
  "declarations": [
1678
1671
  {
1679
1672
  "kind": "variable",
1680
- "name": "CONFIGURATION_RESPONSE",
1681
- "type": {
1682
- "text": "object"
1683
- },
1684
- "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: {}, }"
1685
- },
1673
+ "name": "o",
1674
+ "default": "e"
1675
+ }
1676
+ ],
1677
+ "exports": [
1678
+ {
1679
+ "kind": "js",
1680
+ "name": "templates",
1681
+ "declaration": {
1682
+ "name": "o",
1683
+ "module": "dist/chunks/ar.BIHRX5RF.js"
1684
+ }
1685
+ }
1686
+ ]
1687
+ },
1688
+ {
1689
+ "kind": "javascript-module",
1690
+ "path": "dist/chunks/bg.FGU6YCAF.js",
1691
+ "declarations": [
1686
1692
  {
1687
1693
  "kind": "variable",
1688
- "name": "CARD_NUMBER",
1689
- "type": {
1690
- "text": "string"
1691
- },
1692
- "default": "'4242 4242 4242 4242'"
1693
- },
1694
- {
1695
- "kind": "function",
1696
- "name": "mockBinData",
1697
- "parameters": [
1698
- {
1699
- "name": "page",
1700
- "type": {
1701
- "text": "Page"
1702
- }
1703
- }
1704
- ]
1705
- },
1706
- {
1707
- "kind": "function",
1708
- "name": "mockPaymentInstruments",
1709
- "parameters": [
1710
- {
1711
- "name": "page",
1712
- "type": {
1713
- "text": "Page"
1714
- }
1715
- }
1716
- ]
1717
- },
1718
- {
1719
- "kind": "function",
1720
- "name": "mockPayments",
1721
- "parameters": [
1722
- {
1723
- "name": "page",
1724
- "type": {
1725
- "text": "Page"
1726
- }
1727
- }
1728
- ]
1729
- }
1730
- ],
1731
- "exports": [
1732
- {
1733
- "kind": "js",
1734
- "name": "CONFIGURATION_RESPONSE",
1735
- "declaration": {
1736
- "name": "CONFIGURATION_RESPONSE",
1737
- "module": "e2e/mocks/billing-address.ts"
1738
- }
1739
- },
1740
- {
1741
- "kind": "js",
1742
- "name": "CARD_NUMBER",
1743
- "declaration": {
1744
- "name": "CARD_NUMBER",
1745
- "module": "e2e/mocks/billing-address.ts"
1746
- }
1747
- },
1748
- {
1749
- "kind": "js",
1750
- "name": "mockBinData",
1751
- "declaration": {
1752
- "name": "mockBinData",
1753
- "module": "e2e/mocks/billing-address.ts"
1754
- }
1755
- },
1756
- {
1757
- "kind": "js",
1758
- "name": "mockPaymentInstruments",
1759
- "declaration": {
1760
- "name": "mockPaymentInstruments",
1761
- "module": "e2e/mocks/billing-address.ts"
1762
- }
1763
- },
1764
- {
1765
- "kind": "js",
1766
- "name": "mockPayments",
1767
- "declaration": {
1768
- "name": "mockPayments",
1769
- "module": "e2e/mocks/billing-address.ts"
1770
- }
1771
- }
1772
- ]
1773
- },
1774
- {
1775
- "kind": "javascript-module",
1776
- "path": "e2e/mocks/paypal.ts",
1777
- "declarations": [
1778
- {
1779
- "kind": "variable",
1780
- "name": "CONFIGURATION_RESPONSE",
1781
- "type": {
1782
- "text": "object"
1783
- },
1784
- "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: {}, }"
1785
- }
1786
- ],
1787
- "exports": [
1788
- {
1789
- "kind": "js",
1790
- "name": "CONFIGURATION_RESPONSE",
1791
- "declaration": {
1792
- "name": "CONFIGURATION_RESPONSE",
1793
- "module": "e2e/mocks/paypal.ts"
1794
- }
1795
- }
1796
- ]
1797
- },
1798
- {
1799
- "kind": "javascript-module",
1800
- "path": "e2e/mocks/shared.ts",
1801
- "declarations": [
1802
- {
1803
- "kind": "function",
1804
- "name": "mockConfigurationCall",
1805
- "parameters": [
1806
- {
1807
- "name": "page",
1808
- "type": {
1809
- "text": "Page"
1810
- }
1811
- },
1812
- {
1813
- "name": "config",
1814
- "type": {
1815
- "text": "unknown"
1816
- }
1817
- }
1818
- ]
1819
- },
1820
- {
1821
- "kind": "function",
1822
- "name": "mockDemoUrl",
1823
- "parameters": [
1824
- {
1825
- "name": "primerCheckoutOptions",
1826
- "optional": true,
1827
- "type": {
1828
- "text": "PrimerCheckoutOptions"
1829
- }
1830
- }
1831
- ]
1832
- }
1833
- ],
1834
- "exports": [
1835
- {
1836
- "kind": "js",
1837
- "name": "mockConfigurationCall",
1838
- "declaration": {
1839
- "name": "mockConfigurationCall",
1840
- "module": "e2e/mocks/shared.ts"
1841
- }
1842
- },
1843
- {
1844
- "kind": "js",
1845
- "name": "mockDemoUrl",
1846
- "declaration": {
1847
- "name": "mockDemoUrl",
1848
- "module": "e2e/mocks/shared.ts"
1849
- }
1850
- }
1851
- ]
1852
- },
1853
- {
1854
- "kind": "javascript-module",
1855
- "path": "e2e/tests/card-form-billing-address.spec.ts",
1856
- "declarations": [],
1857
- "exports": []
1858
- },
1859
- {
1860
- "kind": "javascript-module",
1861
- "path": "e2e/tests/paypal.spec.ts",
1862
- "declarations": [],
1863
- "exports": []
1864
- },
1865
- {
1866
- "kind": "javascript-module",
1867
- "path": "dist/chunks/ar.BIHRX5RF.js",
1868
- "declarations": [
1869
- {
1870
- "kind": "variable",
1871
- "name": "o",
1872
- "default": "e"
1873
- }
1874
- ],
1875
- "exports": [
1876
- {
1877
- "kind": "js",
1878
- "name": "templates",
1879
- "declaration": {
1880
- "name": "o",
1881
- "module": "dist/chunks/ar.BIHRX5RF.js"
1882
- }
1883
- }
1884
- ]
1885
- },
1886
- {
1887
- "kind": "javascript-module",
1888
- "path": "dist/chunks/bg.FGU6YCAF.js",
1889
- "declarations": [
1890
- {
1891
- "kind": "variable",
1892
- "name": "o",
1893
- "default": "e"
1894
- }
1895
- ],
1896
- "exports": [
1694
+ "name": "o",
1695
+ "default": "e"
1696
+ }
1697
+ ],
1698
+ "exports": [
1897
1699
  {
1898
1700
  "kind": "js",
1899
1701
  "name": "templates",
@@ -2995,6 +2797,197 @@
2995
2797
  }
2996
2798
  ]
2997
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
+ },
2998
2991
  {
2999
2992
  "kind": "javascript-module",
3000
2993
  "path": "src/__tests__/setup.ts",
@@ -3167,10 +3160,18 @@
3167
3160
  },
3168
3161
  {
3169
3162
  "kind": "js",
3170
- "name": "RedirectPayment",
3163
+ "name": "RedirectPayment",
3164
+ "declaration": {
3165
+ "name": "RedirectPayment",
3166
+ "module": "./redirect-payment/redirect-payment"
3167
+ }
3168
+ },
3169
+ {
3170
+ "kind": "js",
3171
+ "name": "BackendDriven",
3171
3172
  "declaration": {
3172
- "name": "RedirectPayment",
3173
- "module": "./redirect-payment/redirect-payment"
3173
+ "name": "BackendDriven",
3174
+ "module": "./backend-driven/backend-driven"
3174
3175
  }
3175
3176
  },
3176
3177
  {
@@ -3525,24 +3526,6 @@
3525
3526
  "privacy": "private",
3526
3527
  "default": "null"
3527
3528
  },
3528
- {
3529
- "kind": "field",
3530
- "name": "loadingTimeout",
3531
- "type": {
3532
- "text": "ReturnType<typeof setTimeout> | null"
3533
- },
3534
- "privacy": "private",
3535
- "default": "null"
3536
- },
3537
- {
3538
- "kind": "field",
3539
- "name": "isDisconnected",
3540
- "type": {
3541
- "text": "boolean"
3542
- },
3543
- "privacy": "private",
3544
- "default": "false"
3545
- },
3546
3529
  {
3547
3530
  "kind": "field",
3548
3531
  "name": "telemetry",
@@ -3579,26 +3562,6 @@
3579
3562
  }
3580
3563
  }
3581
3564
  },
3582
- {
3583
- "kind": "method",
3584
- "name": "setupLoadingTimeout",
3585
- "privacy": "private",
3586
- "return": {
3587
- "type": {
3588
- "text": "void"
3589
- }
3590
- }
3591
- },
3592
- {
3593
- "kind": "method",
3594
- "name": "clearLoadingTimeout",
3595
- "privacy": "private",
3596
- "return": {
3597
- "type": {
3598
- "text": "void"
3599
- }
3600
- }
3601
- },
3602
3565
  {
3603
3566
  "kind": "method",
3604
3567
  "name": "cleanupResources",
@@ -3651,26 +3614,35 @@
3651
3614
  },
3652
3615
  {
3653
3616
  "kind": "method",
3654
- "name": "initializeHeadless"
3655
- },
3656
- {
3657
- "kind": "method",
3658
- "name": "createManager",
3617
+ "name": "handleShippingAddressChange",
3659
3618
  "privacy": "private",
3660
3619
  "parameters": [
3661
3620
  {
3662
- "name": "paymentMethod",
3621
+ "name": "[data, handler]",
3663
3622
  "type": {
3664
- "text": "PaymentMethodInfo"
3623
+ "text": "Parameters<ShippingAddressChangeCallback>"
3665
3624
  }
3666
- },
3625
+ }
3626
+ ],
3627
+ "description": "Bridges sdk-core's shipping-address-change callback to the\nprimer:shipping-address-change DOM event, auto-resolving with no\noptions so sdk-core's promise doesn't time out if nothing responds."
3628
+ },
3629
+ {
3630
+ "kind": "method",
3631
+ "name": "handleShippingOptionChange",
3632
+ "privacy": "private",
3633
+ "parameters": [
3667
3634
  {
3668
- "name": "headlessInstance",
3635
+ "name": "[data, handler]",
3669
3636
  "type": {
3670
- "text": "PrimerHeadlessCheckout"
3637
+ "text": "Parameters<ShippingOptionChangeCallback>"
3671
3638
  }
3672
3639
  }
3673
- ]
3640
+ ],
3641
+ "description": "Express Checkout (Apple Pay / Google Pay): sdk-core invokes this when the\nshopper selects one of the shipping options previously supplied via\nonShippingAddressChange. Same bridge/auto-resolve shape as\nhandleShippingAddressChange above."
3642
+ },
3643
+ {
3644
+ "kind": "method",
3645
+ "name": "initializeHeadless"
3674
3646
  },
3675
3647
  {
3676
3648
  "kind": "method",
@@ -3711,9 +3683,9 @@
3711
3683
  },
3712
3684
  "parameters": [
3713
3685
  {
3714
- "name": "infos",
3686
+ "name": "paymentMethods",
3715
3687
  "type": {
3716
- "text": "PaymentMethodInfo[]"
3688
+ "text": "InitializedPaymentMethod[]"
3717
3689
  }
3718
3690
  }
3719
3691
  ]
@@ -3725,7 +3697,8 @@
3725
3697
  "name": "paymentMethods",
3726
3698
  "type": {
3727
3699
  "text": "InitializedPaymentMethod[]"
3728
- }
3700
+ },
3701
+ "default": "[]"
3729
3702
  }
3730
3703
  ],
3731
3704
  "exports": [
@@ -4193,6 +4166,40 @@
4193
4166
  ],
4194
4167
  "description": "Dispatch payment approval required event (MANUAL approval flow).\nCalled when `:pay` returns 202 and the attempt awaits merchant approval.\n\nThe detail carries clientSessionId + paymentAttemptId for the merchant's\nbackend to call /approve or /abort, and continueFlow() to resume the SDK."
4195
4168
  },
4169
+ {
4170
+ "kind": "method",
4171
+ "name": "dispatchShippingAddressChange",
4172
+ "return": {
4173
+ "type": {
4174
+ "text": ""
4175
+ }
4176
+ },
4177
+ "parameters": [
4178
+ {
4179
+ "name": "detail",
4180
+ "type": {
4181
+ "text": "{\n paymentMethodType: PaymentMethodType;\n shippingAddress: NullableAddress;\n setShippingOptions: (options: ShippingOption[]) => void;\n }"
4182
+ }
4183
+ }
4184
+ ]
4185
+ },
4186
+ {
4187
+ "kind": "method",
4188
+ "name": "dispatchShippingOptionChange",
4189
+ "return": {
4190
+ "type": {
4191
+ "text": ""
4192
+ }
4193
+ },
4194
+ "parameters": [
4195
+ {
4196
+ "name": "detail",
4197
+ "type": {
4198
+ "text": "{\n paymentMethodType: PaymentMethodType;\n selectedShippingOption: ShippingOption;\n continue: () => void;\n }"
4199
+ }
4200
+ }
4201
+ ]
4202
+ },
4196
4203
  {
4197
4204
  "kind": "method",
4198
4205
  "name": "dispatchVaultMethodsUpdate",
@@ -4526,7 +4533,7 @@
4526
4533
  "name": "getPaymentMethods",
4527
4534
  "return": {
4528
4535
  "type": {
4529
- "text": "PaymentMethodInfo[]"
4536
+ "text": "InitializedPaymentMethod[]"
4530
4537
  }
4531
4538
  },
4532
4539
  "description": "Returns the cached list of payment methods."
@@ -4549,6 +4556,53 @@
4549
4556
  }
4550
4557
  ],
4551
4558
  "description": "Sets the cardholder name value in the card payment form.\n\n⚠️ Must be called after card hosted inputs have been rendered.\nCalling too early will log a warning and fail gracefully."
4559
+ },
4560
+ {
4561
+ "kind": "method",
4562
+ "name": "resumeAppSwitch",
4563
+ "return": {
4564
+ "type": {
4565
+ "text": "Promise<void>"
4566
+ }
4567
+ },
4568
+ "parameters": [
4569
+ {
4570
+ "name": "orderId",
4571
+ "type": {
4572
+ "text": "string"
4573
+ }
4574
+ }
4575
+ ],
4576
+ "description": "PayPal host-app App Switch: finishes the payment after the buyer returns\nfrom the PayPal app, with the `orderId` the host app read from the return\ndeep link's `token` param. The outcome arrives through the usual\nonCheckoutComplete/onCheckoutFail callbacks.\n\nDoes not need the PayPal button to have rendered."
4577
+ },
4578
+ {
4579
+ "kind": "method",
4580
+ "name": "cancelAppSwitch",
4581
+ "return": {
4582
+ "type": {
4583
+ "text": "Promise<void>"
4584
+ }
4585
+ },
4586
+ "description": "PayPal host-app App Switch: cancels when the buyer returns without approving."
4587
+ },
4588
+ {
4589
+ "kind": "method",
4590
+ "name": "findPayPalMethod",
4591
+ "privacy": "private",
4592
+ "return": {
4593
+ "type": {
4594
+ "text": "PayPalPaymentMethod | undefined"
4595
+ }
4596
+ },
4597
+ "parameters": [
4598
+ {
4599
+ "name": "caller",
4600
+ "type": {
4601
+ "text": "string"
4602
+ }
4603
+ }
4604
+ ],
4605
+ "description": "Warns rather than throwing when PayPal is absent: the host app calls these\non a deep-link return, where whether PayPal is in the session is not its\nbusiness."
4552
4606
  }
4553
4607
  ]
4554
4608
  }
@@ -4669,40 +4723,6 @@
4669
4723
  }
4670
4724
  ]
4671
4725
  },
4672
- {
4673
- "kind": "method",
4674
- "name": "setKlarnaCategories",
4675
- "return": {
4676
- "type": {
4677
- "text": "void"
4678
- }
4679
- },
4680
- "parameters": [
4681
- {
4682
- "name": "value",
4683
- "type": {
4684
- "text": "KlarnaCategoriesContextType"
4685
- }
4686
- }
4687
- ]
4688
- },
4689
- {
4690
- "kind": "method",
4691
- "name": "setAdyenKlarnaOptions",
4692
- "return": {
4693
- "type": {
4694
- "text": "void"
4695
- }
4696
- },
4697
- "parameters": [
4698
- {
4699
- "name": "value",
4700
- "type": {
4701
- "text": "AdyenKlarnaOptionsContextType"
4702
- }
4703
- }
4704
- ]
4705
- },
4706
4726
  {
4707
4727
  "kind": "method",
4708
4728
  "name": "setComputedStyles",
@@ -5101,7 +5121,7 @@
5101
5121
  {
5102
5122
  "kind": "variable",
5103
5123
  "name": "cssLoaderStyles",
5104
- "default": "` @keyframes primer-css-spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Hide primer-main and primer-checkout-error while they are loading to prevent FOUC Only check for undefined primer-* elements, ignoring browser extensions */ primer-main:not(:defined), primer-checkout-error:not(:defined) { visibility: hidden; } primer-checkout:not([js-initialized]) [slot=\"main\"] { display: none; } primer-checkout:not([js-initialized]) { display: block; position: relative; width: 100%; min-height: 64px; } primer-checkout:not([js-initialized]):not([loader-disabled])::after { content: \"\"; display: block; box-sizing: border-box; position: absolute; inset: 0; margin: auto; width: var(--primer-size-xlarge); height: var(--primer-size-xlarge); border-radius: 50%; border: 3px solid #f5f5f5; border-top-color: var(--primer-color-loader); animation: primer-css-spinner-rotate 1.2s linear infinite; z-index: 9999; } `",
5124
+ "default": "` @keyframes primer-css-spinner-rotate { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Hide primer-main while it is loading to prevent FOUC. Only check for undefined primer-* elements, ignoring browser extensions. Slotted light-DOM content (including custom checkout-error content) is already hidden pre-init by the [slot=\"main\"] rule below. */ primer-main:not(:defined) { visibility: hidden; } primer-checkout:not([js-initialized]) [slot=\"main\"] { display: none; } primer-checkout:not([js-initialized]) { display: block; position: relative; width: 100%; min-height: 64px; } primer-checkout:not([js-initialized]):not([loader-disabled])::after { content: \"\"; display: block; box-sizing: border-box; position: absolute; inset: 0; margin: auto; width: var(--primer-size-xlarge); height: var(--primer-size-xlarge); border-radius: 50%; border: 3px solid #f5f5f5; border-top-color: var(--primer-color-loader); animation: primer-css-spinner-rotate 1.2s linear infinite; z-index: 9999; } `",
5105
5125
  "description": "This module exports the CSS loader styles as a string for inline injection.\nThese styles are injected into the page before any JavaScript loads,\nensuring the loading indicator appears immediately."
5106
5126
  }
5107
5127
  ],
@@ -5397,9 +5417,9 @@
5397
5417
  },
5398
5418
  {
5399
5419
  "kind": "js",
5400
- "name": "IHeadlessHostedInput",
5420
+ "name": "HostedInput",
5401
5421
  "declaration": {
5402
- "name": "IHeadlessHostedInput",
5422
+ "name": "HostedInput",
5403
5423
  "package": "@primer-io/sdk-core"
5404
5424
  }
5405
5425
  },
@@ -5421,25 +5441,25 @@
5421
5441
  },
5422
5442
  {
5423
5443
  "kind": "js",
5424
- "name": "PaymentMethodInfo",
5444
+ "name": "PaymentSummary",
5425
5445
  "declaration": {
5426
- "name": "PaymentMethodInfo",
5446
+ "name": "PaymentSummary",
5427
5447
  "package": "@primer-io/sdk-core"
5428
5448
  }
5429
5449
  },
5430
5450
  {
5431
5451
  "kind": "js",
5432
- "name": "PaymentSummary",
5452
+ "name": "PrimerHeadlessCheckout",
5433
5453
  "declaration": {
5434
- "name": "PaymentSummary",
5454
+ "name": "PrimerHeadlessCheckout",
5435
5455
  "package": "@primer-io/sdk-core"
5436
5456
  }
5437
5457
  },
5438
5458
  {
5439
5459
  "kind": "js",
5440
- "name": "PrimerHeadlessCheckout",
5460
+ "name": "ShippingOption",
5441
5461
  "declaration": {
5442
- "name": "PrimerHeadlessCheckout",
5462
+ "name": "ShippingOption",
5443
5463
  "package": "@primer-io/sdk-core"
5444
5464
  }
5445
5465
  },
@@ -8742,7 +8762,7 @@
8742
8762
  "kind": "field",
8743
8763
  "name": "paymentMethod",
8744
8764
  "type": {
8745
- "text": "InitializedPaymentMethod | undefined"
8765
+ "text": "AdyenKlarnaPaymentMethod | undefined"
8746
8766
  },
8747
8767
  "description": "The payment method from context",
8748
8768
  "attribute": "paymentMethod"
@@ -8796,15 +8816,6 @@
8796
8816
  "privacy": "private",
8797
8817
  "default": "false"
8798
8818
  },
8799
- {
8800
- "kind": "field",
8801
- "name": "manager",
8802
- "type": {
8803
- "text": "IAdyenKlarnaPaymentMethodManager | null"
8804
- },
8805
- "privacy": "private",
8806
- "readonly": true
8807
- },
8808
8819
  {
8809
8820
  "kind": "field",
8810
8821
  "name": "klarnaLogoUrl",
@@ -8843,7 +8854,7 @@
8843
8854
  {
8844
8855
  "name": "paymentMethod",
8845
8856
  "type": {
8846
- "text": "InitializedPaymentMethod | undefined"
8857
+ "text": "AdyenKlarnaPaymentMethod | undefined"
8847
8858
  },
8848
8859
  "description": "The payment method from context",
8849
8860
  "fieldName": "paymentMethod"
@@ -9136,6 +9147,104 @@
9136
9147
  }
9137
9148
  ]
9138
9149
  },
9150
+ {
9151
+ "kind": "javascript-module",
9152
+ "path": "src/containers/backend-driven/backend-driven.component.ts",
9153
+ "declarations": [
9154
+ {
9155
+ "kind": "class",
9156
+ "description": "Surface for a payment method whose flow the backend drives through a step\ntree. Today every step tree starts by handing off to a third party, so this\nrenders a button — but unlike a redirect method, what the flow needs of this\ncomponent is open-ended: steps can ask for input, render UI, or wait, and\nthis is where that grows.",
9157
+ "name": "BackendDrivenComponent",
9158
+ "members": [
9159
+ {
9160
+ "kind": "field",
9161
+ "name": "paymentMethod",
9162
+ "type": {
9163
+ "text": "BackendDrivenPaymentMethod | undefined"
9164
+ },
9165
+ "attribute": "paymentMethod"
9166
+ },
9167
+ {
9168
+ "kind": "field",
9169
+ "name": "disabled",
9170
+ "type": {
9171
+ "text": "boolean"
9172
+ },
9173
+ "default": "false",
9174
+ "attribute": "disabled"
9175
+ },
9176
+ {
9177
+ "kind": "field",
9178
+ "name": "primerContext",
9179
+ "type": {
9180
+ "text": "ContextType | undefined"
9181
+ }
9182
+ },
9183
+ {
9184
+ "kind": "method",
9185
+ "name": "_handleClick",
9186
+ "privacy": "private"
9187
+ }
9188
+ ],
9189
+ "attributes": [
9190
+ {
9191
+ "name": "paymentMethod",
9192
+ "type": {
9193
+ "text": "BackendDrivenPaymentMethod | undefined"
9194
+ },
9195
+ "fieldName": "paymentMethod"
9196
+ },
9197
+ {
9198
+ "name": "disabled",
9199
+ "type": {
9200
+ "text": "boolean"
9201
+ },
9202
+ "default": "false",
9203
+ "fieldName": "disabled"
9204
+ }
9205
+ ],
9206
+ "superclass": {
9207
+ "name": "LitElement",
9208
+ "package": "lit"
9209
+ },
9210
+ "tagName": "primer-backend-driven",
9211
+ "customElement": true
9212
+ }
9213
+ ],
9214
+ "exports": [
9215
+ {
9216
+ "kind": "js",
9217
+ "name": "BackendDrivenComponent",
9218
+ "declaration": {
9219
+ "name": "BackendDrivenComponent",
9220
+ "module": "src/containers/backend-driven/backend-driven.component.ts"
9221
+ }
9222
+ },
9223
+ {
9224
+ "kind": "custom-element-definition",
9225
+ "name": "primer-backend-driven",
9226
+ "declaration": {
9227
+ "name": "BackendDrivenComponent",
9228
+ "module": "src/containers/backend-driven/backend-driven.component.ts"
9229
+ }
9230
+ }
9231
+ ]
9232
+ },
9233
+ {
9234
+ "kind": "javascript-module",
9235
+ "path": "src/containers/backend-driven/backend-driven.ts",
9236
+ "declarations": [],
9237
+ "exports": [
9238
+ {
9239
+ "kind": "js",
9240
+ "name": "BackendDriven",
9241
+ "declaration": {
9242
+ "name": "BackendDrivenComponent",
9243
+ "module": "src/containers/backend-driven/backend-driven.ts"
9244
+ }
9245
+ }
9246
+ ]
9247
+ },
9139
9248
  {
9140
9249
  "kind": "javascript-module",
9141
9250
  "path": "src/containers/billing-address/billing-address.component.ts",
@@ -9951,7 +10060,7 @@
9951
10060
  "name": "setupCardFormTask",
9952
10061
  "privacy": "private",
9953
10062
  "readonly": true,
9954
- "default": "new Task(this, { task: ([methods]) => { const manager = methods?.find( (pm) => pm.type === PaymentMethodType.PAYMENT_CARD, )?.manager; if (!manager) { return initialState; } const hostedInputs = manager.createHostedInputs(); const { cardNumberInput, expiryInput, cvvInput } = hostedInputs; this.cardFormProvider.setValue({ // Temporarily set any so we can toggle between sdk v2 and new sdk core cardholderNameInput: ( hostedInputs as { cardholderNameInput?: IHeadlessHostedInput } ).cardholderNameInput, cardNumberInput, expiryInput, cvvInput, setCardholderName: (val: string) => { manager.setCardholderName(val); if (this.shouldRequireCardholderName) { void manager.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: () => manager.validate(), submit: (args) => manager.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.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.primerContext?.paymentMethods], })",
9955
10064
  "description": "Task to set up the card form with hosted inputs"
9956
10065
  },
9957
10066
  {
@@ -10379,7 +10488,7 @@
10379
10488
  "kind": "field",
10380
10489
  "name": "_setupTask",
10381
10490
  "privacy": "private",
10382
- "default": "new Task(this, { task: async ([methods, headlessUtils]) => { const manager = methods?.find( (pm) => pm.type === PaymentMethodType.KLARNA, ); if (!manager || !headlessUtils) { return initialState; } return { manager: manager.manager, }; }, args: () => [ this.primerContext?.paymentMethods, this.primerContext?.headlessUtils, ], })"
10491
+ "default": "new Task(this, { task: async ([methods, headlessUtils]) => { const method = methods?.find( (pm) => pm.type === PaymentMethodType.KLARNA, ); if (method?.type !== PaymentMethodType.KLARNA || !headlessUtils) { return initialState; } return { method }; }, args: () => [ this.primerContext?.paymentMethods, this.primerContext?.headlessUtils, ], })"
10383
10492
  },
10384
10493
  {
10385
10494
  "kind": "field",
@@ -10545,7 +10654,7 @@
10545
10654
  "kind": "field",
10546
10655
  "name": "renderButtonTask",
10547
10656
  "privacy": "private",
10548
- "default": "new Task(this, { args: () => [this.paymentMethod], task: async ([paymentMethod]) => { if (!paymentMethod) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const button = paymentMethod.manager.createButton(); const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new SdkError({ origin: 'integration', message: 'Button container not found', code: InitializationErrorCodes.CONTAINER_NOT_FOUND, }); } const style = paymentMethod.type === 'GOOGLE_PAY' ? { shadowRoot: this.shadowRoot } : paymentMethod.type === 'APPLE_PAY' ? { buttonHeight: calculateButtonHeight(buttonContainer) } : { buttonHeight: getPayPalConstrainedHeight( calculateButtonHeight(this), ), }; await button.render(buttonContainer, { style }); // Apply current disabled state to newly created button if (this.disabled) { await button.setDisabled(this.disabled); } return button; }, })"
10657
+ "default": "new Task(this, { args: () => [this.paymentMethod], task: async ([paymentMethod]) => { if (!paymentMethod) { return initialState; } // Ensure the component's DOM is updated await this.updateComplete; const buttonContainer = this.buttonContainerRef.value; if (!buttonContainer) { throw new SdkError({ origin: 'integration', message: 'Button container not found', code: InitializationErrorCodes.CONTAINER_NOT_FOUND, }); } const style = paymentMethod.type === 'GOOGLE_PAY' ? { shadowRoot: this.shadowRoot } : paymentMethod.type === 'APPLE_PAY' ? { buttonHeight: calculateButtonHeight(buttonContainer) } : { buttonHeight: getPayPalConstrainedHeight( calculateButtonHeight(this), ), }; await paymentMethod.render(buttonContainer, { style }); // Apply current disabled state to newly rendered button if (this.disabled) { await paymentMethod.setDisabled(this.disabled); } return paymentMethod; }, })"
10549
10658
  }
10550
10659
  ],
10551
10660
  "attributes": [
@@ -13407,7 +13516,7 @@
13407
13516
  "kind": "field",
13408
13517
  "name": "_hostedInput",
13409
13518
  "type": {
13410
- "text": "IHeadlessHostedInput | null"
13519
+ "text": "HostedInput | null"
13411
13520
  },
13412
13521
  "privacy": "private",
13413
13522
  "default": "null"
@@ -13566,7 +13675,7 @@
13566
13675
  {
13567
13676
  "name": "hostedInput",
13568
13677
  "type": {
13569
- "text": "IHeadlessHostedInput"
13678
+ "text": "HostedInput"
13570
13679
  }
13571
13680
  },
13572
13681
  {
@@ -14161,7 +14270,7 @@
14161
14270
  {
14162
14271
  "name": "paymentMethod",
14163
14272
  "type": {
14164
- "text": "ACHVaultedPaymentMethodSummary"
14273
+ "text": "VaultedPaymentMethod"
14165
14274
  }
14166
14275
  }
14167
14276
  ],