@primer-io/primer-js 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/custom-elements.json +323 -312
- package/dist/primer-loader.d.ts +4 -2
- package/dist/primer-loader.js +10 -10
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -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",
|
|
@@ -104,33 +75,33 @@
|
|
|
104
75
|
{
|
|
105
76
|
"kind": "variable",
|
|
106
77
|
"name": "Me",
|
|
107
|
-
"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=ir(
|
|
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=ir(Ba());this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0,this.requestUpdate()};this.sdkContextController=new Sa(this),this.primerEventsController=new tr(this),this.styleProcessingController=new ba(this),this.vaultManagerController=new Lr(this),this.headlessSdkController=new Wa(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,a,i){e===\"custom-styles\"?this.styleProcessingController.processCustomStyles(i):super.attributeChangedCallback(e,a,i)}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&&(xn(this.options?.locale)?this.locale=ir(this.options?.locale):x.warn(\"\\u{1F30E}\\u2757 Unsupported locale provided:\",this.options?.locale,\"- Falling back to system locale\")),Ln(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,a,i){super.addEventListener(e,a,i)}removeEventListener(e,a,i){super.removeEventListener(e,a,i)}}"
|
|
108
79
|
},
|
|
109
80
|
{
|
|
110
81
|
"kind": "function",
|
|
111
|
-
"name": "
|
|
82
|
+
"name": "Td"
|
|
112
83
|
},
|
|
113
84
|
{
|
|
114
85
|
"kind": "function",
|
|
115
|
-
"name": "
|
|
86
|
+
"name": "Pd"
|
|
116
87
|
},
|
|
117
88
|
{
|
|
118
89
|
"kind": "function",
|
|
119
|
-
"name": "
|
|
90
|
+
"name": "my"
|
|
120
91
|
},
|
|
121
92
|
{
|
|
122
93
|
"kind": "function",
|
|
123
|
-
"name": "
|
|
94
|
+
"name": "hy"
|
|
124
95
|
},
|
|
125
96
|
{
|
|
126
97
|
"kind": "variable",
|
|
127
98
|
"name": "Ke",
|
|
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
|
|
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 eo)return eo[this.size];let e=parseInt(this.size,10);return isNaN(e)?eo.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>`}}"
|
|
129
100
|
},
|
|
130
101
|
{
|
|
131
102
|
"kind": "variable",
|
|
132
103
|
"name": "Fe",
|
|
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=\"${
|
|
104
|
+
"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=\"${Z(e)}\" @click=\"${this.handleWrapperClick}\"><slot name=\"input\"></slot></div><slot name=\"error\"></slot></div>`}}"
|
|
134
105
|
},
|
|
135
106
|
{
|
|
136
107
|
"kind": "variable",
|
|
@@ -139,7 +110,7 @@
|
|
|
139
110
|
},
|
|
140
111
|
{
|
|
141
112
|
"kind": "variable",
|
|
142
|
-
"name": "
|
|
113
|
+
"name": "oe",
|
|
143
114
|
"default": "class extends b{constructor(){super(...arguments);this.variant=\"primary\";this.disabled=!1;this.loading=!1;this.buttonType=\"button\";this.selectionState=\"default\";this.selectable=!1;this.flex=!0;this.handleClick=()=>{!this.selectable||this.disabled||this.loading||(this.selectionState=this.selectionState===\"default\"?\"checked\":\"default\",this.dispatchEvent(new CustomEvent(\"selection-change\",{bubbles:!0,composed:!0,detail:{state:this.selectionState}})))}}renderCheckmark(){return!this.selectable||this.selectionState!==\"checked\"||this.loading?y:u`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`}renderSpinner(){if(!this.loading)return y;let e;return this.variant===\"primary\"?e=\"var(--primer-color-background-outlined-default)\":(this.variant===\"secondary\"||this.variant===\"tertiary\")&&(e=\"var(--primer-color-gray-900)\"),u`<primer-spinner size=\"small\" color=\"${e}\" compact ></primer-spinner>`}render(){return u`<button type=${this.buttonType} ?disabled=${this.disabled||this.loading} @click=${this.handleClick} part=\"button\" aria-checked=${this.selectionState===\"checked\"} aria-busy=${this.loading} aria-label=${this.ariaLabel?this.ariaLabel:y} >${this.renderSpinner()} ${this.flex?u`<span class=\"button-content ${this.loading?\"loading\":\"\"}\"><slot></slot></span>`:u`<span class=\"button-content-base ${this.loading?\"loading\":\"\"}\" ><slot></slot></span>`} ${this.renderCheckmark()}</button>`}}"
|
|
144
115
|
},
|
|
145
116
|
{
|
|
@@ -150,7 +121,7 @@
|
|
|
150
121
|
{
|
|
151
122
|
"kind": "variable",
|
|
152
123
|
"name": "Ue",
|
|
153
|
-
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?
|
|
124
|
+
"default": "class extends b{constructor(){super(...arguments);this.color=\"var(--primer-color-icon-primary)\";this.size=\"lg\"}render(){let e=this.name?Ja[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",
|
|
@@ -165,7 +136,7 @@
|
|
|
165
136
|
{
|
|
166
137
|
"kind": "variable",
|
|
167
138
|
"name": "te",
|
|
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\">${
|
|
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 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\">${fy}</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",
|
|
@@ -174,28 +145,28 @@
|
|
|
174
145
|
},
|
|
175
146
|
{
|
|
176
147
|
"kind": "variable",
|
|
177
|
-
"name": "
|
|
148
|
+
"name": "se",
|
|
178
149
|
"default": "class extends b{constructor(){super(...arguments);this.header=\"\";this.expanded=!1;this.expandText=\"Expand\";this.collapseText=\"Collapse\";this.ariaLabel=\"\";this.buttonVariant=\"primary\";this.isExpanded=!1;this.toggleExpanded=()=>{this.isExpanded=!this.isExpanded,this.dispatchExpandedChangedEvent(this.isExpanded)}}connectedCallback(){super.connectedCallback(),this.isExpanded=this.expanded}dispatchExpandedChangedEvent(e){this.dispatchEvent(new CustomEvent(\"expanded-changed\",{bubbles:!0,composed:!0,detail:{expanded:e}}))}expand(){this.isExpanded||(this.isExpanded=!0,this.dispatchExpandedChangedEvent(!0))}collapse(){this.isExpanded&&(this.isExpanded=!1,this.dispatchExpandedChangedEvent(!1))}render(){let e=this.isExpanded?this.collapseText:this.expandText,a=this.ariaLabel||this.header||e,i=this.header||e;return u`<div class=\"collapsable\"><primer-button variant=${this.buttonVariant} buttonType=\"button\" @click=${this.toggleExpanded} aria-expanded=${this.isExpanded} aria-controls=\"collapsable-content\" aria-label=${a} ><span>${i}</span></primer-button><div class=\"collapsable-wrapper ${this.isExpanded?\"expanded\":\"\"}\" id=\"collapsable-content\" role=\"region\" aria-labelledby=\"collapsable-header\" ><div class=\"collapsable-content\"><slot></slot></div></div></div>`}}"
|
|
179
150
|
},
|
|
180
151
|
{
|
|
181
152
|
"kind": "variable",
|
|
182
153
|
"name": "Ve",
|
|
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 y;let e={\"error-message\":!0,hidden:!this.visible};return u`<div part=\"error-message\" class=${
|
|
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=${Z(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
158
|
"name": "Re",
|
|
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=${
|
|
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=${Z({backdrop:!0,\"backdrop--entering\":this._animationState===\"entering\",\"backdrop--entered\":this._animationState===\"entered\",\"backdrop--exiting\":this._animationState===\"exiting\"})} @click=${e=>{e.preventDefault()}} ><div class=${Z({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
163
|
"name": "fe",
|
|
193
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new H(this,{task:async([e,a])=>{let i=e?.find(n=>n.type===
|
|
164
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.selectedCategory=null;this.isExpanded=!1;this.categoryLoading=!1;this._setupTask=new H(this,{task:async([e,a])=>{let i=e?.find(n=>n.type===I.KLARNA);return i?.type!==I.KLARNA||!a?V:{method:i}},args:()=>[this.primerContext?.paymentMethods,this.primerContext?.headlessUtils]});this.handleExpandedChange=e=>{this.isExpanded=e.detail.expanded,this.isExpanded||(this.selectedCategory=null,this.categoryLoading=!1,this.klarnaContainer&&(this.klarnaContainer.innerHTML=\"\"))};this.klarnaPaymentInProgress=!1}async startKlarnaPayment(){if(!(!this._setupTask.value||!this.selectedCategory||this.klarnaPaymentInProgress)){this.klarnaPaymentInProgress=!0;try{this._setupTask.value.method.setSelectedCategory(this.selectedCategory),await this._setupTask.value.method.start()}catch{}finally{this.klarnaPaymentInProgress=!1}}}async renderSelectedCategory(){if(!(!this._setupTask.value||!this.selectedCategory||!this.klarnaContainer))try{this.klarnaContainer.innerHTML=\"\",this.categoryLoading=!0,await this._setupTask.value.method.renderCategory({containerId:this.klarnaContainer,paymentMethodCategoryId:this.selectedCategory,onHeightChange:()=>{}})}catch{}finally{this.categoryLoading=!1}}selectCategory(e){this.disabled||(this.selectedCategory=e)}updated(e){e.has(\"selectedCategory\")&&this.selectedCategory&&this.renderSelectedCategory()}renderCategorySelection(){let e=this._setupTask?.value?.method.getCategories()||[];return e.length>0&&!this.selectedCategory&&this.selectCategory(e[0].identifier),e.length===1?y:u`<div class=\"category-selection\">${e.map(a=>u`<button class=${Z({\"category-button\":!0,selected:a.identifier===this.selectedCategory,loading:this.categoryLoading&&a.identifier===this.selectedCategory})} @click=${()=>{this.selectCategory(a.identifier)}} ?disabled=${this.disabled} ><span class=${Z({\"category-label\":!0,hidden:this.categoryLoading&&a.identifier===this.selectedCategory})} >${a.name}</span >${this.categoryLoading&&a.identifier===this.selectedCategory?u`<primer-spinner class=\"category-spinner\" size=\"small\" compact ></primer-spinner>`:y}</button>`)}</div>`}renderExpandedContent(){return u` ${this.renderCategorySelection()}<div class=\"klarna-category-container ${!this.categoryLoading&&this.selectedCategory?\"visible\":\"\"}\" ><div id=\"klarna-category-container\" class=\"klarna-category-content\" ></div></div><primer-payment-method-accordion-confirm-button ?disabled=${!this.selectedCategory||this.disabled} ?loading=${gt(this.primerContext?.sdkState)} @confirm=${()=>this.startKlarnaPayment()} ></primer-payment-method-accordion-confirm-button>`}render(){return this._setupTask.render({error:e=>{let a=e instanceof Error?e.message:\"Unknown error in Klarna\";return u`<div class=\"error\"> Error loading Klarna: ${a}</div>`},complete:({method:e})=>e?u`<primer-payment-method-accordion .type=${I.KLARNA} ?disabled=${this.disabled} .expanded=${this.isExpanded} ?suppress-blur-collapse=${this.klarnaPaymentInProgress} @expanded-change=${this.handleExpandedChange} >${this.renderExpandedContent()}</primer-payment-method-accordion>`:y})}}"
|
|
194
165
|
},
|
|
195
166
|
{
|
|
196
167
|
"kind": "variable",
|
|
197
168
|
"name": "xe",
|
|
198
|
-
"default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=
|
|
169
|
+
"default": "class extends b{constructor(){super();this.type=void 0;this.disabled=!1;this.buttonContainerRef=Zr();this.renderButtonTask=new H(this,{args:()=>[this.paymentMethod],task:async([e])=>{if(!e)return V;await this.updateComplete;let a=this.buttonContainerRef.value;if(!a)throw new j({origin:\"integration\",message:\"Button container not found\",code:Ca.CONTAINER_NOT_FOUND});let i=e.type===\"GOOGLE_PAY\"?{shadowRoot:this.shadowRoot}:e.type===\"APPLE_PAY\"?{buttonHeight:zd(a)}:{buttonHeight:Ey(zd(this))};return await e.render(a,{style:i}),this.disabled&&await e.setDisabled(this.disabled),e}})}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>`}}"
|
|
199
170
|
},
|
|
200
171
|
{
|
|
201
172
|
"kind": "variable",
|
|
@@ -205,7 +176,7 @@
|
|
|
205
176
|
{
|
|
206
177
|
"kind": "variable",
|
|
207
178
|
"name": "Pe",
|
|
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){this.errorMessage=A(\"Something went wrong. Please try again.\",{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
|
|
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=A(\"Something went wrong. Please try again.\",{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>=Wd&&this.phoneNumber.length<=Jd&&/^\\+\\d+$/.test(this.phoneNumber)}async submit(){if(this.currentState===\"loading\")return;if(!this.isPhoneValid){this.errorMessage=A(\"Phone number is too short\",{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(a){this.currentState=\"error\",this.errorMessage=a instanceof Error?a.message:A(\"Your payment could not be processed. Please try another payment method.\",{id:\"tokenizationError\"})}}renderExpandedInput(){return u`<div class=\"mbway-input-wrapper\"><label class=\"mbway-label\" for=\"primer-mbway-phone\">${A(\"Phone number\",{id:\"telephoneNumberLabel\"})}</label><primer-pt-phone-number-input input-id=\"primer-mbway-phone\" .value=${this.phoneNumber} .placeholder=${A(\"123xxxxxx\",{id:\"telephoneNumberPlaceholder\"})} .maxLength=${Jd} .minLength=${Wd} ?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} >${A(\"Pay\",{id:\"pay\"})}</button></div>`}renderLoading(){let e=A(\"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||A(\"Something went wrong. Please try again.\",{id:\"something_went_wrong_error\"})}</div><button class=\"mbway-retry-button\" @click=${this.handleRetry} ?disabled=${this.disabled} >${A(\"Retry\",{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",
|
|
@@ -215,7 +186,7 @@
|
|
|
215
186
|
{
|
|
216
187
|
"kind": "variable",
|
|
217
188
|
"name": "He",
|
|
218
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,a])=>{if(!e||!a)return V;let i=a.getPaymentMethodConfiguration(e);if(!i)return V;let n=
|
|
189
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this._setupTask=new H(this,{task:([e,a])=>{if(!e||!a)return V;let i=a.getPaymentMethodConfiguration(e);if(!i)return V;let n=Xd(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?ao(e):\"\";return a===\"payWith\"&&(a=\"pay_with\"),A(e,{id:a})}_getBackgroundColor(e,a,i){switch(e){case I.KLARNA:case I.ADYEN_KLARNA:return a.backgroundColor.light??a.backgroundColor.colored;default:return i??a.backgroundColor.colored??a.backgroundColor.light}}_getIconUrl(e,a,i,n){if(n)return n;switch(e){case I.KLARNA:case I.ADYEN_KLARNA:return Iy;case I.PAY_NL_PAYCONIQ:return i===a.backgroundColor.light?Ty:Py;case I.ADYEN_CASHAPP:return a.iconUrl.dark??a.iconUrl.colored??a.iconUrl.light;default:return e===\"TRIPLE_A\"?ky:a.iconUrl.colored??a.iconUrl.light}}_getIconPosition(e,a){switch(e){case I.KLARNA:case I.ADYEN_KLARNA:return\"END\";default:return a.iconPositionRelativeToText||\"START\"}}_getTextColor(e){let a=e.replace(\"#\",\"\");if(a.length<6)return;let i=parseInt(a.substring(0,2),16),n=parseInt(a.substring(2,4),16),o=parseInt(a.substring(4,6),16);return isNaN(i)||isNaN(n)||isNaN(o)?void 0:(.2126*i+.7152*n+.0722*o)/255>.6?\"#000000\":\"#FFFFFF\"}_getDisplayName(e,a,i){switch(e){case I.KLARNA:return this.primerContext?.clientOptions?.klarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");case I.ADYEN_KLARNA:return this.primerContext?.clientOptions?.adyenKlarna?.buttonOptions?.text??i??this._legacyGetButtonLabel(a)??this._legacyGetButtonLabel(\"Pay with\");default:return i??this._legacyGetButtonLabel(a)}}_handleClick(){this.disabled||this.dispatchEvent(new Event(\"payment-method-click\",{bubbles:!0,composed:!0}))}render(){return this._setupTask.render({error:()=>y,complete:e=>{this.style.setProperty(\"--payment-method-button-bg-color\",e.backgroundColor),e.textColor&&this.style.setProperty(\"--payment-method-button-text-color\",e.textColor);let a={loading:gt(this.primerContext?.sdkState),\"icon-end\":e.iconPosition===\"END\",\"image-only\":!e.displayName};return u`<primer-button @click=\"${()=>this._handleClick()}\" class=${Z(a)} title=\"${A(\"Pay with\",{id:\"pay_with\"})} ${e.name}\" ?disabled=${this.disabled} ><img src=\"${e.iconUrl}\" alt=\"${e.alt}\" />${L(e.displayName,()=>u`<span class=\"button-text\">${e.displayName}</span>`)}</primer-button>`}})}}"
|
|
219
190
|
},
|
|
220
191
|
{
|
|
221
192
|
"kind": "variable",
|
|
@@ -229,37 +200,37 @@
|
|
|
229
200
|
},
|
|
230
201
|
{
|
|
231
202
|
"kind": "variable",
|
|
232
|
-
"name": "
|
|
203
|
+
"name": "Oe",
|
|
233
204
|
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1}getFilteredMethods(){if(!this.primerContext?.paymentMethods)return[];let e=[...this.primerContext.paymentMethods];if(this.include){let a=this.include.split(\",\").map(i=>i.trim());e=e.filter(i=>a.includes(i.type))}if(this.exclude){let a=this.exclude.split(\",\").map(i=>i.trim());e=e.filter(i=>!a.includes(i.type))}return e}render(){let e=this.getFilteredMethods();return e.length===0?y:u`<div class=\"payment-methods-container\">${e.map(a=>u`<primer-payment-method type=\"${a.type}\" ?disabled=\"${this.disabled||this.primerContext?.clientOptions?.disabledPayments===!0}\" ></primer-payment-method>`)}</div>`}}"
|
|
234
205
|
},
|
|
235
206
|
{
|
|
236
207
|
"kind": "variable",
|
|
237
|
-
"name": "
|
|
208
|
+
"name": "ze",
|
|
238
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": "
|
|
243
|
-
"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(
|
|
213
|
+
"name": "re",
|
|
214
|
+
"default": "class extends b{constructor(){super(...arguments);this.formData={};this.errors={};this.touchedFields=new Set;this.dirtyFields=new Set;this.focusedField=null;this.submitted=!1;this.countryOptions=[];this._initializationTask=new H(this,{task:async([e,a])=>{if(!e||!a)return V;let i=this.extractFieldConfig(e);return await this.initializeCountryOptions(),i},args:()=>[this.primerContext?.configuration??null,this.primerContext?.headlessUtils]})}connectedCallback(){super.connectedCallback(),this._initializationTask.value}extractFieldConfig(e){if(e?.checkoutModules){let a=e.checkoutModules.find(i=>i.type===\"BILLING_ADDRESS\");if(a?.options){let i=a.options;return Object.keys(so).reduce((n,o)=>({...n,[o]:i[o]??!1}),{})}}return this.defaultFieldConfig}async initializeCountryOptions(){try{let e=oo(\"en\");this.countryOptions=[...e.map(([n,o])=>({value:n,label:o}))],this.requestUpdate(\"countryOptions\");let a=Rn();if(a===\"en\"||a===\"en-GB\"||a.startsWith(\"en-\"))return;if(await Gc(a)){let n=oo(a);this.countryOptions=[...n.map(([o,s])=>({value:o,label:s}))],this.requestUpdate(\"countryOptions\")}}catch(e){ar(this.primerContext?.telemetry,\"Failed to load country locale\",{error:e})}}get fieldConfig(){return this.extractFieldConfig(this.primerContext?.configuration)}get defaultFieldConfig(){return Object.keys(so).reduce((e,a)=>({...e,[a]:!1}),{})}get shouldShowForm(){return this.fieldConfig.postalCode}handleInput(e,a){this.formData={...this.formData,[e]:a},this.dirtyFields.add(e),(this.submitted||this.dirtyFields.has(e)&&this.touchedFields.has(e))&&this.validateField(e),this.dispatchEvent(new CustomEvent(\"primer-billing-address-change\",{detail:this.formData,bubbles:!0,composed:!0}))}handleFocus(e){this.focusedField=e}handleBlur(e){this.focusedField=null,this.touchedFields.add(e),this.validateField(e)}validateField(e){let a=this.formData[e],i=this.fieldConfig[e];if(!i){delete this.errors[e];return}if(i&&(!a||a.trim()===\"\")){let n=`${e}ErrorRequired`;this.errors={...this.errors,[e]:A(\"This field is required\",{id:n})}}else{let n={...this.errors};delete n[e],this.errors=n}}validateForm(){return Object.keys(so).forEach(e=>{let a=e;this.fieldConfig[a]&&this.validateField(a)}),Object.keys(this.errors).length===0}async validateForSubmission(){if(!this.shouldShowForm)return!0;this.submitted=!0,Object.keys(this.fieldConfig).forEach(a=>{this.fieldConfig[a]&&this.touchedFields.add(a)});let e=this.validateForm();return this.requestUpdate(),await this.updateComplete,e}async submitToSDK(){if(this.primerContext?.headlessUtils?.setBillingAddress)try{return await this.primerContext?.headlessUtils.setBillingAddress(this.formData),this.dispatchEvent(new CustomEvent(\"primer-billing-address-submit\",{detail:this.formData,bubbles:!0,composed:!0})),!0}catch{return!1}return!0}shouldShowError(e){let a=!!this.errors[e],i=this.dirtyFields.has(e),n=this.touchedFields.has(e);return a&&(this.submitted||i&&n)}render(){return this._initializationTask.render({pending:()=>y,error:()=>y,complete:()=>this.shouldShowForm?(this.removeAttribute(\"hidden\"),u`<div class=\"billing-address-form\"><div class=\"billing-address-title\">${A(\"Billing address\",{id:\"billingAddressLabel\"})}</div>${L(this.fieldConfig.countryCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"countryCode\"} .hasError=${this.shouldShowError(\"countryCode\")} ><primer-input-label slot=\"label\">${A(\"Country code\",{id:\"countryCodeLabel\"})}</primer-input-label><primer-select slot=\"input\" id=\"countryCode\" name=\"countryCode\" .value=${this.formData.countryCode||\"\"} .options=${this.countryOptions} .hasError=${this.shouldShowError(\"countryCode\")} placeholder=${A(\"Select a country\",{id:\"countrySelectPlaceholder\"})} @input=${e=>this.handleInput(\"countryCode\",e.detail)} @focus=${()=>this.handleFocus(\"countryCode\")} @blur=${()=>this.handleBlur(\"countryCode\")} ></primer-select>${L(this.shouldShowError(\"countryCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.countryCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.firstName||this.fieldConfig.lastName,()=>u`<div class=\"billing-address-row\">${L(this.fieldConfig.firstName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"firstName\"} .hasError=${this.shouldShowError(\"firstName\")} ><primer-input-label slot=\"label\">${A(\"First name\",{id:\"firstNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"firstName\" name=\"firstName\" type=\"text\" .value=${this.formData.firstName||\"\"} placeholder=${A(\"First name\",{id:\"firstNamePlaceholder\"})} @input=${e=>this.handleInput(\"firstName\",e.detail)} @focus=${()=>this.handleFocus(\"firstName\")} @blur=${()=>this.handleBlur(\"firstName\")} ></primer-input>${L(this.shouldShowError(\"firstName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.firstName}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.lastName,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"lastName\"} .hasError=${this.shouldShowError(\"lastName\")} ><primer-input-label slot=\"label\">${A(\"Last name\",{id:\"lastNameLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"lastName\" name=\"lastName\" type=\"text\" .value=${this.formData.lastName||\"\"} placeholder=${A(\"Last name\",{id:\"lastNamePlaceholder\"})} @input=${e=>this.handleInput(\"lastName\",e.detail)} @focus=${()=>this.handleFocus(\"lastName\")} @blur=${()=>this.handleBlur(\"lastName\")} ></primer-input>${L(this.shouldShowError(\"lastName\"),()=>u`<primer-input-error slot=\"error\">${this.errors.lastName}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${L(this.fieldConfig.addressLine1,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine1\"} .hasError=${this.shouldShowError(\"addressLine1\")} ><primer-input-label slot=\"label\">${A(\"Address line 1\",{id:\"addressLine1\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine1\" name=\"addressLine1\" type=\"text\" .value=${this.formData.addressLine1||\"\"} placeholder=${A(\"Address line 1\",{id:\"addressLine1Placeholder\"})} @input=${e=>this.handleInput(\"addressLine1\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine1\")} @blur=${()=>this.handleBlur(\"addressLine1\")} ></primer-input>${L(this.shouldShowError(\"addressLine1\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine1}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.addressLine2,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"addressLine2\"} .hasError=${this.shouldShowError(\"addressLine2\")} ><primer-input-label slot=\"label\">${A(\"Address line 2\",{id:\"addressLine2\"})}</primer-input-label><primer-input slot=\"input\" id=\"addressLine2\" name=\"addressLine2\" type=\"text\" .value=${this.formData.addressLine2||\"\"} placeholder=${A(\"Address line 2\",{id:\"addressLine2Placeholder\"})} @input=${e=>this.handleInput(\"addressLine2\",e.detail)} @focus=${()=>this.handleFocus(\"addressLine2\")} @blur=${()=>this.handleBlur(\"addressLine2\")} ></primer-input>${L(this.shouldShowError(\"addressLine2\"),()=>u`<primer-input-error slot=\"error\">${this.errors.addressLine2}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.postalCode||this.fieldConfig.city,()=>u`<div class=\"billing-address-row\">${L(this.fieldConfig.postalCode,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"postalCode\"} .hasError=${this.shouldShowError(\"postalCode\")} ><primer-input-label slot=\"label\">${A(\"Postal code\",{id:\"postalCodeLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"postalCode\" name=\"postalCode\" type=\"text\" .value=${this.formData.postalCode||\"\"} placeholder=${A(\"90210\",{id:\"postalCodePlaceholder\"})} @input=${e=>this.handleInput(\"postalCode\",e.detail)} @focus=${()=>this.handleFocus(\"postalCode\")} @blur=${()=>this.handleBlur(\"postalCode\")} ></primer-input>${L(this.shouldShowError(\"postalCode\"),()=>u`<primer-input-error slot=\"error\">${this.errors.postalCode}</primer-input-error>`)}</primer-input-wrapper>`)} ${L(this.fieldConfig.city,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"city\"} .hasError=${this.shouldShowError(\"city\")} ><primer-input-label slot=\"label\">${A(\"City\",{id:\"cityLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"city\" name=\"city\" type=\"text\" .value=${this.formData.city||\"\"} placeholder=${A(\"Cape Town\",{id:\"cityPlaceholder\"})} @input=${e=>this.handleInput(\"city\",e.detail)} @focus=${()=>this.handleFocus(\"city\")} @blur=${()=>this.handleBlur(\"city\")} ></primer-input>${L(this.shouldShowError(\"city\"),()=>u`<primer-input-error slot=\"error\">${this.errors.city}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`)} ${L(this.fieldConfig.state,()=>u`<primer-input-wrapper .focusWithin=${this.focusedField===\"state\"} .hasError=${this.shouldShowError(\"state\")} ><primer-input-label slot=\"label\">${A(\"State / Region / County\",{id:\"stateLabel\"})}</primer-input-label><primer-input slot=\"input\" id=\"state\" name=\"state\" type=\"text\" .value=${this.formData.state||\"\"} placeholder=${A(\"State / Region / County\",{id:\"statePlaceholder\"})} @input=${e=>this.handleInput(\"state\",e.detail)} @focus=${()=>this.handleFocus(\"state\")} @blur=${()=>this.handleBlur(\"state\")} ></primer-input>${L(this.shouldShowError(\"state\"),()=>u`<primer-input-error slot=\"error\">${this.errors.state}</primer-input-error>`)}</primer-input-wrapper>`)}</div>`):(this.setAttribute(\"hidden\",\"\"),y)})}}"
|
|
244
215
|
},
|
|
245
216
|
{
|
|
246
217
|
"kind": "variable",
|
|
247
|
-
"name": "
|
|
248
|
-
"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
|
|
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 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 ni(a,this.primerContext?.headlessUtils,this.primerContext?.vaultManager))}};this.handleCancelDelete=()=>{this.deletePaymentMethodId=null,this.deleteAssetConfig=null};this.handleConfirmDelete=async()=>{if(!this.primerContext?.vaultManager?.deleteVaultedPaymentMethod||!this.deletePaymentMethodId){this.errorMessage=A(\"Something went wrong. Please try again.\",{id:\"something_went_wrong_error\"});return}try{this.isDeleting=!0,await this.primerContext?.vaultManager.deleteVaultedPaymentMethod(this.deletePaymentMethodId),this.deletePaymentMethodId=null,this.deleteAssetConfig=null}catch(e){this.errorMessage=e instanceof Error?e.message:A(\"Something went wrong. Please try again.\",{id:\"something_went_wrong_error\"})}finally{this.isDeleting=!1}};this.handlePaymentError=e=>{let a=e.detail?.error;this.errorMessage=a instanceof Error?a.message:A(\"Your payment could not be processed. Please try again.\",{id:\"payment_processing_error\"})};this.handleCloseError=()=>{this.errorMessage=\"\"};this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitVaultPayment())};this.handleDirectSubmit=()=>{this.submitVaultPayment()};this.handleContextVaultSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitVaultPayment())}finally{this._isHandlingContextEvent=!1}}};new 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 vo(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\" ${Pt({...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} ${Pt({...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} ${Pt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-payment-method-item>`}renderPaymentMethodList(){let e=this.primerContext?.vaultManager?.vaultedPaymentMethods||[],a=!this.isEditMode&&e.length>0&&!this.deletePaymentMethodId;return u`<div class=\"payment-methods-list\">${e.map(i=>this.renderPaymentMethodItem(i))} ${L(a,()=>u`<div class=\"submit-button-container\"><slot name=\"submit-button\" @slotchange=${this.handleSubmitSlotChange} ${Pt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></slot>${L(!this.hasSlottedSubmit,()=>u`<primer-vault-payment-submit class=\"submit-button\" @primer-vault-payment-error=${this.handlePaymentError} ></primer-vault-payment-submit>`)}</div>`,()=>y)}</div>`}render(){if(!this.primerContext?.vaultManager?.enabled||this.primerContext?.vaultManager?.headless)return y;let e=this.primerContext?.vaultManager.vaultedPaymentMethods.length>0,a=this.primerContext?.vaultManager.isLoading,i=this.primerContext?.vaultManager.isUpdating;return u` ${L(!this.primerContext?.vaultManager?.showEmptyState&&!e,()=>y,()=>u`<slot name=\"vault-empty-state\"><div class=\"vault-manager ${i?\"is-updating\":\"\"}\"><primer-vault-manager-header .isEditMode=${this.isEditMode} .hasPaymentMethods=${e} @toggle-edit-mode=${this.handleToggleEditMode} ></primer-vault-manager-header>${L(this.errorMessage,()=>u`<primer-vault-error-message .errorMessage=${this.errorMessage} @close-error=${this.handleCloseError} ${Pt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-error-message>`,()=>y)}<div class=\"vault-manager-content\">${L(!a&&!e,()=>u`<div class=\"content-container\"><primer-vault-empty-state ${Pt({...this.getAnimationConfig(),properties:[\"opacity\"],in:[{opacity:0},{opacity:1}],out:[{opacity:1},{opacity:0}]})} ></primer-vault-empty-state></div>`,()=>y)} ${L(!a&&e,()=>u`<div class=\"content-container\">${L(this.deletePaymentMethodId,()=>this.renderDeleteConfirmation(),()=>this.renderPaymentMethodList())}</div>`,()=>y)}</div>${L(i,()=>this.renderLoadingOverlay(),()=>y)}</div></slot>`)} `}}"
|
|
249
220
|
},
|
|
250
221
|
{
|
|
251
222
|
"kind": "variable",
|
|
252
|
-
"name": "
|
|
253
|
-
"default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,a,i])=>await
|
|
223
|
+
"name": "ke",
|
|
224
|
+
"default": "class extends b{constructor(){super(...arguments);this.paymentMethod=void 0;this.isEditMode=!1;this._getAssetsTask=new H(this,{task:async([e,a,i])=>await ni(e,a,i),args:()=>[this.paymentMethod,this.primerContext?.headlessUtils,this.primerContext?.vaultManager]});this.handleClick=()=>{this.isEditMode||!this.primerContext?.vaultManager||!this.paymentMethod||(this.isSelected()?this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(null):this.primerContext?.vaultItem?.setSelectedVaultedPaymentMethod(this.paymentMethod))};this.handleDeleteClick=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(\"delete-payment-method\",{detail:this.paymentMethod?.id,bubbles:!0,composed:!0}))};this.handleCvvRowClick=e=>{e.stopPropagation()};this.handleRadioClick=e=>{e.stopPropagation(),this.handleClick()}}isSelected(){let e=this.primerContext?.vaultItem?.selectedVaultedPaymentMethod;return!!e&&e.id===this.paymentMethod?.id}render(){return this._getAssetsTask.render({error:()=>y,complete:e=>{let a=e?.description;return u`<div class=\"payment-method-container\"><div class=${Z({\"payment-method-button\":!0,disabled:this.isEditMode,selected:this.isSelected(),\"with-cvv\":e.shouldShowCVV})} @click=${this.handleClick} ><input type=\"radio\" class=\"radio-input\" name=\"vaulted-payment-method\" .checked=${this.isSelected()} ?disabled=${this.isEditMode} aria-label=${e?.description??y} @click=${this.handleRadioClick} /><div class=\"content-wrapper\"><primer-payment-method-content .assetConfig=${e} ></primer-payment-method-content>${L(this.isSelected(),()=>u`<primer-icon name=\"checkmark\" size=\"sm\" color=\"var(--primer-color-brand)\" ></primer-icon>`)}</div>${L(e.shouldShowCVV&&this.isSelected()&&!this.isEditMode,()=>u`<div class=\"payment-method-row mt-2\"><span class=\"flex-center\"><primer-icon name=\"lock\" size=\"sm\"></primer-icon><span class=\"payment-method-subtitle\">${A(\"Input the card CVV for a secure payment\",{id:\"vaultCvvRecapturePrompt\"})}</span ></span><span class=\"cell-2\" @click=${this.handleCvvRowClick}><primer-vault-cvv-input .paymentMethod=\"${this.paymentMethod}\" ><span slot=\"label\"></span></primer-vault-cvv-input></span></div>`,()=>y)}</div>${this.isEditMode?u`<primer-button variant=\"tertiary\" class=\"delete-button\" @click=${this.handleDeleteClick} aria-label=${`${A(\"Delete\",{id:\"delete\"})} ${a}`} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></primer-button>`:y}</div>`}})}}"
|
|
254
225
|
},
|
|
255
226
|
{
|
|
256
227
|
"kind": "variable",
|
|
257
|
-
"name": "
|
|
228
|
+
"name": "De",
|
|
258
229
|
"default": "class extends b{constructor(){super(...arguments);this.isEditMode=!1;this.hasPaymentMethods=!1;this.toggleEditMode=()=>{this.dispatchEvent(new CustomEvent(\"toggle-edit-mode\",{detail:!this.isEditMode,bubbles:!0,composed:!0}))}}render(){return u`<div class=\"vault-manager-header\"><h3>${A(\"Previously used:\",{id:\"previouslyUsed\"})}</h3>${this.hasPaymentMethods?u`<primer-button variant=\"tertiary\" class=\"edit-button ${this.isEditMode?\"active\":\"\"}\" @click=${this.toggleEditMode} aria-label=${this.isEditMode?A(\"Confirm\",{id:\"confirm\"}):A(\"Edit saved payment methods\",{id:\"editPaymentMethods\"})} >${this.isEditMode?u`<primer-icon name=\"checkmark\" size=\"sm\"></primer-icon>`:u`<primer-icon name=\"edit\" size=\"sm\"></primer-icon>`}</primer-button>`:y}</div>`}}"
|
|
259
230
|
},
|
|
260
231
|
{
|
|
261
232
|
"kind": "variable",
|
|
262
|
-
"name": "
|
|
233
|
+
"name": "Ie",
|
|
263
234
|
"default": "class extends b{constructor(){super(...arguments);this.isDeleting=!1;this.paymentMethodId=\"\";this.paymentMethodName=\"\";this.handleConfirmClick=()=>{this.dispatchEvent(new CustomEvent(\"confirm-delete\",{bubbles:!0,composed:!0}))};this.handleCancelClick=()=>{this.dispatchEvent(new CustomEvent(\"cancel-delete\",{bubbles:!0,composed:!0}))}}render(){return u`<div class=\"delete-confirmation\"><p class=\"delete-confirmation-text\"> Are you sure you want to delete this payment method? </p><div class=\"delete-actions\"><primer-button variant=\"secondary\" @click=${this.handleCancelClick} ?disabled=${this.isDeleting} >${A(\"Cancel\",{id:\"cancel\"})}</primer-button><primer-button @click=${this.handleConfirmClick} ?disabled=${this.isDeleting} >${this.isDeleting?A(\"Deleting\",{id:\"deleting\"}):A(\"Yes, delete it\",{id:\"confirmVaultedPaymentMethodDeletion\"})}</primer-button></div></div>`}}"
|
|
264
235
|
},
|
|
265
236
|
{
|
|
@@ -269,18 +240,18 @@
|
|
|
269
240
|
},
|
|
270
241
|
{
|
|
271
242
|
"kind": "variable",
|
|
272
|
-
"name": "
|
|
243
|
+
"name": "Ye",
|
|
273
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=${A(\"Close error message\",{id:\"closeErrorMessage\"})} ><primer-icon name=\"close\" size=\"sm\"></primer-icon></button></div>`}}"
|
|
274
245
|
},
|
|
275
246
|
{
|
|
276
247
|
"kind": "variable",
|
|
277
|
-
"name": "
|
|
248
|
+
"name": "Ce",
|
|
278
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(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:A(\"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}`:y;return u`<primer-button buttonType=\"submit\" variant=${this.variant} @click=${this.handleClick} .disabled=${this.isButtonDisabled} .loading=${gt(this.primerContext?.sdkState)} data-submit >${this.buttonText}${a}</primer-button>`}}"
|
|
279
250
|
},
|
|
280
251
|
{
|
|
281
252
|
"kind": "variable",
|
|
282
|
-
"name": "
|
|
283
|
-
"default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.
|
|
253
|
+
"name": "le",
|
|
254
|
+
"default": "class extends b{constructor(){super();this.paymentMethod=null;this.cvvError=null;this.cvvInput=null;this.isFocused=!1;this._setupCVVIframe=new H(this,{task:([e,a])=>!e||!a||e.paymentMethodType!==\"PAYMENT_CARD\"||!e.paymentInstrumentData?.network||a.createCvvInput===null?V:{network:e.paymentInstrumentData.network,createCvvInput:a.createCvvInput},args:()=>[this.paymentMethod,this.primerContext?.vaultManager]});this.cvvContainerId=`cvv-container-${Math.random().toString(36).substring(2,9)}`,new H(this,{task:async([e])=>{if(!e)return V;await this.updateComplete;let a=this.renderRoot.querySelector(`#${this.cvvContainerId}`);if(!a)return;let i=Qr(this.primerContext?.computedStyles??null),n=i?{input:{base:i}}:void 0,o={cardNetwork:e.network,container:a,name:\"cvv\",placeholder:\"123\",style:n,ariaLabel:A(\"CVV\",{id:\"cardCVV\"})};this.cvvInput=await e.createCvvInput?.(o)??null,this.cvvInput&&(this.cvvInput.focus(),this.cvvError=this.cvvInput.metadata.errorCode||null,this.primerContext?.vaultItem?.setCvvInput(this.cvvInput),this.cvvInput.addListener(\"change\",()=>{this.onCvvInputChange()}),this.cvvInput.addListener(\"blur\",()=>{this.onBlur()}),this.cvvInput.addListener(\"focus\",()=>{this.onFocus()}))},args:()=>[this._setupCVVIframe.value]})}disconnectedCallback(){super.disconnectedCallback(),this.cvvInput&&(this.cvvInput.remove(),this.cvvInput=null,this.cvvError=null,this.primerContext?.vaultItem?.setCvvInput(null))}onCvvInputChange(){!this.cvvInput||!this.primerContext?.vaultItem||(this.cvvError=this.cvvInput.metadata.errorCode||null)}onBlur(){this.isFocused=!1}onFocus(){this.isFocused=!0}get visibleErrorCode(){return this.cvvError&&this.primerContext?.vaultItem?.formIsDirty?this.cvvError:null}render(){return this._setupCVVIframe.render({error:()=>y,complete:()=>u`<div class=\"cvv-input-container\"><primer-input-wrapper .focusWithin=${this.isFocused} .hasError=${!!this.visibleErrorCode} ><slot name=\"label\" slot=\"label\"><primer-input-label>CVV</primer-input-label></slot><div slot=\"input\" class=\"cvv-input-slot\" id=\"${this.cvvContainerId}\" ></div><div slot=\"error\" class=\"cvv-error-slot\">${L(this.visibleErrorCode,()=>u`<primer-input-error>${A(this.visibleErrorCode,{id:this.visibleErrorCode})}</primer-input-error>`)}</div></primer-input-wrapper></div>`})}}"
|
|
284
255
|
},
|
|
285
256
|
{
|
|
286
257
|
"kind": "variable",
|
|
@@ -289,28 +260,28 @@
|
|
|
289
260
|
},
|
|
290
261
|
{
|
|
291
262
|
"kind": "variable",
|
|
292
|
-
"name": "
|
|
293
|
-
"default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new ht(this,{context:
|
|
263
|
+
"name": "Ee",
|
|
264
|
+
"default": "class extends b{constructor(){super(...arguments);this.hideLabels=!1;this.disabled=!1;this.hasAssignedContent=!1;this.selectedCardNetwork=null;this.formErrorMessage=null;this.paymentMethodSelectionSent=!1;this.cardFormProvider=new ht(this,{context:hr,initialValue:null});this.eventsController=new tr(this);this._contextCardSubmitListener=null;this._isHandlingContextEvent=!1;this.inputControllers=new Map;this.setupCardFormTask=new H(this,{task:([e])=>{let a=e?.find(l=>l.type===I.PAYMENT_CARD);if(!a)return V;let{cardNumber:i,cardExpiryDate:n,cardSecurityCode:o,cardholderName:s}=a.iframes;return this.cardFormProvider.setValue({cardholderNameInput:s,cardNumberInput:i,expiryInput:n,cvvInput:o,setCardholderName:l=>{a.setCardholderName(l),this.shouldRequireCardholderName&&a.validate().then(c=>{let h=c?.validationErrors?.find(M=>M.name===vp.cardholderName),g=this.inputControllers.get(\"cardholderName\");g&&g.updateMetaFromValidation({valid:!1,error:h?.message||h?.error||null,errorCode:h?.message||h?.error||null})})},setCardNetwork:l=>{this.selectedCardNetwork=l},validate:()=>a.validate(),submit:l=>a.submit(l),hideLabels:this.hideLabels,disabled:this.disabled,setSubmissionState:l=>{this.inputControllers.forEach(c=>{c.setSubmitted(l)})},propagateValidationErrors:l=>{l&&l.forEach(c=>{let p=c.field||c.name,h=c.message||c.error,g=vp[p];if(g){let M=this.inputControllers.get(g);if(M){let _={valid:!1,error:h,errorCode:h};M.updateMetaFromValidation(_)}}})},registerInputController:(l,c)=>{this.inputControllers.set(l,c)},unregisterInputController:l=>{this.inputControllers.delete(l)},onUserInteraction:()=>{this.clearStaleVaultSelection(),this.sendPaymentMethodSelectionEvent(),this.checkAndSendPaymentDetailsEnteredEvent()}}),!0},args:()=>[this.primerContext?.paymentMethods]});this.paymentDetailsEnteredSent=!1;this.handleSlotButtonClick=e=>{let i=e.target.closest(\"button, primer-button\");if(!i)return;let n=i;this.isSubmitButton(n)&&(e.preventDefault(),this.submitCardPayment())};this.handleDirectSubmit=e=>{e.stopPropagation(),this.submitCardPayment()};this.handleContextCardSubmit=e=>{if(!this._isHandlingContextEvent){this._isHandlingContextEvent=!0;try{e.target!==this&&(e.stopPropagation(),this.submitCardPayment())}finally{this._isHandlingContextEvent=!1}}};this.onSlotChange=e=>{let i=e.target.assignedNodes({flatten:!0});this.hasAssignedContent=i.length>0};this.handleFormSubmit=e=>{e.preventDefault(),e.stopPropagation(),this.submitCardPayment()}}updated(e){if(super.updated(e),(e.has(\"hideLabels\")||e.has(\"disabled\"))&&this.cardFormProvider.value&&this.cardFormProvider.setValue({...this.cardFormProvider.value,hideLabels:this.hideLabels,disabled:this.disabled}),e.has(\"context\")){let i=e.get(\"context\")?.events??null;i?.host&&this._contextCardSubmitListener&&i.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener),this.setupContextEventListeners()}}get shouldShowCardholderName(){let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.visible==\"boolean\"?e.visible:!0}get shouldRequireCardholderName(){if(!this.shouldShowCardholderName)return!1;let e=this.primerContext?.clientOptions?.card?.cardholderName;return typeof e?.required==\"boolean\"?e.required:!0}clearStaleVaultSelection(){this.primerContext?.vaultItem?.selectedVaultedPaymentMethod&&this.primerContext.vaultItem.setSelectedVaultedPaymentMethod(null)}sendPaymentMethodSelectionEvent(){this.paymentMethodSelectionSent||(this.paymentMethodSelectionSent=!0,this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_METHOD_SELECTION\",paymentMethod:\"PAYMENT_CARD\"}))}checkAndSendPaymentDetailsEnteredEvent(){if(this.paymentDetailsEnteredSent)return;let e=this.inputControllers.get(\"cardNumber\"),a=this.inputControllers.get(\"expire\"),i=this.inputControllers.get(\"cvv\"),n=e?.meta?.dirty===!0,o=a?.meta?.dirty===!0,s=i?.meta?.dirty===!0,l=!0;this.shouldRequireCardholderName&&(l=this.inputControllers.get(\"cardholderName\")?.meta?.dirty===!0),n&&o&&s&&l&&(this.sendPaymentDetailsEnteredEvent(),this.paymentDetailsEnteredSent=!0)}sendPaymentDetailsEnteredEvent(){this.primerContext?.telemetry?.analytics.sendEvent({eventName:\"PAYMENT_DETAILS_ENTERED\",paymentMethod:\"PAYMENT_CARD\"})}connectedCallback(){super.connectedCallback(),this.addEventListener(\"click\",this.handleSlotButtonClick),this.addEventListener(\"primer:card-submit\",this.handleDirectSubmit),this._contextCardSubmitListener=e=>{this.handleContextCardSubmit(e)},this.setupContextEventListeners()}disconnectedCallback(){this.removeEventListener(\"click\",this.handleSlotButtonClick),this.removeEventListener(\"primer:card-submit\",this.handleDirectSubmit),this.cleanupContextEventListeners(),super.disconnectedCallback()}setupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.addEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}cleanupContextEventListeners(){this.primerContext?.events?.host&&this._contextCardSubmitListener&&this.primerContext?.events.host.removeEventListener(\"primer:card-submit\",this._contextCardSubmitListener)}isSubmitButton(e){let a=e.tagName.toLowerCase(),i=a===\"button\",n=a===\"primer-button\";return i&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))||n&&(e.getAttribute(\"type\")===\"submit\"||e.hasAttribute(\"data-submit\"))}async submitCardPayment(){let e=this.cardFormProvider.value,a=this.primerContext?.sdkState.isProcessing;if(!e||this.disabled||a)return;this.primerContext?.setProcessing?.(!0),this.formErrorMessage=null,e.setSubmissionState?.(!0);let i=this.querySelector(\"primer-billing-address\")||this.renderRoot.querySelector(\"primer-billing-address\"),n=!0;i&&(n=await i.validateForSubmission());let o=await e.validate?.();if(o?.valid&&n){if(i&&!await i.submitToSDK()){let p=A(\"tokenizationError\",{id:\"tokenizationError\"});this.formErrorMessage=p,this.primerContext?.setProcessing?.(!1),this.eventsController.dispatchFormSubmitErrors([{field:\"billingAddress\",name:\"billingAddress\",error:\"BILLING_ADDRESS_SUBMISSION_FAILED\",message:p}]);return}let s={success:!0};this.eventsController.dispatchFormSubmitSuccess(s);let l=this.selectedCardNetwork?{cardNetwork:this.selectedCardNetwork}:void 0;await e.submit?.(l)}else{this.primerContext?.setProcessing?.(!1);let s=o?.validationErrors;e.propagateValidationErrors?.(s||[]),this.cardFormProvider.setValue({...e,errors:s}),this.eventsController.dispatchFormSubmitErrors(s)}}render(){return this.setupCardFormTask.status===vt.ERROR||this.setupCardFormTask.status===vt.INITIAL?y:u`<form @submit=${this.handleFormSubmit}><slot name=\"card-form-content\" @slotchange=${this.onSlotChange}></slot>${this.setupCardFormTask.render({complete:()=>L(this.hasAssignedContent,()=>y,()=>u`<div class=\"card-form\"><primer-input-card-number></primer-input-card-number><div class=\"card-form-row\"><primer-input-card-expiry></primer-input-card-expiry><primer-input-cvv></primer-input-cvv></div>${L(this.shouldShowCardholderName,()=>u`<primer-input-card-holder-name></primer-input-card-holder-name>`,()=>y)}<primer-billing-address></primer-billing-address></div><primer-card-form-submit></primer-card-form-submit><primer-error-message message=\"${this.formErrorMessage||\"\"}\" ?visible=\"${!!this.formErrorMessage}\" ></primer-error-message>`)})}</form>`}}"
|
|
294
265
|
},
|
|
295
266
|
{
|
|
296
267
|
"kind": "variable",
|
|
297
268
|
"name": "nt",
|
|
298
|
-
"default": "class extends
|
|
269
|
+
"default": "class extends ie{constructor(){super();this.config={inputType:\"cardNumber\",containerSelector:\"#cardNumber\",errorName:\"cardNumber-card\",translations:{label:{id:\"cardNumber\",defaultMessage:\"Card Number\"},placeholder:\"4111 1111 1111 1111\",ariaLabel:{id:\"cardNumber\",defaultMessage:\"Card Number\"}}};this.handleNetworkSelected=e=>{let{network:a}=e.detail;this.cardFormContext&&this.cardFormContext.setCardNetwork(a)};this.childUpdated()}renderInput(){if(this.hostedInputController.setupTask.status===vt.ERROR)return y;let e=this.getError();return u`<primer-input-wrapper .focusWithin=\"${this.hostedInputController.meta.active}\" .hasError=${!!e} >${L(!this.cardFormContext?.hideLabels,()=>u`<primer-input-label slot=\"label\" >${this.label}</primer-input-label >`,()=>y)}<div slot=\"input\" class=\"card-number-container\" aria-label=\"${this.ariaLabel}\" ><div id=\"${this.config.containerSelector.substring(1)}\"></div><div class=\"network-selector-container\"><primer-card-network-selector @network-selected=${this.handleNetworkSelected} ></primer-card-network-selector></div></div>${L(e,a=>u`<primer-input-error slot=\"error\">${A(a,{id:a})}</primer-input-error>`,()=>y)}</primer-input-wrapper>`}render(){return this.renderInput()}}"
|
|
299
270
|
},
|
|
300
271
|
{
|
|
301
272
|
"kind": "variable",
|
|
302
273
|
"name": "ot",
|
|
303
|
-
"default": "class extends
|
|
274
|
+
"default": "class extends ie{constructor(){super();this.config={inputType:\"cvv\",containerSelector:\"#cvv\",errorName:\"cvv-card\",translations:{label:\"CVV\",placeholder:\"123\"}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
304
275
|
},
|
|
305
276
|
{
|
|
306
277
|
"kind": "variable",
|
|
307
278
|
"name": "st",
|
|
308
|
-
"default": "class extends
|
|
279
|
+
"default": "class extends ie{constructor(){super();this.config={inputType:\"expire\",containerSelector:\"#expiry\",errorName:\"expiryDate-card\",translations:{label:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"},placeholder:{id:\"cardExpiryPlaceholder\",defaultMessage:\"MM/YY\"},ariaLabel:{id:\"cardExpiry\",defaultMessage:\"Expiry Date\"}}};this.childUpdated()}render(){return this.renderInput()}}"
|
|
309
280
|
},
|
|
310
281
|
{
|
|
311
282
|
"kind": "variable",
|
|
312
283
|
"name": "lt",
|
|
313
|
-
"default": "class extends
|
|
284
|
+
"default": "class extends ie{constructor(){super();this.config={inputType:\"cardholderName\",containerSelector:\"#cardFormName\",errorName:\"cardholderName\",translations:{label:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"},placeholder:{id:\"cardholderNamePlaceholder\",defaultMessage:\"Name on card\"},ariaLabel:{id:\"cardholderNameLabel\",defaultMessage:\"Cardholder Name\"}},onInput:e=>this.handleInput(e)};this.childUpdated()}handleInput(e){this.cardFormContext?.setCardholderName?.(e)}render(){return this.renderInput()}}"
|
|
314
285
|
},
|
|
315
286
|
{
|
|
316
287
|
"kind": "variable",
|
|
@@ -320,7 +291,7 @@
|
|
|
320
291
|
{
|
|
321
292
|
"kind": "variable",
|
|
322
293
|
"name": "ce",
|
|
323
|
-
"default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=
|
|
294
|
+
"default": "class extends b{constructor(){super(...arguments);this.selectedCardNetwork=null;this.isDropdownOpen=!1;this.focusedNetworkIndex=0;this.isKeyboardNavigation=!1;this.buttonRef=Zr();this.dropdownRef=Zr();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\">${Ja[\"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&&!Gp(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:y} aria-haspopup=${i?\"true\":y} aria-controls=${i?\"network-dropdown\":y} ><img class=\"network-icon\" src=${this.getNetworkIconUrl(a)} alt=${a.displayName} />${L(i,()=>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===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>${L(o.network===a.network,()=>u`<primer-icon class=\"checkmark\" name=\"checkmark\" size=\"sm\" ></primer-icon>`,()=>y)}</div>`)}</div>`,()=>y)} `}}"
|
|
324
295
|
},
|
|
325
296
|
{
|
|
326
297
|
"kind": "variable",
|
|
@@ -335,16 +306,16 @@
|
|
|
335
306
|
{
|
|
336
307
|
"kind": "variable",
|
|
337
308
|
"name": "dt",
|
|
338
|
-
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return u`<button class=${
|
|
309
|
+
"default": "class extends b{constructor(){super(...arguments);this.disabled=!1;this.loading=!1}render(){return u`<button class=${Z({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>`:A(\"Confirm\",{id:\"confirm\"})}</button>`}}"
|
|
339
310
|
},
|
|
340
311
|
{
|
|
341
312
|
"kind": "variable",
|
|
342
|
-
"name": "
|
|
313
|
+
"name": "fr",
|
|
343
314
|
"default": "class extends b{render(){return u`<primer-checkout-state type=\"complete\"></primer-checkout-state>`}}"
|
|
344
315
|
},
|
|
345
316
|
{
|
|
346
317
|
"kind": "variable",
|
|
347
|
-
"name": "
|
|
318
|
+
"name": "zt",
|
|
348
319
|
"default": "class extends b{render(){return u`<primer-checkout-state type=\"failure\" description=${this.primerContext?.sdkState?.primerJsError?.message||\"\"} ></primer-checkout-state>`}}"
|
|
349
320
|
},
|
|
350
321
|
{
|
|
@@ -355,11 +326,11 @@
|
|
|
355
326
|
{
|
|
356
327
|
"kind": "variable",
|
|
357
328
|
"name": "Nt",
|
|
358
|
-
"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?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=${
|
|
329
|
+
"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?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=${Z({\"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>`)} `}}"
|
|
359
330
|
},
|
|
360
331
|
{
|
|
361
332
|
"kind": "function",
|
|
362
|
-
"name": "
|
|
333
|
+
"name": "CO"
|
|
363
334
|
}
|
|
364
335
|
],
|
|
365
336
|
"exports": [
|
|
@@ -399,7 +370,7 @@
|
|
|
399
370
|
"kind": "js",
|
|
400
371
|
"name": "BillingAddress",
|
|
401
372
|
"declaration": {
|
|
402
|
-
"name": "
|
|
373
|
+
"name": "re",
|
|
403
374
|
"module": "dist/primer-loader.js"
|
|
404
375
|
}
|
|
405
376
|
},
|
|
@@ -415,7 +386,7 @@
|
|
|
415
386
|
"kind": "js",
|
|
416
387
|
"name": "Button",
|
|
417
388
|
"declaration": {
|
|
418
|
-
"name": "
|
|
389
|
+
"name": "oe",
|
|
419
390
|
"module": "dist/primer-loader.js"
|
|
420
391
|
}
|
|
421
392
|
},
|
|
@@ -423,7 +394,7 @@
|
|
|
423
394
|
"kind": "js",
|
|
424
395
|
"name": "CardForm",
|
|
425
396
|
"declaration": {
|
|
426
|
-
"name": "
|
|
397
|
+
"name": "Ee",
|
|
427
398
|
"module": "dist/primer-loader.js"
|
|
428
399
|
}
|
|
429
400
|
},
|
|
@@ -487,7 +458,7 @@
|
|
|
487
458
|
"kind": "js",
|
|
488
459
|
"name": "Collapsable",
|
|
489
460
|
"declaration": {
|
|
490
|
-
"name": "
|
|
461
|
+
"name": "se",
|
|
491
462
|
"module": "dist/primer-loader.js"
|
|
492
463
|
}
|
|
493
464
|
},
|
|
@@ -583,7 +554,7 @@
|
|
|
583
554
|
"kind": "js",
|
|
584
555
|
"name": "PaymentMethodContainer",
|
|
585
556
|
"declaration": {
|
|
586
|
-
"name": "
|
|
557
|
+
"name": "Oe",
|
|
587
558
|
"module": "dist/primer-loader.js"
|
|
588
559
|
}
|
|
589
560
|
},
|
|
@@ -607,7 +578,7 @@
|
|
|
607
578
|
"kind": "js",
|
|
608
579
|
"name": "PrimerCheckoutComplete",
|
|
609
580
|
"declaration": {
|
|
610
|
-
"name": "
|
|
581
|
+
"name": "fr",
|
|
611
582
|
"module": "dist/primer-loader.js"
|
|
612
583
|
}
|
|
613
584
|
},
|
|
@@ -623,7 +594,7 @@
|
|
|
623
594
|
"kind": "js",
|
|
624
595
|
"name": "PrimerCheckoutFailure",
|
|
625
596
|
"declaration": {
|
|
626
|
-
"name": "
|
|
597
|
+
"name": "zt",
|
|
627
598
|
"module": "dist/primer-loader.js"
|
|
628
599
|
}
|
|
629
600
|
},
|
|
@@ -679,7 +650,7 @@
|
|
|
679
650
|
"kind": "js",
|
|
680
651
|
"name": "RedirectPayment",
|
|
681
652
|
"declaration": {
|
|
682
|
-
"name": "
|
|
653
|
+
"name": "ze",
|
|
683
654
|
"module": "dist/primer-loader.js"
|
|
684
655
|
}
|
|
685
656
|
},
|
|
@@ -711,7 +682,7 @@
|
|
|
711
682
|
"kind": "js",
|
|
712
683
|
"name": "VaultCvvInput",
|
|
713
684
|
"declaration": {
|
|
714
|
-
"name": "
|
|
685
|
+
"name": "le",
|
|
715
686
|
"module": "dist/primer-loader.js"
|
|
716
687
|
}
|
|
717
688
|
},
|
|
@@ -719,7 +690,7 @@
|
|
|
719
690
|
"kind": "js",
|
|
720
691
|
"name": "VaultDeleteConfirmation",
|
|
721
692
|
"declaration": {
|
|
722
|
-
"name": "
|
|
693
|
+
"name": "Ie",
|
|
723
694
|
"module": "dist/primer-loader.js"
|
|
724
695
|
}
|
|
725
696
|
},
|
|
@@ -735,7 +706,7 @@
|
|
|
735
706
|
"kind": "js",
|
|
736
707
|
"name": "VaultErrorMessage",
|
|
737
708
|
"declaration": {
|
|
738
|
-
"name": "
|
|
709
|
+
"name": "Ye",
|
|
739
710
|
"module": "dist/primer-loader.js"
|
|
740
711
|
}
|
|
741
712
|
},
|
|
@@ -743,7 +714,7 @@
|
|
|
743
714
|
"kind": "js",
|
|
744
715
|
"name": "VaultManager",
|
|
745
716
|
"declaration": {
|
|
746
|
-
"name": "
|
|
717
|
+
"name": "ae",
|
|
747
718
|
"module": "dist/primer-loader.js"
|
|
748
719
|
}
|
|
749
720
|
},
|
|
@@ -751,7 +722,7 @@
|
|
|
751
722
|
"kind": "js",
|
|
752
723
|
"name": "VaultManagerHeader",
|
|
753
724
|
"declaration": {
|
|
754
|
-
"name": "
|
|
725
|
+
"name": "De",
|
|
755
726
|
"module": "dist/primer-loader.js"
|
|
756
727
|
}
|
|
757
728
|
},
|
|
@@ -759,7 +730,7 @@
|
|
|
759
730
|
"kind": "js",
|
|
760
731
|
"name": "VaultPaymentMethodItem",
|
|
761
732
|
"declaration": {
|
|
762
|
-
"name": "
|
|
733
|
+
"name": "ke",
|
|
763
734
|
"module": "dist/primer-loader.js"
|
|
764
735
|
}
|
|
765
736
|
},
|
|
@@ -767,7 +738,7 @@
|
|
|
767
738
|
"kind": "js",
|
|
768
739
|
"name": "VaultPaymentSubmit",
|
|
769
740
|
"declaration": {
|
|
770
|
-
"name": "
|
|
741
|
+
"name": "Ce",
|
|
771
742
|
"module": "dist/primer-loader.js"
|
|
772
743
|
}
|
|
773
744
|
},
|
|
@@ -775,7 +746,7 @@
|
|
|
775
746
|
"kind": "js",
|
|
776
747
|
"name": "injectDarkTheme",
|
|
777
748
|
"declaration": {
|
|
778
|
-
"name": "
|
|
749
|
+
"name": "hy",
|
|
779
750
|
"module": "dist/primer-loader.js"
|
|
780
751
|
}
|
|
781
752
|
},
|
|
@@ -783,7 +754,7 @@
|
|
|
783
754
|
"kind": "js",
|
|
784
755
|
"name": "injectLightTheme",
|
|
785
756
|
"declaration": {
|
|
786
|
-
"name": "
|
|
757
|
+
"name": "my",
|
|
787
758
|
"module": "dist/primer-loader.js"
|
|
788
759
|
}
|
|
789
760
|
},
|
|
@@ -791,7 +762,7 @@
|
|
|
791
762
|
"kind": "js",
|
|
792
763
|
"name": "injectLoaderStyles",
|
|
793
764
|
"declaration": {
|
|
794
|
-
"name": "
|
|
765
|
+
"name": "Td",
|
|
795
766
|
"module": "dist/primer-loader.js"
|
|
796
767
|
}
|
|
797
768
|
},
|
|
@@ -799,7 +770,7 @@
|
|
|
799
770
|
"kind": "js",
|
|
800
771
|
"name": "injectThemeStyles",
|
|
801
772
|
"declaration": {
|
|
802
|
-
"name": "
|
|
773
|
+
"name": "Pd",
|
|
803
774
|
"module": "dist/primer-loader.js"
|
|
804
775
|
}
|
|
805
776
|
},
|
|
@@ -807,12 +778,41 @@
|
|
|
807
778
|
"kind": "js",
|
|
808
779
|
"name": "loadPrimer",
|
|
809
780
|
"declaration": {
|
|
810
|
-
"name": "
|
|
781
|
+
"name": "CO",
|
|
811
782
|
"module": "dist/primer-loader.js"
|
|
812
783
|
}
|
|
813
784
|
}
|
|
814
785
|
]
|
|
815
786
|
},
|
|
787
|
+
{
|
|
788
|
+
"kind": "javascript-module",
|
|
789
|
+
"path": "e2e/utils.ts",
|
|
790
|
+
"declarations": [
|
|
791
|
+
{
|
|
792
|
+
"kind": "variable",
|
|
793
|
+
"name": "test",
|
|
794
|
+
"default": "chromaticTest"
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"exports": [
|
|
798
|
+
{
|
|
799
|
+
"kind": "js",
|
|
800
|
+
"name": "expect",
|
|
801
|
+
"declaration": {
|
|
802
|
+
"name": "expect",
|
|
803
|
+
"package": "@chromatic-com/playwright"
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"kind": "js",
|
|
808
|
+
"name": "test",
|
|
809
|
+
"declaration": {
|
|
810
|
+
"name": "test",
|
|
811
|
+
"module": "e2e/utils.ts"
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
]
|
|
815
|
+
},
|
|
816
816
|
{
|
|
817
817
|
"kind": "javascript-module",
|
|
818
818
|
"path": "src/consts.ts",
|
|
@@ -1648,213 +1648,22 @@
|
|
|
1648
1648
|
"exports": [
|
|
1649
1649
|
{
|
|
1650
1650
|
"kind": "js",
|
|
1651
|
-
"name": "PrimerCheckout",
|
|
1652
|
-
"declaration": {
|
|
1653
|
-
"name": "PrimerCheckoutComponent",
|
|
1654
|
-
"module": "src/primer-checkout.ts"
|
|
1655
|
-
}
|
|
1656
|
-
},
|
|
1657
|
-
{
|
|
1658
|
-
"kind": "js",
|
|
1659
|
-
"name": "testPrimerJSValidation",
|
|
1660
|
-
"declaration": {
|
|
1661
|
-
"name": "testPrimerJSValidation",
|
|
1662
|
-
"module": "src/primer-checkout.ts"
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
]
|
|
1666
|
-
},
|
|
1667
|
-
{
|
|
1668
|
-
"kind": "javascript-module",
|
|
1669
|
-
"path": "e2e/mocks/billing-address.ts",
|
|
1670
|
-
"declarations": [
|
|
1671
|
-
{
|
|
1672
|
-
"kind": "variable",
|
|
1673
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1674
|
-
"type": {
|
|
1675
|
-
"text": "object"
|
|
1676
|
-
},
|
|
1677
|
-
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
1678
|
-
},
|
|
1679
|
-
{
|
|
1680
|
-
"kind": "variable",
|
|
1681
|
-
"name": "CARD_NUMBER",
|
|
1682
|
-
"type": {
|
|
1683
|
-
"text": "string"
|
|
1684
|
-
},
|
|
1685
|
-
"default": "'4242 4242 4242 4242'"
|
|
1686
|
-
},
|
|
1687
|
-
{
|
|
1688
|
-
"kind": "function",
|
|
1689
|
-
"name": "mockBinData",
|
|
1690
|
-
"parameters": [
|
|
1691
|
-
{
|
|
1692
|
-
"name": "page",
|
|
1693
|
-
"type": {
|
|
1694
|
-
"text": "Page"
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
]
|
|
1698
|
-
},
|
|
1699
|
-
{
|
|
1700
|
-
"kind": "function",
|
|
1701
|
-
"name": "mockPaymentInstruments",
|
|
1702
|
-
"parameters": [
|
|
1703
|
-
{
|
|
1704
|
-
"name": "page",
|
|
1705
|
-
"type": {
|
|
1706
|
-
"text": "Page"
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
]
|
|
1710
|
-
},
|
|
1711
|
-
{
|
|
1712
|
-
"kind": "function",
|
|
1713
|
-
"name": "mockPayments",
|
|
1714
|
-
"parameters": [
|
|
1715
|
-
{
|
|
1716
|
-
"name": "page",
|
|
1717
|
-
"type": {
|
|
1718
|
-
"text": "Page"
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
]
|
|
1722
|
-
}
|
|
1723
|
-
],
|
|
1724
|
-
"exports": [
|
|
1725
|
-
{
|
|
1726
|
-
"kind": "js",
|
|
1727
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1728
|
-
"declaration": {
|
|
1729
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1730
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1731
|
-
}
|
|
1732
|
-
},
|
|
1733
|
-
{
|
|
1734
|
-
"kind": "js",
|
|
1735
|
-
"name": "CARD_NUMBER",
|
|
1736
|
-
"declaration": {
|
|
1737
|
-
"name": "CARD_NUMBER",
|
|
1738
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1739
|
-
}
|
|
1740
|
-
},
|
|
1741
|
-
{
|
|
1742
|
-
"kind": "js",
|
|
1743
|
-
"name": "mockBinData",
|
|
1744
|
-
"declaration": {
|
|
1745
|
-
"name": "mockBinData",
|
|
1746
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1747
|
-
}
|
|
1748
|
-
},
|
|
1749
|
-
{
|
|
1750
|
-
"kind": "js",
|
|
1751
|
-
"name": "mockPaymentInstruments",
|
|
1752
|
-
"declaration": {
|
|
1753
|
-
"name": "mockPaymentInstruments",
|
|
1754
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1755
|
-
}
|
|
1756
|
-
},
|
|
1757
|
-
{
|
|
1758
|
-
"kind": "js",
|
|
1759
|
-
"name": "mockPayments",
|
|
1760
|
-
"declaration": {
|
|
1761
|
-
"name": "mockPayments",
|
|
1762
|
-
"module": "e2e/mocks/billing-address.ts"
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
]
|
|
1766
|
-
},
|
|
1767
|
-
{
|
|
1768
|
-
"kind": "javascript-module",
|
|
1769
|
-
"path": "e2e/mocks/paypal.ts",
|
|
1770
|
-
"declarations": [
|
|
1771
|
-
{
|
|
1772
|
-
"kind": "variable",
|
|
1773
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1774
|
-
"type": {
|
|
1775
|
-
"text": "object"
|
|
1776
|
-
},
|
|
1777
|
-
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
1778
|
-
}
|
|
1779
|
-
],
|
|
1780
|
-
"exports": [
|
|
1781
|
-
{
|
|
1782
|
-
"kind": "js",
|
|
1783
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1784
|
-
"declaration": {
|
|
1785
|
-
"name": "CONFIGURATION_RESPONSE",
|
|
1786
|
-
"module": "e2e/mocks/paypal.ts"
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
]
|
|
1790
|
-
},
|
|
1791
|
-
{
|
|
1792
|
-
"kind": "javascript-module",
|
|
1793
|
-
"path": "e2e/mocks/shared.ts",
|
|
1794
|
-
"declarations": [
|
|
1795
|
-
{
|
|
1796
|
-
"kind": "function",
|
|
1797
|
-
"name": "mockConfigurationCall",
|
|
1798
|
-
"parameters": [
|
|
1799
|
-
{
|
|
1800
|
-
"name": "page",
|
|
1801
|
-
"type": {
|
|
1802
|
-
"text": "Page"
|
|
1803
|
-
}
|
|
1804
|
-
},
|
|
1805
|
-
{
|
|
1806
|
-
"name": "config",
|
|
1807
|
-
"type": {
|
|
1808
|
-
"text": "unknown"
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
|
-
]
|
|
1812
|
-
},
|
|
1813
|
-
{
|
|
1814
|
-
"kind": "function",
|
|
1815
|
-
"name": "mockDemoUrl",
|
|
1816
|
-
"parameters": [
|
|
1817
|
-
{
|
|
1818
|
-
"name": "primerCheckoutOptions",
|
|
1819
|
-
"optional": true,
|
|
1820
|
-
"type": {
|
|
1821
|
-
"text": "PrimerCheckoutOptions"
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
]
|
|
1825
|
-
}
|
|
1826
|
-
],
|
|
1827
|
-
"exports": [
|
|
1828
|
-
{
|
|
1829
|
-
"kind": "js",
|
|
1830
|
-
"name": "mockConfigurationCall",
|
|
1651
|
+
"name": "PrimerCheckout",
|
|
1831
1652
|
"declaration": {
|
|
1832
|
-
"name": "
|
|
1833
|
-
"module": "
|
|
1653
|
+
"name": "PrimerCheckoutComponent",
|
|
1654
|
+
"module": "src/primer-checkout.ts"
|
|
1834
1655
|
}
|
|
1835
1656
|
},
|
|
1836
1657
|
{
|
|
1837
1658
|
"kind": "js",
|
|
1838
|
-
"name": "
|
|
1659
|
+
"name": "testPrimerJSValidation",
|
|
1839
1660
|
"declaration": {
|
|
1840
|
-
"name": "
|
|
1841
|
-
"module": "
|
|
1661
|
+
"name": "testPrimerJSValidation",
|
|
1662
|
+
"module": "src/primer-checkout.ts"
|
|
1842
1663
|
}
|
|
1843
1664
|
}
|
|
1844
1665
|
]
|
|
1845
1666
|
},
|
|
1846
|
-
{
|
|
1847
|
-
"kind": "javascript-module",
|
|
1848
|
-
"path": "e2e/tests/card-form-billing-address.spec.ts",
|
|
1849
|
-
"declarations": [],
|
|
1850
|
-
"exports": []
|
|
1851
|
-
},
|
|
1852
|
-
{
|
|
1853
|
-
"kind": "javascript-module",
|
|
1854
|
-
"path": "e2e/tests/paypal.spec.ts",
|
|
1855
|
-
"declarations": [],
|
|
1856
|
-
"exports": []
|
|
1857
|
-
},
|
|
1858
1667
|
{
|
|
1859
1668
|
"kind": "javascript-module",
|
|
1860
1669
|
"path": "dist/chunks/ar.E4O36EC6.js",
|
|
@@ -2988,6 +2797,197 @@
|
|
|
2988
2797
|
}
|
|
2989
2798
|
]
|
|
2990
2799
|
},
|
|
2800
|
+
{
|
|
2801
|
+
"kind": "javascript-module",
|
|
2802
|
+
"path": "e2e/mocks/billing-address.ts",
|
|
2803
|
+
"declarations": [
|
|
2804
|
+
{
|
|
2805
|
+
"kind": "variable",
|
|
2806
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2807
|
+
"type": {
|
|
2808
|
+
"text": "object"
|
|
2809
|
+
},
|
|
2810
|
+
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [ { type: 'BILLING_ADDRESS', options: { firstName: false, lastName: false, city: true, countryCode: true, postalCode: true, addressLine1: true, addressLine2: true, state: false, }, }, ], clientSession: { clientSessionId: '0ad5b471-5b80-436b-ad03-57850585e3fd', order: { orderId: '12577', currencyCode: 'EUR', countryCode: 'FR', totalOrderAmount: 1050, merchantAmount: 1050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer123', billingAddress: { firstName: 'testt', lastName: 'test', postalCode: '51662', addressLine1: 'aksjlkajl', addressLine2: 'jfjkahk', countryCode: 'PL', city: 'wroclaw', state: 'test', }, shippingAddress: {}, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '75dc7012-785c-443a-80b1-0e1f88fd4fad', env: 'SANDBOX', paymentMethods: [ { id: '42e32c6e-7faa-4f5a-97d0-9c4f7b848ae1', type: 'APPLE_PAY', options: { merchantId: '75dc7012785c443a80b10e1f88fd4fad', merchantName: 'Primer', merchantDomains: [], }, implementationType: 'NATIVE_SDK', name: 'Apple Pay', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/APPLE_PAY/apple-pay-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
2811
|
+
},
|
|
2812
|
+
{
|
|
2813
|
+
"kind": "variable",
|
|
2814
|
+
"name": "CARD_NUMBER",
|
|
2815
|
+
"type": {
|
|
2816
|
+
"text": "string"
|
|
2817
|
+
},
|
|
2818
|
+
"default": "'4242 4242 4242 4242'"
|
|
2819
|
+
},
|
|
2820
|
+
{
|
|
2821
|
+
"kind": "function",
|
|
2822
|
+
"name": "mockBinData",
|
|
2823
|
+
"parameters": [
|
|
2824
|
+
{
|
|
2825
|
+
"name": "page",
|
|
2826
|
+
"type": {
|
|
2827
|
+
"text": "Page"
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
]
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
"kind": "function",
|
|
2834
|
+
"name": "mockPaymentInstruments",
|
|
2835
|
+
"parameters": [
|
|
2836
|
+
{
|
|
2837
|
+
"name": "page",
|
|
2838
|
+
"type": {
|
|
2839
|
+
"text": "Page"
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
]
|
|
2843
|
+
},
|
|
2844
|
+
{
|
|
2845
|
+
"kind": "function",
|
|
2846
|
+
"name": "mockPayments",
|
|
2847
|
+
"parameters": [
|
|
2848
|
+
{
|
|
2849
|
+
"name": "page",
|
|
2850
|
+
"type": {
|
|
2851
|
+
"text": "Page"
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
]
|
|
2855
|
+
}
|
|
2856
|
+
],
|
|
2857
|
+
"exports": [
|
|
2858
|
+
{
|
|
2859
|
+
"kind": "js",
|
|
2860
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2861
|
+
"declaration": {
|
|
2862
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2863
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2864
|
+
}
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
"kind": "js",
|
|
2868
|
+
"name": "CARD_NUMBER",
|
|
2869
|
+
"declaration": {
|
|
2870
|
+
"name": "CARD_NUMBER",
|
|
2871
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2872
|
+
}
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
"kind": "js",
|
|
2876
|
+
"name": "mockBinData",
|
|
2877
|
+
"declaration": {
|
|
2878
|
+
"name": "mockBinData",
|
|
2879
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2880
|
+
}
|
|
2881
|
+
},
|
|
2882
|
+
{
|
|
2883
|
+
"kind": "js",
|
|
2884
|
+
"name": "mockPaymentInstruments",
|
|
2885
|
+
"declaration": {
|
|
2886
|
+
"name": "mockPaymentInstruments",
|
|
2887
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2888
|
+
}
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
"kind": "js",
|
|
2892
|
+
"name": "mockPayments",
|
|
2893
|
+
"declaration": {
|
|
2894
|
+
"name": "mockPayments",
|
|
2895
|
+
"module": "e2e/mocks/billing-address.ts"
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
]
|
|
2899
|
+
},
|
|
2900
|
+
{
|
|
2901
|
+
"kind": "javascript-module",
|
|
2902
|
+
"path": "e2e/mocks/paypal.ts",
|
|
2903
|
+
"declarations": [
|
|
2904
|
+
{
|
|
2905
|
+
"kind": "variable",
|
|
2906
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2907
|
+
"type": {
|
|
2908
|
+
"text": "object"
|
|
2909
|
+
},
|
|
2910
|
+
"default": "{ coreUrl: 'https://api.sandbox.primer.io', pciUrl: 'https://sdk.api.sandbox.primer.io', binDataUrl: 'https://bin-data.api.sandbox.core.primer.io', assetsUrl: 'https://assets.sandbox.core.primer.io', checkoutModules: [], clientSession: { clientSessionId: 'f2868f83-9f30-44d0-ae15-c67d6424badc', order: { orderId: '1257721757579', currencyCode: 'USD', countryCode: 'FR', totalOrderAmount: 5050, merchantAmount: 5050, lineItems: [ { itemId: 'primer-hoodie-gray', description: 'Primer Hoodie', amount: 4950, quantity: 1, }, { itemId: 'primer-hoodie-blue', description: 'Primer Blue', amount: 50, quantity: 1, }, ], shipping: { amount: 50, methodId: 'Regular', methodName: 'Regular 50', methodDescription: 'Regular', }, }, customer: { customerId: 'Customer1234367', billingAddress: { countryCode: 'FR', }, shippingAddress: { firstName: 'test', lastName: 'test', postalCode: '51786', addressLine1: 'test', addressLine2: 'test', countryCode: 'FR', city: 'test', }, nationalDocumentId: '9011211234567', }, paymentMethod: { vaultOnSuccess: false, orderedAllowedCardNetworks: [ 'VISA', 'MASTERCARD', 'AMEX', 'MAESTRO', 'UNIONPAY', 'CARTES_BANCAIRES', 'DANKORT', 'DINERS_CLUB', 'DISCOVER', 'ENROUTE', 'ELO', 'HIPER', 'INTERAC', 'JCB', 'MIR', 'OTHER', ], vaultOnAgreement: false, }, }, primerAccountId: '33c6e1fc-5199-43ed-a734-acd3deb27d81', env: 'SANDBOX', paymentMethods: [ { id: 'a04ecba7-cc9d-40de-96b9-7bd6a85b4e0d', type: 'GOOGLE_PAY', options: { merchantId: 'Chris', merchantName: 'Chisisthebest', type: 'GOOGLE_PAY', }, implementationType: 'NATIVE_SDK', name: 'Google Pay', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', dark: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/GOOGLE_PAY/google-pay-logo-light@3x.png', }, backgroundColor: { colored: '#000000', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 1, dark: 1, light: 1, }, borderColor: { colored: '#8E8E93', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '1c2bb0fc-d8ed-4399-9154-2aba015ec50a', type: 'BRAINTREE_VENMO', options: { merchantId: 'primer', merchantAccountId: 'cde7e786-5324-5e41-9694-1aa394ed5be1', }, processorConfigId: '52bef1ae-fdfc-4cae-bb91-3fb9b81a7b5a', implementationType: 'WEB_REDIRECT', name: 'Venmo', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/VENMO/venmo-logo-light@3x.png', }, backgroundColor: { colored: '#008CFF', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, { id: '2fc60a42-3729-40c4-bf52-4427e87db7eb', type: 'KLARNA', options: { merchantId: 'PK55462', merchantAccountId: 'fcd08555-1d1a-588f-b7d7-c3058b9fcd26', clientId: 'PK55462', }, processorConfigId: 'a38c95ba-8381-4bd7-b7c5-07f36c1f0a98', implementationType: 'NATIVE_SDK', name: 'Klarna', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/KLARNA/klarna-logo-light@3x.png', }, backgroundColor: { colored: '#FFB3C7', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { colored: '#FFB3C7', dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { id: '30294d7c-d820-470e-9d43-5b701cd925d8', type: 'PAYPAL', options: { merchantId: 'Default Application', merchantAccountId: '49989e77-764d-585f-b66c-3ea34551094b', clientId: 'AW0qJdOMrgWr2ste9V9pZ1njg3tilO-8P9-vkSfm9e0f82wlXfsAxjoNSCmu-xGfFd6vqNM9XAHB6vX_', intent: 'authorize', }, processorConfigId: 'bf904deb-a083-4168-883d-f55eb142e993', implementationType: 'NATIVE_SDK', name: 'PayPal', displayMetadata: { button: { iconUrl: { colored: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo@3x.png', dark: 'https://assets.sandbox.core.primer.io/PAYPAL/paypal-logo-dark@3x.png', }, backgroundColor: { colored: '#FFC439', dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, }, }, forceRedirect: false, implementation: {}, }, { type: 'PAYMENT_CARD', options: { threeDSecureProvider: '3DSECUREIO', threeDSecureEnabled: true, }, implementationType: 'NATIVE_SDK', name: 'Card', displayMetadata: { button: { iconUrl: { dark: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-dark@3x.png', light: 'https://assets.sandbox.core.primer.io/PAYMENT_CARD/payment-card-logo-light@3x.png', }, backgroundColor: { dark: '#000000', light: '#FFFFFF', }, cornerRadius: 4, borderWidth: { colored: 0, dark: 1, light: 1, }, borderColor: { dark: '#FFFFFF', light: '#212121', }, text: 'Pay by card', textColor: { dark: '#FFFFFF', light: '#000000', }, }, }, forceRedirect: false, implementation: {}, }, ], styleDefaults: {}, }"
|
|
2911
|
+
}
|
|
2912
|
+
],
|
|
2913
|
+
"exports": [
|
|
2914
|
+
{
|
|
2915
|
+
"kind": "js",
|
|
2916
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2917
|
+
"declaration": {
|
|
2918
|
+
"name": "CONFIGURATION_RESPONSE",
|
|
2919
|
+
"module": "e2e/mocks/paypal.ts"
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
]
|
|
2923
|
+
},
|
|
2924
|
+
{
|
|
2925
|
+
"kind": "javascript-module",
|
|
2926
|
+
"path": "e2e/mocks/shared.ts",
|
|
2927
|
+
"declarations": [
|
|
2928
|
+
{
|
|
2929
|
+
"kind": "function",
|
|
2930
|
+
"name": "mockConfigurationCall",
|
|
2931
|
+
"parameters": [
|
|
2932
|
+
{
|
|
2933
|
+
"name": "page",
|
|
2934
|
+
"type": {
|
|
2935
|
+
"text": "Page"
|
|
2936
|
+
}
|
|
2937
|
+
},
|
|
2938
|
+
{
|
|
2939
|
+
"name": "config",
|
|
2940
|
+
"type": {
|
|
2941
|
+
"text": "unknown"
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
]
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
"kind": "function",
|
|
2948
|
+
"name": "mockDemoUrl",
|
|
2949
|
+
"parameters": [
|
|
2950
|
+
{
|
|
2951
|
+
"name": "primerCheckoutOptions",
|
|
2952
|
+
"optional": true,
|
|
2953
|
+
"type": {
|
|
2954
|
+
"text": "PrimerCheckoutOptions"
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
]
|
|
2958
|
+
}
|
|
2959
|
+
],
|
|
2960
|
+
"exports": [
|
|
2961
|
+
{
|
|
2962
|
+
"kind": "js",
|
|
2963
|
+
"name": "mockConfigurationCall",
|
|
2964
|
+
"declaration": {
|
|
2965
|
+
"name": "mockConfigurationCall",
|
|
2966
|
+
"module": "e2e/mocks/shared.ts"
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
"kind": "js",
|
|
2971
|
+
"name": "mockDemoUrl",
|
|
2972
|
+
"declaration": {
|
|
2973
|
+
"name": "mockDemoUrl",
|
|
2974
|
+
"module": "e2e/mocks/shared.ts"
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
]
|
|
2978
|
+
},
|
|
2979
|
+
{
|
|
2980
|
+
"kind": "javascript-module",
|
|
2981
|
+
"path": "e2e/tests/card-form-billing-address.spec.ts",
|
|
2982
|
+
"declarations": [],
|
|
2983
|
+
"exports": []
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
"kind": "javascript-module",
|
|
2987
|
+
"path": "e2e/tests/paypal.spec.ts",
|
|
2988
|
+
"declarations": [],
|
|
2989
|
+
"exports": []
|
|
2990
|
+
},
|
|
2991
2991
|
{
|
|
2992
2992
|
"kind": "javascript-module",
|
|
2993
2993
|
"path": "src/__tests__/setup.ts",
|
|
@@ -10060,9 +10060,19 @@
|
|
|
10060
10060
|
"name": "setupCardFormTask",
|
|
10061
10061
|
"privacy": "private",
|
|
10062
10062
|
"readonly": true,
|
|
10063
|
-
"default": "new Task(this, { task: ([methods]) => { const method = methods?.find( (pm) => pm.type === PaymentMethodType.PAYMENT_CARD, ); if (!method) { return initialState; } const { cardNumber, cardExpiryDate, cardSecurityCode, cardholderName } = method.iframes; this.cardFormProvider.setValue({ cardholderNameInput: cardholderName, cardNumberInput: cardNumber, expiryInput: cardExpiryDate, cvvInput: cardSecurityCode, setCardholderName: (val: string) => { method.setCardholderName(val); if (this.shouldRequireCardholderName) { void method.validate().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => method.validate(), submit: (args) => method.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) { return; } errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.primerContext?.paymentMethods], })",
|
|
10063
|
+
"default": "new Task(this, { task: ([methods]) => { const method = methods?.find( (pm) => pm.type === PaymentMethodType.PAYMENT_CARD, ); if (!method) { return initialState; } const { cardNumber, cardExpiryDate, cardSecurityCode, cardholderName } = method.iframes; this.cardFormProvider.setValue({ cardholderNameInput: cardholderName, cardNumberInput: cardNumber, expiryInput: cardExpiryDate, cvvInput: cardSecurityCode, setCardholderName: (val: string) => { method.setCardholderName(val); if (this.shouldRequireCardholderName) { void method.validate().then((validationResult) => { const errors = validationResult?.validationErrors; const cardholderNameError = errors?.find( (error) => error.name === fieldToInputType.cardholderName, ); const controller = this.inputControllers.get( HostedInputType.CARD_HOLDER_NAME, ); if (controller) { controller.updateMetaFromValidation({ valid: false, error: cardholderNameError?.message || cardholderNameError?.error || null, errorCode: cardholderNameError?.message || cardholderNameError?.error || null, }); } }); } }, setCardNetwork: (val: string) => { this.selectedCardNetwork = val; }, validate: () => method.validate(), submit: (args) => method.submit(args), hideLabels: this.hideLabels, disabled: this.disabled, // New meta state management methods setSubmissionState: (submitted: boolean) => { this.inputControllers.forEach((controller) => { controller.setSubmitted(submitted); }); }, propagateValidationErrors: (errors: InputValidationError[]) => { if (!errors) { return; } errors.forEach((error) => { const fieldName = error.field || error.name; const errorMessage = error.message || error.error; const inputType = fieldToInputType[fieldName]; if (inputType) { const controller = this.inputControllers.get(inputType); if (controller) { const updateData = { valid: false, error: errorMessage, errorCode: errorMessage, // Use error message (localization key) instead of field name }; controller.updateMetaFromValidation(updateData); } } }); }, registerInputController: ( inputType: HostedInputType, controller: IHostedInputController, ) => { this.inputControllers.set(inputType, controller); }, unregisterInputController: (inputType: HostedInputType) => { this.inputControllers.delete(inputType); }, onUserInteraction: () => { this.clearStaleVaultSelection(); this.sendPaymentMethodSelectionEvent(); this.checkAndSendPaymentDetailsEnteredEvent(); }, }); return true; }, args: () => [this.primerContext?.paymentMethods], })",
|
|
10064
10064
|
"description": "Task to set up the card form with hosted inputs"
|
|
10065
10065
|
},
|
|
10066
|
+
{
|
|
10067
|
+
"kind": "method",
|
|
10068
|
+
"name": "clearStaleVaultSelection",
|
|
10069
|
+
"privacy": "private",
|
|
10070
|
+
"return": {
|
|
10071
|
+
"type": {
|
|
10072
|
+
"text": "void"
|
|
10073
|
+
}
|
|
10074
|
+
}
|
|
10075
|
+
},
|
|
10066
10076
|
{
|
|
10067
10077
|
"kind": "method",
|
|
10068
10078
|
"name": "sendPaymentMethodSelectionEvent",
|
|
@@ -14098,7 +14108,7 @@
|
|
|
14098
14108
|
},
|
|
14099
14109
|
{
|
|
14100
14110
|
"kind": "function",
|
|
14101
|
-
"name": "
|
|
14111
|
+
"name": "getCardNetworkDisplayName",
|
|
14102
14112
|
"return": {
|
|
14103
14113
|
"type": {
|
|
14104
14114
|
"text": "string"
|
|
@@ -14113,7 +14123,7 @@
|
|
|
14113
14123
|
}
|
|
14114
14124
|
}
|
|
14115
14125
|
],
|
|
14116
|
-
"description": "
|
|
14126
|
+
"description": "Get the display name for a card network (e.g. \"CARTES_BANCAIRES\" -> \"Cartes Bancaires\")"
|
|
14117
14127
|
},
|
|
14118
14128
|
{
|
|
14119
14129
|
"kind": "function",
|
|
@@ -14339,9 +14349,9 @@
|
|
|
14339
14349
|
},
|
|
14340
14350
|
{
|
|
14341
14351
|
"kind": "js",
|
|
14342
|
-
"name": "
|
|
14352
|
+
"name": "getCardNetworkDisplayName",
|
|
14343
14353
|
"declaration": {
|
|
14344
|
-
"name": "
|
|
14354
|
+
"name": "getCardNetworkDisplayName",
|
|
14345
14355
|
"module": "src/containers/vault-manager/utils/formatters.ts"
|
|
14346
14356
|
}
|
|
14347
14357
|
},
|
|
@@ -16363,24 +16373,6 @@
|
|
|
16363
16373
|
"privacy": "private",
|
|
16364
16374
|
"default": "null"
|
|
16365
16375
|
},
|
|
16366
|
-
{
|
|
16367
|
-
"kind": "field",
|
|
16368
|
-
"name": "cvvInputIsDirty",
|
|
16369
|
-
"type": {
|
|
16370
|
-
"text": "boolean"
|
|
16371
|
-
},
|
|
16372
|
-
"privacy": "private",
|
|
16373
|
-
"default": "false"
|
|
16374
|
-
},
|
|
16375
|
-
{
|
|
16376
|
-
"kind": "field",
|
|
16377
|
-
"name": "cvvInputIsBlurred",
|
|
16378
|
-
"type": {
|
|
16379
|
-
"text": "boolean"
|
|
16380
|
-
},
|
|
16381
|
-
"privacy": "private",
|
|
16382
|
-
"default": "false"
|
|
16383
|
-
},
|
|
16384
16376
|
{
|
|
16385
16377
|
"kind": "field",
|
|
16386
16378
|
"name": "cvvInput",
|
|
@@ -16428,6 +16420,15 @@
|
|
|
16428
16420
|
{
|
|
16429
16421
|
"kind": "method",
|
|
16430
16422
|
"name": "onFocus"
|
|
16423
|
+
},
|
|
16424
|
+
{
|
|
16425
|
+
"kind": "field",
|
|
16426
|
+
"name": "visibleErrorCode",
|
|
16427
|
+
"type": {
|
|
16428
|
+
"text": "string | null"
|
|
16429
|
+
},
|
|
16430
|
+
"privacy": "private",
|
|
16431
|
+
"readonly": true
|
|
16431
16432
|
}
|
|
16432
16433
|
],
|
|
16433
16434
|
"attributes": [
|
|
@@ -17031,6 +17032,16 @@
|
|
|
17031
17032
|
"name": "handleDeleteClick",
|
|
17032
17033
|
"privacy": "private",
|
|
17033
17034
|
"description": "Dispatch delete event"
|
|
17035
|
+
},
|
|
17036
|
+
{
|
|
17037
|
+
"kind": "field",
|
|
17038
|
+
"name": "handleCvvRowClick",
|
|
17039
|
+
"privacy": "private"
|
|
17040
|
+
},
|
|
17041
|
+
{
|
|
17042
|
+
"kind": "field",
|
|
17043
|
+
"name": "handleRadioClick",
|
|
17044
|
+
"privacy": "private"
|
|
17034
17045
|
}
|
|
17035
17046
|
],
|
|
17036
17047
|
"attributes": [
|