@everymatrix/cashier-methods-list 1.20.10 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).app=t()}(this,(function(){"use strict";function e(){}function t(e){return e()}function r(){return Object.create(null)}function n(e){e.forEach(t)}function i(e){return"function"==typeof e}function o(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let s,a;function h(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function c(t,...r){if(null==t)return e;const n=t.subscribe(...r);return n.unsubscribe?()=>n.unsubscribe():n}function l(e,t){e.appendChild(t)}function u(e,t,r){e.insertBefore(t,r||null)}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e){return document.createElement(e)}function m(e){return document.createTextNode(e)}function
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).app=t()}(this,(function(){"use strict";function e(){}function t(e){return e()}function r(){return Object.create(null)}function n(e){e.forEach(t)}function i(e){return"function"==typeof e}function o(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let s,a;function h(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function c(t,...r){if(null==t)return e;const n=t.subscribe(...r);return n.unsubscribe?()=>n.unsubscribe():n}function l(e,t){e.appendChild(t)}function u(e,t,r){e.insertBefore(t,r||null)}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e){return document.createElement(e)}function m(e){return document.createTextNode(e)}function g(){return m(" ")}function d(e,t,r,n){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}function b(e,t,r){null==r?e.removeAttribute(t):e.getAttribute(t)!==r&&e.setAttribute(t,r)}function E(e,t){t=""+t,e.data!==t&&(e.data=t)}function y(e,t,r){e.classList[r?"add":"remove"](t)}function v(e){const t={};for(const r of e)t[r.name]=r.value;return t}function T(e){a=e}
|
|
2
2
|
/**
|
|
3
3
|
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).
|
|
4
4
|
* Event dispatchers are functions that can take two arguments: `name` and `detail`.
|
|
@@ -33,17 +33,17 @@ const o=function(e,t,{bubbles:r=!1,cancelable:n=!1}={}){const i=document.createE
|
|
|
33
33
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
34
34
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
35
35
|
// function, guarantees this behavior.
|
|
36
|
-
const M=new Set;let
|
|
37
|
-
function
|
|
36
|
+
const M=new Set;let N=0;// Do *not* move this inside the flush() function
|
|
37
|
+
function I(){
|
|
38
38
|
// Do not reenter flush while dirty components are updated, as this can
|
|
39
39
|
// result in an infinite loop. Instead, let the inner flush handle it.
|
|
40
40
|
// Reentrancy is ok afterwards for bindings etc.
|
|
41
|
-
if(0!==
|
|
41
|
+
if(0!==N)return;const e=a;do{
|
|
42
42
|
// first, call beforeUpdate functions
|
|
43
43
|
// and update components
|
|
44
|
-
try{for(;
|
|
44
|
+
try{for(;N<H.length;){const e=H[N];N++,T(e),O(e.$$)}}catch(e){
|
|
45
45
|
// reset dirty state to not end up in a deadlocked state and then rethrow
|
|
46
|
-
throw H.length=0,
|
|
46
|
+
throw H.length=0,N=0,e}for(T(null),H.length=0,N=0;B.length;)B.pop()();
|
|
47
47
|
// then, once components are updated, call
|
|
48
48
|
// afterUpdate functions. This may cause
|
|
49
49
|
// subsequent updates...
|
|
@@ -55,19 +55,19 @@ M.add(t),t())}A.length=0}while(H.length);for(;S.length;)S.pop()();P=!1,M.clear()
|
|
|
55
55
|
*/const w=new Set;function R(e,t){const r=e.$$;null!==r.fragment&&(!function(e){const t=[],r=[];A.forEach((n=>-1===e.indexOf(n)?t.push(n):r.push(n))),r.forEach((e=>e())),A=t}(r.after_update),n(r.on_destroy),r.fragment&&r.fragment.d(t),
|
|
56
56
|
// TODO null out other refs, including component.$$ (but need to
|
|
57
57
|
// preserve final state?)
|
|
58
|
-
r.on_destroy=r.fragment=null,r.ctx=[])}function U(e,t){-1===e.$$.dirty[0]&&(H.push(e),P||(P=!0,L.then(
|
|
58
|
+
r.on_destroy=r.fragment=null,r.ctx=[])}function U(e,t){-1===e.$$.dirty[0]&&(H.push(e),P||(P=!0,L.then(I)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function D(o,s,h,c,l,u,p,m=[-1]){const g=a;T(o);const d=o.$$={fragment:null,ctx:[],
|
|
59
59
|
// state
|
|
60
60
|
props:u,update:e,not_equal:l,bound:r(),
|
|
61
61
|
// lifecycle
|
|
62
|
-
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(
|
|
62
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(g?g.$$.context:[])),
|
|
63
63
|
// everything else
|
|
64
|
-
callbacks:r(),dirty:m,skip_bound:!1,root:s.target||
|
|
64
|
+
callbacks:r(),dirty:m,skip_bound:!1,root:s.target||g.$$.root};p&&p(d.root);let b=!1;if(d.ctx=h?h(o,s.props||{},((e,t,...r)=>{const n=r.length?r[0]:t;return d.ctx&&l(d.ctx[e],d.ctx[e]=n)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](n),b&&U(o,e)),t})):[],d.update(),b=!0,n(d.before_update),
|
|
65
65
|
// `false` as a special case of no DOM component
|
|
66
|
-
|
|
66
|
+
d.fragment=!!c&&c(d.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);
|
|
67
67
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
68
|
-
|
|
68
|
+
d.fragment&&d.fragment.l(e),e.forEach(f)}else
|
|
69
69
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
70
|
-
|
|
70
|
+
d.fragment&&d.fragment.c();s.intro&&((E=o.$$.fragment)&&E.i&&(w.delete(E),E.i(y))),function(e,r,o,s){const{fragment:a,after_update:h}=e.$$;a&&a.m(r,o),s||
|
|
71
71
|
// onMount happens before the initial afterUpdate
|
|
72
72
|
C((()=>{const r=e.$$.on_mount.map(t).filter(i);
|
|
73
73
|
// if the component was destroyed immediately
|
|
@@ -76,13 +76,13 @@ C((()=>{const r=e.$$.on_mount.map(t).filter(i);
|
|
|
76
76
|
e.$$.on_destroy?e.$$.on_destroy.push(...r):
|
|
77
77
|
// Edge case - component was destroyed immediately,
|
|
78
78
|
// most likely as a result of a binding initialising
|
|
79
|
-
n(r),e.$$.on_mount=[]})),h.forEach(C)}(o,s.target,s.anchor,s.customElement),
|
|
79
|
+
n(r),e.$$.on_mount=[]})),h.forEach(C)}(o,s.target,s.anchor,s.customElement),I()}var E,y;T(g)}let G;"function"==typeof HTMLElement&&(G=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(i);
|
|
80
80
|
// @ts-ignore todo: improve typings
|
|
81
81
|
for(const e in this.$$.slotted)
|
|
82
82
|
// @ts-ignore todo: improve typings
|
|
83
83
|
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,r){this[e]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){R(this,1),this.$destroy=e}$on(t,r){
|
|
84
84
|
// TODO should this delegate to addEventListener?
|
|
85
|
-
if(!i(r))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(r),()=>{const e=n.indexOf(r);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}});const
|
|
85
|
+
if(!i(r))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(r),()=>{const e=n.indexOf(r);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}});const $=[];
|
|
86
86
|
/**
|
|
87
87
|
* Creates a `Readable` store that allows reading by subscription.
|
|
88
88
|
* @param value initial value
|
|
@@ -94,19 +94,19 @@ if(!i(r))return e;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return
|
|
|
94
94
|
* @param {StartStopNotifier=} start
|
|
95
95
|
*/
|
|
96
96
|
function x(t,r=e){let n;const i=new Set;function s(e){if(o(t,e)&&(t=e,n)){// store is ready
|
|
97
|
-
const e
|
|
97
|
+
const e=!$.length;for(const e of i)e[1](),$.push(e,t);if(e){for(let e=0;e<$.length;e+=2)$[e][0]($[e+1]);$.length=0}}}return{set:s,update:function(e){s(e(t))},subscribe:function(o,a=e){const h=[o,a];return i.add(h),1===i.size&&(n=r(s)||e),o(t),()=>{i.delete(h),0===i.size&&n&&(n(),n=null)}}}}function k(t,r,o){const s=!Array.isArray(t),a=s?[t]:t,h=r.length<2;return l=t=>{let o=!1;const l=[];let u=0,f=e;const p=()=>{if(u)return;f();const n=r(s?l[0]:l,t);h?t(n):f=i(n)?n:e},m=a.map(((e,t)=>c(e,(e=>{l[t]=e,u&=~(1<<t),o&&p()}),(()=>{u|=1<<t}))));return o=!0,p(),function(){n(m),f(),
|
|
98
98
|
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
|
99
99
|
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
|
100
100
|
// invoke this derived store.
|
|
101
101
|
o=!1}},{subscribe:x(o,l).subscribe};var l}var F=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===j}(e)}
|
|
102
102
|
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
103
|
-
(e)};var j="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function V(e,t){return!1!==t.clone&&t.isMergeableObject(e)?
|
|
103
|
+
(e)};var j="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function V(e,t){return!1!==t.clone&&t.isMergeableObject(e)?z((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function X(e,t,r){return e.concat(t).map((function(e){return V(e,r)}))}function K(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function W(e,t){try{return t in e}catch(e){return!1}}
|
|
104
104
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
105
|
-
function
|
|
106
|
-
})(e,i)||(W(e,i)&&r.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return
|
|
105
|
+
function Y(e,t,r){var n={};return r.isMergeableObject(e)&&K(e).forEach((function(t){n[t]=V(e[t],r)})),K(t).forEach((function(i){(function(e,t){return W(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t));// and also unsafe if they're nonenumerable.
|
|
106
|
+
})(e,i)||(W(e,i)&&r.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return z;var r=t.customMerge(e);return"function"==typeof r?r:z}(i,r)(e[i],t[i],r):n[i]=V(t[i],r))})),n}function z(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||X,r.isMergeableObject=r.isMergeableObject||F,
|
|
107
107
|
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
108
108
|
// implementations can use it. The caller may not replace it.
|
|
109
|
-
r.cloneUnlessOtherwiseSpecified=V;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):
|
|
109
|
+
r.cloneUnlessOtherwiseSpecified=V;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):Y(e,t,r):V(t,r)}z.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return z(e,r,t)}),{})};var Z=z,J=function(e,t){return J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},J(e,t)};function Q(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var q,ee,te,re=function(){return re=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},re.apply(this,arguments)};function ne(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}
|
|
110
110
|
/**
|
|
111
111
|
* Type Guards
|
|
112
112
|
*/
|
|
@@ -209,7 +209,7 @@ e[e.pound=7]="pound",
|
|
|
209
209
|
/**
|
|
210
210
|
* XML-like tag
|
|
211
211
|
*/
|
|
212
|
-
e[e.tag=8]="tag"}(ee||(ee={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(te||(te={}));var
|
|
212
|
+
e[e.tag=8]="tag"}(ee||(ee={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(te||(te={}));var ge=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,de=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
213
213
|
/**
|
|
214
214
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
215
215
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
@@ -221,7 +221,7 @@ e[e.tag=8]="tag"}(ee||(ee={})),function(e){e[e.number=0]="number",e[e.dateTime=1
|
|
|
221
221
|
* @public
|
|
222
222
|
* @param skeleton skeleton string
|
|
223
223
|
*/
|
|
224
|
-
function be(e){var t={};return e.replace(
|
|
224
|
+
function be(e){var t={};return e.replace(de,(function(e){var r=e.length;switch(e[0]){
|
|
225
225
|
// Era
|
|
226
226
|
case"G":t.era=4===r?"long":5===r?"narrow":"short";break;
|
|
227
227
|
// Year
|
|
@@ -255,7 +255,7 @@ case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
|
255
255
|
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
256
256
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}
|
|
257
257
|
// @generated from regex-gen.ts
|
|
258
|
-
var
|
|
258
|
+
var Ee=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var ye=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ve=/^(@+)?(\+|#+)?[rs]?$/g,Te=/(\*)(0+)|(#+)(0+)|(0+)/g,_e=/^(0+)$/;function He(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ve,(function(e,r,n){
|
|
259
259
|
// @@@ case
|
|
260
260
|
return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""})),t}function Be(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Ae(e){
|
|
261
261
|
// Engineering
|
|
@@ -268,11 +268,11 @@ case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";
|
|
|
268
268
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
269
269
|
case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Te,(function(e,r,n,i,o,s){if(r)t.minimumIntegerDigits=n.length;else{if(i&&o)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
|
270
270
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
271
|
-
if(_e.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(
|
|
271
|
+
if(_e.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(ye.test(i.stem)){
|
|
272
272
|
// Precision
|
|
273
273
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
274
274
|
// precision-integer case
|
|
275
|
-
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(
|
|
275
|
+
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(ye,(function(e,r,n,i,o,s){
|
|
276
276
|
// .000* case (before ICU67 it was .000+)
|
|
277
277
|
return"*"===n?t.minimumFractionDigits=r.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&s?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""}));var o=i.options[0];
|
|
278
278
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
@@ -302,35 +302,35 @@ e.hourCycles.length&&(
|
|
|
302
302
|
// @ts-ignore
|
|
303
303
|
t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
|
304
304
|
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
305
|
-
var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(Ce[r||""]||Ce[n||""]||Ce["".concat(n,"-001")]||Ce["001"])[0]}var
|
|
305
|
+
var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(Ce[r||""]||Ce[n||""]||Ce["".concat(n,"-001")]||Ce["001"])[0]}var Ne=new RegExp("^".concat(ge.source,"*")),Ie=new RegExp("".concat(ge.source,"*$"));function Oe(e,t){return{start:e,end:t}}
|
|
306
306
|
// #region Ponyfills
|
|
307
307
|
// Consolidate these variables up top for easier toggling during debugging
|
|
308
|
-
var we=!!String.prototype.startsWith,Re=!!String.fromCodePoint,Ue=!!Object.fromEntries
|
|
308
|
+
var we=!!String.prototype.startsWith,Re=!!String.fromCodePoint,Ue=!!Object.fromEntries,De=!!String.prototype.codePointAt,Ge=!!String.prototype.trimStart,$e=!!String.prototype.trimEnd,xe=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ke=!0;try{
|
|
309
309
|
/**
|
|
310
310
|
* legacy Edge or Xbox One browser
|
|
311
311
|
* Unicode flag support: supported
|
|
312
312
|
* Pattern_Syntax support: not supported
|
|
313
313
|
* See https://github.com/formatjs/formatjs/issues/2822
|
|
314
314
|
*/
|
|
315
|
-
ke="a"===(null===(Pe=
|
|
315
|
+
ke="a"===(null===(Pe=ze("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Pe?void 0:Pe[0])}catch(e){ke=!1}var Fe,je=we?// Native
|
|
316
316
|
function(e,t,r){return e.startsWith(t,r)}:// For IE11
|
|
317
317
|
function(e,t,r){return e.slice(r,r+t.length)===t},Ve=Re?String.fromCodePoint:// IE11
|
|
318
318
|
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",i=e.length,o=0;i>o;){if((r=e[o++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},Xe=
|
|
319
319
|
// native
|
|
320
320
|
Ue?Object.fromEntries:// Ponyfill
|
|
321
|
-
function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t},Ke
|
|
321
|
+
function(e){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t},Ke=De?// Native
|
|
322
322
|
function(e,t){return e.codePointAt(t)}:// IE 11
|
|
323
|
-
function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,i=e.charCodeAt(t);return i<55296||i>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},We=
|
|
323
|
+
function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,i=e.charCodeAt(t);return i<55296||i>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},We=Ge?// Native
|
|
324
324
|
function(e){return e.trimStart()}:// Ponyfill
|
|
325
|
-
function(e){return e.replace(
|
|
325
|
+
function(e){return e.replace(Ne,"")},Ye=$e?// Native
|
|
326
326
|
function(e){return e.trimEnd()}:// Ponyfill
|
|
327
|
-
function(e){return e.replace(
|
|
327
|
+
function(e){return e.replace(Ie,"")};
|
|
328
328
|
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
329
|
-
function
|
|
329
|
+
function ze(e,t){return new RegExp(e,t)}
|
|
330
330
|
// #endregion
|
|
331
331
|
if(ke){
|
|
332
332
|
// Native
|
|
333
|
-
var Ze=
|
|
333
|
+
var Ze=ze("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Fe=function(e,t){var r;return Ze.lastIndex=t,null!==(r=Ze.exec(e)[1])&&void 0!==r?r:""}}else
|
|
334
334
|
// IE11
|
|
335
335
|
Fe=function(e,t){for(var r=[];;){var n=Ke(e,t);if(void 0===n||qe(n)||et(n))break;r.push(n),t+=n>=65536?2:1}return Ve.apply(void 0,r)};var Je=/** @class */function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var i=this.char();if(123/* `{` */===i){if((o=this.parseArgument(e,r)).err)return o;n.push(o.val)}else{if(125/* `}` */===i&&e>0)break;if(35/* `#` */!==i||"plural"!==t&&"selectordinal"!==t){if(60/* `<` */===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(q.UNMATCHED_CLOSING_TAG,Oe(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===i&&!this.ignoreTag&&Qe(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;n.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;n.push(o.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:ee.pound,location:Oe(s,this.clonePosition())})}}}return{val:n,err:null}},
|
|
336
336
|
/**
|
|
@@ -409,7 +409,7 @@ return this.error(q.EXPECT_ARGUMENT_TYPE,Oe(o,a));case"number":case"date":case"t
|
|
|
409
409
|
// Parse this range:
|
|
410
410
|
// {name, number, style}
|
|
411
411
|
// ^-------^
|
|
412
|
-
this.bumpSpace();var h=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(p=
|
|
412
|
+
this.bumpSpace();var h=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(p=Ye(b.val)).length)return this.error(q.EXPECT_ARGUMENT_STYLE,Oe(this.clonePosition(),this.clonePosition()));h={style:p,styleLocation:Oe(c,this.clonePosition())}}if((E=this.tryParseArgumentClose(n)).err)return E;var l=Oe(n,this.clonePosition());
|
|
413
413
|
// Extract style or skeleton
|
|
414
414
|
if(h&&je(null==h?void 0:h.style,"::",0)){
|
|
415
415
|
// Skeleton starts with `::`.
|
|
@@ -430,9 +430,9 @@ var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.err
|
|
|
430
430
|
// or the first option:
|
|
431
431
|
// {name, plural, one {...} other {...}}
|
|
432
432
|
// ^--^
|
|
433
|
-
var
|
|
433
|
+
var g=this.parseIdentifierIfPossible(),d=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Oe(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(q.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,q.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;
|
|
434
434
|
// Parse another identifier for option parsing
|
|
435
|
-
this.bumpSpace(),
|
|
435
|
+
this.bumpSpace(),g=this.parseIdentifierIfPossible(),d=b.val}var E,y=this.tryParsePluralOrSelectOptions(e,s,t,g);if(y.err)return y;if((E=this.tryParseArgumentClose(n)).err)return E;var v=Oe(n,this.clonePosition());return"select"===s?{val:{type:ee.select,value:r,options:Xe(y.val),location:v},err:null}:{val:{type:ee.plural,value:r,options:Xe(y.val),offset:d,pluralType:"plural"===s?"cardinal":"ordinal",location:v},err:null};default:return this.error(q.INVALID_ARGUMENT_TYPE,Oe(o,a))}},e.prototype.tryParseArgumentClose=function(e){
|
|
436
436
|
// Parse: {value, number, ::currency/GBP }
|
|
437
437
|
return this.isEOF()||125/* `}` */!==this.char()?this.error(q.EXPECT_ARGUMENT_CLOSING_BRACE,Oe(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
438
438
|
/**
|
|
@@ -443,7 +443,7 @@ e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePos
|
|
|
443
443
|
// Find the end of the quoted literal text.
|
|
444
444
|
this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(q.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Oe(r,this.clonePosition()));this.bump();break;case 123/* `{` */:e+=1,this.bump();break;case 125/* `}` */:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");
|
|
445
445
|
// Parse the skeleton
|
|
446
|
-
for(var t=[],r=0,n=e.split(
|
|
446
|
+
for(var t=[],r=0,n=e.split(Ee).filter((function(e){return e.length>0}));r<n.length;r++){var i=n[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,h=s;a<h.length;a++)if(0===h[a].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:s})}return t}(e)}catch(e){return this.error(q.INVALID_NUMBER_SKELETON,t)}return{val:{type:te.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?Le(r):{}},err:null}},
|
|
447
447
|
/**
|
|
448
448
|
* @param nesting_level The current nesting level of messages.
|
|
449
449
|
* This can be positive when parsing message fragment in select or plural argument options.
|
|
@@ -545,9 +545,9 @@ e.MISSING_VALUE="MISSING_VALUE",
|
|
|
545
545
|
// When value supplied is invalid
|
|
546
546
|
e.INVALID_VALUE="INVALID_VALUE",
|
|
547
547
|
// When we need specific Intl API but it's not available
|
|
548
|
-
e.MISSING_INTL_API="MISSING_INTL_API"}(lt||(lt={}));var pt,mt=/** @class */function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.code=r,i.originalMessage=n,i}return Q(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),
|
|
548
|
+
e.MISSING_INTL_API="MISSING_INTL_API"}(lt||(lt={}));var pt,mt=/** @class */function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.code=r,i.originalMessage=n,i}return Q(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),gt=/** @class */function(e){function t(t,r,n,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),lt.INVALID_VALUE,i)||this}return Q(t,e),t}(mt),dt=/** @class */function(e){function t(t,r,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(r),lt.INVALID_VALUE,n)||this}return Q(t,e),t}(mt),bt=/** @class */function(e){function t(t,r){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(r,'"'),lt.MISSING_VALUE,r)||this}return Q(t,e),t}(mt);function Et(e){return"function"==typeof e}
|
|
549
549
|
// TODO(skeleton): add skeleton support
|
|
550
|
-
function
|
|
550
|
+
function yt(e,t,r,n,i,o,
|
|
551
551
|
// For debugging
|
|
552
552
|
s){
|
|
553
553
|
// Hot path for straight simple msg translations
|
|
@@ -562,7 +562,7 @@ if(!i||!(u in i))throw new bt(u,s);var f=i[u];if(oe(l))f&&"string"!=typeof f&&"n
|
|
|
562
562
|
// Recursively format plural and select parts' option — which can be a
|
|
563
563
|
// nested pattern structure. The choosing of the option to use is
|
|
564
564
|
// abstracted-by and delegated-to the part helper object.
|
|
565
|
-
if(ae(l)){var p="string"==typeof l.style?n.date[l.style]:me(l.style)?l.style.parsedOptions:void 0;a.push({type:pt.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(he(l)){p="string"==typeof l.style?n.time[l.style]:me(l.style)?l.style.parsedOptions:n.time.medium;a.push({type:pt.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(se(l)){(p="string"==typeof l.style?n.number[l.style]:pe(l.style)?l.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:pt.literal,value:r.getNumberFormat(t,p).format(f)})}else{if(fe(l)){var m=l.children,
|
|
565
|
+
if(ae(l)){var p="string"==typeof l.style?n.date[l.style]:me(l.style)?l.style.parsedOptions:void 0;a.push({type:pt.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(he(l)){p="string"==typeof l.style?n.time[l.style]:me(l.style)?l.style.parsedOptions:n.time.medium;a.push({type:pt.literal,value:r.getDateTimeFormat(t,p).format(f)})}else if(se(l)){(p="string"==typeof l.style?n.number[l.style]:pe(l.style)?l.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:pt.literal,value:r.getNumberFormat(t,p).format(f)})}else{if(fe(l)){var m=l.children,g=l.value,d=i[g];if(!Et(d))throw new dt(g,"function",s);var b=d(yt(m,t,r,n,i,o).map((function(e){return e.value})));Array.isArray(b)||(b=[b]),a.push.apply(a,b.map((function(e){return{type:"string"==typeof e?pt.literal:pt.object,value:e}})))}if(ce(l)){if(!(E=l.options[f]||l.options.other))throw new gt(l.value,f,Object.keys(l.options),s);a.push.apply(a,yt(E.value,t,r,n,i))}else if(le(l)){var E;if(!(E=l.options["=".concat(f)])){if(!Intl.PluralRules)throw new mt('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',lt.MISSING_INTL_API,s);var y=r.getPluralRules(t,{type:l.pluralType}).select(f-(l.offset||0));E=l.options[y]||l.options.other}if(!E)throw new gt(l.value,f,Object.keys(l.options),s);a.push.apply(a,yt(E.value,t,r,n,i,f-(l.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var r=e[e.length-1];return r&&r.type===pt.literal&&t.type===pt.literal?r.value+=t.value:e.push(t),e}),[])}(a)}
|
|
566
566
|
/*
|
|
567
567
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
568
568
|
Copyrights licensed under the New BSD License.
|
|
@@ -571,7 +571,7 @@ if(ae(l)){var p="string"==typeof l.style?n.date[l.style]:me(l.style)?l.style.par
|
|
|
571
571
|
// -- MessageFormat --------------------------------------------------------
|
|
572
572
|
function vt(e,t){return t?Object.keys(e).reduce((function(r,n){var i,o;return r[n]=(i=e[n],(o=t[n])?re(re(re({},i||{}),o||{}),Object.keys(i).reduce((function(e,t){return e[t]=re(re({},i[t]),o[t]||{}),e}),{})):i),r}),re({},e)):e}function Tt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(pt||(pt={}));var _t=/** @class */function(){function e(t,r,n,i){var o,s=this;if(void 0===r&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);
|
|
573
573
|
// Hot path for straight simple msg translations
|
|
574
|
-
if(1===t.length)return t[0].value;var r=t.reduce((function(e,t){return e.length&&t.type===pt.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return
|
|
574
|
+
if(1===t.length)return t[0].value;var r=t.reduce((function(e,t){return e.length&&t.type===pt.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return yt(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},
|
|
575
575
|
// Defined first because it's used to build the format pattern.
|
|
576
576
|
this.locales=r,this.resolvedLocale=e.resolveLocale(r),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
577
577
|
// Parse string messages into an AST.
|
|
@@ -582,13 +582,13 @@ this.formats=vt(e.formats,n),this.formatters=i&&i.formatters||(void 0===(o=this.
|
|
|
582
582
|
// Default format options used as the prototype of the `formats` provided to the
|
|
583
583
|
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
584
584
|
// and Intl.DateTimeFormat instances.
|
|
585
|
-
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ht={},Bt=(e,t,r)=>r?(t in Ht||(Ht[t]={}),e in Ht[t]||(Ht[t][e]=r),r):r,At=(e,t)=>{if(null==t)return;if(t in Ht&&e in Ht[t])return Ht[t][e];const r=Zt(t);for(let n=0;n<r.length;n++){const i=Ct(r[n],e);if(i)return Bt(e,t,i)}};let St;const Lt=x({});function Pt(e){return e in St}function Ct(e,t){if(!Pt(e))return null;const r=function(e){return St[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let e=0;e<r.length;e++)if("object"==typeof n){if(e>0){const t=r.slice(e,r.length).join(".");if(t in n){n=n[t];break}}n=n[r[e]]}else n=void 0;return n}(r,t)}function Mt(e,...t){delete Ht[e],Lt.update((r=>(r[e]=Z.all([r[e]||{},...t]),r)))}k([Lt],(([e])=>Object.keys(e))),Lt.subscribe((e=>St=e));const
|
|
585
|
+
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();const Ht={},Bt=(e,t,r)=>r?(t in Ht||(Ht[t]={}),e in Ht[t]||(Ht[t][e]=r),r):r,At=(e,t)=>{if(null==t)return;if(t in Ht&&e in Ht[t])return Ht[t][e];const r=Zt(t);for(let n=0;n<r.length;n++){const i=Ct(r[n],e);if(i)return Bt(e,t,i)}};let St;const Lt=x({});function Pt(e){return e in St}function Ct(e,t){if(!Pt(e))return null;const r=function(e){return St[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const r=t.split(".");let n=e;for(let e=0;e<r.length;e++)if("object"==typeof n){if(e>0){const t=r.slice(e,r.length).join(".");if(t in n){n=n[t];break}}n=n[r[e]]}else n=void 0;return n}(r,t)}function Mt(e,...t){delete Ht[e],Lt.update((r=>(r[e]=Z.all([r[e]||{},...t]),r)))}k([Lt],(([e])=>Object.keys(e))),Lt.subscribe((e=>St=e));const Nt={};function It(e){return Nt[e]}function Ot(e){return null!=e&&Zt(e).some((e=>{var t;return null==(t=It(e))?void 0:t.size}))}function wt(e,t){const r=Promise.all(t.map((t=>(function(e,t){Nt[e].delete(t),0===Nt[e].size&&delete Nt[e]}(e,t),t().then((e=>e.default||e))))));return r.then((t=>Mt(e,...t)))}const Rt={};function Ut(e){if(!Ot(e))return e in Rt?Rt[e]:Promise.resolve();const t=function(e){return Zt(e).map((e=>{const t=It(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Rt[e]=Promise.all(t.map((([e,t])=>wt(e,t)))).then((()=>{if(Ot(e))return Ut(e);delete Rt[e]})),Rt[e]}const Dt={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Gt(){return Dt}const $t=x(!1);var xt=Object.defineProperty,kt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable,Kt=(e,t,r)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;let Wt;const Yt=x(null);function zt(e){return e.split("-").map(((e,t,r)=>r.slice(0,t+1).join("-"))).reverse()}function Zt(e,t=Gt().fallbackLocale){const r=zt(e);return t?[...new Set([...r,...zt(t)])]:r}function Jt(){return null!=Wt?Wt:void 0}Yt.subscribe((e=>{Wt=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const Qt=(qt=((e,t)=>{for(var r in t||(t={}))Vt.call(t,r)&&Kt(e,r,t[r]);if(jt)for(var r of jt(t))Xt.call(t,r)&&Kt(e,r,t[r]);return e})({},Yt),kt(qt,Ft({set:e=>{if(e&&function(e){if(null==e)return;const t=Zt(e);for(let e=0;e<t.length;e++){const r=t[e];if(Pt(r))return r}}(e)&&Ot(e)){const{loadingDelay:t}=Gt();let r;return"undefined"!=typeof window&&null!=Jt()&&t?r=window.setTimeout((()=>$t.set(!0)),t):$t.set(!0),Ut(e).then((()=>{Yt.set(e)})).finally((()=>{clearTimeout(r),$t.set(!1)}))}return Yt.set(e)}})));var qt;const er=e=>{const t=Object.create(null);return r=>{const n=JSON.stringify(r);return n in t?t[n]:t[n]=e(r)}};var tr=Object.defineProperty,rr=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,ir=Object.prototype.propertyIsEnumerable,or=(e,t,r)=>t in e?tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sr=(e,t)=>{for(var r in t||(t={}))nr.call(t,r)&&or(e,r,t[r]);if(rr)for(var r of rr(t))ir.call(t,r)&&or(e,r,t[r]);return e},ar=(e,t)=>{var r={};for(var n in e)nr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&rr)for(var n of rr(e))t.indexOf(n)<0&&ir.call(e,n)&&(r[n]=e[n]);return r};const hr=(e,t)=>{const{formats:r}=Gt();if(e in r&&t in r[e])return r[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},cr=er((e=>{var t=e,{locale:r,format:n}=t,i=ar(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(i=hr("number",n)),new Intl.NumberFormat(r,i)})),lr=er((e=>{var t=e,{locale:r,format:n}=t,i=ar(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?i=hr("date",n):0===Object.keys(i).length&&(i=hr("date","short")),new Intl.DateTimeFormat(r,i)})),ur=er((e=>{var t=e,{locale:r,format:n}=t,i=ar(t,["locale","format"]);if(null==r)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?i=hr("time",n):0===Object.keys(i).length&&(i=hr("time","short")),new Intl.DateTimeFormat(r,i)})),fr=er((
|
|
586
586
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
587
|
-
(e,t=Jt())=>new _t(e,t,
|
|
588
|
-
/* src/CashierMethodsList.svelte generated by Svelte v3.59.2 */function Tr(e,t,r){const n=e.slice();return n[
|
|
589
|
-
// (
|
|
590
|
-
function _r(e){let t,r,i,o,s,a,c,v,T,_,H,B,A,S,L,P,C,M,I,
|
|
591
|
-
return e[
|
|
587
|
+
(e,t=Jt())=>new _t(e,t,Gt().formats,{ignoreTag:Gt().ignoreTag}))),pr=(e,t={})=>{var r,n,i,o;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:h=Jt(),default:c}=s;if(null==h)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let l=At(e,h);if(l){if("string"!=typeof l)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof l}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),l}else l=null!=(o=null!=(i=null==(n=(r=Gt()).handleMissingMessage)?void 0:n.call(r,{locale:h,id:e,defaultValue:c}))?i:c)?o:e;if(!a)return l;let u=l;try{u=fr(l,h).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return u},mr=(e,t)=>((e={})=>{var t=e,{locale:r=Jt()}=t,n=ar(t,["locale"]);return ur(sr({locale:r},n))})(t).format(e),gr=(e,t)=>((e={})=>{var t=e,{locale:r=Jt()}=t,n=ar(t,["locale"]);return lr(sr({locale:r},n))})(t).format(e),dr=(e,t)=>((e={})=>{var t=e,{locale:r=Jt()}=t,n=ar(t,["locale"]);return cr(sr({locale:r},n))})(t).format(e),br=(e,t=Jt())=>At(e,t),Er=k([Qt,Lt],(()=>pr));function yr(e,t){Mt(e,t)}k([Qt],(()=>mr)),k([Qt],(()=>gr)),k([Qt],(()=>dr)),k([Qt,Lt],(()=>br));const vr={en:{generalMin:"Min",generalMax:"Max"},uk:{generalMin:"Мін",generalMax:"Макс"}};
|
|
588
|
+
/* src/CashierMethodsList.svelte generated by Svelte v3.59.2 */function Tr(e,t,r){const n=e.slice();return n[26]=t[r],n[28]=r,n}
|
|
589
|
+
// (102:2) {#each paymentMethods as payMeth, index}
|
|
590
|
+
function _r(e){let t,r,i,o,s,a,c,v,T,_,H,B,A,S,L,P,C,M,N,I,O,w,R,U,D,G=/*payMeth*/(e[26].Label||/*payMeth*/e[26].Name)+"",$=/*payMeth*/e[26].LimitString+"",x=!1;function k(){/*click_handler*/
|
|
591
|
+
return e[14](/*payMeth*/e[26])}return R=function(e){let t;return{
|
|
592
592
|
/* push */p(...r){t=r,t.forEach((t=>e.push(t)))},
|
|
593
|
-
/* remove */r(){t.forEach((t=>e.splice(e.indexOf(t),1)))}}}(/*$$binding_groups*/e[
|
|
593
|
+
/* remove */r(){t.forEach((t=>e.splice(e.indexOf(t),1)))}}}(/*$$binding_groups*/e[13][0]),{c(){t=p("div"),r=p("div"),i=p("div"),o=p("img"),c=g(),v=p("div"),T=p("div"),_=p("span"),H=m(G),B=g(),A=p("div"),S=p("span"),L=m($),P=g(),C=p("div"),M=p("input"),I=g(),O=p("label"),w=g(),h(o.src,s=/*payMeth*/e[26].LogoUrl)||b(o,"src",s),b(o,"alt",a=/*payMeth*/e[26].Label),b(i,"class","MethodLogo"),b(T,"class","MethodTitle"),b(S,"class","Limits"),b(A,"class","MethodLimits"),b(v,"class","MethodInfo"),b(r,"class","LogoSelector"),b(M,"type","radio"),b(M,"id",/*index*/e[28]),b(M,"name","radioGroup"),M.__value=N=/*payMeth*/e[26].Name,M.value=M.__value,b(O,"for",/*index*/e[28]),b(C,"class","RadioButtonSelector"),b(t,"class","SelectorWrapper"),y(t,"checked",/*selectedPaymentMethod*/e[2]===/*payMeth*/e[26].Name),R.p(M)},m(n,s){u(n,t,s),l(t,r),l(r,i),l(i,o),l(r,c),l(r,v),l(v,T),l(T,_),l(_,H),l(v,B),l(v,A),l(A,S),l(S,L),l(t,P),l(t,C),l(C,M),M.checked=M.__value===/*paymethnames*/e[0],l(C,I),l(C,O),l(t,w),U||(D=[d(M,"change",/*input_change_handler*/e[12]),d(t,"click",k),d(t,"keyup",Br)],U=!0)},p(r,n){e=r,/*paymentMethods*/2&n&&!h(o.src,s=/*payMeth*/e[26].LogoUrl)&&b(o,"src",s),/*paymentMethods*/2&n&&a!==(a=/*payMeth*/e[26].Label)&&b(o,"alt",a),/*paymentMethods*/2&n&&G!==(G=/*payMeth*/(e[26].Label||/*payMeth*/e[26].Name)+"")&&E(H,G),/*paymentMethods*/2&n&&$!==($=/*payMeth*/e[26].LimitString+"")&&E(L,$),/*paymentMethods*/2&n&&N!==(N=/*payMeth*/e[26].Name)&&(M.__value=N,M.value=M.__value,x=!0),(x||/*paymethnames, paymentMethods*/3&n)&&(M.checked=M.__value===/*paymethnames*/e[0]),/*selectedPaymentMethod, paymentMethods*/6&n&&y(t,"checked",/*selectedPaymentMethod*/e[2]===/*payMeth*/e[26].Name)},d(e){e&&f(t),R.r(),U=!1,n(D)}}}function Hr(t){let r,n=/*paymentMethods*/t[1],i=[];for(let e=0;e<n.length;e+=1)i[e]=_r(Tr(t,n,e));return{c(){r=p("div");for(let e=0;e<i.length;e+=1)i[e].c();this.c=e,b(r,"class","CashierMethodItem")},m(e,t){u(e,r,t);for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(r,null)},p(e,[t]){if(/*selectedPaymentMethod, paymentMethods, selectPayMeth, paymethnames*/15&t){let o;for(n=/*paymentMethods*/e[1],o=0;o<n.length;o+=1){const s=Tr(e,n,o);i[o]?i[o].p(s,t):(i[o]=_r(s),i[o].c(),i[o].m(r,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=n.length}},i:e,o:e,d(e){e&&f(r),function(e,t){for(let r=0;r<e.length;r+=1)e[r]&&e[r].d(t)}(i,e)}}}const Br=()=>{};function Ar(e,t,r){let n;var i,o;i=Er,o=e=>r(17,n=e),e.$$.on_destroy.push(c(i,o));let s,{lang:a="en"}=t,{endpoint:h}=t,{session:l}=t,{customerid:u}=t,{currency:f}=t,{translationurl:p=""}=t,{clientstyling:m=""}=t,{clientstylingurl:g=""}=t,d=[],b=[];_();Object.keys(vr).forEach((e=>{yr(e,vr[e])}));const E=()=>{var e;e=a,Qt.set(e)},y=e=>{const t=n("generalMin"),r=n("generalMax"),i=e.DisplayCurrency.MinAmountLimit?`${t}: ${e.DisplayCurrency.MinAmountLimit} ${e.DisplayCurrency.Name}`:"",o=e.DisplayCurrency.MaxAmountLimit?`${r}: ${e.DisplayCurrency.MaxAmountLimit} ${e.DisplayCurrency.Name}`:"";return`${i} ${e.DisplayCurrency.MinAmountLimit&&e.DisplayCurrency.MaxAmountLimit?"/":""} ${o}`},v=e=>{r(2,s=e.Name),dispatchEvent(new CustomEvent("selectPayMeth",{detail:e,bubbles:!0,cancelable:!0,composed:!0}))};return e.$$set=e=>{"lang"in e&&r(4,a=e.lang),"endpoint"in e&&r(5,h=e.endpoint),"session"in e&&r(6,l=e.session),"customerid"in e&&r(7,u=e.customerid),"currency"in e&&r(8,f=e.currency),"translationurl"in e&&r(9,p=e.translationurl),"clientstyling"in e&&r(10,m=e.clientstyling),"clientstylingurl"in e&&r(11,g=e.clientstylingurl)},e.$$.update=()=>{/*endpoint, session, customerid*/224&e.$$.dirty&&h&&l&&u&&(()=>{const e=new URL(`${h}/v1/player/${u}/payment/GetPaymentMetadata`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json"),t.append("X-Payment-Session-Token",`${l}`);const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({Currency:f})};fetch(e,n).then((e=>e.json())).then((e=>{r(1,b=e.PaymentMethods.PaymentMethods.map((e=>Object.assign(Object.assign({},e),{LimitString:y(e),LogoUrl:e.Logos&&e.Logos[0].LogoUrl?`https:${e.Logos[0].LogoUrl}`:""}))))}))})(),/*lang*/16&e.$$.dirty&&a&&E(),/*translationurl*/512&e.$$.dirty&&p&&(()=>{if(p)fetch(p).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{yr(t,e[t])}))})).catch((e=>{console.log(e)}))})(),e.$$.dirty,e.$$.dirty},[d,b,s,v,a,h,l,u,f,p,m,g,function(){d=this.__value,r(0,d)},[[]],e=>v(e)]}class Sr extends G{constructor(e){super();const t=document.createElement("style");t.textContent='*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.CashierMethodItem{display:flex;flex-direction:column;gap:10px}.CashierMethodItem .SelectorWrapper{display:flex;flex-direction:row;align-items:center;justify-content:space-between;cursor:pointer;position:relative;height:71px;width:390px;background:var(--mm-selector-background-color, #F8F9FA);box-shadow:0 0 4px rgba(0, 0, 0, 0.25);box-sizing:border-box;border-radius:5px;padding:1% 1% 1% 2%}.CashierMethodItem .SelectorWrapper .LogoSelector{width:calc(100% - 19px);overflow:hidden;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.CashierMethodItem .SelectorWrapper .MethodLogo{margin-right:19px;width:82px;height:47px;border:1px solid var(--mm-selector-label-color, #CED4DA);box-sizing:content-box;border-radius:2px}.CashierMethodItem .SelectorWrapper .MethodLogo img{width:inherit;height:inherit}.CashierMethodItem .SelectorWrapper .MethodInfo{display:flex;flex-direction:column;width:calc(100% - 70px);gap:8px}.CashierMethodItem .SelectorWrapper .MethodLimits{height:16px;display:flex;flex-direction:row;align-items:center}.CashierMethodItem .SelectorWrapper .MethodLimits .Limits{max-width:100%;white-space:nowrap;font-size:14px;color:var(--mm-selector-limits-color, #495057);font-weight:400;font-style:normal}.CashierMethodItem .SelectorWrapper .RadioButtonSelector{position:static;height:30px;width:30px}.CashierMethodItem .SelectorWrapper .RadioButtonSelector input{height:0;width:revert;padding:0;border:none;display:none}.CashierMethodItem .SelectorWrapper .RadioButtonSelector label{pointer-events:none;position:relative;cursor:pointer;line-height:20px;display:block;color:var(--mm-selector-label-color, #CED4DA)}.CashierMethodItem .SelectorWrapper .RadioButtonSelector label::before{left:0;content:"";position:absolute;top:0;width:30px;height:30px;border:3px solid var(--mm-selector-label-color, #CED4DA);border-radius:100%;background:var(--emfe-w-color-white, #FFFFFF);box-sizing:border-box}.CashierMethodItem .SelectorWrapper .RadioButtonSelector label::after{left:6px;opacity:1;content:"";width:18px;height:18px;background:var(--mm-selector-color-selected, #388D79);position:absolute;top:6px;border-radius:100%;transition:all 0.2s ease}.CashierMethodItem .SelectorWrapper.checked{border:1px solid var(--mm-selector-color-selected, #388D79)}.CashierMethodItem .SelectorWrapper.checked input+label:after{opacity:1}.CashierMethodItem .SelectorWrapper:not(.checked) input+label:after{opacity:0}',this.shadowRoot.appendChild(t),D(this,{target:this.shadowRoot,props:v(this.attributes),customElement:!0},Ar,Hr,o,{lang:4,endpoint:5,session:6,customerid:7,currency:8,translationurl:9,clientstyling:10,clientstylingurl:11},null),e&&(e.target&&u(e.target,this,e.anchor),e.props&&(this.$set(e.props),I()))}static get observedAttributes(){return["lang","endpoint","session","customerid","currency","translationurl","clientstyling","clientstylingurl"]}get lang(){return this.$$.ctx[4]}set lang(e){this.$$set({lang:e}),I()}get endpoint(){return this.$$.ctx[5]}set endpoint(e){this.$$set({endpoint:e}),I()}get session(){return this.$$.ctx[6]}set session(e){this.$$set({session:e}),I()}get customerid(){return this.$$.ctx[7]}set customerid(e){this.$$set({customerid:e}),I()}get currency(){return this.$$.ctx[8]}set currency(e){this.$$set({currency:e}),I()}get translationurl(){return this.$$.ctx[9]}set translationurl(e){this.$$set({translationurl:e}),I()}get clientstyling(){return this.$$.ctx[10]}set clientstyling(e){this.$$set({clientstyling:e}),I()}get clientstylingurl(){return this.$$.ctx[11]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),I()}}return!customElements.get("cashier-methods-list")&&customElements.define("cashier-methods-list",Sr),Sr}));
|
|
594
594
|
//# sourceMappingURL=cashier-methods-list.js.map
|