@justifi/webcomponents 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-68222998.js → index-4f753ffd.js} +32 -1
- package/dist/cjs/justifi-bank-account-form_4.cjs.entry.js +74 -60
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/webcomponents.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +43 -45
- package/dist/collection/components/card-form/card-form.js +43 -55
- package/dist/collection/components/payment-method-form/message-event-types.js +14 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +76 -72
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +1 -1
- package/dist/components/justifi-bank-account-form.js +16 -13
- package/dist/components/justifi-card-form.js +16 -16
- package/dist/components/payment-method-form.js +54 -38
- package/dist/esm/{index-e279d85e.js → index-3d88d85c.js} +32 -2
- package/dist/esm/justifi-bank-account-form_4.entry.js +74 -60
- package/dist/esm/loader.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/webcomponents.js +4 -3
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Payment.d.ts +1 -1
- package/dist/types/components/bank-account-form/bank-account-form.d.ts +10 -5
- package/dist/types/components/card-form/card-form.d.ts +10 -5
- package/dist/types/components/payment-method-form/message-event-types.d.ts +14 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +6 -4
- package/dist/types/components.d.ts +13 -12
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/webcomponents/p-338453e1.entry.js +1 -0
- package/dist/webcomponents/p-de108437.js +2 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/loader/index.d.ts +9 -0
- package/package.json +1 -1
- package/dist/collection/components/card-form/card-form.css +0 -3
- package/dist/webcomponents/p-146348d6.js +0 -2
- package/dist/webcomponents/p-a967d55b.entry.js +0 -1
|
@@ -41,6 +41,18 @@ const isComplexType = (o) => {
|
|
|
41
41
|
o = typeof o;
|
|
42
42
|
return o === 'object' || o === 'function';
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
46
|
+
* out of a DOM's head.
|
|
47
|
+
*
|
|
48
|
+
* @param doc The DOM containing the `head` to query against
|
|
49
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
50
|
+
* exists or the tag has no content.
|
|
51
|
+
*/
|
|
52
|
+
function queryNonceMetaTagContent(doc) {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
|
|
55
|
+
}
|
|
44
56
|
/**
|
|
45
57
|
* Production h() function based on Preact by
|
|
46
58
|
* Jason Miller (@developit)
|
|
@@ -49,7 +61,6 @@ const isComplexType = (o) => {
|
|
|
49
61
|
*
|
|
50
62
|
* Modified for Stencil's compiler and vdom
|
|
51
63
|
*/
|
|
52
|
-
// const stack: any[] = [];
|
|
53
64
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
|
54
65
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
55
66
|
const h = (nodeName, vnodeData, ...children) => {
|
|
@@ -197,6 +208,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
197
208
|
styles.set(scopeId, style);
|
|
198
209
|
};
|
|
199
210
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
211
|
+
var _a;
|
|
200
212
|
let scopeId = getScopeId(cmpMeta);
|
|
201
213
|
const style = styles.get(scopeId);
|
|
202
214
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
@@ -216,6 +228,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
216
228
|
styleElm = doc.createElement('style');
|
|
217
229
|
styleElm.innerHTML = style;
|
|
218
230
|
}
|
|
231
|
+
// Apply CSP nonce to the style tag if it exists
|
|
232
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
233
|
+
if (nonce != null) {
|
|
234
|
+
styleElm.setAttribute('nonce', nonce);
|
|
235
|
+
}
|
|
219
236
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
220
237
|
}
|
|
221
238
|
if (appliedStyles) {
|
|
@@ -1136,6 +1153,7 @@ const disconnectedCallback = (elm) => {
|
|
|
1136
1153
|
}
|
|
1137
1154
|
};
|
|
1138
1155
|
const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1156
|
+
var _a;
|
|
1139
1157
|
const endBootstrap = createTime();
|
|
1140
1158
|
const cmpTags = [];
|
|
1141
1159
|
const exclude = options.exclude || [];
|
|
@@ -1215,6 +1233,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1215
1233
|
{
|
|
1216
1234
|
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
|
1217
1235
|
visibilityStyle.setAttribute('data-styles', '');
|
|
1236
|
+
// Apply CSP nonce to the style tag if it exists
|
|
1237
|
+
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
|
1238
|
+
if (nonce != null) {
|
|
1239
|
+
visibilityStyle.setAttribute('nonce', nonce);
|
|
1240
|
+
}
|
|
1218
1241
|
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
|
1219
1242
|
}
|
|
1220
1243
|
// Process deferred connectedCallbacks now all components have been registered
|
|
@@ -1259,6 +1282,13 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1259
1282
|
};
|
|
1260
1283
|
// prettier-ignore
|
|
1261
1284
|
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1285
|
+
/**
|
|
1286
|
+
* Assigns the given value to the nonce property on the runtime platform object.
|
|
1287
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
|
|
1288
|
+
* @param nonce The value to be assigned to the platform nonce property.
|
|
1289
|
+
* @returns void
|
|
1290
|
+
*/
|
|
1291
|
+
const setNonce = (nonce) => (plt.$nonce$ = nonce);
|
|
1262
1292
|
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1263
1293
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1264
1294
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
@@ -1369,4 +1399,4 @@ const flush = () => {
|
|
|
1369
1399
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1370
1400
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1371
1401
|
|
|
1372
|
-
export { Host as H, bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r };
|
|
1402
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
@@ -1,97 +1,106 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3d88d85c.js';
|
|
2
2
|
|
|
3
3
|
const BankAccountForm = class {
|
|
4
4
|
constructor(hostRef) {
|
|
5
5
|
registerInstance(this, hostRef);
|
|
6
6
|
this.bankAccountFormReady = createEvent(this, "bankAccountFormReady", 7);
|
|
7
|
-
this.bankAccountFormChange = createEvent(this, "bankAccountFormChange", 7);
|
|
8
|
-
this.bankAccountFormBlur = createEvent(this, "bankAccountFormBlur", 7);
|
|
9
7
|
this.bankAccountFormTokenize = createEvent(this, "bankAccountFormTokenize", 7);
|
|
10
|
-
this.
|
|
8
|
+
this.bankAccountFormValidate = createEvent(this, "bankAccountFormValidate", 7);
|
|
9
|
+
this.validationStrategy = undefined;
|
|
11
10
|
}
|
|
12
11
|
readyHandler(event) {
|
|
13
12
|
this.bankAccountFormReady.emit(event);
|
|
14
13
|
}
|
|
15
|
-
changeHandler(event) {
|
|
16
|
-
this.bankAccountFormChange.emit(event);
|
|
17
|
-
}
|
|
18
|
-
blurHandler(event) {
|
|
19
|
-
this.bankAccountFormBlur.emit(event);
|
|
20
|
-
}
|
|
21
14
|
tokenizeHandler(event) {
|
|
22
15
|
this.bankAccountFormTokenize.emit(event);
|
|
23
16
|
}
|
|
17
|
+
validateHandler(event) {
|
|
18
|
+
this.bankAccountFormValidate.emit(event);
|
|
19
|
+
}
|
|
24
20
|
async tokenize(...args) {
|
|
25
21
|
if (!this.childRef) {
|
|
26
22
|
throw new Error('Cannot call tokenize');
|
|
27
23
|
}
|
|
28
24
|
return this.childRef.tokenize(...args);
|
|
29
25
|
}
|
|
26
|
+
async validate() {
|
|
27
|
+
if (!this.childRef) {
|
|
28
|
+
throw new Error('Cannot call validate');
|
|
29
|
+
}
|
|
30
|
+
return this.childRef.validate();
|
|
31
|
+
}
|
|
30
32
|
render() {
|
|
31
33
|
return (h("justifi-payment-method-form", { ref: el => {
|
|
32
34
|
if (el) {
|
|
33
35
|
this.childRef = el;
|
|
34
36
|
}
|
|
35
|
-
}, "
|
|
37
|
+
}, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-tokenize": this.bankAccountFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit' }));
|
|
36
38
|
}
|
|
37
39
|
};
|
|
38
40
|
|
|
39
|
-
const cardFormCss = "justifi-card-form iframe{height:55px}";
|
|
40
|
-
|
|
41
41
|
const CardForm = class {
|
|
42
42
|
constructor(hostRef) {
|
|
43
43
|
registerInstance(this, hostRef);
|
|
44
44
|
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
45
|
-
this.cardFormChange = createEvent(this, "cardFormChange", 7);
|
|
46
|
-
this.cardFormBlur = createEvent(this, "cardFormBlur", 7);
|
|
47
45
|
this.cardFormTokenize = createEvent(this, "cardFormTokenize", 7);
|
|
48
|
-
this.
|
|
46
|
+
this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
|
|
47
|
+
this.validationStrategy = undefined;
|
|
49
48
|
}
|
|
50
49
|
readyHandler(event) {
|
|
51
50
|
this.cardFormReady.emit(event);
|
|
52
51
|
}
|
|
53
|
-
changeHandler(event) {
|
|
54
|
-
this.cardFormChange.emit(event);
|
|
55
|
-
}
|
|
56
|
-
blurHandler(event) {
|
|
57
|
-
this.cardFormBlur.emit(event);
|
|
58
|
-
}
|
|
59
52
|
tokenizeHandler(event) {
|
|
60
53
|
this.cardFormTokenize.emit(event);
|
|
61
54
|
}
|
|
55
|
+
validateHandler(event) {
|
|
56
|
+
this.cardFormValidate.emit(event);
|
|
57
|
+
}
|
|
62
58
|
async tokenize(...args) {
|
|
63
59
|
if (!this.childRef) {
|
|
64
60
|
throw new Error('Cannot call tokenize');
|
|
65
61
|
}
|
|
66
62
|
return this.childRef.tokenize(...args);
|
|
67
63
|
}
|
|
64
|
+
async validate() {
|
|
65
|
+
if (!this.childRef) {
|
|
66
|
+
throw new Error('Cannot call validate');
|
|
67
|
+
}
|
|
68
|
+
return this.childRef.validate();
|
|
69
|
+
}
|
|
68
70
|
render() {
|
|
69
71
|
return (h("justifi-payment-method-form", { ref: el => {
|
|
70
72
|
if (el) {
|
|
71
73
|
this.childRef = el;
|
|
72
74
|
}
|
|
73
|
-
}, "
|
|
75
|
+
}, "payment-method-form-type": "card", "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit' }));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const MessageEventType = {
|
|
80
|
+
card: {
|
|
81
|
+
ready: 'justifi.card.ready',
|
|
82
|
+
tokenize: 'justifi.card.tokenize',
|
|
83
|
+
validate: 'justifi.card.validate',
|
|
84
|
+
resize: 'justifi.card.resize',
|
|
85
|
+
},
|
|
86
|
+
bankAccount: {
|
|
87
|
+
ready: 'justifi.bankAccount.ready',
|
|
88
|
+
tokenize: 'justifi.bankAccount.tokenize',
|
|
89
|
+
validate: 'justifi.bankAccount.validate',
|
|
90
|
+
resize: 'justifi.bankAccount.resize',
|
|
74
91
|
}
|
|
75
92
|
};
|
|
76
|
-
CardForm.style = cardFormCss;
|
|
77
93
|
|
|
78
94
|
const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
|
|
79
95
|
|
|
80
|
-
var DispatchedEventTypes;
|
|
81
|
-
(function (DispatchedEventTypes) {
|
|
82
|
-
DispatchedEventTypes["blur"] = "blur";
|
|
83
|
-
DispatchedEventTypes["change"] = "change";
|
|
84
|
-
DispatchedEventTypes["ready"] = "ready";
|
|
85
|
-
DispatchedEventTypes["tokenize"] = "tokenize";
|
|
86
|
-
})(DispatchedEventTypes || (DispatchedEventTypes = {}));
|
|
87
96
|
const PaymentMethodForm = class {
|
|
88
97
|
constructor(hostRef) {
|
|
89
98
|
registerInstance(this, hostRef);
|
|
90
99
|
this.paymentMethodFormReady = createEvent(this, "paymentMethodFormReady", 7);
|
|
91
|
-
this.paymentMethodFormChange = createEvent(this, "paymentMethodFormChange", 7);
|
|
92
|
-
this.paymentMethodFormBlur = createEvent(this, "paymentMethodFormBlur", 7);
|
|
93
100
|
this.paymentMethodFormTokenize = createEvent(this, "paymentMethodFormTokenize", 7);
|
|
94
|
-
this.
|
|
101
|
+
this.paymentMethodFormType = undefined;
|
|
102
|
+
this.paymentMethodFormValidationStrategy = undefined;
|
|
103
|
+
this.height = 55;
|
|
95
104
|
}
|
|
96
105
|
connectedCallback() {
|
|
97
106
|
window.addEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
@@ -103,43 +112,48 @@ const PaymentMethodForm = class {
|
|
|
103
112
|
const messagePayload = messageEvent.data;
|
|
104
113
|
const messageType = messagePayload.eventType;
|
|
105
114
|
const messageData = messagePayload.data;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.paymentMethodFormReady.emit(messageData);
|
|
109
|
-
break;
|
|
110
|
-
case DispatchedEventTypes.change:
|
|
111
|
-
this.paymentMethodFormChange.emit(messageData);
|
|
112
|
-
break;
|
|
113
|
-
case DispatchedEventTypes.blur:
|
|
114
|
-
this.paymentMethodFormBlur.emit(messageData);
|
|
115
|
-
break;
|
|
115
|
+
if (messageType === MessageEventType[this.paymentMethodFormType].ready) {
|
|
116
|
+
this.paymentMethodFormReady.emit(messageData);
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (this.iframeElement && this.iframeElement.contentWindow) {
|
|
120
|
-
this.iframeElement.contentWindow.postMessage({
|
|
121
|
-
eventType: DispatchedEventTypes.tokenize,
|
|
122
|
-
clientKey: clientKey,
|
|
123
|
-
paymentMethodMetadata: paymentMethodMetadata,
|
|
124
|
-
account: account
|
|
125
|
-
}, '*');
|
|
118
|
+
if (messageType === MessageEventType[this.paymentMethodFormType].resize) {
|
|
119
|
+
this.height = messageData.height;
|
|
126
120
|
}
|
|
127
121
|
}
|
|
128
|
-
async
|
|
122
|
+
async postMessageWithResponseListener(eventType, payload) {
|
|
129
123
|
return new Promise((resolve) => {
|
|
130
|
-
const
|
|
131
|
-
if (event.data.eventType !==
|
|
124
|
+
const responseListener = (event) => {
|
|
125
|
+
if (event.data.eventType !== eventType)
|
|
132
126
|
return;
|
|
133
|
-
window.removeEventListener('message',
|
|
127
|
+
window.removeEventListener('message', responseListener);
|
|
134
128
|
resolve(event.data.data);
|
|
135
129
|
};
|
|
136
|
-
window.addEventListener('message',
|
|
137
|
-
this.
|
|
130
|
+
window.addEventListener('message', responseListener);
|
|
131
|
+
this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
|
|
138
132
|
});
|
|
139
133
|
}
|
|
134
|
+
async tokenize(clientKey, paymentMethodMetadata, account) {
|
|
135
|
+
const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
|
|
136
|
+
const payload = {
|
|
137
|
+
clientKey: clientKey,
|
|
138
|
+
paymentMethodMetadata: paymentMethodMetadata,
|
|
139
|
+
account: account
|
|
140
|
+
};
|
|
141
|
+
return this.postMessageWithResponseListener(eventType, payload);
|
|
142
|
+
}
|
|
143
|
+
;
|
|
144
|
+
async validate() {
|
|
145
|
+
return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);
|
|
146
|
+
}
|
|
140
147
|
;
|
|
148
|
+
getIframeSrc() {
|
|
149
|
+
let iframeSrc = `https://js.justifi.ai/v2/${this.paymentMethodFormType}`;
|
|
150
|
+
if (this.paymentMethodFormValidationStrategy) {
|
|
151
|
+
iframeSrc += `?validationStrategy=${this.paymentMethodFormValidationStrategy}`;
|
|
152
|
+
}
|
|
153
|
+
return iframeSrc;
|
|
154
|
+
}
|
|
141
155
|
render() {
|
|
142
|
-
return (h(Host, null, h("iframe", { id:
|
|
156
|
+
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: (el) => this.iframeElement = el, height: this.height })));
|
|
143
157
|
}
|
|
144
158
|
};
|
|
145
159
|
PaymentMethodForm.style = paymentMethodFormCss;
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-3d88d85c.js';
|
|
2
|
+
export { s as setNonce } from './index-3d88d85c.js';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
|
-
Stencil Client Patch Esm v2.
|
|
5
|
+
Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
|
|
5
6
|
*/
|
|
6
7
|
const patchEsm = () => {
|
|
7
8
|
return promiseResolve();
|
|
@@ -10,7 +11,7 @@ const patchEsm = () => {
|
|
|
10
11
|
const defineCustomElements = (win, options) => {
|
|
11
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
13
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["justifi-bank-account-form_4",[[0,"justifi-bank-account-form",{"
|
|
14
|
+
return bootstrapLazy([["justifi-bank-account-form_4",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}],[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
|
|
14
15
|
});
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
1
|
+
var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-3d88d85c.js';
|
|
2
|
+
export { s as setNonce } from './index-3d88d85c.js';
|
|
2
3
|
|
|
3
4
|
/*
|
|
4
|
-
Stencil Client Patch Browser v2.
|
|
5
|
+
Stencil Client Patch Browser v2.22.1 | MIT Licensed | https://stenciljs.com
|
|
5
6
|
*/
|
|
6
7
|
const patchBrowser = () => {
|
|
7
8
|
const importMeta = import.meta.url;
|
|
@@ -13,5 +14,5 @@ const patchBrowser = () => {
|
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["justifi-bank-account-form_4",[[0,"justifi-bank-account-form",{"
|
|
17
|
+
return bootstrapLazy([["justifi-bank-account-form_4",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}],[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
|
|
17
18
|
});
|
package/dist/types/api/Api.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare enum PaymentDisputedStatuses {
|
|
|
22
22
|
export interface IPaymentMethod {
|
|
23
23
|
card?: ICard;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type CardBrand = 'american_express' | 'diners_club' | 'discover' | 'jcb' | 'mastercard' | 'china_unionpay' | 'visa' | 'unknown';
|
|
26
26
|
export interface ICard {
|
|
27
27
|
id: string;
|
|
28
28
|
acct_last_four: string;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
export declare class BankAccountForm {
|
|
3
|
-
|
|
3
|
+
validationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
4
4
|
bankAccountFormReady: EventEmitter;
|
|
5
|
-
bankAccountFormChange: EventEmitter;
|
|
6
|
-
bankAccountFormBlur: EventEmitter;
|
|
7
5
|
bankAccountFormTokenize: EventEmitter<{
|
|
8
6
|
data: any;
|
|
9
7
|
}>;
|
|
8
|
+
bankAccountFormValidate: EventEmitter<{
|
|
9
|
+
data: {
|
|
10
|
+
isValid: boolean;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
10
13
|
readyHandler(event: CustomEvent): void;
|
|
11
|
-
changeHandler(event: CustomEvent): void;
|
|
12
|
-
blurHandler(event: CustomEvent): void;
|
|
13
14
|
tokenizeHandler(event: {
|
|
14
15
|
data: any;
|
|
15
16
|
}): void;
|
|
17
|
+
validateHandler(event: {
|
|
18
|
+
data: any;
|
|
19
|
+
}): void;
|
|
16
20
|
private childRef?;
|
|
17
21
|
tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<any>;
|
|
22
|
+
validate(): Promise<any>;
|
|
18
23
|
render(): any;
|
|
19
24
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
export declare class CardForm {
|
|
3
|
-
|
|
3
|
+
validationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
4
4
|
cardFormReady: EventEmitter;
|
|
5
|
-
cardFormChange: EventEmitter;
|
|
6
|
-
cardFormBlur: EventEmitter;
|
|
7
5
|
cardFormTokenize: EventEmitter<{
|
|
8
6
|
data: any;
|
|
9
7
|
}>;
|
|
8
|
+
cardFormValidate: EventEmitter<{
|
|
9
|
+
data: {
|
|
10
|
+
isValid: boolean;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
10
13
|
readyHandler(event: CustomEvent): void;
|
|
11
|
-
changeHandler(event: CustomEvent): void;
|
|
12
|
-
blurHandler(event: CustomEvent): void;
|
|
13
14
|
tokenizeHandler(event: {
|
|
14
15
|
data: any;
|
|
15
16
|
}): void;
|
|
17
|
+
validateHandler(event: {
|
|
18
|
+
data: any;
|
|
19
|
+
}): void;
|
|
16
20
|
private childRef?;
|
|
17
21
|
tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<any>;
|
|
22
|
+
validate(): Promise<any>;
|
|
18
23
|
render(): any;
|
|
19
24
|
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
export declare class PaymentMethodForm {
|
|
3
|
-
|
|
3
|
+
paymentMethodFormType: 'card' | 'bankAccount';
|
|
4
|
+
paymentMethodFormValidationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
4
5
|
paymentMethodFormReady: EventEmitter;
|
|
5
|
-
paymentMethodFormChange: EventEmitter;
|
|
6
|
-
paymentMethodFormBlur: EventEmitter;
|
|
7
6
|
paymentMethodFormTokenize: EventEmitter<{
|
|
8
7
|
data: any;
|
|
9
8
|
}>;
|
|
9
|
+
height: number;
|
|
10
10
|
iframeElement: HTMLIFrameElement;
|
|
11
11
|
connectedCallback(): void;
|
|
12
12
|
disconnectedCallback(): void;
|
|
13
13
|
private dispatchMessageEvent;
|
|
14
|
-
private
|
|
14
|
+
private postMessageWithResponseListener;
|
|
15
15
|
tokenize(clientKey: string, paymentMethodMetadata: any, account?: string): Promise<any>;
|
|
16
|
+
validate(): Promise<any>;
|
|
17
|
+
private getIframeSrc;
|
|
16
18
|
render(): any;
|
|
17
19
|
}
|
|
@@ -7,16 +7,20 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface JustifiBankAccountForm {
|
|
10
|
-
"iframeOrigin": string;
|
|
11
10
|
"tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
|
|
11
|
+
"validate": () => Promise<any>;
|
|
12
|
+
"validationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
12
13
|
}
|
|
13
14
|
interface JustifiCardForm {
|
|
14
|
-
"iframeOrigin": string;
|
|
15
15
|
"tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
|
|
16
|
+
"validate": () => Promise<any>;
|
|
17
|
+
"validationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
16
18
|
}
|
|
17
19
|
interface JustifiPaymentMethodForm {
|
|
18
|
-
"
|
|
20
|
+
"paymentMethodFormType": 'card' | 'bankAccount';
|
|
21
|
+
"paymentMethodFormValidationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
19
22
|
"tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
|
|
23
|
+
"validate": () => Promise<any>;
|
|
20
24
|
}
|
|
21
25
|
interface JustifiPaymentsList {
|
|
22
26
|
"accountId": string;
|
|
@@ -69,25 +73,22 @@ declare global {
|
|
|
69
73
|
}
|
|
70
74
|
declare namespace LocalJSX {
|
|
71
75
|
interface JustifiBankAccountForm {
|
|
72
|
-
"iframeOrigin"?: string;
|
|
73
|
-
"onBankAccountFormBlur"?: (event: JustifiBankAccountFormCustomEvent<any>) => void;
|
|
74
|
-
"onBankAccountFormChange"?: (event: JustifiBankAccountFormCustomEvent<any>) => void;
|
|
75
76
|
"onBankAccountFormReady"?: (event: JustifiBankAccountFormCustomEvent<any>) => void;
|
|
76
77
|
"onBankAccountFormTokenize"?: (event: JustifiBankAccountFormCustomEvent<{ data: any }>) => void;
|
|
78
|
+
"onBankAccountFormValidate"?: (event: JustifiBankAccountFormCustomEvent<{ data: { isValid: boolean } }>) => void;
|
|
79
|
+
"validationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
77
80
|
}
|
|
78
81
|
interface JustifiCardForm {
|
|
79
|
-
"iframeOrigin"?: string;
|
|
80
|
-
"onCardFormBlur"?: (event: JustifiCardFormCustomEvent<any>) => void;
|
|
81
|
-
"onCardFormChange"?: (event: JustifiCardFormCustomEvent<any>) => void;
|
|
82
82
|
"onCardFormReady"?: (event: JustifiCardFormCustomEvent<any>) => void;
|
|
83
83
|
"onCardFormTokenize"?: (event: JustifiCardFormCustomEvent<{ data: any }>) => void;
|
|
84
|
+
"onCardFormValidate"?: (event: JustifiCardFormCustomEvent<{ data: { isValid: boolean } }>) => void;
|
|
85
|
+
"validationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
84
86
|
}
|
|
85
87
|
interface JustifiPaymentMethodForm {
|
|
86
|
-
"iframeOrigin"?: string;
|
|
87
|
-
"onPaymentMethodFormBlur"?: (event: JustifiPaymentMethodFormCustomEvent<any>) => void;
|
|
88
|
-
"onPaymentMethodFormChange"?: (event: JustifiPaymentMethodFormCustomEvent<any>) => void;
|
|
89
88
|
"onPaymentMethodFormReady"?: (event: JustifiPaymentMethodFormCustomEvent<any>) => void;
|
|
90
89
|
"onPaymentMethodFormTokenize"?: (event: JustifiPaymentMethodFormCustomEvent<{ data: any }>) => void;
|
|
90
|
+
"paymentMethodFormType"?: 'card' | 'bankAccount';
|
|
91
|
+
"paymentMethodFormValidationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
|
|
91
92
|
}
|
|
92
93
|
interface JustifiPaymentsList {
|
|
93
94
|
"accountId"?: string;
|