@everymatrix/cashier-method-details 1.27.0 → 1.27.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1 -0
- package/dist/cashier-method-details.js +251 -223
- package/dist/cashier-method-details.js.map +1 -1
- package/package.json +2 -2
- package/src/CashierMethodDetails.svelte +172 -133
@@ -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
|
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 n(){return Object.create(null)}function r(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;function a(e,t){return s||(s=document.createElement("a")),s.href=t,e===s.href}function l(t,...n){if(null==t)return e;const r=t.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}function c(e,t,n){e.$$.on_destroy.push(l(t,n))}const u="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function h(e,t){e.appendChild(t)}function p(e,t,n){e.insertBefore(t,n||null)}function d(e){e.parentNode&&e.parentNode.removeChild(e)}function f(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function m(e){return document.createElement(e)}function g(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function y(e){return document.createTextNode(e)}function b(){return y(" ")}function v(){return y("")}function E(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function w(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function T(e,t,n){t in e?e[t]="boolean"==typeof e[t]&&""===n||n:w(e,t,n)}function C(e){return""===e?null:+e}function x(e,t){t=""+t,e.data!==t&&(e.data=t)}function _(e,t){e.value=null==t?"":t}function B(e,t,n){e.classList[n?"add":"remove"](t)}function L(e){const t={};for(const n of e)t[n.name]=n.value;return t}let A;function P(e){A=e}function H(){if(!A)throw new Error("Function called outside component initialization");return A}
|
2
2
|
/**
|
3
3
|
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
4
4
|
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
@@ -20,10 +20,10 @@
|
|
20
20
|
*
|
21
21
|
* https://svelte.dev/docs#run-time-svelte-createeventdispatcher
|
22
22
|
*/
|
23
|
-
function
|
23
|
+
function S(){const e=H();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){
|
24
24
|
// TODO are there situations where events could be dispatched
|
25
25
|
// in a server (non-DOM) environment?
|
26
|
-
const
|
26
|
+
const o=function(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,r,t),i}(t,n,{cancelable:r});return i.slice().forEach((t=>{t.call(e,o)})),!o.defaultPrevented}return!0}}const M=[],R=[];let k=[];const O=[],I=Promise.resolve();let $=!1;function N(e){k.push(e)}
|
27
27
|
// flush() calls callbacks in this order:
|
28
28
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
29
29
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
@@ -42,61 +42,61 @@ const i=function(e,t,{bubbles:r=!1,cancelable:n=!1}={}){const o=document.createE
|
|
42
42
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
43
43
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
44
44
|
// function, guarantees this behavior.
|
45
|
-
const
|
45
|
+
const D=new Set;let F=0;// Do *not* move this inside the flush() function
|
46
46
|
function U(){
|
47
47
|
// Do not reenter flush while dirty components are updated, as this can
|
48
48
|
// result in an infinite loop. Instead, let the inner flush handle it.
|
49
49
|
// Reentrancy is ok afterwards for bindings etc.
|
50
|
-
if(0!==F)return;const e=
|
50
|
+
if(0!==F)return;const e=A;do{
|
51
51
|
// first, call beforeUpdate functions
|
52
52
|
// and update components
|
53
|
-
try{for(;F<M.length;){const e=M[F];F++,
|
53
|
+
try{for(;F<M.length;){const e=M[F];F++,P(e),j(e.$$)}}catch(e){
|
54
54
|
// reset dirty state to not end up in a deadlocked state and then rethrow
|
55
|
-
throw M.length=0,F=0,e}for(
|
55
|
+
throw M.length=0,F=0,e}for(P(null),M.length=0,F=0;R.length;)R.pop()();
|
56
56
|
// then, once components are updated, call
|
57
57
|
// afterUpdate functions. This may cause
|
58
58
|
// subsequent updates...
|
59
|
-
for(let e=0;e<
|
59
|
+
for(let e=0;e<k.length;e+=1){const t=k[e];D.has(t)||(
|
60
60
|
// ...so guard against infinite loops
|
61
|
-
|
61
|
+
D.add(t),t())}k.length=0}while(M.length);for(;O.length;)O.pop()();$=!1,D.clear(),P(e)}function j(e){if(null!==e.fragment){e.update(),r(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(N)}}
|
62
62
|
/**
|
63
63
|
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
64
|
-
*/const
|
64
|
+
*/const G=new Set;function V(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];k.forEach((r=>-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),k=t}(n.after_update),r(n.on_destroy),n.fragment&&n.fragment.d(t),
|
65
65
|
// TODO null out other refs, including component.$$ (but need to
|
66
66
|
// preserve final state?)
|
67
|
-
|
67
|
+
n.on_destroy=n.fragment=null,n.ctx=[])}function z(e,t){-1===e.$$.dirty[0]&&(M.push(e),$||($=!0,I.then(U)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function W(o,s,a,l,c,u,h,p=[-1]){const f=A;P(o);const m=o.$$={fragment:null,ctx:[],
|
68
68
|
// state
|
69
|
-
props:u,update:e,not_equal:c,bound:
|
69
|
+
props:u,update:e,not_equal:c,bound:n(),
|
70
70
|
// lifecycle
|
71
|
-
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(
|
71
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(f?f.$$.context:[])),
|
72
72
|
// everything else
|
73
|
-
callbacks:
|
73
|
+
callbacks:n(),dirty:p,skip_bound:!1,root:s.target||f.$$.root};h&&h(m.root);let g=!1;if(m.ctx=a?a(o,s.props||{},((e,t,...n)=>{const r=n.length?n[0]:t;return m.ctx&&c(m.ctx[e],m.ctx[e]=r)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](r),g&&z(o,e)),t})):[],m.update(),g=!0,r(m.before_update),
|
74
74
|
// `false` as a special case of no DOM component
|
75
75
|
m.fragment=!!l&&l(m.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);
|
76
76
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
77
|
-
m.fragment&&m.fragment.l(e),e.forEach(
|
77
|
+
m.fragment&&m.fragment.l(e),e.forEach(d)}else
|
78
78
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
79
|
-
m.fragment&&m.fragment.c();s.intro&&((
|
79
|
+
m.fragment&&m.fragment.c();s.intro&&((y=o.$$.fragment)&&y.i&&(G.delete(y),y.i(b))),function(e,n,o,s){const{fragment:a,after_update:l}=e.$$;a&&a.m(n,o),s||
|
80
80
|
// onMount happens before the initial afterUpdate
|
81
|
-
|
81
|
+
N((()=>{const n=e.$$.on_mount.map(t).filter(i);
|
82
82
|
// if the component was destroyed immediately
|
83
83
|
// it will update the `$$.on_destroy` reference to `null`.
|
84
84
|
// the destructured on_destroy may still reference to the old array
|
85
|
-
e.$$.on_destroy?e.$$.on_destroy.push(...
|
85
|
+
e.$$.on_destroy?e.$$.on_destroy.push(...n):
|
86
86
|
// Edge case - component was destroyed immediately,
|
87
87
|
// most likely as a result of a binding initialising
|
88
|
-
n
|
88
|
+
r(n),e.$$.on_mount=[]})),l.forEach(N)}(o,s.target,s.anchor,s.customElement),U()}var y,b;P(f)}let X;"function"==typeof HTMLElement&&(X=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(t).filter(i);
|
89
89
|
// @ts-ignore todo: improve typings
|
90
90
|
for(const e in this.$$.slotted)
|
91
91
|
// @ts-ignore todo: improve typings
|
92
|
-
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,
|
92
|
+
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){r(this.$$.on_disconnect)}$destroy(){V(this,1),this.$destroy=e}$on(t,n){
|
93
93
|
// TODO should this delegate to addEventListener?
|
94
|
-
if(!
|
94
|
+
if(!i(n))return e;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const e=r.indexOf(n);-1!==e&&r.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)}})
|
95
95
|
/* eslint-disable no-prototype-builtins */;var K="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||
|
96
96
|
// eslint-disable-next-line no-undef
|
97
|
-
"undefined"!=typeof global&&global||{},
|
97
|
+
"undefined"!=typeof global&&global||{},Y="URLSearchParams"in K,Z="Symbol"in K&&"iterator"in Symbol,q="FileReader"in K&&"Blob"in K&&function(){try{return new Blob,!0}catch(e){return!1}}(),Q="FormData"in K,J="ArrayBuffer"in K;if(J)var ee=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],te=ArrayBuffer.isView||function(e){return e&&ee.indexOf(Object.prototype.toString.call(e))>-1};function ne(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function re(e){return"string"!=typeof e&&(e=String(e)),e}
|
98
98
|
// Build a destructive iterator for the value list
|
99
|
-
function
|
99
|
+
function ie(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Z&&(t[Symbol.iterator]=function(){return t}),t}function oe(e){this.map={},e instanceof oe?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function se(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function ae(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function le(e){var t=new FileReader,n=ae(t);return t.readAsArrayBuffer(e),n}function ce(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function ue(){return this.bodyUsed=!1,this._initBody=function(e){var t;
|
100
100
|
/*
|
101
101
|
fetch-mock wraps the Response object in an ES6 Proxy to
|
102
102
|
provide useful test harness features such as flush. However, on
|
@@ -108,24 +108,24 @@ function oe(e){var t={next:function(){var t=e.shift();return{done:void 0===t,val
|
|
108
108
|
_initBody is called.
|
109
109
|
*/
|
110
110
|
// eslint-disable-next-line no-self-assign
|
111
|
-
this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:
|
111
|
+
this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:q&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Q&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Y&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():J&&q&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=ce(e.buffer),
|
112
112
|
// IE 10-11 can't handle a DataView body.
|
113
|
-
this._bodyInit=new Blob([this._bodyArrayBuffer])):J&&(ArrayBuffer.prototype.isPrototypeOf(e)||te(e))?this._bodyArrayBuffer=ce(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):
|
113
|
+
this._bodyInit=new Blob([this._bodyArrayBuffer])):J&&(ArrayBuffer.prototype.isPrototypeOf(e)||te(e))?this._bodyArrayBuffer=ce(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Y&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},q&&(this.blob=function(){var e=se(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=se(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(q)return this.blob().then(le);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,i,o=se(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=ae(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8",t.readAsText(e,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Q&&(this.formData=function(){return this.text().then(de)}),this.json=function(){return this.text().then(JSON.parse)},this}
|
114
114
|
// HTTP methods whose capitalization should be normalized
|
115
|
-
|
115
|
+
oe.prototype.append=function(e,t){e=ne(e),t=re(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},oe.prototype.delete=function(e){delete this.map[ne(e)]},oe.prototype.get=function(e){return e=ne(e),this.has(e)?this.map[e]:null},oe.prototype.has=function(e){return this.map.hasOwnProperty(ne(e))},oe.prototype.set=function(e,t){this.map[ne(e)]=re(t)},oe.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},oe.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),ie(e)},oe.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),ie(e)},oe.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),ie(e)},Z&&(oe.prototype[Symbol.iterator]=oe.prototype.entries);var he=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function pe(e,t){if(!(this instanceof pe))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof pe){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new oe(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new oe(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),he.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in K)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){
|
116
116
|
// Search for a '_' parameter in the query string
|
117
|
-
var
|
117
|
+
var o=/([?&])_=[^&]*/;if(o.test(this.url))
|
118
118
|
// If it already exists then set the value with the current time
|
119
|
-
this.url=this.url.replace(
|
119
|
+
this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function de(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function fe(e,t){if(!(this instanceof fe))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new oe(t.headers),this.url=t.url||"",this._initBody(e)}pe.prototype.clone=function(){return new pe(this,{body:this._bodyInit})},ue.call(pe.prototype),ue.call(fe.prototype),fe.prototype.clone=function(){return new fe(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new oe(this.headers),url:this.url})},fe.error=function(){var e=new fe(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var me=[301,302,303,307,308];fe.redirect=function(e,t){if(-1===me.indexOf(t))throw new RangeError("Invalid status code");return new fe(null,{status:t,headers:{location:e}})};var ge=K.DOMException;try{new ge}catch(e){(ge=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),ge.prototype.constructor=ge}function ye(e,t){return new Promise((function(n,r){var i=new pe(e,t);if(i.signal&&i.signal.aborted)return r(new ge("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}if(o.onload=function(){var e,t,r={statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new oe,
|
120
120
|
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
|
121
121
|
// https://github.com/github/fetch/issues/748
|
122
122
|
// https://github.com/zloirock/core-js/issues/751
|
123
|
-
e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var
|
123
|
+
e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(e){console.warn("Response "+e.message)}}})),t)};
|
124
124
|
// This check if specifically for when a user fetches a file locally from the file system
|
125
125
|
// Only if the status is out of a normal range
|
126
|
-
|
126
|
+
i.url.startsWith("file://")&&(o.status<200||o.status>599)?r.status=200:r.status=o.status,r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var s="response"in o?o.response:o.responseText;setTimeout((function(){n(new fe(s,r))}),0)},o.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request timed out"))}),0)},o.onabort=function(){setTimeout((function(){r(new ge("Aborted","AbortError"))}),0)},o.open(i.method,function(e){try{return""===e&&K.location.href?K.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&(q?o.responseType="blob":J&&(o.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof oe||K.Headers&&t.headers instanceof K.Headers)){var a=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){a.push(ne(e)),o.setRequestHeader(e,re(t.headers[e]))})),i.headers.forEach((function(e,t){-1===a.indexOf(t)&&o.setRequestHeader(t,e)}))}else i.headers.forEach((function(e,t){o.setRequestHeader(t,e)}));i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){
|
127
127
|
// DONE (success or failure)
|
128
|
-
4===
|
128
|
+
4===o.readyState&&i.signal.removeEventListener("abort",s)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}ye.polyfill=!0,K.fetch||(K.fetch=ye,K.Headers=oe,K.Request=pe,K.Response=fe),
|
129
129
|
// the whatwg-fetch polyfill installs the fetch() function
|
130
130
|
// on the global object (window or self)
|
131
131
|
// Return that as the export for use in Webpack, Browserify etc.
|
@@ -145,7 +145,7 @@ self.fetch.bind(self);
|
|
145
145
|
PERFORMANCE OF THIS SOFTWARE.
|
146
146
|
***************************************************************************** */
|
147
147
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
148
|
-
var ge=function(e,t){return ge=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])},ge(e,t)};function ve(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}ge(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Ee(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function we(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function Te(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function _e(e){return"function"==typeof e}function Ce(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}"function"==typeof SuppressedError&&SuppressedError;var xe=Ce((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Be(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ae=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,r,n,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=Ee(i),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else i.remove(this);var l=this.initialTeardown;if(_e(l))try{l()}catch(e){o=e instanceof xe?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=Ee(c),h=u.next();!h.done;h=u.next()){var p=h.value;try{He(p)}catch(e){o=null!=o?o:[],e instanceof xe?o=Te(Te([],we(o)),we(e.errors)):o.push(e)}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}if(o)throw new xe(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)He(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Be(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&Be(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Le=Ae.EMPTY;function Se(e){return e instanceof Ae||e&&"closed"in e&&_e(e.remove)&&_e(e.add)&&_e(e.unsubscribe)}function He(e){_e(e)?e():e.unsubscribe()}var Pe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Me={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Me.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,Te([e,t],we(r))):setTimeout.apply(void 0,Te([e,t],we(r)))},clearTimeout:function(e){var t=Me.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Oe(){}var Re=null;function Ne(e){if(Pe.useDeprecatedSynchronousErrorHandling){var t=!Re;if(t&&(Re={errorThrown:!1,error:null}),e(),t){var r=Re,n=r.errorThrown,o=r.error;if(Re=null,n)throw o}}else e()}var Ie=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,Se(t)&&t.add(r)):r.destination=Ge,r}return ve(t,e),t.create=function(e,t,r){return new Fe(e,t,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ae),ke=Function.prototype.bind;function De(e,t){return ke.call(e,t)}var $e=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Ue(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Ue(e)}else Ue(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Ue(e)}},e}(),Fe=function(e){function t(t,r,n){var o,i,s=e.call(this)||this;_e(t)||!t?o={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&Pe.useDeprecatedNextContext?((i=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&De(t.next,i),error:t.error&&De(t.error,i),complete:t.complete&&De(t.complete,i)}):o=t;return s.destination=new $e(o),s}return ve(t,e),t}(Ie);function Ue(e){var t;t=e,Me.setTimeout((function(){throw t}))}var Ge={closed:!0,next:Oe,error:function(e){throw e},complete:Oe},je="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ve(e){return e}var ze=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof Ie||function(e){return e&&_e(e.next)&&_e(e.error)&&_e(e.complete)}(n)&&Se(n)?e:new Fe(e,t,r);return Ne((function(){var e=o,t=e.operator,r=e.source;i.add(t?t.call(i,r):r?o._subscribe(i):o._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=Xe(t))((function(t,n){var o=new Fe({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[je]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0===(e=t).length?Ve:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Xe(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Xe(e){var t;return null!==(t=null!=e?e:Pe.Promise)&&void 0!==t?t:Promise}var We=Ce((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ke=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ve(t,e),t.prototype.lift=function(e){var t=new qe(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new We},t.prototype.next=function(e){var t=this;Ne((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var o=Ee(t.currentObservers),i=o.next();!i.done;i=o.next()){i.value.next(e)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;Ne((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;Ne((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,o=r.isStopped,i=r.observers;return n||o?Le:(this.currentObservers=null,i.push(e),new Ae((function(){t.currentObservers=null,Be(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,o=t.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new ze;return e.source=this,e},t.create=function(e,t){return new qe(e,t)},t}(ze),qe=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return ve(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:Le},t}(Ke),Ze={now:function(){return(Ze.delegate||Date).now()},delegate:void 0},Ye=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=Ze);var o=e.call(this)||this;return o._bufferSize=t,o._windowTime=r,o._timestampProvider=n,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,t),o._windowTime=Math.max(1,r),o}return ve(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,o=r._buffer,i=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(o.push(t),!i&&o.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,o=e._infiniteTimeWindow,i=(o?1:2)*t;if(t<1/0&&i<n.length&&n.splice(0,n.length-i),!o){for(var s=r.now(),a=0,l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}},t}(Ke);let Qe=[],Je={};
|
148
|
+
var be=function(e,t){return be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},be(e,t)};function ve(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}be(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ee(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function we(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function Te(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function Ce(e){return"function"==typeof e}function xe(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}"function"==typeof SuppressedError&&SuppressedError;var _e=xe((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Be(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Le=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Ee(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(Ce(l))try{l()}catch(e){i=e instanceof _e?e.errors:[e]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=Ee(c),h=u.next();!h.done;h=u.next()){var p=h.value;try{He(p)}catch(e){i=null!=i?i:[],e instanceof _e?i=Te(Te([],we(i)),we(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new _e(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)He(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Be(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Be(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Ae=Le.EMPTY;function Pe(e){return e instanceof Le||e&&"closed"in e&&Ce(e.remove)&&Ce(e.add)&&Ce(e.unsubscribe)}function He(e){Ce(e)?e():e.unsubscribe()}var Se={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Me={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Me.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,Te([e,t],we(n))):setTimeout.apply(void 0,Te([e,t],we(n)))},clearTimeout:function(e){var t=Me.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Re(){}var ke=null;function Oe(e){if(Se.useDeprecatedSynchronousErrorHandling){var t=!ke;if(t&&(ke={errorThrown:!1,error:null}),e(),t){var n=ke,r=n.errorThrown,i=n.error;if(ke=null,r)throw i}}else e()}var Ie=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Pe(t)&&t.add(n)):n.destination=je,n}return ve(t,e),t.create=function(e,t,n){return new Fe(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Le),$e=Function.prototype.bind;function Ne(e,t){return $e.call(e,t)}var De=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Ue(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Ue(e)}else Ue(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Ue(e)}},e}(),Fe=function(e){function t(t,n,r){var i,o,s=e.call(this)||this;Ce(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Se.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&Ne(t.next,o),error:t.error&&Ne(t.error,o),complete:t.complete&&Ne(t.complete,o)}):i=t;return s.destination=new De(i),s}return ve(t,e),t}(Ie);function Ue(e){var t;t=e,Me.setTimeout((function(){throw t}))}var je={closed:!0,next:Re,error:function(e){throw e},complete:Re},Ge="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ve(e){return e}var ze=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,o=(r=e)&&r instanceof Ie||function(e){return e&&Ce(e.next)&&Ce(e.error)&&Ce(e.complete)}(r)&&Pe(r)?e:new Fe(e,t,n);return Oe((function(){var e=i,t=e.operator,n=e.source;o.add(t?t.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=We(t))((function(t,r){var i=new Fe({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Ge]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?Ve:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=We(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function We(e){var t;return null!==(t=null!=e?e:Se.Promise)&&void 0!==t?t:Promise}var Xe=xe((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ke=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ve(t,e),t.prototype.lift=function(e){var t=new Ye(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Xe},t.prototype.next=function(e){var t=this;Oe((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=Ee(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;Oe((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;Oe((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Ae:(this.currentObservers=null,o.push(e),new Le((function(){t.currentObservers=null,Be(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new ze;return e.source=this,e},t.create=function(e,t){return new Ye(e,t)},t}(ze),Ye=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return ve(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:Ae},t}(Ke),Ze={now:function(){return(Ze.delegate||Date).now()},delegate:void 0},qe=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Ze);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return ve(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,l=1;l<r.length&&r[l]<=s;l+=2)a=l;a&&r.splice(0,a+1)}},t}(Ke);let Qe=[],Je={};
|
149
149
|
/**
|
150
150
|
* @name topic
|
151
151
|
* @description A small wrapper over the rxjs to offer the topic method on top of it
|
@@ -159,30 +159,30 @@ const et=[];
|
|
159
159
|
* @param {*=}value initial value
|
160
160
|
* @param {StartStopNotifier=} start
|
161
161
|
*/
|
162
|
-
function tt(t,
|
163
|
-
const e=!et.length;for(const e of
|
162
|
+
function tt(t,n=e){let r;const i=new Set;function s(e){if(o(t,e)&&(t=e,r)){// store is ready
|
163
|
+
const e=!et.length;for(const e of i)e[1](),et.push(e,t);if(e){for(let e=0;e<et.length;e+=2)et[e][0](et[e+1]);et.length=0}}}return{set:s,update:function(e){s(e(t))},subscribe:function(o,a=e){const l=[o,a];return i.add(l),1===i.size&&(r=n(s)||e),o(t),()=>{i.delete(l),0===i.size&&r&&(r(),r=null)}}}}function nt(t,n,o){const s=!Array.isArray(t),a=s?[t]:t,c=n.length<2;return u=t=>{let o=!1;const u=[];let h=0,p=e;const d=()=>{if(h)return;p();const r=n(s?u[0]:u,t);c?t(r):p=i(r)?r:e},f=a.map(((e,t)=>l(e,(e=>{u[t]=e,h&=~(1<<t),o&&d()}),(()=>{h|=1<<t}))));return o=!0,d(),function(){r(f),p(),
|
164
164
|
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
165
165
|
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
166
166
|
// invoke this derived store.
|
167
|
-
|
167
|
+
o=!1}},{subscribe:tt(o,u).subscribe};
|
168
168
|
/**
|
169
169
|
* Creates a `Readable` store that allows reading by subscription.
|
170
170
|
* @param value initial value
|
171
171
|
* @param {StartStopNotifier} [start]
|
172
172
|
*/
|
173
|
-
var u}var
|
173
|
+
var u}var rt=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===it}(e)}
|
174
174
|
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
175
|
-
(e)};var
|
175
|
+
(e)};var it="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ot(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ut((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function st(e,t,n){return e.concat(t).map((function(e){return ot(e,n)}))}function at(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 lt(e,t){try{return t in e}catch(e){return!1}}
|
176
176
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
177
|
-
function ct(e,t,
|
178
|
-
})(e,
|
177
|
+
function ct(e,t,n){var r={};return n.isMergeableObject(e)&&at(e).forEach((function(t){r[t]=ot(e[t],n)})),at(t).forEach((function(i){(function(e,t){return lt(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t));// and also unsafe if they're nonenumerable.
|
178
|
+
})(e,i)||(lt(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return ut;var n=t.customMerge(e);return"function"==typeof n?n:ut}(i,n)(e[i],t[i],n):r[i]=ot(t[i],n))})),r}function ut(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||st,n.isMergeableObject=n.isMergeableObject||rt,
|
179
179
|
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
180
180
|
// implementations can use it. The caller may not replace it.
|
181
|
-
|
181
|
+
n.cloneUnlessOtherwiseSpecified=ot;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):ct(e,t,n):ot(t,n)}ut.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return ut(e,n,t)}),{})};var ht=ut,pt=function(e,t){return pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},pt(e,t)};function dt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}pt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ft,mt,gt,yt=function(){return yt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},yt.apply(this,arguments)};function bt(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}
|
182
182
|
/**
|
183
183
|
* Type Guards
|
184
184
|
*/
|
185
|
-
function vt(e){return e.type===mt.literal}function Et(e){return e.type===mt.argument}function wt(e){return e.type===mt.number}function Tt(e){return e.type===mt.date}function
|
185
|
+
function vt(e){return e.type===mt.literal}function Et(e){return e.type===mt.argument}function wt(e){return e.type===mt.number}function Tt(e){return e.type===mt.date}function Ct(e){return e.type===mt.time}function xt(e){return e.type===mt.select}function _t(e){return e.type===mt.plural}function Bt(e){return e.type===mt.pound}function Lt(e){return e.type===mt.tag}function At(e){return!(!e||"object"!=typeof e||e.type!==gt.number)}function Pt(e){return!(!e||"object"!=typeof e||e.type!==gt.dateTime)}
|
186
186
|
// @generated from regex-gen.ts
|
187
187
|
"function"==typeof SuppressedError&&SuppressedError,function(e){
|
188
188
|
/** Argument is unclosed (e.g. `{0`) */
|
@@ -244,7 +244,7 @@ e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
244
244
|
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
245
245
|
e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
246
246
|
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
247
|
-
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(
|
247
|
+
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(ft||(ft={})),function(e){
|
248
248
|
/**
|
249
249
|
* Raw text
|
250
250
|
*/
|
@@ -281,7 +281,7 @@ e[e.pound=7]="pound",
|
|
281
281
|
/**
|
282
282
|
* XML-like tag
|
283
283
|
*/
|
284
|
-
e[e.tag=8]="tag"}(mt||(mt={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(
|
284
|
+
e[e.tag=8]="tag"}(mt||(mt={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(gt||(gt={}));var Ht=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,St=/(?:[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;
|
285
285
|
/**
|
286
286
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
287
287
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
@@ -293,33 +293,33 @@ e[e.tag=8]="tag"}(mt||(mt={})),function(e){e[e.number=0]="number",e[e.dateTime=1
|
|
293
293
|
* @public
|
294
294
|
* @param skeleton skeleton string
|
295
295
|
*/
|
296
|
-
function Mt(e){var t={};return e.replace(
|
296
|
+
function Mt(e){var t={};return e.replace(St,(function(e){var n=e.length;switch(e[0]){
|
297
297
|
// Era
|
298
|
-
case"G":t.era=4===
|
298
|
+
case"G":t.era=4===n?"long":5===n?"narrow":"short";break;
|
299
299
|
// Year
|
300
|
-
case"y":t.year=2===
|
300
|
+
case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
301
301
|
// Quarter
|
302
302
|
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
303
303
|
// Month
|
304
|
-
case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][
|
304
|
+
case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;
|
305
305
|
// Week
|
306
|
-
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][
|
306
|
+
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
307
307
|
// Weekday
|
308
|
-
case"E":t.weekday=4===
|
308
|
+
case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;
|
309
309
|
// Period
|
310
310
|
case"a":// AM, PM
|
311
311
|
t.hour12=!0;break;case"b":// am, pm, noon, midnight
|
312
312
|
case"B":// flexible day periods
|
313
313
|
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
314
314
|
// Hour
|
315
|
-
case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][
|
315
|
+
case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
316
316
|
// Minute
|
317
|
-
case"m":t.minute=["numeric","2-digit"][
|
317
|
+
case"m":t.minute=["numeric","2-digit"][n-1];break;
|
318
318
|
// Second
|
319
|
-
case"s":t.second=["numeric","2-digit"][
|
319
|
+
case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
320
320
|
// Zone
|
321
321
|
case"z":// 1..3, 4: specific non-location format
|
322
|
-
t.timeZoneName=
|
322
|
+
t.timeZoneName=n<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
323
323
|
case"O":// 1, 4: miliseconds in day short, long
|
324
324
|
case"v":// 1, 4: generic non-location format
|
325
325
|
case"V":// 1, 2, 3, 4: time zone ID or city
|
@@ -327,33 +327,33 @@ case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
327
327
|
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
328
328
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}
|
329
329
|
// @generated from regex-gen.ts
|
330
|
-
var
|
330
|
+
var Rt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var kt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Ot=/^(@+)?(\+|#+)?[rs]?$/g,It=/(\*)(0+)|(#+)(0+)|(0+)/g,$t=/^(0+)$/;function Nt(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Ot,(function(e,n,r){
|
331
331
|
// @@@ case
|
332
|
-
return"string"!=typeof
|
332
|
+
return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function Dt(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 Ft(e){
|
333
333
|
// Engineering
|
334
|
-
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var
|
334
|
+
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!$t.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Ut(e){var t=Dt(e);return t||{}}
|
335
335
|
/**
|
336
336
|
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
337
|
-
*/function
|
337
|
+
*/function jt(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=yt(yt(yt({},t),{notation:"scientific"}),i.options.reduce((function(e,t){return yt(yt({},e),Ut(t))}),{}));continue;case"engineering":t=yt(yt(yt({},t),{notation:"engineering"}),i.options.reduce((function(e,t){return yt(yt({},e),Ut(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;
|
338
338
|
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
339
|
-
case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(
|
339
|
+
case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;
|
340
340
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
341
|
-
case"integer-width":if(
|
341
|
+
case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(It,(function(e,n,r,i,o,s){if(n)t.minimumIntegerDigits=r.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}
|
342
342
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
343
|
-
if(
|
343
|
+
if($t.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(kt.test(i.stem)){
|
344
344
|
// Precision
|
345
345
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
346
346
|
// precision-integer case
|
347
|
-
if(
|
347
|
+
if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(kt,(function(e,n,r,i,o,s){
|
348
348
|
// .000* case (before ICU67 it was .000+)
|
349
|
-
return"*"===
|
349
|
+
return"*"===r?t.minimumFractionDigits=n.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:o&&s?(t.minimumFractionDigits=o.length,t.maximumFractionDigits=o.length+s.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var o=i.options[0];
|
350
350
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
351
|
-
"w"===
|
351
|
+
"w"===o?t=yt(yt({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=yt(yt({},t),Nt(o)))}
|
352
352
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
353
|
-
else if(
|
353
|
+
else if(Ot.test(i.stem))t=yt(yt({},t),Nt(i.stem));else{var s=Dt(i.stem);s&&(t=yt(yt({},t),s));var a=Ft(i.stem);a&&(t=yt(yt({},t),a))}}return t}
|
354
354
|
// @generated from time-data-gen.ts
|
355
355
|
// prettier-ignore
|
356
|
-
var
|
356
|
+
var Gt,Vt={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};
|
357
357
|
/**
|
358
358
|
* Returns the best matching date time pattern if a date time skeleton
|
359
359
|
* pattern is provided with a locale. Follows the Unicode specification:
|
@@ -374,37 +374,37 @@ e.hourCycles.length&&(
|
|
374
374
|
// @ts-ignore
|
375
375
|
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")}
|
376
376
|
// TODO: Once hourCycle is fully supported remove the following with data generation
|
377
|
-
var r
|
377
|
+
var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(Vt[n||""]||Vt[r||""]||Vt["".concat(r,"-001")]||Vt["001"])[0]}var Wt=new RegExp("^".concat(Ht.source,"*")),Xt=new RegExp("".concat(Ht.source,"*$"));function Kt(e,t){return{start:e,end:t}}
|
378
378
|
// #region Ponyfills
|
379
379
|
// Consolidate these variables up top for easier toggling during debugging
|
380
|
-
var
|
380
|
+
var Yt=!!String.prototype.startsWith,Zt=!!String.fromCodePoint,qt=!!Object.fromEntries,Qt=!!String.prototype.codePointAt,Jt=!!String.prototype.trimStart,en=!!String.prototype.trimEnd,tn=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},nn=!0;try{
|
381
381
|
/**
|
382
382
|
* legacy Edge or Xbox One browser
|
383
383
|
* Unicode flag support: supported
|
384
384
|
* Pattern_Syntax support: not supported
|
385
385
|
* See https://github.com/formatjs/formatjs/issues/2822
|
386
386
|
*/
|
387
|
-
|
388
|
-
function(e,t,
|
389
|
-
function(e,t,
|
390
|
-
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r
|
387
|
+
nn="a"===(null===(Gt=hn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Gt?void 0:Gt[0])}catch(e){nn=!1}var rn,on=Yt?// Native
|
388
|
+
function(e,t,n){return e.startsWith(t,n)}:// For IE11
|
389
|
+
function(e,t,n){return e.slice(n,n+t.length)===t},sn=Zt?String.fromCodePoint:// IE11
|
390
|
+
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",i=e.length,o=0;i>o;){if((n=e[o++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},an=
|
391
391
|
// native
|
392
|
-
|
393
|
-
function(e){for(var t={},
|
392
|
+
qt?Object.fromEntries:// Ponyfill
|
393
|
+
function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n],o=i[0],s=i[1];t[o]=s}return t},ln=Qt?// Native
|
394
394
|
function(e,t){return e.codePointAt(t)}:// IE 11
|
395
|
-
function(e,t){var
|
395
|
+
function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,i=e.charCodeAt(t);return i<55296||i>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},cn=Jt?// Native
|
396
396
|
function(e){return e.trimStart()}:// Ponyfill
|
397
|
-
function(e){return e.replace(
|
397
|
+
function(e){return e.replace(Wt,"")},un=en?// Native
|
398
398
|
function(e){return e.trimEnd()}:// Ponyfill
|
399
|
-
function(e){return e.replace(
|
399
|
+
function(e){return e.replace(Xt,"")};
|
400
400
|
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
401
|
-
function
|
401
|
+
function hn(e,t){return new RegExp(e,t)}
|
402
402
|
// #endregion
|
403
|
-
if(
|
403
|
+
if(nn){
|
404
404
|
// Native
|
405
|
-
var
|
405
|
+
var pn=hn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");rn=function(e,t){var n;return pn.lastIndex=t,null!==(n=pn.exec(e)[1])&&void 0!==n?n:""}}else
|
406
406
|
// IE11
|
407
|
-
|
407
|
+
rn=function(e,t){for(var n=[];;){var r=ln(e,t);if(void 0===r||mn(r)||gn(r))break;n.push(r),t+=r>=65536?2:1}return sn.apply(void 0,n)};var dn=/** @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,n){for(var r=[];!this.isEOF();){var i=this.char();if(123/* `{` */===i){if((o=this.parseArgument(e,n)).err)return o;r.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(n)break;return this.error(ft.UNMATCHED_CLOSING_TAG,Kt(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===i&&!this.ignoreTag&&fn(this.peek()||0)){if((o=this.parseTag(e,t)).err)return o;r.push(o.val)}else{var o;if((o=this.parseLiteral(e,t)).err)return o;r.push(o.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:mt.pound,location:Kt(s,this.clonePosition())})}}}return{val:r,err:null}},
|
408
408
|
/**
|
409
409
|
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
410
410
|
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
@@ -423,17 +423,17 @@ nr=function(e,t){for(var r=[];;){var n=ar(e,t);if(void 0===n||dr(n)||mr(n))break
|
|
423
423
|
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
424
424
|
* since other tag-based engines like React allow it
|
425
425
|
*/
|
426
|
-
e.prototype.parseTag=function(e,t){var
|
427
|
-
var
|
426
|
+
e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();// `<`
|
427
|
+
var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
428
428
|
// Self closing tag
|
429
|
-
return{val:{type:mt.literal,value:"<".concat(
|
429
|
+
return{val:{type:mt.literal,value:"<".concat(r,"/>"),location:Kt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(e+1,t,!0);if(i.err)return i;var o=i.val,s=this.clonePosition();
|
430
430
|
// Expecting a close tag
|
431
|
-
if(this.bumpIf("</")){if(this.isEOF()||!
|
431
|
+
if(this.bumpIf("</")){if(this.isEOF()||!fn(this.char()))return this.error(ft.INVALID_TAG,Kt(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(ft.UNMATCHED_CLOSING_TAG,Kt(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:mt.tag,value:r,children:o,location:Kt(n,this.clonePosition())},err:null}:this.error(ft.INVALID_TAG,Kt(s,this.clonePosition())))}return this.error(ft.UNCLOSED_TAG,Kt(n,this.clonePosition()))}return this.error(ft.INVALID_TAG,Kt(n,this.clonePosition()))},
|
432
432
|
/**
|
433
433
|
* This method assumes that the caller has peeked ahead for the first tag character.
|
434
434
|
*/
|
435
435
|
e.prototype.parseTagName=function(){var e,t=this.offset();// the first tag name character
|
436
|
-
for(this.bump();!this.isEOF()&&(45/* '-' */===(e=this.char())||46/* '.' */===e||e>=48&&e<=57/* 0..9 */||95/* '_' */===e||e>=97&&e<=122/** a..z */||e>=65&&e<=90/* A..Z */||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var
|
436
|
+
for(this.bump();!this.isEOF()&&(45/* '-' */===(e=this.char())||46/* '.' */===e||e>=48&&e<=57/* 0..9 */||95/* '_' */===e||e>=97&&e<=122/** a..z */||e>=65&&e<=90/* A..Z */||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var i=this.tryParseQuote(t);if(i)r+=i;else{var o=this.tryParseUnquoted(e,t);if(o)r+=o;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var a=Kt(n,this.clonePosition());return{val:{type:mt.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(fn(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e;
|
437
437
|
/** See `parseTag` function docs. */},
|
438
438
|
/**
|
439
439
|
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
@@ -451,71 +451,71 @@ case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
451
451
|
if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();// apostrophe
|
452
452
|
var t=[this.char()];// escaped char
|
453
453
|
// read chars until the optional closing apostrophe is found
|
454
|
-
for(this.bump();!this.isEOF();){var
|
454
|
+
for(this.bump();!this.isEOF();){var n=this.char();if(39/* `'` */===n){if(39/* `'` */!==this.peek()){
|
455
455
|
// Optional closing apostrophe.
|
456
456
|
this.bump();break}t.push(39),
|
457
457
|
// Bump one more time because we need to skip 2 characters.
|
458
|
-
this.bump()}else t.push(
|
459
|
-
this.bumpSpace(),this.isEOF())return this.error(
|
458
|
+
this.bump()}else t.push(n);this.bump()}return sn.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60/* `<` */===n||123/* `{` */===n||35/* `#` */===n&&("plural"===t||"selectordinal"===t)||125/* `}` */===n&&e>0?null:(this.bump(),sn(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),// `{`
|
459
|
+
this.bumpSpace(),this.isEOF())return this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(n,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(ft.EMPTY_ARGUMENT,Kt(n,this.clonePosition()));
|
460
460
|
// argument name
|
461
|
-
var
|
461
|
+
var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(ft.MALFORMED_ARGUMENT,Kt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(n,this.clonePosition()));switch(this.char()){
|
462
462
|
// Simple argument: `{name}`
|
463
463
|
case 125/* `}` */:// `}`
|
464
464
|
return this.bump(),{val:{type:mt.argument,
|
465
465
|
// value does not include the opening and closing braces.
|
466
|
-
value:
|
466
|
+
value:r,location:Kt(n,this.clonePosition())},err:null};
|
467
467
|
// Argument with options: `{name, format, ...}`
|
468
468
|
case 44/* `,` */:return this.bump(),// `,`
|
469
|
-
this.bumpSpace(),this.isEOF()?this.error(
|
469
|
+
this.bumpSpace(),this.isEOF()?this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(ft.MALFORMED_ARGUMENT,Kt(n,this.clonePosition()))}},
|
470
470
|
/**
|
471
471
|
* Advance the parser until the end of the identifier, if it is currently on
|
472
472
|
* an identifier character. Return an empty string otherwise.
|
473
473
|
*/
|
474
|
-
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),
|
474
|
+
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=rn(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Kt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var i,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
475
475
|
// Parse this range:
|
476
476
|
// {name, type, style}
|
477
477
|
// ^---^
|
478
478
|
switch(s){case"":
|
479
479
|
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
480
|
-
return this.error(
|
480
|
+
return this.error(ft.EXPECT_ARGUMENT_TYPE,Kt(o,a));case"number":case"date":case"time":
|
481
481
|
// Parse this range:
|
482
482
|
// {name, number, style}
|
483
483
|
// ^-------^
|
484
|
-
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((
|
484
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(d=un(y.val)).length)return this.error(ft.EXPECT_ARGUMENT_STYLE,Kt(this.clonePosition(),this.clonePosition()));l={style:d,styleLocation:Kt(c,this.clonePosition())}}if((b=this.tryParseArgumentClose(r)).err)return b;var u=Kt(r,this.clonePosition());
|
485
485
|
// Extract style or skeleton
|
486
|
-
if(l&&
|
486
|
+
if(l&&on(null==l?void 0:l.style,"::",0)){
|
487
487
|
// Skeleton starts with `::`.
|
488
|
-
var h=
|
488
|
+
var h=cn(l.style.slice(2));if("number"===s)return(y=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?y:{val:{type:mt.number,value:n,location:u,style:y.val},err:null};if(0===h.length)return this.error(ft.EXPECT_DATE_TIME_SKELETON,u);var p=h;
|
489
489
|
// Get "best match" pattern only if locale is passed, if not, let it
|
490
490
|
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
491
491
|
// for unsupported patterns.
|
492
|
-
this.locale&&(p=function(e,t){for(var
|
492
|
+
this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if("j"===i){for(var o=0;r+1<e.length&&e.charAt(r+1)===i;)o++,r++;var s=1+(1&o),a=o<2?1:3+(o>>1),l=zt(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)n+="a";for(;s-- >0;)n=l+n}else n+="J"===i?"H":i}return n}(h,this.locale));var d={type:gt.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Mt(p):{}};return{val:{type:"date"===s?mt.date:mt.time,value:n,location:u,style:d},err:null}}
|
493
493
|
// Regular style or no style.
|
494
|
-
return{val:{type:"number"===s?mt.number:"date"===s?mt.date:mt.time,value:
|
494
|
+
return{val:{type:"number"===s?mt.number:"date"===s?mt.date:mt.time,value:n,location:u,style:null!==(i=null==l?void 0:l.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":
|
495
495
|
// Parse this range:
|
496
496
|
// {name, plural, options}
|
497
497
|
// ^---------^
|
498
|
-
var
|
498
|
+
var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(ft.EXPECT_SELECT_ARGUMENT_OPTIONS,Kt(f,yt({},f)));this.bumpSpace();
|
499
499
|
// Parse offset:
|
500
500
|
// {name, plural, offset:1, options}
|
501
501
|
// ^-----^
|
502
502
|
// or the first option:
|
503
503
|
// {name, plural, one {...} other {...}}
|
504
504
|
// ^--^
|
505
|
-
var m=this.parseIdentifierIfPossible(),
|
505
|
+
var m=this.parseIdentifierIfPossible(),g=0;if("select"!==s&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(ft.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Kt(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(ft.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ft.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;
|
506
506
|
// Parse another identifier for option parsing
|
507
|
-
this.bumpSpace(),m=this.parseIdentifierIfPossible(),y
|
507
|
+
this.bumpSpace(),m=this.parseIdentifierIfPossible(),g=y.val}var b,v=this.tryParsePluralOrSelectOptions(e,s,t,m);if(v.err)return v;if((b=this.tryParseArgumentClose(r)).err)return b;var E=Kt(r,this.clonePosition());return"select"===s?{val:{type:mt.select,value:n,options:an(v.val),location:E},err:null}:{val:{type:mt.plural,value:n,options:an(v.val),offset:g,pluralType:"plural"===s?"cardinal":"ordinal",location:E},err:null};default:return this.error(ft.INVALID_ARGUMENT_TYPE,Kt(o,a))}},e.prototype.tryParseArgumentClose=function(e){
|
508
508
|
// Parse: {value, number, ::currency/GBP }
|
509
|
-
return this.isEOF()||125/* `}` */!==this.char()?this.error(
|
509
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(ft.EXPECT_ARGUMENT_CLOSING_BRACE,Kt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
510
510
|
/**
|
511
511
|
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
512
512
|
*/
|
513
513
|
e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
514
514
|
// Treat apostrophe as quoting but include it in the style part.
|
515
515
|
// Find the end of the quoted literal text.
|
516
|
-
this.bump();var
|
516
|
+
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(ft.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Kt(n,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 n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");
|
517
517
|
// Parse the skeleton
|
518
|
-
for(var t=[],
|
518
|
+
for(var t=[],n=0,r=e.split(Rt).filter((function(e){return e.length>0}));n<r.length;n++){var i=r[n].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var o=i[0],s=i.slice(1),a=0,l=s;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");t.push({stem:o,options:s})}return t}(e)}catch(e){return this.error(ft.INVALID_NUMBER_SKELETON,t)}return{val:{type:gt.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?jt(n):{}},err:null}},
|
519
519
|
/**
|
520
520
|
* @param nesting_level The current nesting level of messages.
|
521
521
|
* This can be positive when parsing message fragment in select or plural argument options.
|
@@ -526,30 +526,30 @@ for(var t=[],r=0,n=e.split(Ot).filter((function(e){return e.length>0}));r<n.leng
|
|
526
526
|
* between a pair of opening and closing tags. The nested message will not parse beyond
|
527
527
|
* the closing tag boundary.
|
528
528
|
*/
|
529
|
-
e.prototype.tryParsePluralOrSelectOptions=function(e,t,r
|
529
|
+
e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){
|
530
530
|
// Parse:
|
531
531
|
// one {one apple}
|
532
532
|
// ^--^
|
533
|
-
for(var o
|
533
|
+
for(var i,o=!1,s=[],a=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;
|
534
534
|
// Try parse `={number}` selector
|
535
|
-
var h=this.tryParseDecimalInteger(
|
535
|
+
var h=this.tryParseDecimalInteger(ft.EXPECT_PLURAL_ARGUMENT_SELECTOR,ft.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=Kt(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}
|
536
536
|
// Duplicate selector clauses
|
537
|
-
if(a.has(l))return this.error("select"===t?
|
537
|
+
if(a.has(l))return this.error("select"===t?ft.DUPLICATE_SELECT_ARGUMENT_SELECTOR:ft.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(o=!0),
|
538
538
|
// Parse:
|
539
539
|
// one {one apple}
|
540
540
|
// ^----------^
|
541
|
-
this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?
|
541
|
+
this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?ft.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:ft.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Kt(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(e+1,t,n);if(d.err)return d;var f=this.tryParseArgumentClose(p);if(f.err)return f;s.push([l,{value:d.val,location:Kt(p,this.clonePosition())}]),
|
542
542
|
// Keep track of the existing selectors
|
543
543
|
a.add(l),
|
544
544
|
// Prep next selector clause.
|
545
|
-
this.bumpSpace(),l=(
|
545
|
+
this.bumpSpace(),l=(i=this.parseIdentifierIfPossible()).value,c=i.location}return 0===s.length?this.error("select"===t?ft.EXPECT_SELECT_ARGUMENT_SELECTOR:ft.EXPECT_PLURAL_ARGUMENT_SELECTOR,Kt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(ft.MISSING_OTHER_CLAUSE,Kt(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,o=0;!this.isEOF();){var s=this.char();if(!(s>=48/* `0` */&&s<=57/* `9` */))break;i=!0,o=10*o+(s-48),this.bump()}var a=Kt(r,this.clonePosition());return i?tn(o*=n)?{val:o,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){
|
546
546
|
// This is much faster than `Object.assign` or spread.
|
547
547
|
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
548
548
|
/**
|
549
549
|
* Return the code point at the current position of the parser.
|
550
550
|
* Throws if the index is out of bound.
|
551
551
|
*/
|
552
|
-
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=
|
552
|
+
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=ln(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},
|
553
553
|
/** Bump the parser to the next UTF-16 code unit. */
|
554
554
|
e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10/* '\n' */===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
555
555
|
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
@@ -560,189 +560,217 @@ this.position.offset+=e<65536?1:2)}},
|
|
560
560
|
* following the prefix and return true. Otherwise, don't bump the parser
|
561
561
|
* and return false.
|
562
562
|
*/
|
563
|
-
e.prototype.bumpIf=function(e){if(
|
563
|
+
e.prototype.bumpIf=function(e){if(on(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},
|
564
564
|
/**
|
565
565
|
* Bump the parser until the pattern character is found and return `true`.
|
566
566
|
* Otherwise bump to the end of the file and return `false`.
|
567
567
|
*/
|
568
|
-
e.prototype.bumpUntil=function(e){var t=this.offset(),
|
568
|
+
e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},
|
569
569
|
/**
|
570
570
|
* Bump the parser to the target offset.
|
571
571
|
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
572
572
|
*/
|
573
573
|
e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
574
574
|
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
575
|
-
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&
|
575
|
+
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&mn(this.char());)this.bump()},
|
576
576
|
/**
|
577
577
|
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
578
578
|
* If the input has been exhausted, then this returns null.
|
579
579
|
*/
|
580
|
-
e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),
|
580
|
+
e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();
|
581
581
|
/**
|
582
582
|
* This check if codepoint is alphabet (lower & uppercase)
|
583
583
|
* @param codepoint
|
584
584
|
* @returns
|
585
|
-
*/function
|
585
|
+
*/function fn(e){return e>=97&&e<=122||e>=65&&e<=90}
|
586
586
|
/**
|
587
587
|
* Code point equivalent of regex `\p{White_Space}`.
|
588
588
|
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
589
589
|
*/
|
590
|
-
function
|
590
|
+
function mn(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}
|
591
591
|
/**
|
592
592
|
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
593
593
|
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
594
|
-
*/function
|
594
|
+
*/function gn(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function yn(e){e.forEach((function(e){if(delete e.location,xt(e)||_t(e))for(var t in e.options)delete e.options[t].location,yn(e.options[t].value);else wt(e)&&At(e.style)||(Tt(e)||Ct(e))&&Pt(e.style)?delete e.style.location:Lt(e)&&yn(e.children)}))}function bn(e,t){void 0===t&&(t={}),t=yt({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new dn(e,t).parse();if(n.err){var r=SyntaxError(ft[n.err.kind]);
|
595
595
|
// @ts-expect-error Assign to error object
|
596
|
-
throw
|
596
|
+
throw r.location=n.err.location,
|
597
597
|
// @ts-expect-error Assign to error object
|
598
|
-
|
598
|
+
r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||yn(n.val),n.val}
|
599
599
|
|
600
600
|
// Main
|
601
601
|
|
602
|
-
function
|
602
|
+
function vn(e,t){var n=t&&t.cache?t.cache:Ln,r=t&&t.serializer?t.serializer:xn;return(t&&t.strategy?t.strategy:Cn)(e,{cache:n,serializer:r})}
|
603
603
|
|
604
604
|
// Strategy
|
605
605
|
|
606
|
-
function
|
606
|
+
function En(e,t,n,r){var i,o=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),s=t.get(o);return void 0===s&&(s=e.call(this,r),t.set(o,s)),s}function wn(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return void 0===o&&(o=e.apply(this,r),t.set(i,o)),o}function Tn(e,t,n,r,i){return n.bind(t,e,r,i)}function Cn(e,t){return Tn(e,this,1===e.length?En:wn,t.cache.create(),t.serializer)}
|
607
607
|
// Serializer
|
608
|
-
var
|
608
|
+
var xn=function(){return JSON.stringify(arguments)};
|
609
609
|
|
610
610
|
// Cache
|
611
611
|
|
612
|
-
function
|
612
|
+
function _n(){this.cache=Object.create(null)}_n.prototype.get=function(e){return this.cache[e]},_n.prototype.set=function(e,t){this.cache[e]=t};var Bn,Ln={create:function(){
|
613
613
|
// @ts-ignore
|
614
|
-
return new
|
614
|
+
return new _n}},An={variadic:function(e,t){return Tn(e,this,wn,t.cache.create(),t.serializer)},monadic:function(e,t){return Tn(e,this,En,t.cache.create(),t.serializer)}};!function(e){
|
615
615
|
// When we have a placeholder but no value to format
|
616
616
|
e.MISSING_VALUE="MISSING_VALUE",
|
617
617
|
// When value supplied is invalid
|
618
618
|
e.INVALID_VALUE="INVALID_VALUE",
|
619
619
|
// When we need specific Intl API but it's not available
|
620
|
-
e.MISSING_INTL_API="MISSING_INTL_API"}(
|
620
|
+
e.MISSING_INTL_API="MISSING_INTL_API"}(Bn||(Bn={}));var Pn,Hn=/** @class */function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.originalMessage=r,i}return dt(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Sn=/** @class */function(e){function t(t,n,r,i){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Bn.INVALID_VALUE,i)||this}return dt(t,e),t}(Hn),Mn=/** @class */function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Bn.INVALID_VALUE,r)||this}return dt(t,e),t}(Hn),Rn=/** @class */function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Bn.MISSING_VALUE,n)||this}return dt(t,e),t}(Hn);function kn(e){return"function"==typeof e}
|
621
621
|
// TODO(skeleton): add skeleton support
|
622
|
-
function
|
622
|
+
function On(e,t,n,r,i,o,
|
623
623
|
// For debugging
|
624
624
|
s){
|
625
625
|
// Hot path for straight simple msg translations
|
626
|
-
if(1===e.length&&vt(e[0]))return[{type:
|
626
|
+
if(1===e.length&&vt(e[0]))return[{type:Pn.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];
|
627
627
|
// Exit early for string parts.
|
628
|
-
if(vt(u))a.push({type:
|
628
|
+
if(vt(u))a.push({type:Pn.literal,value:u.value});else
|
629
629
|
// TODO: should this part be literal type?
|
630
630
|
// Replace `#` in plural rules with the actual numeric value.
|
631
|
-
if(Bt(u))"number"==typeof
|
631
|
+
if(Bt(u))"number"==typeof o&&a.push({type:Pn.literal,value:n.getNumberFormat(t).format(o)});else{var h=u.value;
|
632
632
|
// Enforce that all required values are provided by the caller.
|
633
|
-
if(!
|
633
|
+
if(!i||!(h in i))throw new Rn(h,s);var p=i[h];if(Et(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),a.push({type:"string"==typeof p?Pn.literal:Pn.object,value:p});else
|
634
634
|
// Recursively format plural and select parts' option — which can be a
|
635
635
|
// nested pattern structure. The choosing of the option to use is
|
636
636
|
// abstracted-by and delegated-to the part helper object.
|
637
|
-
if(Tt(u)){var
|
637
|
+
if(Tt(u)){var d="string"==typeof u.style?r.date[u.style]:Pt(u.style)?u.style.parsedOptions:void 0;a.push({type:Pn.literal,value:n.getDateTimeFormat(t,d).format(p)})}else if(Ct(u)){d="string"==typeof u.style?r.time[u.style]:Pt(u.style)?u.style.parsedOptions:r.time.medium;a.push({type:Pn.literal,value:n.getDateTimeFormat(t,d).format(p)})}else if(wt(u)){(d="string"==typeof u.style?r.number[u.style]:At(u.style)?u.style.parsedOptions:void 0)&&d.scale&&(p*=d.scale||1),a.push({type:Pn.literal,value:n.getNumberFormat(t,d).format(p)})}else{if(Lt(u)){var f=u.children,m=u.value,g=i[m];if(!kn(g))throw new Mn(m,"function",s);var y=g(On(f,t,n,r,i,o).map((function(e){return e.value})));Array.isArray(y)||(y=[y]),a.push.apply(a,y.map((function(e){return{type:"string"==typeof e?Pn.literal:Pn.object,value:e}})))}if(xt(u)){if(!(b=u.options[p]||u.options.other))throw new Sn(u.value,p,Object.keys(u.options),s);a.push.apply(a,On(b.value,t,n,r,i))}else if(_t(u)){var b;if(!(b=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new Hn('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Bn.MISSING_INTL_API,s);var v=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));b=u.options[v]||u.options.other}if(!b)throw new Sn(u.value,p,Object.keys(u.options),s);a.push.apply(a,On(b.value,t,n,r,i,p-(u.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===Pn.literal&&t.type===Pn.literal?n.value+=t.value:e.push(t),e}),[])}(a)}
|
638
638
|
/*
|
639
639
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
640
640
|
Copyrights licensed under the New BSD License.
|
641
641
|
See the accompanying LICENSE file for terms.
|
642
642
|
*/
|
643
643
|
// -- MessageFormat --------------------------------------------------------
|
644
|
-
function
|
644
|
+
function In(e,t){return t?Object.keys(e).reduce((function(n,r){var i,o;return n[r]=(i=e[r],(o=t[r])?yt(yt(yt({},i||{}),o||{}),Object.keys(i).reduce((function(e,t){return e[t]=yt(yt({},i[t]),o[t]||{}),e}),{})):i),n}),yt({},e)):e}function $n(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Pn||(Pn={}));var Nn=/** @class */function(){function e(t,n,r,i){var o,s=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);
|
645
645
|
// Hot path for straight simple msg translations
|
646
|
-
if(1===t.length)return t[0].value;var
|
646
|
+
if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===Pn.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return On(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},
|
647
647
|
// Defined first because it's used to build the format pattern.
|
648
|
-
this.locales=
|
648
|
+
this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
649
649
|
// Parse string messages into an AST.
|
650
|
-
this.ast=e.__parse(t,{ignoreTag:null==
|
650
|
+
this.ast=e.__parse(t,{ignoreTag:null==i?void 0:i.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
651
651
|
// Creates a new object with the specified `formats` merged with the default
|
652
652
|
// formats.
|
653
|
-
this.formats=
|
653
|
+
this.formats=In(e.formats,r),this.formatters=i&&i.formatters||(void 0===(o=this.formatterCache)&&(o={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:vn((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,bt([void 0],t,!1)))}),{cache:$n(o.number),strategy:An.variadic}),getDateTimeFormat:vn((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,bt([void 0],t,!1)))}),{cache:$n(o.dateTime),strategy:An.variadic}),getPluralRules:vn((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,bt([void 0],t,!1)))}),{cache:$n(o.pluralRules),strategy:An.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])},e.__parse=bn,
|
654
654
|
// Default format options used as the prototype of the `formats` provided to the
|
655
655
|
// constructor. These are used when constructing the internal Intl.NumberFormat
|
656
656
|
// and Intl.DateTimeFormat instances.
|
657
|
-
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
|
657
|
+
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 Dn={},Fn=(e,t,n)=>n?(t in Dn||(Dn[t]={}),e in Dn[t]||(Dn[t][e]=n),n):n,Un=(e,t)=>{if(null==t)return;if(t in Dn&&e in Dn[t])return Dn[t][e];const n=pr(t);for(let r=0;r<n.length;r++){const i=zn(n[r],e);if(i)return Fn(e,t,i)}};let jn;const Gn=tt({});function Vn(e){return e in jn}function zn(e,t){if(!Vn(e))return null;const n=function(e){return jn[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const n=t.split(".");let r=e;for(let e=0;e<n.length;e++)if("object"==typeof r){if(e>0){const t=n.slice(e,n.length).join(".");if(t in r){r=r[t];break}}r=r[n[e]]}else r=void 0;return r}(n,t)}function Wn(e,...t){delete Dn[e],Gn.update((n=>(n[e]=ht.all([n[e]||{},...t]),n)))}nt([Gn],(([e])=>Object.keys(e))),Gn.subscribe((e=>jn=e));const Xn={};function Kn(e){return Xn[e]}function Yn(e){return null!=e&&pr(e).some((e=>{var t;return null==(t=Kn(e))?void 0:t.size}))}function Zn(e,t){const n=Promise.all(t.map((t=>(function(e,t){Xn[e].delete(t),0===Xn[e].size&&delete Xn[e]}(e,t),t().then((e=>e.default||e))))));return n.then((t=>Wn(e,...t)))}const qn={};function Qn(e){if(!Yn(e))return e in qn?qn[e]:Promise.resolve();const t=function(e){return pr(e).map((e=>{const t=Kn(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return qn[e]=Promise.all(t.map((([e,t])=>Zn(e,t)))).then((()=>{if(Yn(e))return Qn(e);delete qn[e]})),qn[e]}const Jn={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 er(){return Jn}const tr=tt(!1);var nr=Object.defineProperty,rr=Object.defineProperties,ir=Object.getOwnPropertyDescriptors,or=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,ar=Object.prototype.propertyIsEnumerable,lr=(e,t,n)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let cr;const ur=tt(null);function hr(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function pr(e,t=er().fallbackLocale){const n=hr(e);return t?[...new Set([...n,...hr(t)])]:n}function dr(){return null!=cr?cr:void 0}ur.subscribe((e=>{cr=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const fr=(mr=((e,t)=>{for(var n in t||(t={}))sr.call(t,n)&&lr(e,n,t[n]);if(or)for(var n of or(t))ar.call(t,n)&&lr(e,n,t[n]);return e})({},ur),rr(mr,ir({set:e=>{if(e&&function(e){if(null==e)return;const t=pr(e);for(let e=0;e<t.length;e++){const n=t[e];if(Vn(n))return n}}(e)&&Yn(e)){const{loadingDelay:t}=er();let n;return"undefined"!=typeof window&&null!=dr()&&t?n=window.setTimeout((()=>tr.set(!0)),t):tr.set(!0),Qn(e).then((()=>{ur.set(e)})).finally((()=>{clearTimeout(n),tr.set(!1)}))}return ur.set(e)}})));var mr;const gr=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}};var yr=Object.defineProperty,br=Object.getOwnPropertySymbols,vr=Object.prototype.hasOwnProperty,Er=Object.prototype.propertyIsEnumerable,wr=(e,t,n)=>t in e?yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tr=(e,t)=>{for(var n in t||(t={}))vr.call(t,n)&&wr(e,n,t[n]);if(br)for(var n of br(t))Er.call(t,n)&&wr(e,n,t[n]);return e},Cr=(e,t)=>{var n={};for(var r in e)vr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&br)for(var r of br(e))t.indexOf(r)<0&&Er.call(e,r)&&(n[r]=e[r]);return n};const xr=(e,t)=>{const{formats:n}=er();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},_r=gr((e=>{var t=e,{locale:n,format:r}=t,i=Cr(t,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return r&&(i=xr("number",r)),new Intl.NumberFormat(n,i)})),Br=gr((e=>{var t=e,{locale:n,format:r}=t,i=Cr(t,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return r?i=xr("date",r):0===Object.keys(i).length&&(i=xr("date","short")),new Intl.DateTimeFormat(n,i)})),Lr=gr((e=>{var t=e,{locale:n,format:r}=t,i=Cr(t,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return r?i=xr("time",r):0===Object.keys(i).length&&(i=xr("time","short")),new Intl.DateTimeFormat(n,i)})),Ar=gr((
|
658
658
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
659
|
-
(e,t=
|
660
|
-
/* ../cashier-iframe-redirect/src/CashierIframeRedirect.svelte generated by Svelte v3.59.2 */function
|
659
|
+
(e,t=dr())=>new Nn(e,t,er().formats,{ignoreTag:er().ignoreTag}))),Pr=(e,t={})=>{var n,r,i,o;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:l=dr(),default:c}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=Un(e,l);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!=(o=null!=(i=null==(r=(n=er()).handleMissingMessage)?void 0:r.call(n,{locale:l,id:e,defaultValue:c}))?i:c)?o:e;if(!a)return u;let h=u;try{h=Ar(u,l).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return h},Hr=(e,t)=>((e={})=>{var t=e,{locale:n=dr()}=t,r=Cr(t,["locale"]);return Lr(Tr({locale:n},r))})(t).format(e),Sr=(e,t)=>((e={})=>{var t=e,{locale:n=dr()}=t,r=Cr(t,["locale"]);return Br(Tr({locale:n},r))})(t).format(e),Mr=(e,t)=>((e={})=>{var t=e,{locale:n=dr()}=t,r=Cr(t,["locale"]);return _r(Tr({locale:n},r))})(t).format(e),Rr=(e,t=dr())=>Un(e,t),kr=nt([fr,Gn],(()=>Pr));nt([fr],(()=>Hr)),nt([fr],(()=>Sr)),nt([fr],(()=>Mr)),nt([fr,Gn],(()=>Rr)),window.emWidgets={topic:(e,t=0)=>{if(-1==Qe.indexOf(e)){let n=new qe(t);Je[e]=n,Qe.push(e)}return Je[e]}};function Or(e,t){Wn(e,t)}const Ir={en:{loading:"Loading...",amountLabel:"Amount",makeDepositButton:"DEPOSIT",confirmDepositText:"Are you sure you want to deposit",confirmDepositButton:"Ok",redirectTitle:"You are redirected to the payment's provider page",redirectMessage:"Please complete your transaction on the payment's provider page.",backToPayment:"Close",retryText:"Please note that your popup blocker may prevent the payment window from appearing",retryButton:"RETRY",processingButton:"PROCESSING...",generalMin:"Min:",generalMax:"Max:",amountPlaceholder:"0.00",change:"Change",errorEmptyField:"Please enter data",minAmountError:"Amount cannot be smaller than {amount} {currency}",maxAmountError:"Amount cannot be bigger than {amount} {currency}",amountMultiplierError:"Amount should be multiple of {multiplier}",amountIntError:"Amount should be integer value",amountDecimalError:"Amount should have 2 or less digits after decimal point",invalidFieldError:"{field} is invalid"}};function $r(e,t){Wn(e,t)}const Nr={en:{backButton:"Back"},hr:{backButton:"Natrag"}};
|
660
|
+
/* ../cashier-iframe-redirect/src/CashierIframeRedirect.svelte generated by Svelte v3.59.2 */function Dr(t){let n,r,i,o,s,l,c,u,f,v,T,C,_=/*$_*/t[1]("backButton")+"";return{c(){n=m("div"),r=m("div"),i=g("svg"),o=g("path"),s=b(),l=m("span"),c=y(_),u=b(),f=m("iframe"),this.c=e,w(o,"fill-rule","evenodd"),w(o,"clip-rule","evenodd"),w(o,"d","M12.5632 3.47776C12.4787 3.50132 12.3362 3.57499 12.2465 3.64147C12.1567 3.708 10.8069 5.0421 9.24694 6.6062C6.11944 9.74186 6.25999 9.58198 6.25999 10.0036C6.25999 10.4243 6.13093 10.2783 9.34296 13.4902C12.4449 16.5921 12.356 16.5115 12.7278 16.5555C13.1855 16.6098 13.6413 16.2584 13.7301 15.783C13.7612 15.6163 13.7212 15.3394 13.6437 15.1846C13.6158 15.1289 12.451 13.9396 11.0553 12.5417L8.51768 9.99999L11.0553 7.45831C12.451 6.06042 13.6158 4.87108 13.6437 4.81538C13.7729 4.55745 13.7703 4.20054 13.6374 3.94268C13.4469 3.57304 12.9668 3.36526 12.5632 3.47776Z"),w(o,"fill","#111111"),w(i,"xmlns","http://www.w3.org/2000/svg"),w(i,"width","20"),w(i,"height","20"),w(i,"viewBox","0 0 20 20"),w(i,"fill","none"),w(r,"class","BackButton"),a(f.src,v=/*iframeurl*/t[0])||w(f,"src",v),w(f,"frameborder","0"),w(n,"class","CashierRedirectIframe")},m(e,a){p(e,n,a),h(n,r),h(r,i),h(i,o),h(r,s),h(r,l),h(l,c),h(n,u),h(n,f),T||(C=E(r,"click",/*close*/t[2]),T=!0)},p(e,[t]){/*$_*/2&t&&_!==(_=/*$_*/e[1]("backButton")+"")&&x(c,_),/*iframeurl*/1&t&&!a(f.src,v=/*iframeurl*/e[0])&&w(f,"src",v)},i:e,o:e,d(e){e&&d(n),T=!1,C()}}}function Fr(e,t,n){let r;c(e,kr,(e=>n(1,r=e)));let{lang:i="en"}=t,{iframeurl:o}=t,{translationurl:s=""}=t;S();Object.keys(Nr).forEach((e=>{$r(e,Nr[e])}));const a=()=>{var e;e=i,fr.set(e)};return e.$$set=e=>{"lang"in e&&n(3,i=e.lang),"iframeurl"in e&&n(0,o=e.iframeurl),"translationurl"in e&&n(4,s=e.translationurl)},e.$$.update=()=>{/*lang*/8&e.$$.dirty&&i&&a(),/*translationurl*/16&e.$$.dirty&&s&&(()=>{if(s)fetch(s).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{$r(t,e[t])}))})).catch((e=>{console.log(e)}))})()},[o,r,()=>{dispatchEvent(new CustomEvent("closeIframe",{bubbles:!0,cancelable:!0,composed:!0}))},i,s]}function Ur(e,t){Wn(e,t)}!customElements.get("cashier-iframe-redirect")&&customElements.define("cashier-iframe-redirect",class extends X{constructor(e){super();const t=document.createElement("style");t.textContent=".CashierRedirectIframe{height:inherit;width:inherit}iframe{height:100%;width:100%;background:rgba(0, 0, 0, 0.1)}.BackButton{position:absolute;display:flex;align-items:center;padding:8px 8px 8px 4px;margin:8px;border-radius:2px;background:rgba(0, 0, 0, 0.1);justify-content:center;cursor:pointer}",this.shadowRoot.appendChild(t),W(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},Fr,Dr,o,{lang:3,iframeurl:0,translationurl:4},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),U()))}static get observedAttributes(){return["lang","iframeurl","translationurl"]}get lang(){return this.$$.ctx[3]}set lang(e){this.$$set({lang:e}),U()}get iframeurl(){return this.$$.ctx[0]}set iframeurl(e){this.$$set({iframeurl:e}),U()}get translationurl(){return this.$$.ctx[4]}set translationurl(e){this.$$set({translationurl:e}),U()}});const jr={en:{deposit:{success:{title:"{amount} {currency}",subTitle:"Deposited in your account",text:"Your deposit is successful"},pending:{title:"{amount} {currency}",subTitle:"Transaction is in progress",text:"Thank you. Your deposit is being processed."},reject:{title:"Deposit Rejected",subTitle:" ",text:"{errorText}"},fail:{title:"Error",subTitle:" ",text:"{errorText}"},cancel:{title:"You have cancelled the transaction",subTitle:" ",text:"{errorText}"}},withdrawal:{success:{title:"{amount} {currency}",subTitle:"Withdrawn from your account",text:"Your withdrawal is successful"},pending:{title:"{amount} {currency}",subTitle:"Withdrawn from your account",text:"Thank you. Your withdrawal is being processed."},reject:{title:"Withdrawal Rejected",subTitle:" ",text:"{errorText}"},fail:{title:"Error",subTitle:" ",text:"{errorText}"},cancel:{title:"You have cancelled the transaction",subTitle:" ",text:"{errorText}"}},reference:"Reference ID: {code}",close:"BACK TO MERCHANT"}},Gr={Success:"/txn-success.png",Voided:"/txn-success.png",Rejected:"/txn-failed.png",Failed:"/txn-failed.png",Canceled:"/txn-failed.png",PendingNotification:"/txn-pending.png","Pending Approval III":"/txn-pending.png","Pending Confirmation":"/txn-pending.png","Pending Approval I":"/txn-pending.png","Pending Offline Notification":"/txn-pending.png","Pending Approval II":"/txn-pending.png"},Vr={Deposit:"deposit",Withdraw:"withdrawal"},zr={Success:"success",Voided:"success",PendingNotification:"pending","Pending Approval III":"pending","Pending Confirmation":"pending","Pending Approval I":"pending","Pending Offline Notification":"pending","Pending Approval II":"pending",Rejected:"reject",Failed:"fail",Canceled:"cancel"},{document:Wr}=u;function Xr(e,t,n){const r=e.slice();return r[32]=t[n],r[34]=n,r}
|
661
|
+
// (168:5) {#if txnInfo}
|
662
|
+
function Kr(e){let t,n,i,o,s,l,c,u,f,g,v,T,C,_,B,L,A,P,H,S,M,R,k,O,I,$=/*$_*/e[9]("close")+"",N=/*txnInfo*/e[2].referenceId&&Yr(e),D=/*receiptFields*/e[3].length&&Zr(e);return{c(){t=m("div"),n=m("span"),n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.33279 0.00663425C7.89688 0.105453 6.49895 0.511564 5.2336 1.19749C3.96825 1.88341 2.86499 2.83313 1.9985 3.9824C0.985792 5.31809 0.356137 6.84155 0.0769857 8.63039C-0.0256619 9.28509 -0.0256619 10.7147 0.0769857 11.3694C0.505101 14.1158 1.83326 16.3704 3.9851 18.0027C5.31451 19.0117 6.84672 19.6451 8.63053 19.923C9.28522 20.0257 10.7148 20.0257 11.3695 19.923C13.803 19.5437 15.8709 18.4471 17.4232 16.7121C18.8001 15.1736 19.595 13.4737 19.923 11.3694C20.0257 10.7147 20.0257 9.28509 19.923 8.63039C19.6451 6.84655 19.0117 5.31433 18.0028 3.9849C17.1973 2.91304 16.1846 2.01398 15.0249 1.34112C13.8652 0.668249 12.5821 0.235297 11.2518 0.0679732C10.614 0.00852964 9.97311 -0.0119547 9.33279 0.00663425ZM11.3019 1.33481C14.7956 1.87685 17.641 4.45559 18.4885 7.848C18.69 8.65292 18.7288 9.00343 18.7288 9.99988C18.7288 10.6946 18.715 10.97 18.6675 11.2855C18.4018 13.0557 17.6016 14.7024 16.374 16.0052C15.1464 17.308 13.5501 18.2045 11.7988 18.5748C10.686 18.8127 9.31401 18.8127 8.20117 18.5748C4.93272 17.8788 2.33398 15.3927 1.52156 12.1868C1.31126 11.3556 1.2712 11.0101 1.2712 9.99988C1.2712 8.98966 1.31126 8.64416 1.52156 7.81295C1.91376 6.29839 2.70396 4.91631 3.81023 3.81003C4.9165 2.70374 6.29856 1.91353 7.81311 1.52133C8.0885 1.45123 8.49409 1.36986 8.7144 1.34107L9.21512 1.27347C9.46673 1.23967 10.9689 1.28349 11.3019 1.33481ZM9.5481 5.25925C8.67685 5.35439 7.88821 5.8138 7.33116 6.54987C7.12462 6.82277 7.042 7.06437 7.09332 7.25339C7.17594 7.56009 7.55398 7.71781 7.87945 7.58262C7.94079 7.55633 8.16236 7.36355 8.37016 7.15325C8.79201 6.72763 8.99981 6.59995 9.41541 6.51232C10.5533 6.27197 11.541 6.85532 11.596 7.79918C11.6086 8.02326 11.5998 8.08084 11.5259 8.24107C11.3632 8.59659 11.0177 8.88826 10.5095 9.09982C10.1439 9.24341 9.76155 9.33975 9.3716 9.38649L9.1275 9.40902L9.13876 10.5306L9.14878 11.6523L9.23265 11.8025C9.42542 12.1517 9.96745 12.2118 10.2378 11.9152C10.3793 11.7587 10.4056 11.6247 10.4256 10.9638L10.4431 10.3416L10.6635 10.2815C12.1518 9.88095 13.1433 8.66669 12.973 7.44993C12.8579 6.62248 12.3709 5.96027 11.586 5.56845C11.0778 5.31433 10.2278 5.18539 9.5481 5.25925ZM9.37285 13.0568C9.06365 13.2108 8.90092 13.4799 8.89967 13.8404C8.89717 14.6003 9.77342 15.0071 10.3405 14.5089C10.4789 14.3866 10.576 14.2244 10.6186 14.0447C10.6612 13.8649 10.6471 13.6764 10.5783 13.505C10.3755 13.0493 9.81098 12.839 9.37285 13.0568Z" fill="#111111"></path></svg>',i=b(),o=m("span"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" fill="none"><path d="M12.7711 0.229435C13.0582 0.517619 13.0755 0.973729 12.8215 1.28141L12.7711 1.33721L7.60685 6.50068L12.7711 11.6641C12.9128 11.8066 12.9944 11.998 12.999 12.1988C13.0035 12.3997 12.9308 12.5946 12.7957 12.7433C12.6606 12.892 12.4735 12.9832 12.2731 12.9979C12.0728 13.0126 11.8744 12.9497 11.7191 12.8223L11.6633 12.7719L6.49958 7.60791L1.3359 12.7719C1.19349 12.9136 1.00207 12.9952 0.801203 12.9998C0.60034 13.0044 0.405398 12.9316 0.256676 12.7965C0.107955 12.6614 0.0168256 12.4744 0.00212786 12.274C-0.0125699 12.0736 0.0502877 11.8753 0.177706 11.7199L0.228086 11.6641L5.3923 6.50068L0.228086 1.33721C0.0863637 1.1948 0.00478102 1.00338 0.000203544 0.802529C-0.00437393 0.601674 0.0684038 0.40674 0.203491 0.258024C0.338579 0.109308 0.525647 0.0181829 0.726024 0.00348576C0.9264 -0.0112114 1.12476 0.0516437 1.28011 0.179057L1.3359 0.229435L6.49958 5.39345L11.6633 0.229435C11.736 0.156695 11.8223 0.0989949 11.9174 0.0596283C12.0124 0.0202617 12.1143 0 12.2172 0C12.32 0 12.4219 0.0202617 12.5169 0.0596283C12.612 0.0989949 12.6983 0.156695 12.7711 0.229435Z" fill="#111111"></path></svg>',s=b(),l=m("div"),c=m("img"),f=b(),g=m("div"),v=m("h2"),T=y(/*title*/e[5]),C=b(),_=m("div"),B=y(/*subTitle*/e[4]),L=b(),A=m("div"),P=y(/*text*/e[6]),H=b(),N&&N.c(),S=b(),D&&D.c(),M=b(),R=m("button"),k=y($),w(t,"class","HeaderButtonContainer"),a(c.src,u=/*statusImageUrl*/e[7])||w(c,"src",u),w(c,"class","StatusLogo"),w(v,"class","Title"),w(_,"class","SubTitle"),w(g,"class","TitleWrapper"),w(l,"class","ReceiptWrapper"),w(A,"class","Text"),w(R,"class","PrimaryButton")},m(r,a){p(r,t,a),h(t,n),h(t,i),h(t,o),p(r,s,a),p(r,l,a),h(l,c),h(l,f),h(l,g),h(g,v),h(v,T),h(g,C),h(g,_),h(_,B),p(r,L,a),p(r,A,a),h(A,P),p(r,H,a),N&&N.m(r,a),p(r,S,a),D&&D.m(r,a),p(r,M,a),p(r,R,a),h(R,k),O||(I=[E(n,"click",/*liveChat*/e[11]),E(o,"click",/*closeReceipt*/e[10]),E(R,"click",/*closeReceipt*/e[10])],O=!0)},p(e,t){/*statusImageUrl*/128&t[0]&&!a(c.src,u=/*statusImageUrl*/e[7])&&w(c,"src",u),/*title*/32&t[0]&&x(T,/*title*/e[5]),/*subTitle*/16&t[0]&&x(B,/*subTitle*/e[4]),/*text*/64&t[0]&&x(P,/*text*/e[6]),/*txnInfo*/e[2].referenceId?N?N.p(e,t):(N=Yr(e),N.c(),N.m(S.parentNode,S)):N&&(N.d(1),N=null),/*receiptFields*/e[3].length?D?D.p(e,t):(D=Zr(e),D.c(),D.m(M.parentNode,M)):D&&(D.d(1),D=null),/*$_*/512&t[0]&&$!==($=/*$_*/e[9]("close")+"")&&x(k,$)},d(e){e&&d(t),e&&d(s),e&&d(l),e&&d(L),e&&d(A),e&&d(H),N&&N.d(e),e&&d(S),D&&D.d(e),e&&d(M),e&&d(R),O=!1,r(I)}}}
|
663
|
+
// (189:7) {#if txnInfo.referenceId}
|
664
|
+
function Yr(e){let t,n,r=/*$_*/e[9]("reference",{values:{code:/*txnInfo*/e[2].referenceId}})+"";return{c(){t=m("div"),n=y(r),w(t,"class","Reference")},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*$_, txnInfo*/516&t[0]&&r!==(r=/*$_*/e[9]("reference",{values:{code:/*txnInfo*/e[2].referenceId}})+"")&&x(n,r)},d(e){e&&d(t)}}}
|
665
|
+
// (192:7) {#if receiptFields.length}
|
666
|
+
function Zr(e){let t,n=/*receiptFields*/e[3],r=[];for(let t=0;t<n.length;t+=1)r[t]=ni(Xr(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=v()},m(e,n){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,n);p(e,t,n)},p(e,i){if(/*openUrlInNewTab, receiptFields, qrCodeContainer, FieldTypes*/4362&i[0]){let o;for(n=/*receiptFields*/e[3],o=0;o<n.length;o+=1){const s=Xr(e,n,o);r[o]?r[o].p(s,i):(r[o]=ni(s),r[o].c(),r[o].m(t.parentNode,t))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(e){f(r,e),e&&d(t)}}}
|
667
|
+
// (209:17) {:else}
|
668
|
+
function qr(e){let t,n,r=/*field*/e[32].defaultValue+"";return{c(){t=m("span"),n=y(r),w(t,"class","Label")},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*receiptFields*/8&t[0]&&r!==(r=/*field*/e[32].defaultValue+"")&&x(n,r)},d(e){e&&d(t)}}}
|
669
|
+
// (203:58)
|
670
|
+
function Qr(e){let t,n,r,i,o,s,a=/*field*/e[32].description+"",l=/*field*/e[32].Name+"";return{c(){t=m("span"),n=y(a),r=b(),i=m("a"),o=y(l),w(i,"href",s=/*field*/e[32].defaultValue),w(i,"target","_blank"),w(i,"rel","noopener noreferrer")},m(e,s){p(e,t,s),h(t,n),h(t,r),h(t,i),h(i,o)},p(e,t){/*receiptFields*/8&t[0]&&a!==(a=/*field*/e[32].description+"")&&x(n,a),/*receiptFields*/8&t[0]&&l!==(l=/*field*/e[32].Name+"")&&x(o,l),/*receiptFields*/8&t[0]&&s!==(s=/*field*/e[32].defaultValue)&&w(i,"href",s)},d(e){e&&d(t)}}}
|
671
|
+
// (201:59)
|
672
|
+
function Jr(e){let t,n,r;return{c(){t=m("img"),a(t.src,n=/*field*/e[32].defaultValue)||w(t,"src",n),w(t,"title",r=/*field*/e[32].description),w(t,"alt","")},m(e,n){p(e,t,n)},p(e,i){/*receiptFields*/8&i[0]&&!a(t.src,n=/*field*/e[32].defaultValue)&&w(t,"src",n),/*receiptFields*/8&i[0]&&r!==(r=/*field*/e[32].description)&&w(t,"title",r)},d(e){e&&d(t)}}}
|
673
|
+
// (199:58)
|
674
|
+
function ei(e){let t,n=/*field*/e[32].defaultValue+"";return{c(){t=m("span")},m(e,r){p(e,t,r),t.innerHTML=n},p(e,r){/*receiptFields*/8&r[0]&&n!==(n=/*field*/e[32].defaultValue+"")&&(t.innerHTML=n)},d(e){e&&d(t)}}}
|
675
|
+
// (195:17) {#if field.type === FieldTypes.QRCode}
|
676
|
+
function ti(e){let t,n,r,i,o,s=/*field*/e[32].defaultValue+"";function a(){/*click_handler*/
|
677
|
+
return e[22](/*field*/e[32])}return{c(){t=m("div"),n=m("div"),r=y(s),w(t,"class","QRCode")},m(s,l){p(s,t,l),h(t,n),h(n,r),
|
678
|
+
/*div0_binding*/e[21](n),i||(o=E(t,"click",a),i=!0)},p(t,n){e=t,/*receiptFields*/8&n[0]&&s!==(s=/*field*/e[32].defaultValue+"")&&x(r,s)},d(n){n&&d(t)
|
679
|
+
/*div0_binding*/,e[21](null),i=!1,o()}}}
|
680
|
+
// (193:10) {#each receiptFields as field, index}
|
681
|
+
function ni(e){let t,n;function r(e,t){/*field*/
|
682
|
+
return e[32].type===/*FieldTypes*/e[1].QRCode?ti:/*field*/e[32].type===/*FieldTypes*/e[1].Html?ei:/*field*/e[32].type===/*FieldTypes*/e[1].Image?Jr:/*field*/e[32].type===/*FieldTypes*/e[1].Link?Qr:qr}let i=r(e),o=i(e);return{c(){t=m("div"),o.c(),n=b(),w(t,"class","ReceiptField")},m(e,r){p(e,t,r),o.m(t,null),h(t,n)},p(e,s){i===(i=r(e))&&o?o.p(e,s):(o.d(1),o=i(e),o&&(o.c(),o.m(t,n)))},d(e){e&&d(t),o.d()}}}function ri(t){let n,r,i,o,s,l=/*txnInfo*/t[2]&&Kr(t);return{c(){n=m("script"),i=b(),o=m("div"),s=m("div"),l&&l.c(),this.c=e,a(n.src,r=ii)||w(n,"src",r),w(s,"class","CashierReceiptPage"),w(o,"class","CashierReceiptPageWidget")},m(e,r){h(Wr.head,n),p(e,i,r),p(e,o,r),h(o,s),l&&l.m(s,null)
|
683
|
+
/*div1_binding*/,t[23](o)},p(e,t){/*txnInfo*/e[2]?l?l.p(e,t):(l=Kr(e),l.c(),l.m(s,null)):l&&(l.d(1),l=null)},i:e,o:e,d(e){d(n),e&&d(i),e&&d(o),l&&l.d()
|
684
|
+
/*div1_binding*/,t[23](null)}}}let ii="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function oi(e,t,n){let r;c(e,kr,(e=>n(9,r=e)));let{endpoint:i}=t,{session:o}=t,{lang:s="en"}=t,{translationurl:a}=t,{assetsurl:l}=t,{customerid:u}=t,{clientstyling:h=""}=t,{clientstylingurl:p=""}=t;var d;let f;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(d||(d={}));let m,g,y,b,v,E=[],w=[];const T=()=>{var e;e=s,fr.set(e)};Object.keys(jr).forEach((e=>{Ur(e,jr[e])}));const C=()=>{const e=new URL(`${i}/v1/player/${u}/payment/GetPaymentInfo`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const s={method:"POST",headers:t,body:JSON.stringify({XPaymentSessionToken:o})};fetch(e,s).then((e=>e.json())).then((e=>{var t,i,o,s,a,c;n(2,f={type:e.Transaction.Type,referenceId:e.Transaction.Code,status:null===(t=e.Transaction.Status)||void 0===t?void 0:t.Status,message:null===(i=e.Transaction.Status)||void 0===i?void 0:i.Message,amount:null===(o=e.Transaction.Amounts[0])||void 0===o?void 0:o.Amount,currency:null===(s=e.Transaction.Amounts[0])||void 0===s?void 0:s.Currency}),n(3,E=e.ReceiptInfo&&e.ReceiptInfo.ReceiptFields?e.ReceiptInfo.ReceiptFields.map((e=>({type:e.Type,name:e.Name,description:e.Description,defaultValue:e.DefaultValue,useCopyButton:e.UseCopyButton,usePrintButton:e.UsePrintButton}))):[]),n(5,g=r((a=f.status,c=f.type,`${Vr[c]}.${zr[a]}.title`),{values:{amount:f.amount,currency:f.currency}})),n(4,m=r(((e,t)=>`${Vr[t]}.${zr[e]}.subTitle`)(f.status,f.type))),n(6,y=r(((e,t)=>`${Vr[t]}.${zr[e]}.text`)(f.status,f.type),{values:{errorText:f.message}})),n(7,b=((e,t)=>`${e+Gr[t]}`)(l,f.status))}))},x=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)};return e.$$set=e=>{"endpoint"in e&&n(13,i=e.endpoint),"session"in e&&n(14,o=e.session),"lang"in e&&n(15,s=e.lang),"translationurl"in e&&n(16,a=e.translationurl),"assetsurl"in e&&n(17,l=e.assetsurl),"customerid"in e&&n(18,u=e.customerid),"clientstyling"in e&&n(19,h=e.clientstyling),"clientstylingurl"in e&&n(20,p=e.clientstylingurl)},e.$$.update=()=>{/*endpoint, session, customerid*/286720&e.$$.dirty[0]&&i&&o&&u&&C(),/*lang*/32768&e.$$.dirty[0]&&s&&T(),/*lang, translationurl*/98304&e.$$.dirty[0]&&s&&a&&(()=>{if(a)fetch(a).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{Ur(t,e[t])}))})).catch((e=>{}))})(),/*clientstyling, customStylingContainer*/524289&e.$$.dirty[0]&&h&&v&&(()=>{let e=document.createElement("style");e.innerHTML=h,v.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/1048577&e.$$.dirty[0]&&p&&v&&(()=>{let e=new URL(p),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{v.appendChild(t)}),1),setTimeout((()=>{}),500)}))})()},[v,d,f,E,m,g,y,b,w,r,()=>{dispatchEvent(new CustomEvent("closeCashierReceiptPage",{bubbles:!0,cancelable:!0,composed:!0}))},()=>{dispatchEvent(new CustomEvent("liveChatReceiptPage",{bubbles:!0,cancelable:!0,composed:!0}))},x,i,o,s,a,l,u,h,p,function(e){R[e?"unshift":"push"]((()=>{w[w.length]=e,n(8,w)}))},e=>{x(e.description)},function(e){R[e?"unshift":"push"]((()=>{v=e,n(0,v)}))}]}
|
661
685
|
/* ../cashier-confirm-modal/src/CashierConfirmModal.svelte generated by Svelte v3.59.2 */
|
662
|
-
function
|
686
|
+
function si(t){let n,i,o,s,a,l,c,u,f,g,y,v;return{c(){n=m("div"),i=m("div"),o=m("div"),s=m("slot"),a=b(),l=m("slot"),c=b(),u=m("span"),u.innerHTML='<slot name="confirm"></slot>',f=b(),g=m("span"),g.innerHTML='<slot name="close"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></slot>',this.c=e,w(s,"name","title"),w(s,"class","CashierModalTitle"),w(l,"name","text"),w(l,"class","CashierModalText"),w(u,"class","ModalOkBtn"),w(u,"role","button"),w(g,"class","ModalCloseBtn"),w(g,"role","button"),w(o,"class","CashierModalContainer"),w(o,"part","CashierModalContainer"),w(i,"class","CashierModalWindow"),w(i,"part","CashierModalWindow"),w(i,"id","Modal"),w(n,"part","CustomStylingContainer")},m(e,r){p(e,n,r),h(n,i),h(i,o),h(o,s),h(o,a),h(o,l),h(o,c),h(o,u),h(o,f),h(o,g),y||(v=[E(u,"click",/*confirm*/t[1]),E(g,"click",/*close*/t[0])],y=!0)},p:e,i:e,o:e,d(e){e&&d(n),y=!1,r(v)}}}function ai(e){const t=()=>{dispatchEvent(new CustomEvent("closeModal",{bubbles:!0,cancelable:!0,composed:!0}))};return[t,()=>{dispatchEvent(new CustomEvent("confirmModal",{bubbles:!0,cancelable:!0,composed:!0})),t()}]}!customElements.get("cashier-receipt-page")&&customElements.define("cashier-receipt-page",class extends X{constructor(e){super();const t=document.createElement("style");t.textContent=".CashierReceiptPageWidget{height:100%}.CashierReceiptPage{border-radius:var(--emw--border-radius-large, 6px);background:var(--emw--color-background, #fff);padding:0 0 10px 0;margin:0 auto;max-width:530px;position:relative;word-wrap:break-word}.ReceiptWrapper{width:100%;height:200px;border-bottom:1px solid rgba(0, 0, 0, 0.1);background:linear-gradient(180deg, #e8e9eb, hsla(0, 0%, 75.7%, 0));display:flex;align-items:flex-end;flex-direction:row-reverse;position:relative}.TitleWrapper{display:flex;position:absolute;left:var(--emw--spacing-small, 12px);bottom:11px;flex-direction:column;justify-content:flex-end;flex-shrink:0}.Title{color:var(--emw--color-gray-300, #111);font-size:var(--emw--font-size-x-large, 26px);font-weight:var(--emw--font-weight-semibold, 500);margin-bottom:0;line-height:var(--emw--font-size-x-large, 26px)}.SubTitle{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-small, 14px);color:var(--emw--color-gray-150, #666);margin-top:var(--emw--spacing-small, 12px)}.Text{padding:var(--emw--spacing-small, 12px);font-size:var(--emw--font-size-small, 14px);color:var(--header-text-color, #111)}.Reference{color:var(--header-sub-text-color, #666);font-size:var(--emw--font-size-x-small, 12px);font-weight:var(--emw--font-weight-normal, 400);margin:0 var(--emw--spacing-small, 12px) 0}.PrimaryButton{color:var(--emw--color-white, #FFF);border:none;background:var(--emw--color-primary, #7EC51E);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:5px;border-radius:var(--emw--border-radius-medium, 5px);height:36px;font-size:var(--emw--font-size-x-small, 12px);margin:var(--emw--spacing-large, 20px) var(--emw--spacing-small, 12px);width:calc(100% - var(--emw--spacing-small, 12px) * 2)}.PrimaryButton:hover{background:var(--emw--color-hover, #71B11B)}.PrimaryButton:active{background:var(--emw--color-active, #5C950F)}.HeaderButtonContainer{position:absolute;z-index:1;right:0;display:flex;align-items:center;gap:var(--emw--spacing-small, 12px);padding:var(--emw--spacing-small, 12px)}.HeaderButtonContainer>span{cursor:pointer}.ReceiptField{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-small, 14px);line-height:var(--emw--font-size-medium, 16px);color:var(--emw--color-gray-150, #666);margin:var(--emw--spacing-small, 12px)}",this.shadowRoot.appendChild(t),W(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},oi,ri,o,{endpoint:13,session:14,lang:15,translationurl:16,assetsurl:17,customerid:18,clientstyling:19,clientstylingurl:20},null,[-1,-1]),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),U()))}static get observedAttributes(){return["endpoint","session","lang","translationurl","assetsurl","customerid","clientstyling","clientstylingurl"]}get endpoint(){return this.$$.ctx[13]}set endpoint(e){this.$$set({endpoint:e}),U()}get session(){return this.$$.ctx[14]}set session(e){this.$$set({session:e}),U()}get lang(){return this.$$.ctx[15]}set lang(e){this.$$set({lang:e}),U()}get translationurl(){return this.$$.ctx[16]}set translationurl(e){this.$$set({translationurl:e}),U()}get assetsurl(){return this.$$.ctx[17]}set assetsurl(e){this.$$set({assetsurl:e}),U()}get customerid(){return this.$$.ctx[18]}set customerid(e){this.$$set({customerid:e}),U()}get clientstyling(){return this.$$.ctx[19]}set clientstyling(e){this.$$set({clientstyling:e}),U()}get clientstylingurl(){return this.$$.ctx[20]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),U()}});
|
663
687
|
/* ../cashier-notifications/src/CashierNotifications.svelte generated by Svelte v3.59.2 */
|
664
|
-
function
|
688
|
+
function li(t){let n,r,i,o,s,a,l,c;return{c(){n=m("div"),r=m("span"),i=y(/*text*/t[0]),o=b(),s=m("button"),a=y(/*button*/t[1]),this.c=e,w(n,"class","cashier-notifications")},m(e,u){p(e,n,u),h(n,r),h(r,i),h(n,o),h(n,s),h(s,a),l||(c=E(s,"click",/*notificationClick*/t[2]),l=!0)},p(e,[t]){/*text*/1&t&&x(i,/*text*/e[0]),/*button*/2&t&&x(a,/*button*/e[1])},i:e,o:e,d(e){e&&d(n),l=!1,c()}}}function ci(e,t,n){let{text:r}=t,{button:i}=t;return e.$$set=e=>{"text"in e&&n(0,r=e.text),"button"in e&&n(1,i=e.button)},[r,i,()=>{dispatchEvent(new CustomEvent("notificationButtonClick",{bubbles:!0,cancelable:!0,composed:!0}))}]}!customElements.get("cashier-confirm-modal")&&customElements.define("cashier-confirm-modal",class extends X{constructor(e){super();const t=document.createElement("style");t.textContent="*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.CashierModalWindow{container-type:inline-size;container-name:confirm-modal;display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%;z-index:100;top:0;left:0;background-color:rgba(0, 0, 0, 0.1)}.CashierModalWindow .CashierModalContainer{width:500px;display:flex;gap:20px;align-items:center;position:relative;padding:15px;min-height:200px;box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.1);justify-content:center;border-radius:10px;flex-direction:column;background-color:#fff}.CashierModalWindow .ModalOkBtn{color:#FFF;display:flex;align-items:center;justify-content:center;font-size:14px;font-style:normal;font-weight:400;height:46px;border-radius:50px;line-height:normal;border:none;background-color:rgb(126, 197, 30);width:100%;margin:12px 0;cursor:pointer}.CashierModalWindow .ModalCloseBtn{position:absolute;display:flex;align-items:center;justify-content:center;top:-50px;right:-50px;padding:6px;border-radius:50%;color:#FFFFFF;background:rgba(84, 77, 77, 0.1);cursor:pointer;transition:all 150ms ease-in-out}.CashierModalWindow .ModalCloseBtn svg{width:32px;height:32px}.CashierModalWindow .ModalCloseBtn:hover{background:rgba(255, 255, 255, 0.2)}@container confirm-modal (max-width: 750px){.CashierModalContainer{margin:30px}.CashierModalContainer .ModalCloseBtn{top:-30px;right:-30px}.CashierModalContainer .ModalCloseBtn svg{width:20px;height:20px}}",this.shadowRoot.appendChild(t),W(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},ai,si,o,{},null),e&&e.target&&p(e.target,this,e.anchor)}});!customElements.get("cashier-notifications")&&customElements.define("cashier-notifications",class extends X{constructor(e){super();const t=document.createElement("style");t.textContent='.cashier-notifications{position:absolute;margin:12px 0;background-color:rgb(17, 17, 17);color:rgb(255, 255, 255);display:flex;border-radius:4px;align-items:center;gap:12px;padding:12px 15px;min-height:65px;pointer-events:auto;bottom:0;width:calc(100% - 30px)}.cashier-notifications span,.cashier-notifications button{font-family:"Roboto", sans-serif;border:none;font-variant:normal}.cashier-notifications span{line-height:normal}.cashier-notifications button{color:rgb(126, 197, 30);background-color:rgb(17, 17, 17);cursor:pointer;font-size:14px;font-style:normal;font-weight:700}',this.shadowRoot.appendChild(t),W(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},ci,li,o,{text:0,button:1},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),U()))}static get observedAttributes(){return["text","button"]}get text(){return this.$$.ctx[0]}set text(e){this.$$set({text:e}),U()}get button(){return this.$$.ctx[1]}set button(e){this.$$set({button:e}),U()}});
|
665
689
|
/* src/CashierMethodDetails.svelte generated by Svelte v3.59.2 */
|
666
|
-
const{document:
|
667
|
-
// (
|
668
|
-
function
|
669
|
-
|
690
|
+
const{document:ui,window:hi}=u;function pi(e,t,n){const r=e.slice();return r[100]=t[n],r[101]=t,r[102]=n,r}function di(e,t,n){const r=e.slice();return r[103]=t[n],r}
|
691
|
+
// (446:2) {#if selectedPaymentMethod?.Name}
|
692
|
+
function fi(e){let t,n,r,i=!/*showReceiptPage*/e[19]&&mi(e),o=/*showRedirectNotification*/e[21]&&Fi(e),s=/*showReceiptPage*/e[19]&&Ui(e);return{c(){t=m("div"),i&&i.c(),n=b(),o&&o.c(),r=b(),s&&s.c(),w(t,"class","MethodsDetails")},m(e,a){p(e,t,a),i&&i.m(t,null),h(t,n),o&&o.m(t,null),h(t,r),s&&s.m(t,null)},p(e,a){/*showReceiptPage*/e[19]?i&&(i.d(1),i=null):i?i.p(e,a):(i=mi(e),i.c(),i.m(t,n)),/*showRedirectNotification*/e[21]?o?o.p(e,a):(o=Fi(e),o.c(),o.m(t,r)):o&&(o.d(1),o=null),/*showReceiptPage*/e[19]?s?s.p(e,a):(s=Ui(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(e){e&&d(t),i&&i.d(),o&&o.d(),s&&s.d()}}}
|
693
|
+
// (448:6) {#if !showReceiptPage}
|
694
|
+
function mi(e){let t,n,r,i,o,s,l,c,u,g,v,T,C,_,B,L,A,P,H=/*selectedPaymentMethod*/e[15].Label+"",S=/*mobileView*/e[12]&&gi(e),M=/*selectedPaymentMethod*/e[15].Description&&yi(e),R=!/*selectedPaymentMethod*/e[15].HideAmountField&&bi(e),k=/*fields*/e[16],O=[];for(let t=0;t<k.length;t+=1)O[t]=Ii(pi(e,k,t));function I(e,t){/*isProcessingTxn*/
|
695
|
+
return e[24]?$i:Ni}let $=I(e),N=$(e),D=/*showRetryNotification*/e[23]&&Di(e);return{c(){t=m("form"),n=m("div"),r=m("div"),i=m("div"),o=m("img"),c=b(),u=m("div"),g=y(H),v=b(),S&&S.c(),T=b(),M&&M.c(),C=b(),R&&R.c(),_=b();for(let e=0;e<O.length;e+=1)O[e].c();B=b(),N.c(),L=b(),D&&D.c(),a(o.src,s=/*selectedPaymentMethod*/e[15].Logos[0].LogoUrl)||w(o,"src",s),w(o,"alt",l=/*selectedPaymentMethod*/e[15].Label),w(i,"class","SelectedLogoWrapper"),w(u,"class","SelectedLogoDescription"),w(r,"class","FormLogo"),w(n,"class","FieldWrapper")},m(s,a){p(s,t,a),h(t,n),h(n,r),h(r,i),h(i,o),h(r,c),h(r,u),h(u,g),h(r,v),S&&S.m(r,null),h(n,T),M&&M.m(n,null),h(n,C),R&&R.m(n,null),h(t,_);for(let e=0;e<O.length;e+=1)O[e]&&O[e].m(t,null);var l;h(t,B),N.m(t,null),h(t,L),D&&D.m(t,null),A||(P=E(t,"submit",(l=/*prepareTxn*/e[32],function(e){
|
670
696
|
// @ts-ignore
|
671
|
-
return e.preventDefault(),
|
672
|
-
// (
|
673
|
-
function
|
674
|
-
// (
|
675
|
-
function
|
676
|
-
// (
|
677
|
-
function
|
678
|
-
return e[
|
679
|
-
// (
|
680
|
-
function
|
681
|
-
// (
|
682
|
-
function
|
683
|
-
// (
|
684
|
-
function
|
685
|
-
// (
|
686
|
-
function
|
687
|
-
return e[
|
688
|
-
// (
|
689
|
-
function
|
690
|
-
// (
|
691
|
-
function
|
692
|
-
// (
|
693
|
-
function
|
694
|
-
/*input_input_handler_5*/e[
|
695
|
-
// (
|
696
|
-
function
|
697
|
-
// (
|
698
|
-
function
|
699
|
-
// (
|
700
|
-
function
|
701
|
-
return e[
|
702
|
-
/*div0_binding*/e[
|
703
|
-
/*div0_binding*/,e[
|
704
|
-
// (
|
705
|
-
function
|
706
|
-
/*input_change_handler*/e[
|
707
|
-
return e[
|
708
|
-
// (
|
709
|
-
function
|
710
|
-
return e[
|
711
|
-
// (
|
712
|
-
function
|
713
|
-
/*input_input_handler_4*/e[
|
714
|
-
// (
|
715
|
-
function
|
716
|
-
/*input_input_handler_3*/e[
|
717
|
-
return e[
|
718
|
-
return e[
|
719
|
-
// (
|
720
|
-
function
|
721
|
-
/*input_input_handler_2*/e[
|
722
|
-
return e[
|
723
|
-
return e[
|
724
|
-
// (
|
725
|
-
function
|
726
|
-
/*input_input_handler_1*/e[
|
727
|
-
return e[
|
728
|
-
return e[
|
729
|
-
// (
|
730
|
-
function
|
731
|
-
return e[
|
732
|
-
// (
|
733
|
-
function
|
734
|
-
// (
|
735
|
-
function
|
736
|
-
// (
|
737
|
-
function
|
738
|
-
// (
|
739
|
-
function
|
740
|
-
// (
|
741
|
-
function
|
742
|
-
// (
|
743
|
-
function
|
744
|
-
// (
|
745
|
-
function
|
746
|
-
|
747
|
-
/*div_binding*/,t[64](null),c=!1,u()}}}let xo="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function Bo(e,t,r){let n;c(e,Rn,(e=>r(23,n=e)));class o{constructor(e){this.correlationFieldName=e.CorrelationFieldName||null,this.correlationFieldValue=e.CorrelationFieldValue&&e.CorrelationFieldValue.length>0?e.CorrelationFieldValue.split(","):[],this.name=e.Name||null,this.label=e.Label||null,this.description=e.Description||null,this.type=e.Type||null,this.defaultValue=this.calcDefaultValue(e),this.format=e.Format||null,this.placeholder=e.Placeholder||null,this.isReadonly=e.IsReadonly||!1,this.isRequired=e.IsRequired||!1,this.maxValue=e.MaxValue||null,this.minValue=e.MinValue||null,this.isPrimaryField=e.IsPrimaryField||!1,this.demandUserInput=e.DemandUserInput||!1,this.autoTrim=e.AutoTrim||!1,this.autoUppercase=e.AutoUppercase||!1,this.notEqualToFieldName=e.NotEqualToFieldName||null,this.values=e.Values,this.useCopyButton=e.UseCopyButton||!1,this.inputMask=e.InputMask,this.tags=e.Tags||null}calcDefaultValue(e){return 2===this.type?"True"===e.DefaultValue:e.DefaultValue||null}get descriptionWithLink(){if("Boolean"===i[this.type]&&this.placeholder||"Link"===i[this.type]){const e=/{link}/i,t=`<a href="${this.placeholder||this.defaultValue}" target="_blank" rel="noopener noreferrer">${this.label}</a>`;return this.description.match(e)?this.description.replace(e,t):`${this.description} ${t}`}return this.description}}let{FieldTypes:i}=t;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(i||(i={}));let s,{endpoint:a}=t,{session:l}=t,{lang:u="en"}=t,{local:h="en-US"}=t,{translationurl:p}=t,{customerid:f}=t,{currency:d}=t,{amount:m}=t,{selectedpaymentmethodname:y}=t,{clientstyling:b=""}=t,{clientstylingurl:g=""}=t,{RedirectionModeStringEnum:v}=t;!function(e){e.Default="Default",e.RedirectWithRetry="Redirect"}(v||(v={}));let E,w,T,C,x,B,A,L,S,P,M={},R=[],N={},I=!1,k=[],D=!1,$=window.navigator.userAgent,F=window.matchMedia("(max-width: 750px)"),U=new Intl.NumberFormat(h,{minimumFractionDigits:2}),G="",j={},V={};const z=()=>{var e;e=u,dn.set(e)};Object.keys(In).forEach((e=>{Nn(e,In[e])}));var X;X=()=>(window.addEventListener("closeModal",J,!1),window.addEventListener("confirmModal",ee,!1),window.addEventListener("closeIframe",Q,!1),window.addEventListener("notificationButtonClick",te,!1),document.addEventListener("click",W),()=>{window.removeEventListener("closeModal",J),window.removeEventListener("confirmModal",ee),window.removeEventListener("closeIframe",Q),window.removeEventListener("notificationButtonClick",te)}),H().$$.on_mount.push(X);const W=e=>{L&&(r(21,j[L]=!0,j),oe(R.find((e=>e.name===L)))),e.composedPath().includes(S)||r(19,L=null)},K=(e,t)=>{t!==L?(S=e.composedPath()[0],r(19,L=t)):r(19,L=null)},q=()=>{dispatchEvent(new CustomEvent("backToMethodList",{bubbles:!0,cancelable:!0,composed:!0})),Z()},Z=()=>{dispatchEvent(new CustomEvent("hidePaymentDetails",{detail:{hideMethodDetails:D},bubbles:!0,cancelable:!0,composed:!0}))},Y=()=>{dispatchEvent(new CustomEvent("hideMethodsList",{detail:{hideMethodsList:D},bubbles:!0,cancelable:!0,composed:!0}))},Q=()=>{r(14,w=null)},J=()=>{r(13,I=!1)},ee=()=>{r(18,A=!0);const e=new URL(`${a}/v1/player/${f}/payment/GetPaymentConfirm`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s})};fetch(e,n).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,r(14,w=e.RedirectUrl),r(16,x=e.RedirectionMode),r(18,A=!1),e.RedirectionMode===v.RedirectWithRetry&&(T=window.open(e.RedirectUrl,"_blank"),r(15,C=!!T),T||r(17,B=!0))}))},te=()=>{T=window.open(w,"_blank"),r(15,C=!0),r(17,B=!1)},re=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)},ne=()=>{r(20,G=(m?"":n("errorEmptyField"))||(M.DisplayCurrency.MinAmountLimit>m?n("minAmountError",{values:{amount:U.format(M.DisplayCurrency.MinAmountLimit),currency:M.DisplayCurrency.Name}}):"")||(M.DisplayCurrency.MaxAmountLimit<m?n("maxAmountError",{values:{amount:U.format(M.DisplayCurrency.MaxAmountLimit),currency:M.DisplayCurrency.Name}}):"")||(M.AmountMultiplier&&M.AmountMultiplier%m!=0?n("amountMultiplierError",{values:{multiplier:M.AmountMultiplier}}):"")||(M.IsIntegerAmount&&!Number.isInteger(m)?n("amountIntError"):"")||(Number(m).toFixed(2)!=m?n("amountDecimalError"):""))},oe=e=>{const t=N[e.name];r(22,V[e.name]=((e,t)=>!e.isRequired||t&&t.toString().trim()?"":n("errorEmptyField"))(e,t)||((e,t)=>e.format&&!t.toString().match(e.format)?n("invalidFieldError",{values:{field:e.label}}):"")(e,t),V)};return e.$$set=e=>{"FieldTypes"in e&&r(0,i=e.FieldTypes),"endpoint"in e&&r(34,a=e.endpoint),"session"in e&&r(35,l=e.session),"lang"in e&&r(3,u=e.lang),"local"in e&&r(36,h=e.local),"translationurl"in e&&r(4,p=e.translationurl),"customerid"in e&&r(37,f=e.customerid),"currency"in e&&r(5,d=e.currency),"amount"in e&&r(1,m=e.amount),"selectedpaymentmethodname"in e&&r(38,y=e.selectedpaymentmethodname),"clientstyling"in e&&r(39,b=e.clientstyling),"clientstylingurl"in e&&r(40,g=e.clientstylingurl),"RedirectionModeStringEnum"in e&&r(2,v=e.RedirectionModeStringEnum)},e.$$.update=()=>{/*currency*/32&e.$$.dirty[0]|/*endpoint, session, selectedpaymentmethodname*/152&e.$$.dirty[1]&&a&&l&&y&&d&&(()=>{const e=new URL(`${a}/v1/player/${f}/payment/GetPaymentMethod`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({PaymentMethodName:y,Currency:d,XPaymentSessionToken:l})};fetch(e,n).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,r(10,M=e.PaymentMethod),r(21,j={}),r(12,N={}),r(22,V={}),ne(),r(11,R=M.Fields&&M.Fields.map((e=>new o(e)))),R.forEach((e=>{oe(e)})),Y()}))})(),/*customStylingContainer*/64&e.$$.dirty[0]|/*clientstyling*/256&e.$$.dirty[1]&&b&&E&&(()=>{let e=document.createElement("style");e.innerHTML=b,E.appendChild(e)})(),/*customStylingContainer*/64&e.$$.dirty[0]|/*clientstylingurl*/512&e.$$.dirty[1]&&g&&E&&(()=>{let e=new URL(g),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{E.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*lang*/8&e.$$.dirty[0]&&u&&z(),/*lang, translationurl*/24&e.$$.dirty[0]&&u&&p&&(()=>{if(p)fetch(p).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{Nn(t,e[t])}))})).catch((e=>{}))})(),/*qrCodeContainer*/128&e.$$.dirty[0]|/*selectedpaymentmethodname*/128&e.$$.dirty[1]&&y&&k.length&&k.forEach((e=>{if(e&&e.innerText){const t=e.innerText;e.innerText="",new QRCode(e,{text:t,width:250,height:250})}})),/*innerWidth*/512&e.$$.dirty[0]&&P&&r(8,D=(e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)))($)||F.matches),/*mobileView*/256&e.$$.dirty[0]&&D.toString()&&Y()},[i,m,v,u,p,d,E,k,D,P,M,R,N,I,w,C,x,B,A,L,G,j,V,n,U,K,()=>{r(18,A=!0);const e=new URL(`${a}/v1/player/${f}/payment/GetPaymentPrepare`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const n={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s,Transaction:{PaymentMethod:M.Name,Amount:m,Currency:d,CustomFields:N},Account:{}})};fetch(e,n).then((e=>e.json())).then((e=>{s=e.XPaymentSessionToken,r(18,A=!1),r(13,I=!0)}))},q,re,e=>{if(!e.correlationFieldName)return!0;const t=e.correlationFieldValue.includes(N[e.correlationFieldName]);return!t&&N[e.name]&&delete N[e.name],t},ne,oe,(e,t)=>!!e||Object.values(t).some((e=>!!e)),o,a,l,h,f,y,b,g,function(){r(9,P=Xn.innerWidth)},()=>q(),function(){m=_(this.value),r(1,m)},()=>ne(),()=>{r(21,j.amount=!0,j),ne()},function(e){N[e.name]=this.value,r(12,N)},e=>{oe(e)},e=>{r(21,j[e.name]=!0,j),oe(e)},function(e){N[e.name]=_(this.value),r(12,N)},e=>{oe(e)},e=>{r(21,j[e.name]=!0,j),oe(e)},function(e){N[e.name]=this.value,r(12,N)},e=>{oe(e)},e=>{r(21,j[e.name]=!0,j),oe(e)},function(e){N[e.name]=this.value,r(12,N)},(e,t)=>K(t,e.name),(e,t)=>{r(12,N[e.name]=t.Name,N),r(11,R)},function(e){N[e.name]=this.checked,r(12,N)},e=>{r(21,j[e.name]=!0,j),oe(e)},function(e){O[e?"unshift":"push"]((()=>{k[k.length]=e,r(7,k)}))},e=>{re(e.description)},function(e){N[e.name]=this.value,r(12,N)},()=>{r(15,C=!1)},function(e){O[e?"unshift":"push"]((()=>{E=e,r(6,E)}))}]}class Ao extends W{constructor(e){super();const t=document.createElement("style");t.textContent='@keyframes loading-spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.MethodsDetails{position:relative;display:flex;flex-direction:column;gap:5px}.MethodsDetails:has(.RedirectionNotification) form{visibility:hidden}.FormLogo{align-items:center;display:flex;height:50px;border-bottom:1px solid var(--emw--color-gray-100, #E8E9EB)}.FormLogo .SelectedLogoDescription{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);margin:7px 5px 7px 7px;word-break:break-word}.FormLogo .SelectedLogoWrapper{width:56px;height:32px;flex-shrink:0;background:var(--emw--color-background, #FFF);border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-large, 6px)}.FormLogo .SelectedLogoWrapper img{max-height:32px;max-width:56px}.FormLogo .ChangePaymeth{margin-left:auto;cursor:pointer;color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);text-decoration-line:underline}.SelectedMethodDescription{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:10px 0 5px;line-height:var(--emw--font-size-x-small, 12px)}.RedirectionNotification{height:100%;width:inherit;position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}.RedirectionNotification .RedirectionClose{display:flex;width:234px;height:36px;flex-direction:column;justify-content:center;flex-shrink:0;color:var(--emw--color-white, #FFF);cursor:pointer;text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:500;line-height:normal;text-transform:uppercase;border-radius:4px;background:var(--emw--color-primary, #7EC51E)}.RedirectionNotification .RedirectionTitle{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none;font-weight:var(--emw--font-weight-bold, 600)}.RedirectionNotification .RedirectionMessage{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none}cashier-iframe-redirect{height:inherit;width:inherit}.IframeRedirect{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%;z-index:100;top:0;left:0;background-color:var(--emw--color-gray-transparency-20, rgba(0, 0, 0, 0.2))}.FieldWrapper,label{display:flex;flex-direction:column}.FieldWrapper{background-color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));border-radius:6px;box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.1);padding:0 15px 15px;margin-bottom:10px}.FieldWrapper:has(.QRCode, .Label){box-shadow:none;background:transparent}.FieldWrapper.Hidden{height:0;visibility:hidden;margin:0;padding:0}.Alert{display:none}.Invalid input,.Invalid .Selected{border-color:var(--emw--color-error, #FE0101)}.Invalid .Alert{display:inline-block}.Invalid .AmountLimits{display:none}.Alert{color:var(--emw--color-error, #FE0101);font-size:var(--emw--font-size-x-small, 12px);margin:5px 0 0 2px;line-height:var(--emw--font-size-x-small, 12px)}.AmountLimits{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:5px 0 0 2px;line-height:var(--emw--font-size-x-small, 12px)}input,.Selected{border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);height:40px;line-height:var(--emw--size-small, 14px);color:var(--emw--color-black, #111);padding:0 15px}input:focus,.Selected:focus{outline:none}label{color:var(--emw--color-black, #111);font-size:var(--emw--size-small, 14px);margin-top:7px;line-height:27px}label span.Required:before{content:"*";display:inline-block;margin-right:2px}.Description{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:0 0 5px 2px;line-height:var(--emw--font-size-x-small, 12px)}.PrimaryButton{color:var(--emw--color-white, #FFF);text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:400;height:46px;border-radius:50px;line-height:normal;border:none;background:var(--emw--color-primary, #7EC51E);width:100%;margin:12px 0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:5px}.PrimaryButton .ButtonAmount{font-weight:600}.PrimaryButton .ButtonSpinner{animation:loading-spinner 1s linear infinite;background:var(--emw--color-active, #5C950F)}.PrimaryButton[disabled]{background:var(--emw--color-disabled, rgba(153, 153, 153, 0.5019607843));cursor:auto;pointer-events:none}.PrimaryButton:hover{background:var(--emw--color-hover, #71B11B)}.PrimaryButton:active{background:var(--emw--color-active, #5C950F)}.QRCode{width:250px;margin:auto}.Checkbox{display:flex;position:relative;margin-top:12px}.Checkbox .Description{margin:0 0 0 20px;cursor:pointer;line-height:var(--emw--font-size-medium, 16px)}.Checkbox .Checkmark{position:absolute;top:2px;left:0;height:12px;width:12px;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);background-color:var(--emw--color-white, #FFF);cursor:pointer}.Checkbox .Checkmark:after{content:"";position:absolute;display:none}.Checkbox .Checkmark:after{left:4px;top:0;width:2px;height:8px;border:solid var(--emw--color-white, #FFF);border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.Checkbox input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.Checkbox input:checked~.Checkmark{background-color:var(--emw--color-primary, #7EC51E);border-color:var(--emw--color-primary, #7EC51E)}.Checkbox input:checked~.Checkmark:after{display:block}.CustomSelect{width:100%;position:relative}.Selected{display:flex;align-items:center;cursor:pointer}.Selected:after{position:absolute;content:"";top:19px;right:10px;width:0;height:0;border:6px solid transparent;border-color:rgb(168, 169, 170) transparent transparent transparent}.OptionList{display:none;position:absolute;top:100%;left:0;right:0;z-index:99;background-color:white;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);margin-top:5px}.OptionList div{padding:8px 16px;cursor:pointer;user-select:none}.OptionList div:hover{background-color:var(--emw--color-background-secondary, #F9F9F9)}.OptionList.Opened{display:block}',this.shadowRoot.appendChild(t),X(this,{target:this.shadowRoot,props:A(this.attributes),customElement:!0},Bo,Co,i,{PaymentMethodDetails:33,FieldTypes:0,endpoint:34,session:35,lang:3,local:36,translationurl:4,customerid:37,currency:5,amount:1,selectedpaymentmethodname:38,clientstyling:39,clientstylingurl:40,RedirectionModeStringEnum:2},null,[-1,-1,-1,-1]),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),U()))}static get observedAttributes(){return["PaymentMethodDetails","FieldTypes","endpoint","session","lang","local","translationurl","customerid","currency","amount","selectedpaymentmethodname","clientstyling","clientstylingurl","RedirectionModeStringEnum"]}get PaymentMethodDetails(){return this.$$.ctx[33]}get FieldTypes(){return this.$$.ctx[0]}set FieldTypes(e){this.$$set({FieldTypes:e}),U()}get endpoint(){return this.$$.ctx[34]}set endpoint(e){this.$$set({endpoint:e}),U()}get session(){return this.$$.ctx[35]}set session(e){this.$$set({session:e}),U()}get lang(){return this.$$.ctx[3]}set lang(e){this.$$set({lang:e}),U()}get local(){return this.$$.ctx[36]}set local(e){this.$$set({local:e}),U()}get translationurl(){return this.$$.ctx[4]}set translationurl(e){this.$$set({translationurl:e}),U()}get customerid(){return this.$$.ctx[37]}set customerid(e){this.$$set({customerid:e}),U()}get currency(){return this.$$.ctx[5]}set currency(e){this.$$set({currency:e}),U()}get amount(){return this.$$.ctx[1]}set amount(e){this.$$set({amount:e}),U()}get selectedpaymentmethodname(){return this.$$.ctx[38]}set selectedpaymentmethodname(e){this.$$set({selectedpaymentmethodname:e}),U()}get clientstyling(){return this.$$.ctx[39]}set clientstyling(e){this.$$set({clientstyling:e}),U()}get clientstylingurl(){return this.$$.ctx[40]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),U()}get RedirectionModeStringEnum(){return this.$$.ctx[2]}set RedirectionModeStringEnum(e){this.$$set({RedirectionModeStringEnum:e}),U()}}return!customElements.get("cashier-method-details")&&customElements.define("cashier-method-details",Ao),Ao}));
|
697
|
+
return e.preventDefault(),l.call(this,e)})),A=!0)},p(e,i){if(/*selectedPaymentMethod*/32768&i[0]&&!a(o.src,s=/*selectedPaymentMethod*/e[15].Logos[0].LogoUrl)&&w(o,"src",s),/*selectedPaymentMethod*/32768&i[0]&&l!==(l=/*selectedPaymentMethod*/e[15].Label)&&w(o,"alt",l),/*selectedPaymentMethod*/32768&i[0]&&H!==(H=/*selectedPaymentMethod*/e[15].Label+"")&&x(g,H),/*mobileView*/e[12]?S?S.p(e,i):(S=gi(e),S.c(),S.m(r,null)):S&&(S.d(1),S=null),/*selectedPaymentMethod*/e[15].Description?M?M.p(e,i):(M=yi(e),M.c(),M.m(n,C)):M&&(M.d(1),M=null),/*selectedPaymentMethod*/e[15].HideAmountField?R&&(R.d(1),R=null):R?R.p(e,i):(R=bi(e),R.c(),R.m(n,null)),/*fields, FieldTypes, showError, fieldValidation, prepareFields, openedLookup, qrCodeContainer*/436406273&i[0]|/*validateField, showLookup, openUrlInNewTab, showField*/89&i[1]){let n;for(k=/*fields*/e[16],n=0;n<k.length;n+=1){const r=pi(e,k,n);O[n]?O[n].p(r,i):(O[n]=Ii(r),O[n].c(),O[n].m(t,B))}for(;n<O.length;n+=1)O[n].d(1);O.length=k.length}$===($=I(e))&&N?N.p(e,i):(N.d(1),N=$(e),N&&(N.c(),N.m(t,L))),/*showRetryNotification*/e[23]?D?D.p(e,i):(D=Di(e),D.c(),D.m(t,null)):D&&(D.d(1),D=null)},d(e){e&&d(t),S&&S.d(),M&&M.d(),R&&R.d(),f(O,e),N.d(),D&&D.d(),A=!1,P()}}}
|
698
|
+
// (458:14) {#if mobileView}
|
699
|
+
function gi(e){let t,n,r,i,o=/*$_*/e[29]("change")+"";return{c(){t=m("div"),n=y(o),w(t,"class","ChangePaymeth")},m(o,s){p(o,t,s),h(t,n),r||(i=E(t,"click",/*click_handler*/e[45]),r=!0)},p(e,t){/*$_*/536870912&t[0]&&o!==(o=/*$_*/e[29]("change")+"")&&x(n,o)},d(e){e&&d(t),r=!1,i()}}}
|
700
|
+
// (462:12) {#if selectedPaymentMethod.Description}
|
701
|
+
function yi(e){let t,n,r=/*selectedPaymentMethod*/e[15].Description+"";return{c(){t=m("div"),n=y(r),w(t,"class","SelectedMethodDescription")},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*selectedPaymentMethod*/32768&t[0]&&r!==(r=/*selectedPaymentMethod*/e[15].Description+"")&&x(n,r)},d(e){e&&d(t)}}}
|
702
|
+
// (467:12) {#if !selectedPaymentMethod.HideAmountField}
|
703
|
+
function bi(e){let t,n,r,i,o,s=/*$_*/e[29]("amountLabel")+"";function a(e,t){/*selectedPaymentMethod*/
|
704
|
+
return e[15].IsAmountConfigurable?Ei:vi}let l=a(e),c=l(e);return{c(){t=m("div"),n=m("label"),r=m("span"),i=y(s),o=b(),c.c(),w(r,"class","Required"),w(t,"class","Amount"),B(t,"Invalid",/*amountError*/e[26]&&/*showError*/e[27].amount)},m(e,s){p(e,t,s),h(t,n),h(n,r),h(r,i),h(n,o),c.m(n,null)},p(e,r){/*$_*/536870912&r[0]&&s!==(s=/*$_*/e[29]("amountLabel")+"")&&x(i,s),l===(l=a(e))&&c?c.p(e,r):(c.d(1),c=l(e),c&&(c.c(),c.m(n,null))),/*amountError, showError*/201326592&r[0]&&B(t,"Invalid",/*amountError*/e[26]&&/*showError*/e[27].amount)},d(e){e&&d(t),c.d()}}}
|
705
|
+
// (487:16) {:else}
|
706
|
+
function vi(e){let t,n,r,i,o=/*formatter*/e[30].format(/*amount*/e[1])+"";return{c(){t=m("span"),n=y(o),r=b(),i=y(/*currency*/e[8]),w(t,"class","NonConfigurableAmount")},m(e,o){p(e,t,o),h(t,n),h(t,r),h(t,i)},p(e,t){/*amount*/2&t[0]&&o!==(o=/*formatter*/e[30].format(/*amount*/e[1])+"")&&x(n,o),/*currency*/256&t[0]&&x(i,/*currency*/e[8])},d(e){e&&d(t)}}}
|
707
|
+
// (473:16) {#if selectedPaymentMethod.IsAmountConfigurable}
|
708
|
+
function Ei(e){let t,n,i,o,s,a,l,c,u,f=/*selectedPaymentMethod*/e[15].DisplayCurrency&&wi(e);return{c(){t=m("input"),i=b(),o=m("span"),s=y(/*amountError*/e[26]),a=b(),f&&f.c(),l=v(),w(t,"type","number"),w(t,"placeholder",n=/*$_*/e[29]("amountPlaceholder")),w(o,"class","Alert")},m(n,r){p(n,t,r),_(t,/*amount*/e[1]),p(n,i,r),p(n,o,r),h(o,s),p(n,a,r),f&&f.m(n,r),p(n,l,r),c||(u=[E(t,"input",/*input_input_handler*/e[46]),E(t,"input",/*input_handler*/e[47]),E(t,"blur",/*blur_handler*/e[48])],c=!0)},p(e,r){/*$_*/536870912&r[0]&&n!==(n=/*$_*/e[29]("amountPlaceholder"))&&w(t,"placeholder",n),/*amount*/2&r[0]&&C(t.value)!==/*amount*/e[1]&&_(t,/*amount*/e[1]),/*amountError*/67108864&r[0]&&x(s,/*amountError*/e[26]),/*selectedPaymentMethod*/e[15].DisplayCurrency?f?f.p(e,r):(f=wi(e),f.c(),f.m(l.parentNode,l)):f&&(f.d(1),f=null)},d(e){e&&d(t),e&&d(i),e&&d(o),e&&d(a),f&&f.d(e),e&&d(l),c=!1,r(u)}}}
|
709
|
+
// (481:18) {#if selectedPaymentMethod.DisplayCurrency}
|
710
|
+
function wi(e){let t,n,r,i,o=/*selectedPaymentMethod*/e[15].DisplayCurrency.MinAmountLimit?`${/*$_*/e[29]("generalMin")} ${/*formatter*/e[30].format(/*selectedPaymentMethod*/e[15].DisplayCurrency.MinAmountLimit)} ${/*currency*/e[8]}`:"",s=/*selectedPaymentMethod*/e[15].DisplayCurrency.MaxAmountLimit?`/ ${/*$_*/e[29]("generalMax")} ${/*formatter*/e[30].format(/*selectedPaymentMethod*/e[15].DisplayCurrency.MaxAmountLimit)} ${/*currency*/e[8]}`:"";return{c(){t=m("span"),n=y(o),r=b(),i=y(s),w(t,"class","AmountLimits")},m(e,o){p(e,t,o),h(t,n),h(t,r),h(t,i)},p(e,t){/*selectedPaymentMethod, $_, currency*/536903936&t[0]&&o!==(o=/*selectedPaymentMethod*/e[15].DisplayCurrency.MinAmountLimit?`${/*$_*/e[29]("generalMin")} ${/*formatter*/e[30].format(/*selectedPaymentMethod*/e[15].DisplayCurrency.MinAmountLimit)} ${/*currency*/e[8]}`:"")&&x(n,o),/*selectedPaymentMethod, $_, currency*/536903936&t[0]&&s!==(s=/*selectedPaymentMethod*/e[15].DisplayCurrency.MaxAmountLimit?`/ ${/*$_*/e[29]("generalMax")} ${/*formatter*/e[30].format(/*selectedPaymentMethod*/e[15].DisplayCurrency.MaxAmountLimit)} ${/*currency*/e[8]}`:"")&&x(i,s)},d(e){e&&d(t)}}}
|
711
|
+
// (497:14) {#if showField(field)}
|
712
|
+
function Ti(e){let t,n,r,i,o,s,a,l=/*fieldValidation*/(e[28][/*field*/e[100].name]||"")+"",c=/*field*/e[100].label&&/*field*/e[100].type!==/*FieldTypes*/e[0].Link&&/*field*/e[100].type!==/*FieldTypes*/e[0].Boolean&&Ci(e),u=/*field*/e[100].description&&/*field*/e[100].description!==/*field*/e[100].label&&/*field*/e[100].type!==/*FieldTypes*/e[0].QRCode&&/*field*/e[100].type!==/*FieldTypes*/e[0].Boolean&&/*field*/e[100].type!==/*FieldTypes*/e[0].Link&&xi(e);function f(e,t){/*field*/
|
713
|
+
return e[100].type===/*FieldTypes*/e[0].Text?ki:/*field*/e[100].type===/*FieldTypes*/e[0].Number||/*field*/e[100].type===/*FieldTypes*/e[0].Money?Ri:/*field*/e[100].type===/*FieldTypes*/e[0].Password?Mi:/*field*/e[100].type===/*FieldTypes*/e[0].Hidden?Si:/*field*/e[100].type===/*FieldTypes*/e[0].Lookup?Hi:/*field*/e[100].type===/*FieldTypes*/e[0].Boolean?Pi:/*field*/e[100].type===/*FieldTypes*/e[0].QRCode?Ai:/*field*/e[100].type===/*FieldTypes*/e[0].Link?Li:/*field*/e[100].type===/*FieldTypes*/e[0].Label?Bi:_i}let g=f(e),v=g(e);return{c(){t=m("div"),n=m("label"),c&&c.c(),r=b(),u&&u.c(),i=b(),v.c(),o=b(),s=m("span"),a=y(l),w(s,"class","Alert"),w(t,"class","FieldWrapper"),B(t,"Hidden",/*field*/e[100].type===/*FieldTypes*/e[0].Hidden),B(t,"Invalid",/*showError*/e[27][/*field*/e[100].name]&&/*fieldValidation*/e[28][/*field*/e[100].name])},m(e,l){p(e,t,l),h(t,n),c&&c.m(n,null),h(n,r),u&&u.m(n,null),h(n,i),v.m(n,null),h(t,o),h(t,s),h(s,a)},p(e,o){/*field*/e[100].label&&/*field*/e[100].type!==/*FieldTypes*/e[0].Link&&/*field*/e[100].type!==/*FieldTypes*/e[0].Boolean?c?c.p(e,o):(c=Ci(e),c.c(),c.m(n,r)):c&&(c.d(1),c=null),/*field*/e[100].description&&/*field*/e[100].description!==/*field*/e[100].label&&/*field*/e[100].type!==/*FieldTypes*/e[0].QRCode&&/*field*/e[100].type!==/*FieldTypes*/e[0].Boolean&&/*field*/e[100].type!==/*FieldTypes*/e[0].Link?u?u.p(e,o):(u=xi(e),u.c(),u.m(n,i)):u&&(u.d(1),u=null),g===(g=f(e))&&v?v.p(e,o):(v.d(1),v=g(e),v&&(v.c(),v.m(n,null))),/*fieldValidation, fields*/268500992&o[0]&&l!==(l=/*fieldValidation*/(e[28][/*field*/e[100].name]||"")+"")&&x(a,l),/*fields, FieldTypes*/65537&o[0]&&B(t,"Hidden",/*field*/e[100].type===/*FieldTypes*/e[0].Hidden),/*showError, fields, fieldValidation*/402718720&o[0]&&B(t,"Invalid",/*showError*/e[27][/*field*/e[100].name]&&/*fieldValidation*/e[28][/*field*/e[100].name])},d(e){e&&d(t),c&&c.d(),u&&u.d(),v.d()}}}
|
714
|
+
// (502:20) {#if field.label && field.type !== FieldTypes.Link && field.type !== FieldTypes.Boolean}
|
715
|
+
function Ci(e){let t,n,r=/*field*/e[100].label+"";return{c(){t=m("span"),n=y(r),B(t,"Required",/*field*/e[100].isRequired)},m(e,r){p(e,t,r),h(t,n)},p(e,i){/*fields*/65536&i[0]&&r!==(r=/*field*/e[100].label+"")&&x(n,r),/*fields*/65536&i[0]&&B(t,"Required",/*field*/e[100].isRequired)},d(e){e&&d(t)}}}
|
716
|
+
// (505:20) {#if field.description && field.description !== field.label && field.type !== FieldTypes.QRCode && field.type !== FieldTypes.Boolean && field.type !== FieldTypes.Link}
|
717
|
+
function xi(e){let t,n,r=/*field*/e[100].description+"";return{c(){t=m("span"),n=y(r),w(t,"class","Description")},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*fields*/65536&t[0]&&r!==(r=/*field*/e[100].description+"")&&x(n,r)},d(e){e&&d(t)}}}
|
718
|
+
// (554:20) {:else}
|
719
|
+
function _i(e){let t,n,r,i;function o(){
|
720
|
+
/*input_input_handler_5*/e[65].call(t,/*field*/e[100])}return{c(){t=m("input"),w(t,"type","text"),w(t,"placeholder",n=/*field*/e[100].placeholder)},m(n,s){p(n,t,s),_(t,/*prepareFields*/e[17][/*field*/e[100].name]),r||(i=E(t,"input",o),r=!0)},p(r,i){e=r,/*fields*/65536&i[0]&&n!==(n=/*field*/e[100].placeholder)&&w(t,"placeholder",n),/*prepareFields, fields*/196608&i[0]&&t.value!==/*prepareFields*/e[17][/*field*/e[100].name]&&_(t,/*prepareFields*/e[17][/*field*/e[100].name])},d(e){e&&d(t),r=!1,i()}}}
|
721
|
+
// (552:62)
|
722
|
+
function Bi(t){let n;return{c(){n=m("span"),w(n,"class","Label")},m(e,t){p(e,n,t)},p:e,d(e){e&&d(n)}}}
|
723
|
+
// (550:61)
|
724
|
+
function Li(e){let t,n=/*field*/e[100].descriptionWithLink+"";return{c(){t=m("span")},m(e,r){p(e,t,r),t.innerHTML=n},p(e,r){/*fields*/65536&r[0]&&n!==(n=/*field*/e[100].descriptionWithLink+"")&&(t.innerHTML=n)},d(e){e&&d(t)}}}
|
725
|
+
// (546:63)
|
726
|
+
function Ai(e){let t,n,r,i,o,s=/*field*/e[100].defaultValue+"";function a(){/*click_handler_3*/
|
727
|
+
return e[64](/*field*/e[100])}return{c(){t=m("div"),n=m("div"),r=y(s),w(t,"class","QRCode")},m(s,l){p(s,t,l),h(t,n),h(n,r),
|
728
|
+
/*div0_binding*/e[63](n),i||(o=E(t,"click",a),i=!0)},p(t,n){e=t,/*fields*/65536&n[0]&&s!==(s=/*field*/e[100].defaultValue+"")&&x(r,s)},d(n){n&&d(t)
|
729
|
+
/*div0_binding*/,e[63](null),i=!1,o()}}}
|
730
|
+
// (538:64)
|
731
|
+
function Pi(e){let t,n,i,o,s,a,l,c,u,f=/*field*/e[100].descriptionWithLink+"";function g(){
|
732
|
+
/*input_change_handler*/e[61].call(n,/*field*/e[100])}function y(){/*change_handler*/
|
733
|
+
return e[62](/*field*/e[100])}return{c(){t=m("div"),n=m("input"),o=b(),s=m("span"),a=b(),l=m("span"),w(n,"type","checkbox"),w(n,"placeholder",i=/*field*/e[100].placeholder),w(s,"class","Checkmark"),w(l,"class","Description"),w(t,"class","Checkbox")},m(r,i){p(r,t,i),h(t,n),n.checked=/*prepareFields*/e[17][/*field*/e[100].name],h(t,o),h(t,s),h(t,a),h(t,l),l.innerHTML=f,c||(u=[E(n,"change",g),E(n,"change",y)],c=!0)},p(t,r){e=t,/*fields*/65536&r[0]&&i!==(i=/*field*/e[100].placeholder)&&w(n,"placeholder",i),/*prepareFields, fields*/196608&r[0]&&(n.checked=/*prepareFields*/e[17][/*field*/e[100].name]),/*fields*/65536&r[0]&&f!==(f=/*field*/e[100].descriptionWithLink+"")&&(l.innerHTML=f)},d(e){e&&d(t),c=!1,r(u)}}}
|
734
|
+
// (527:63)
|
735
|
+
function Hi(e){let t,n,r,i,o,s,a,l=/*prepareFields*/(e[17][/*field*/e[100].name]||"")+"";function c(...t){/*click_handler_1*/
|
736
|
+
return e[59](/*field*/e[100],...t)}let u=/*field*/e[100].values,g=[];for(let t=0;t<u.length;t+=1)g[t]=Oi(di(e,u,t));return{c(){t=m("div"),n=m("div"),r=y(l),i=b(),o=m("div");for(let e=0;e<g.length;e+=1)g[e].c();w(n,"class","Selected"),w(n,"id",/*index*/e[102]),w(o,"class","OptionList"),B(o,"Opened",/*openedLookup*/e[25]===/*field*/e[100].name),w(t,"class","CustomSelect")},m(e,l){p(e,t,l),h(t,n),h(n,r),h(t,i),h(t,o);for(let e=0;e<g.length;e+=1)g[e]&&g[e].m(o,null);s||(a=E(n,"click",c),s=!0)},p(t,n){if(e=t,/*prepareFields, fields*/196608&n[0]&&l!==(l=/*prepareFields*/(e[17][/*field*/e[100].name]||"")+"")&&x(r,l),/*prepareFields, fields*/196608&n[0]){let t;for(u=/*field*/e[100].values,t=0;t<u.length;t+=1){const r=di(e,u,t);g[t]?g[t].p(r,n):(g[t]=Oi(r),g[t].c(),g[t].m(o,null))}for(;t<g.length;t+=1)g[t].d(1);g.length=u.length}/*openedLookup, fields*/33619968&n[0]&&B(o,"Opened",/*openedLookup*/e[25]===/*field*/e[100].name)},d(e){e&&d(t),f(g,e),s=!1,a()}}}
|
737
|
+
// (524:63)
|
738
|
+
function Si(e){let t,n,r,i;function o(){
|
739
|
+
/*input_input_handler_4*/e[58].call(t,/*field*/e[100])}return{c(){t=m("input"),w(t,"type","hidden"),w(t,"placeholder",n=/*field*/e[100].placeholder)},m(n,s){p(n,t,s),_(t,/*prepareFields*/e[17][/*field*/e[100].name]),r||(i=E(t,"input",o),r=!0)},p(r,i){e=r,/*fields*/65536&i[0]&&n!==(n=/*field*/e[100].placeholder)&&w(t,"placeholder",n),/*prepareFields, fields*/196608&i[0]&&_(t,/*prepareFields*/e[17][/*field*/e[100].name])},d(e){e&&d(t),r=!1,i()}}}
|
740
|
+
// (519:65)
|
741
|
+
function Mi(e){let t,n,i,o;function s(){
|
742
|
+
/*input_input_handler_3*/e[55].call(t,/*field*/e[100])}function a(){/*input_handler_3*/
|
743
|
+
return e[56](/*field*/e[100])}function l(){/*blur_handler_3*/
|
744
|
+
return e[57](/*field*/e[100])}return{c(){t=m("input"),w(t,"type","password"),w(t,"placeholder",n=/*field*/e[100].placeholder)},m(n,r){p(n,t,r),_(t,/*prepareFields*/e[17][/*field*/e[100].name]),i||(o=[E(t,"input",s),E(t,"input",a),E(t,"blur",l)],i=!0)},p(r,i){e=r,/*fields*/65536&i[0]&&n!==(n=/*field*/e[100].placeholder)&&w(t,"placeholder",n),/*prepareFields, fields*/196608&i[0]&&t.value!==/*prepareFields*/e[17][/*field*/e[100].name]&&_(t,/*prepareFields*/e[17][/*field*/e[100].name])},d(e){e&&d(t),i=!1,r(o)}}}
|
745
|
+
// (514:98)
|
746
|
+
function Ri(e){let t,n,i,o;function s(){
|
747
|
+
/*input_input_handler_2*/e[52].call(t,/*field*/e[100])}function a(){/*input_handler_2*/
|
748
|
+
return e[53](/*field*/e[100])}function l(){/*blur_handler_2*/
|
749
|
+
return e[54](/*field*/e[100])}return{c(){t=m("input"),w(t,"type","number"),w(t,"placeholder",n=/*field*/e[100].placeholder)},m(n,r){p(n,t,r),_(t,/*prepareFields*/e[17][/*field*/e[100].name]),i||(o=[E(t,"input",s),E(t,"input",a),E(t,"blur",l)],i=!0)},p(r,i){e=r,/*fields*/65536&i[0]&&n!==(n=/*field*/e[100].placeholder)&&w(t,"placeholder",n),/*prepareFields, fields*/196608&i[0]&&C(t.value)!==/*prepareFields*/e[17][/*field*/e[100].name]&&_(t,/*prepareFields*/e[17][/*field*/e[100].name])},d(e){e&&d(t),i=!1,r(o)}}}
|
750
|
+
// (508:20) {#if field.type === FieldTypes.Text}
|
751
|
+
function ki(e){let t,n,i,o;function s(){
|
752
|
+
/*input_input_handler_1*/e[49].call(t,/*field*/e[100])}function a(){/*input_handler_1*/
|
753
|
+
return e[50](/*field*/e[100])}function l(){/*blur_handler_1*/
|
754
|
+
return e[51](/*field*/e[100])}return{c(){t=m("input"),w(t,"type","text"),w(t,"placeholder",n=/*field*/e[100].placeholder)},m(n,r){p(n,t,r),_(t,/*prepareFields*/e[17][/*field*/e[100].name]),i||(o=[E(t,"input",s),E(t,"input",a),E(t,"blur",l)],i=!0)},p(r,i){e=r,/*fields*/65536&i[0]&&n!==(n=/*field*/e[100].placeholder)&&w(t,"placeholder",n),/*prepareFields, fields*/196608&i[0]&&t.value!==/*prepareFields*/e[17][/*field*/e[100].name]&&_(t,/*prepareFields*/e[17][/*field*/e[100].name])},d(e){e&&d(t),i=!1,r(o)}}}
|
755
|
+
// (531:26) {#each field.values as value}
|
756
|
+
function Oi(e){let t,n,r,i,o,s,a=/*value*/e[103].Value+"";function l(){/*click_handler_2*/
|
757
|
+
return e[60](/*field*/e[100],/*value*/e[103])}return{c(){t=m("div"),n=m("span"),r=y(a),i=b()},m(e,a){p(e,t,a),h(t,n),h(n,r),h(t,i),o||(s=E(t,"click",l),o=!0)},p(t,n){e=t,/*fields*/65536&n[0]&&a!==(a=/*value*/e[103].Value+"")&&x(r,a)},d(e){e&&d(t),o=!1,s()}}}
|
758
|
+
// (496:12) {#each fields as field, index}
|
759
|
+
function Ii(e){let t,n=/*showField*/e[35](/*field*/e[100]),r=n&&Ti(e);return{c(){r&&r.c(),t=v()},m(e,n){r&&r.m(e,n),p(e,t,n)},p(e,i){/*fields*/65536&i[0]&&(n=/*showField*/e[35](/*field*/e[100])),n?r?r.p(e,i):(r=Ti(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},d(e){r&&r.d(e),e&&d(t)}}}
|
760
|
+
// (570:10) {:else}
|
761
|
+
function $i(e){let t,n,r,i,o,s=/*$_*/e[29]("processingButton")+"";return{c(){t=m("button"),n=g("svg"),r=g("path"),i=b(),o=y(s),w(r,"d","M14.0282 6.58425C13.9037 4.05374 12.3688 1.68916 10.0872 0.61058C7.59818 -0.509483 4.56986 -0.0531603 2.49567 1.68916C0.504443 3.34851 -0.408201 6.04496 0.172573 8.57547C0.711862 11.0645 2.6616 13.0972 5.10915 13.7609C8.0545 14.5906 10.7509 13.1802 12.4103 10.7741C10.9169 12.7653 8.63527 14.0928 6.10476 13.6365C3.57424 13.1802 1.50005 11.2719 0.919281 8.78289C0.297024 6.12793 1.54154 3.34851 3.90612 1.97955C6.35366 0.569097 9.79682 1.10839 11.4147 3.51445C11.8295 4.09522 12.1199 4.80045 12.2444 5.50567C12.3688 6.08644 12.3273 6.7087 12.4103 7.28947C12.4933 7.82876 12.9496 8.53399 13.5718 8.16063C14.1111 7.82876 14.0696 7.12354 14.0282 6.58425C14.0696 6.87464 14.0282 6.41831 14.0282 6.58425Z"),w(r,"fill","white"),w(n,"class","ButtonSpinner"),w(n,"xmlns","http://www.w3.org/2000/svg"),w(n,"width","15"),w(n,"height","14"),w(n,"viewBox","0 0 15 14"),w(n,"fill","none"),w(t,"class","PrimaryButton")},m(e,s){p(e,t,s),h(t,n),h(n,r),h(t,i),h(t,o)},p(e,t){/*$_*/536870912&t[0]&&s!==(s=/*$_*/e[29]("processingButton")+"")&&x(o,s)},d(e){e&&d(t)}}}
|
762
|
+
// (562:10) {#if !isProcessingTxn}
|
763
|
+
function Ni(e){let t,n,r,i,o,s,a,l,c,u,f,v=/*$_*/e[29]("makeDepositButton")+"",E=/*formatter*/e[30].format(/*amount*/e[1])+"";return{c(){t=m("button"),n=g("svg"),r=g("path"),i=b(),o=y(v),s=b(),a=m("span"),l=y(E),c=b(),u=y(/*currency*/e[8]),w(r,"fill-rule","evenodd"),w(r,"clip-rule","evenodd"),w(r,"d","M7.51564 0.574496C6.49714 0.733152 5.5928 1.46162 5.21164 2.43037C5.01714 2.92471 4.98674 3.24368 4.98671 4.78987L4.98668 5.99306L4.55336 6.00671C4.20693 6.01762 4.08258 6.03221 3.93336 6.07946C3.43136 6.23846 3.00318 6.58293 2.73943 7.04C2.70133 7.106 2.63639 7.256 2.59508 7.37334L2.52002 7.58665V13.9067L2.59268 14.12C2.6993 14.4331 2.83849 14.6518 3.09336 14.9067C3.34821 15.1615 3.56693 15.3007 3.88002 15.4073L4.09336 15.48H11.9067L12.12 15.4073C12.4331 15.3007 12.6518 15.1615 12.9067 14.9067C13.1616 14.6518 13.3007 14.4331 13.4074 14.12L13.48 13.9067V7.58665L13.405 7.37334C13.1846 6.74712 12.6999 6.27875 12.0667 6.08C11.9191 6.03371 11.7891 6.0184 11.4467 6.00696L11.0134 5.99253L11.0133 4.78959C11.0133 4.128 11.0008 3.45465 10.9855 3.29334C10.9257 2.66268 10.7188 2.13556 10.3497 1.67368C9.66549 0.817589 8.6023 0.405214 7.51564 0.574496ZM8.46436 1.58665C9.01596 1.7035 9.52999 2.11659 9.79758 2.65809C9.98521 3.03771 9.98202 3.00646 9.99305 4.58L10.003 6H5.99702L6.00699 4.58C6.01802 3.00646 6.01483 3.03771 6.20246 2.65809C6.31793 2.42446 6.43799 2.26065 6.61818 2.09103C6.89043 1.83468 7.21371 1.65496 7.52352 1.58775C7.74977 1.53865 8.23518 1.53809 8.46436 1.58665ZM11.9201 7.0955C12.0975 7.17871 12.2992 7.37412 12.3874 7.54806C12.4231 7.61846 12.465 7.75796 12.4805 7.85803C12.4993 7.97978 12.5061 8.97962 12.501 10.88L12.4934 13.72L12.4082 13.8997C12.26 14.2127 12.0016 14.419 11.6821 14.4796C11.4864 14.5167 4.51364 14.5167 4.31793 14.4796C3.99843 14.419 3.74008 14.2127 3.59183 13.8997L3.50668 13.72L3.49905 10.88C3.49393 8.97728 3.50074 7.97987 3.51964 7.85778C3.57627 7.49218 3.79218 7.21543 4.12918 7.0765L4.28002 7.01431L8.02668 7.0205L11.7734 7.02665L11.9201 7.0955Z"),w(r,"fill","white"),w(n,"class","ButtonLock"),w(n,"xmlns","http://www.w3.org/2000/svg"),w(n,"width","16"),w(n,"height","16"),w(n,"viewBox","0 0 16 16"),w(n,"fill","none"),w(a,"class","ButtonAmount"),w(t,"class","PrimaryButton"),w(t,"type","submit"),t.disabled=f=/*isSubmitDisabled*/e[38](/*amountError*/e[26],/*fieldValidation*/e[28])},m(e,d){p(e,t,d),h(t,n),h(n,r),h(t,i),h(t,o),h(t,s),h(t,a),h(a,l),h(a,c),h(a,u)},p(e,n){/*$_*/536870912&n[0]&&v!==(v=/*$_*/e[29]("makeDepositButton")+"")&&x(o,v),/*amount*/2&n[0]&&E!==(E=/*formatter*/e[30].format(/*amount*/e[1])+"")&&x(l,E),/*currency*/256&n[0]&&x(u,/*currency*/e[8]),/*amountError, fieldValidation*/335544320&n[0]&&f!==(f=/*isSubmitDisabled*/e[38](/*amountError*/e[26],/*fieldValidation*/e[28]))&&(t.disabled=f)},d(e){e&&d(t)}}}
|
764
|
+
// (578:10) {#if showRetryNotification}
|
765
|
+
function Di(e){let t,n,r;return{c(){t=m("cashier-notifications"),T(t,"text",n=/*$_*/e[29]("retryText")),T(t,"button",r=/*$_*/e[29]("retryButton"))},m(e,n){p(e,t,n)},p(e,i){/*$_*/536870912&i[0]&&n!==(n=/*$_*/e[29]("retryText"))&&T(t,"text",n),/*$_*/536870912&i[0]&&r!==(r=/*$_*/e[29]("retryButton"))&&T(t,"button",r)},d(e){e&&d(t)}}}
|
766
|
+
// (587:6) {#if showRedirectNotification}
|
767
|
+
function Fi(e){let t,n,r,i,o,s,l,c,u,f,g,v,T,C,_=/*$_*/e[29]("redirectTitle")+"",B=/*$_*/e[29]("redirectMessage")+"",L=/*$_*/e[29]("backToPayment")+"";return{c(){t=m("div"),n=m("img"),i=b(),o=m("span"),s=y(_),l=b(),c=m("span"),u=y(B),f=b(),g=m("div"),v=y(L),a(n.src,r="//static.everymatrix.com/mmstage/cashier/assets/redirect.png")||w(n,"src","//static.everymatrix.com/mmstage/cashier/assets/redirect.png"),w(n,"alt",""),w(o,"class","RedirectionTitle"),w(c,"class","RedirectionMessage"),w(g,"class","RedirectionClose"),w(t,"class","RedirectionNotification")},m(r,a){p(r,t,a),h(t,n),h(t,i),h(t,o),h(o,s),h(t,l),h(t,c),h(c,u),h(t,f),h(t,g),h(g,v),T||(C=E(g,"click",/*click_handler_4*/e[66]),T=!0)},p(e,t){/*$_*/536870912&t[0]&&_!==(_=/*$_*/e[29]("redirectTitle")+"")&&x(s,_),/*$_*/536870912&t[0]&&B!==(B=/*$_*/e[29]("redirectMessage")+"")&&x(u,B),/*$_*/536870912&t[0]&&L!==(L=/*$_*/e[29]("backToPayment")+"")&&x(v,L)},d(e){e&&d(t),T=!1,C()}}}
|
768
|
+
// (595:6) {#if showReceiptPage}
|
769
|
+
function Ui(e){let t,n;return{c(){t=m("div"),n=m("cashier-receipt-page"),T(n,"lang",/*lang*/e[4]),T(n,"translationurl",/*translationurl*/e[6]),T(n,"local",/*local*/e[5]),T(n,"endpoint",/*endpoint*/e[3]),T(n,"customerid",/*customerid*/e[7]),T(n,"assetsurl",/*assetsurl*/e[9]),T(n,"session",/*xPaymentSessionToken*/e[14]),w(t,"class","ReceiptPage")},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*lang*/16&t[0]&&T(n,"lang",/*lang*/e[4]),/*translationurl*/64&t[0]&&T(n,"translationurl",/*translationurl*/e[6]),/*local*/32&t[0]&&T(n,"local",/*local*/e[5]),/*endpoint*/8&t[0]&&T(n,"endpoint",/*endpoint*/e[3]),/*customerid*/128&t[0]&&T(n,"customerid",/*customerid*/e[7]),/*assetsurl*/512&t[0]&&T(n,"assetsurl",/*assetsurl*/e[9]),/*xPaymentSessionToken*/16384&t[0]&&T(n,"session",/*xPaymentSessionToken*/e[14])},d(e){e&&d(t)}}}
|
770
|
+
// (611:2) {#if redirectUrl && redirectMode === RedirectionModeStringEnum.Default}
|
771
|
+
function ji(e){let t,n;return{c(){t=m("div"),n=m("cashier-iframe-redirect"),T(n,"lang",/*lang*/e[4]),T(n,"translationurl",/*translationurl*/e[6]),T(n,"iframeurl",/*redirectUrl*/e[20]),w(t,"class","IframeRedirect")},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*lang*/16&t[0]&&T(n,"lang",/*lang*/e[4]),/*translationurl*/64&t[0]&&T(n,"translationurl",/*translationurl*/e[6]),/*redirectUrl*/1048576&t[0]&&T(n,"iframeurl",/*redirectUrl*/e[20])},d(e){e&&d(t)}}}
|
772
|
+
// (620:2) {#if showConfirmModal}
|
773
|
+
function Gi(e){let t,n,r,i,o,s,a,l,c,u,f,g=/*$_*/e[29]("confirmDepositText")+"",v=/*formatter*/e[30].format(/*amount*/e[1])+"",E=/*$_*/e[29]("confirmDepositButton")+"";return{c(){t=m("cashier-confirm-modal"),n=m("span"),r=y(g),i=b(),o=y(v),s=b(),a=y(/*currency*/e[8]),l=y(" ?"),c=b(),u=m("div"),f=y(E),w(n,"slot","text"),w(u,"slot","confirm")},m(e,d){p(e,t,d),h(t,n),h(n,r),h(n,i),h(n,o),h(n,s),h(n,a),h(n,l),h(t,c),h(t,u),h(u,f)},p(e,t){/*$_*/536870912&t[0]&&g!==(g=/*$_*/e[29]("confirmDepositText")+"")&&x(r,g),/*amount*/2&t[0]&&v!==(v=/*formatter*/e[30].format(/*amount*/e[1])+"")&&x(o,v),/*currency*/256&t[0]&&x(a,/*currency*/e[8]),/*$_*/536870912&t[0]&&E!==(E=/*$_*/e[29]("confirmDepositButton")+"")&&x(f,E)},d(e){e&&d(t)}}}function Vi(t){let n,r,i,o,s,l,c,u;N(/*onwindowresize*/t[44]);let f=/*selectedPaymentMethod*/t[15]?.Name&&fi(t),g=/*redirectUrl*/t[20]&&/*redirectMode*/t[22]===/*RedirectionModeStringEnum*/t[2].Default&&ji(t),y=/*showConfirmModal*/t[18]&&Gi(t);return{c(){n=m("script"),i=b(),o=m("div"),f&&f.c(),s=b(),g&&g.c(),l=b(),y&&y.c(),this.c=e,a(n.src,r=zi)||w(n,"src",r),w(o,"class","CashierMethodDetails")},m(e,r){h(ui.head,n),p(e,i,r),p(e,o,r),f&&f.m(o,null),h(o,s),g&&g.m(o,null),h(o,l),y&&y.m(o,null)
|
774
|
+
/*div_binding*/,t[67](o),c||(u=E(hi,"resize",/*onwindowresize*/t[44]),c=!0)},p(e,t){/*selectedPaymentMethod*/e[15]?.Name?f?f.p(e,t):(f=fi(e),f.c(),f.m(o,s)):f&&(f.d(1),f=null),/*redirectUrl*/e[20]&&/*redirectMode*/e[22]===/*RedirectionModeStringEnum*/e[2].Default?g?g.p(e,t):(g=ji(e),g.c(),g.m(o,l)):g&&(g.d(1),g=null),/*showConfirmModal*/e[18]?y?y.p(e,t):(y=Gi(e),y.c(),y.m(o,null)):y&&(y.d(1),y=null)},i:e,o:e,d(e){d(n),e&&d(i),e&&d(o),f&&f.d(),g&&g.d(),y&&y.d()
|
775
|
+
/*div_binding*/,t[67](null),c=!1,u()}}}let zi="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js";function Wi(e,t,n){let r;c(e,kr,(e=>n(29,r=e)));class i{constructor(e){this.correlationFieldName=e.CorrelationFieldName||null,this.correlationFieldValue=e.CorrelationFieldValue&&e.CorrelationFieldValue.length>0?e.CorrelationFieldValue.split(","):[],this.name=e.Name||null,this.label=e.Label||null,this.description=e.Description||null,this.type=e.Type||null,this.defaultValue=this.calcDefaultValue(e),this.format=e.Format||null,this.placeholder=e.Placeholder||null,this.isReadonly=e.IsReadonly||!1,this.isRequired=e.IsRequired||!1,this.maxValue=e.MaxValue||null,this.minValue=e.MinValue||null,this.isPrimaryField=e.IsPrimaryField||!1,this.demandUserInput=e.DemandUserInput||!1,this.autoTrim=e.AutoTrim||!1,this.autoUppercase=e.AutoUppercase||!1,this.notEqualToFieldName=e.NotEqualToFieldName||null,this.values=e.Values,this.useCopyButton=e.UseCopyButton||!1,this.inputMask=e.InputMask,this.tags=e.Tags||null}calcDefaultValue(e){return 2===this.type?"True"===e.DefaultValue:e.DefaultValue||null}get descriptionWithLink(){if("Boolean"===o[this.type]&&this.placeholder||"Link"===o[this.type]){const e=/{link}/i,t=`<a href="${this.placeholder||this.defaultValue}" target="_blank" rel="noopener noreferrer">${this.label}</a>`;return this.description.match(e)?this.description.replace(e,t):`${this.description} ${t}`}return this.description}}let{FieldTypes:o}=t;!function(e){e.Unknown="Unknown",e.Text="Text",e.Boolean="Boolean",e.Number="Number",e.Money="Money",e.DateTime="DateTime",e.Lookup="Lookup",e.IpAddress="IpAddress",e.Date="Date",e.Time="Time",e.LookupCollection="LookupCollection",e.Hidden="Hidden",e.Label="Label",e.Password="Password",e.Link="Link",e.Image="Image",e.Html="Html",e.QRCode="QR"}(o||(o={}));let s,{endpoint:a}=t,{session:l}=t,{lang:u="en"}=t,{local:h="en-US"}=t,{translationurl:p}=t,{customerid:d}=t,{currency:f}=t,{amount:m}=t,{assetsurl:g}=t,{selectedpaymentmethodname:y}=t,{clientstyling:b=""}=t,{clientstylingurl:v=""}=t,{RedirectionModeStringEnum:E}=t;!function(e){e.Default="Default",e.RedirectWithRetry="Redirect"}(E||(E={}));let w,T,x,_,B,L,A,P,S,M,k={},O=[],I={},$=!1,N=!1,D=[],F=!1,U=window.navigator.userAgent,j=window.matchMedia("(max-width: 750px)"),G=new Intl.NumberFormat(h,{minimumFractionDigits:2}),V="",z={},W={};const X=()=>{var e;e=u,fr.set(e)};Object.keys(Ir).forEach((e=>{Or(e,Ir[e])}));var K;K=()=>(window.addEventListener("closeModal",te,!1),window.addEventListener("confirmModal",ne,!1),window.addEventListener("closeIframe",ee,!1),window.addEventListener("notificationButtonClick",re,!1),window.addEventListener("closeCashierReceiptPage",ie,!1),document.addEventListener("click",Y),()=>{window.removeEventListener("closeModal",te),window.removeEventListener("confirmModal",ne),window.removeEventListener("closeIframe",ee),window.removeEventListener("notificationButtonClick",re),window.removeEventListener("closeCashierReceiptPage",ie)}),H().$$.on_mount.push(K);const Y=e=>{P&&(n(27,z[P]=!0,z),ae(O.find((e=>e.name===P)))),e.composedPath().includes(S)||n(25,P=null)},Z=(e,t)=>{t!==P?(S=e.composedPath()[0],n(25,P=t)):n(25,P=null)},q=()=>{dispatchEvent(new CustomEvent("backToMethodList",{bubbles:!0,cancelable:!0,composed:!0})),Q()},Q=()=>{dispatchEvent(new CustomEvent("hidePaymentDetails",{detail:{hideMethodDetails:F},bubbles:!0,cancelable:!0,composed:!0}))},J=()=>{dispatchEvent(new CustomEvent("hideMethodsList",{detail:{hideMethodsList:F},bubbles:!0,cancelable:!0,composed:!0}))},ee=()=>{n(20,T=null),n(19,N=!0)},te=()=>{n(18,$=!1)},ne=()=>{n(24,A=!0);const e=new URL(`${a}/v1/player/${d}/payment/GetPaymentConfirm`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s})};fetch(e,r).then((e=>e.json())).then((e=>{n(14,s=e.XPaymentSessionToken),n(20,T=e.RedirectUrl),n(22,B=e.RedirectionMode),n(24,A=!1),T||n(19,N=!0),e.RedirectionMode===E.RedirectWithRetry&&(x=window.open(e.RedirectUrl,"_blank"),n(21,_=!!x),x||n(23,L=!0))}))},re=()=>{x=window.open(T,"_blank"),n(21,_=!0),n(23,L=!1)},ie=()=>{n(19,N=!1)},oe=e=>{e&&window.postMessage({type:"NavigateTo",path:e,target:"_blank",externalLink:!1},window.location.href)},se=()=>{n(26,V=(m?"":r("errorEmptyField"))||(k.DisplayCurrency.MinAmountLimit>m?r("minAmountError",{values:{amount:G.format(k.DisplayCurrency.MinAmountLimit),currency:k.DisplayCurrency.Name}}):"")||(k.DisplayCurrency.MaxAmountLimit<m?r("maxAmountError",{values:{amount:G.format(k.DisplayCurrency.MaxAmountLimit),currency:k.DisplayCurrency.Name}}):"")||(k.AmountMultiplier&&m%k.AmountMultiplier!=0?r("amountMultiplierError",{values:{multiplier:k.AmountMultiplier}}):"")||(k.IsIntegerAmount&&!Number.isInteger(m)?r("amountIntError"):"")||(Number(m).toFixed(2)!=m?r("amountDecimalError"):""))},ae=e=>{const t=I[e.name];n(28,W[e.name]=((e,t)=>!e.isRequired||t&&t.toString().trim()?"":r("errorEmptyField"))(e,t)||((e,t)=>e.format&&!t.toString().match(e.format)?r("invalidFieldError",{values:{field:e.label}}):"")(e,t),W)};return e.$$set=e=>{"FieldTypes"in e&&n(0,o=e.FieldTypes),"endpoint"in e&&n(3,a=e.endpoint),"session"in e&&n(40,l=e.session),"lang"in e&&n(4,u=e.lang),"local"in e&&n(5,h=e.local),"translationurl"in e&&n(6,p=e.translationurl),"customerid"in e&&n(7,d=e.customerid),"currency"in e&&n(8,f=e.currency),"amount"in e&&n(1,m=e.amount),"assetsurl"in e&&n(9,g=e.assetsurl),"selectedpaymentmethodname"in e&&n(41,y=e.selectedpaymentmethodname),"clientstyling"in e&&n(42,b=e.clientstyling),"clientstylingurl"in e&&n(43,v=e.clientstylingurl),"RedirectionModeStringEnum"in e&&n(2,E=e.RedirectionModeStringEnum)},e.$$.update=()=>{/*endpoint, currency*/264&e.$$.dirty[0]|/*session, selectedpaymentmethodname*/1536&e.$$.dirty[1]&&a&&l&&y&&f&&(()=>{const e=new URL(`${a}/v1/player/${d}/payment/GetPaymentMethod`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({PaymentMethodName:y,Currency:f,XPaymentSessionToken:l})};fetch(e,r).then((e=>e.json())).then((e=>{n(14,s=e.XPaymentSessionToken),n(15,k=e.PaymentMethod),n(27,z={}),n(17,I={}),n(28,W={}),se(),n(16,O=k.Fields&&k.Fields.map((e=>new i(e)))),O.forEach((e=>{ae(e)})),J()}))})(),/*customStylingContainer*/1024&e.$$.dirty[0]|/*clientstyling*/2048&e.$$.dirty[1]&&b&&w&&(()=>{let e=document.createElement("style");e.innerHTML=b,w.appendChild(e)})(),/*customStylingContainer*/1024&e.$$.dirty[0]|/*clientstylingurl*/4096&e.$$.dirty[1]&&v&&w&&(()=>{let e=new URL(v),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{w.appendChild(t)}),1),setTimeout((()=>{}),500)}))})(),/*lang*/16&e.$$.dirty[0]&&u&&X(),/*lang, translationurl*/80&e.$$.dirty[0]&&u&&p&&(()=>{if(p)fetch(p).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{Or(t,e[t])}))})).catch((e=>{}))})(),/*qrCodeContainer*/2048&e.$$.dirty[0]|/*selectedpaymentmethodname*/1024&e.$$.dirty[1]&&y&&D.length&&D.forEach((e=>{if(e&&e.innerText){const t=e.innerText;e.innerText="",new QRCode(e,{text:t,width:250,height:250})}})),/*innerWidth*/8192&e.$$.dirty[0]&&M&&n(12,F=(e=>!!(e.toLowerCase().match(/android/i)||e.toLowerCase().match(/blackberry|bb/i)||e.toLowerCase().match(/iphone|ipad|ipod/i)||e.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)))(U)||j.matches),/*mobileView*/4096&e.$$.dirty[0]&&F.toString()&&J()},[o,m,E,a,u,h,p,d,f,g,w,D,F,M,s,k,O,I,$,N,T,_,B,L,A,P,V,z,W,r,G,Z,()=>{n(24,A=!0);const e=new URL(`${a}/v1/player/${d}/payment/GetPaymentPrepare`),t=new Headers;t.append("accept","application/json"),t.append("Content-Type","application/json");const r={method:"POST",mode:"cors",headers:t,body:JSON.stringify({XPaymentSessionToken:s,Transaction:{PaymentMethod:k.Name,Amount:m,Currency:f,CustomFields:I},Account:{}})};fetch(e,r).then((e=>e.json())).then((e=>{n(14,s=e.XPaymentSessionToken),n(24,A=!1),n(18,$=!0)}))},q,oe,e=>{if(!e.correlationFieldName)return!0;const t=e.correlationFieldValue.includes(I[e.correlationFieldName]);return!t&&I[e.name]&&delete I[e.name],t},se,ae,(e,t)=>!!e||Object.values(t).some((e=>!!e)),i,l,y,b,v,function(){n(13,M=hi.innerWidth)},()=>q(),function(){m=C(this.value),n(1,m)},()=>se(),()=>{n(27,z.amount=!0,z),se()},function(e){I[e.name]=this.value,n(17,I)},e=>{ae(e)},e=>{n(27,z[e.name]=!0,z),ae(e)},function(e){I[e.name]=C(this.value),n(17,I)},e=>{ae(e)},e=>{n(27,z[e.name]=!0,z),ae(e)},function(e){I[e.name]=this.value,n(17,I)},e=>{ae(e)},e=>{n(27,z[e.name]=!0,z),ae(e)},function(e){I[e.name]=this.value,n(17,I)},(e,t)=>Z(t,e.name),(e,t)=>{n(17,I[e.name]=t.Name,I),n(16,O)},function(e){I[e.name]=this.checked,n(17,I)},e=>{n(27,z[e.name]=!0,z),ae(e)},function(e){R[e?"unshift":"push"]((()=>{D[D.length]=e,n(11,D)}))},e=>{oe(e.description)},function(e){I[e.name]=this.value,n(17,I)},()=>{n(21,_=!1)},function(e){R[e?"unshift":"push"]((()=>{w=e,n(10,w)}))}]}class Xi extends X{constructor(e){super();const t=document.createElement("style");t.textContent='@keyframes loading-spinner{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.MethodsDetails{position:relative;display:flex;flex-direction:column;gap:5px}.MethodsDetails:has(.RedirectionNotification) form{visibility:hidden}.FormLogo{align-items:center;display:flex;height:50px;border-bottom:1px solid var(--emw--color-gray-100, #E8E9EB)}.FormLogo .SelectedLogoDescription{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);margin:7px 5px 7px 7px;word-break:break-word}.FormLogo .SelectedLogoWrapper{width:56px;height:32px;flex-shrink:0;background:var(--emw--color-background, #FFF);border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-large, 6px)}.FormLogo .SelectedLogoWrapper img{max-height:32px;max-width:56px}.FormLogo .ChangePaymeth{margin-left:auto;cursor:pointer;color:var(--emw--color-black, #111);font-size:var(--emw--font-size-small, 14px);text-decoration-line:underline}.SelectedMethodDescription{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:10px 0 5px;line-height:var(--emw--font-size-x-small, 12px)}.RedirectionNotification{height:100%;width:100%;position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}.RedirectionNotification .RedirectionClose{display:flex;width:234px;height:36px;flex-direction:column;justify-content:center;flex-shrink:0;color:var(--emw--color-white, #FFF);cursor:pointer;text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:500;line-height:normal;text-transform:uppercase;border-radius:4px;background:var(--emw--color-primary, #7EC51E)}.RedirectionNotification .RedirectionTitle{color:var(--emw--color-black, #111);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none;font-weight:var(--emw--font-weight-bold, 600)}.RedirectionNotification .RedirectionMessage{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;text-transform:none}cashier-iframe-redirect{height:inherit;width:inherit}.IframeRedirect{display:flex;position:absolute;align-items:center;justify-content:center;width:100%;height:100%;z-index:100;top:0;left:0;background-color:var(--emw--color-gray-transparency-20, rgba(0, 0, 0, 0.2))}.FieldWrapper,label{display:flex;flex-direction:column}.FieldWrapper{background-color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));border-radius:6px;box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.1);padding:0 15px 15px;margin-bottom:10px}.FieldWrapper:has(.QRCode, .Label){box-shadow:none;background:transparent}.FieldWrapper.Hidden{height:0;visibility:hidden;margin:0;padding:0}.Alert{display:none}.Invalid input,.Invalid .Selected{border-color:var(--emw--color-error, #FE0101)}.Invalid .Alert{display:inline-block}.Invalid .AmountLimits{display:none}.Alert{color:var(--emw--color-error, #FE0101);font-size:var(--emw--font-size-x-small, 12px);margin:5px 0 0 2px;line-height:var(--emw--font-size-x-small, 12px)}.AmountLimits{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:5px 0 0 2px;line-height:var(--emw--font-size-x-small, 12px)}input,.Selected{border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);height:40px;line-height:var(--emw--size-small, 14px);color:var(--emw--color-black, #111);padding:0 15px}input:focus,.Selected:focus{outline:none}label{color:var(--emw--color-black, #111);font-size:var(--emw--size-small, 14px);margin-top:7px;line-height:27px}label span.Required:before{content:"*";display:inline-block;margin-right:2px}.Description{color:var(--emw--color-gray-300, #666);font-size:var(--emw--font-size-x-small, 12px);margin:0 0 5px 2px;line-height:var(--emw--font-size-x-small, 12px)}.PrimaryButton{color:var(--emw--color-white, #FFF);text-align:center;font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:400;height:46px;border-radius:50px;line-height:normal;border:none;background:var(--emw--color-primary, #7EC51E);width:100%;margin:12px 0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:5px}.PrimaryButton .ButtonAmount{font-weight:600}.PrimaryButton .ButtonSpinner{animation:loading-spinner 1s linear infinite;background:var(--emw--color-active, #5C950F)}.PrimaryButton[disabled]{background:var(--emw--color-disabled, rgba(153, 153, 153, 0.5019607843));cursor:auto;pointer-events:none}.PrimaryButton:hover{background:var(--emw--color-hover, #71B11B)}.PrimaryButton:active{background:var(--emw--color-active, #5C950F)}.QRCode{width:250px;margin:auto}.Checkbox{display:flex;position:relative;margin-top:12px}.Checkbox .Description{margin:0 0 0 20px;cursor:pointer;line-height:var(--emw--font-size-medium, 16px)}.Checkbox .Checkmark{position:absolute;top:2px;left:0;height:12px;width:12px;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);background-color:var(--emw--color-white, #FFF);cursor:pointer}.Checkbox .Checkmark:after{content:"";position:absolute;display:none}.Checkbox .Checkmark:after{left:4px;top:0;width:2px;height:8px;border:solid var(--emw--color-white, #FFF);border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.Checkbox input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.Checkbox input:checked~.Checkmark{background-color:var(--emw--color-primary, #7EC51E);border-color:var(--emw--color-primary, #7EC51E)}.Checkbox input:checked~.Checkmark:after{display:block}.CustomSelect{width:100%;position:relative}.Selected{display:flex;align-items:center;cursor:pointer}.Selected:after{position:absolute;content:"";top:19px;right:10px;width:0;height:0;border:6px solid transparent;border-color:rgb(168, 169, 170) transparent transparent transparent}.OptionList{display:none;position:absolute;top:100%;left:0;right:0;z-index:99;background-color:white;border:1px solid var(--emw--color-gray-100, #E8E9EB);border-radius:var(--emw--border-radius-medium, 4px);margin-top:5px}.OptionList div{padding:8px 16px;cursor:pointer;user-select:none}.OptionList div:hover{background-color:var(--emw--color-background-secondary, #F9F9F9)}.OptionList.Opened{display:block}',this.shadowRoot.appendChild(t),W(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},Wi,Vi,o,{PaymentMethodDetails:39,FieldTypes:0,endpoint:3,session:40,lang:4,local:5,translationurl:6,customerid:7,currency:8,amount:1,assetsurl:9,selectedpaymentmethodname:41,clientstyling:42,clientstylingurl:43,RedirectionModeStringEnum:2},null,[-1,-1,-1,-1]),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),U()))}static get observedAttributes(){return["PaymentMethodDetails","FieldTypes","endpoint","session","lang","local","translationurl","customerid","currency","amount","assetsurl","selectedpaymentmethodname","clientstyling","clientstylingurl","RedirectionModeStringEnum"]}get PaymentMethodDetails(){return this.$$.ctx[39]}get FieldTypes(){return this.$$.ctx[0]}set FieldTypes(e){this.$$set({FieldTypes:e}),U()}get endpoint(){return this.$$.ctx[3]}set endpoint(e){this.$$set({endpoint:e}),U()}get session(){return this.$$.ctx[40]}set session(e){this.$$set({session:e}),U()}get lang(){return this.$$.ctx[4]}set lang(e){this.$$set({lang:e}),U()}get local(){return this.$$.ctx[5]}set local(e){this.$$set({local:e}),U()}get translationurl(){return this.$$.ctx[6]}set translationurl(e){this.$$set({translationurl:e}),U()}get customerid(){return this.$$.ctx[7]}set customerid(e){this.$$set({customerid:e}),U()}get currency(){return this.$$.ctx[8]}set currency(e){this.$$set({currency:e}),U()}get amount(){return this.$$.ctx[1]}set amount(e){this.$$set({amount:e}),U()}get assetsurl(){return this.$$.ctx[9]}set assetsurl(e){this.$$set({assetsurl:e}),U()}get selectedpaymentmethodname(){return this.$$.ctx[41]}set selectedpaymentmethodname(e){this.$$set({selectedpaymentmethodname:e}),U()}get clientstyling(){return this.$$.ctx[42]}set clientstyling(e){this.$$set({clientstyling:e}),U()}get clientstylingurl(){return this.$$.ctx[43]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),U()}get RedirectionModeStringEnum(){return this.$$.ctx[2]}set RedirectionModeStringEnum(e){this.$$set({RedirectionModeStringEnum:e}),U()}}return!customElements.get("cashier-method-details")&&customElements.define("cashier-method-details",Xi),Xi}));
|
748
776
|
//# sourceMappingURL=cashier-method-details.js.map
|