@everymatrix/player-rglimits 1.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/player-rglimits.js +1220 -0
- package/dist/player-rglimits.js.map +1 -0
- package/index.html +42 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +61 -0
- package/src/PlayerRglimits.svelte +510 -0
- package/src/i18n.js +27 -0
- package/src/images/caret-right-solid.svg +1 -0
- package/src/images/fa-caret-right.svg +1 -0
- package/src/images/gauge-body-background.svg +5 -0
- package/src/images/usd-circle.svg +2 -0
- package/src/index.ts +4 -0
- package/src/translations.js +242 -0
- package/stories/PlayerRglimits.stories.js +13 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,1220 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).app=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let o,a;function l(t,e){return o||(o=document.createElement("a")),o.href=e,t===o.href}function u(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}function h(t,e){t.appendChild(e)}function c(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t){return document.createElement(t)}function f(t){return document.createTextNode(t)}function p(){return f(" ")}function g(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function y(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function _(t,e,n){e in t?t[e]="boolean"==typeof t[e]&&""===n||n:y(t,e,n)}function v(t,e){e=""+e,t.data!==e&&(t.data=e)}function b(t,e,n,i){null==n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function w(t,e,n){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e)return void(i.selected=!0)}n&&void 0===e||(t.selectedIndex=-1)}function T(t){const e={};for(const n of t)e[n.name]=n.value;return e}function E(t){a=t}
|
|
2
|
+
/**
|
|
3
|
+
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
|
4
|
+
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
|
5
|
+
* it can be called from an external module).
|
|
6
|
+
*
|
|
7
|
+
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
|
8
|
+
*
|
|
9
|
+
* https://svelte.dev/docs#run-time-svelte-onmount
|
|
10
|
+
*/
|
|
11
|
+
function S(t){(function(){if(!a)throw new Error("Function called outside component initialization");return a})().$$.on_mount.push(t)}const L=[],M=[];let D=[];const k=[],A=Promise.resolve();let P=!1;function H(t){D.push(t)}
|
|
12
|
+
// flush() calls callbacks in this order:
|
|
13
|
+
// 1. All beforeUpdate callbacks, in order: parents before children
|
|
14
|
+
// 2. All bind:this callbacks, in reverse order: children before parents.
|
|
15
|
+
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
|
16
|
+
// for afterUpdates called during the initial onMount, which are called in
|
|
17
|
+
// reverse order: children before parents.
|
|
18
|
+
// Since callbacks might update component values, which could trigger another
|
|
19
|
+
// call to flush(), the following steps guard against this:
|
|
20
|
+
// 1. During beforeUpdate, any updated components will be added to the
|
|
21
|
+
// dirty_components array and will cause a reentrant call to flush(). Because
|
|
22
|
+
// the flush index is kept outside the function, the reentrant call will pick
|
|
23
|
+
// up where the earlier call left off and go through all dirty components. The
|
|
24
|
+
// current_component value is saved and restored so that the reentrant call will
|
|
25
|
+
// not interfere with the "parent" flush() call.
|
|
26
|
+
// 2. bind:this callbacks cannot trigger new flush() calls.
|
|
27
|
+
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
28
|
+
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
29
|
+
// function, guarantees this behavior.
|
|
30
|
+
const O=new Set;let C=0;// Do *not* move this inside the flush() function
|
|
31
|
+
function N(){
|
|
32
|
+
// Do not reenter flush while dirty components are updated, as this can
|
|
33
|
+
// result in an infinite loop. Instead, let the inner flush handle it.
|
|
34
|
+
// Reentrancy is ok afterwards for bindings etc.
|
|
35
|
+
if(0!==C)return;const t=a;do{
|
|
36
|
+
// first, call beforeUpdate functions
|
|
37
|
+
// and update components
|
|
38
|
+
try{for(;C<L.length;){const t=L[C];C++,E(t),x(t.$$)}}catch(t){
|
|
39
|
+
// reset dirty state to not end up in a deadlocked state and then rethrow
|
|
40
|
+
throw L.length=0,C=0,t}for(E(null),L.length=0,C=0;M.length;)M.pop()();
|
|
41
|
+
// then, once components are updated, call
|
|
42
|
+
// afterUpdate functions. This may cause
|
|
43
|
+
// subsequent updates...
|
|
44
|
+
for(let t=0;t<D.length;t+=1){const e=D[t];O.has(e)||(
|
|
45
|
+
// ...so guard against infinite loops
|
|
46
|
+
O.add(e),e())}D.length=0}while(L.length);for(;k.length;)k.pop()();P=!1,O.clear(),E(t)}function x(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(H)}}
|
|
47
|
+
/**
|
|
48
|
+
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
|
49
|
+
*/const R=new Set;function B(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];D.forEach((i=>-1===t.indexOf(i)?e.push(i):n.push(i))),n.forEach((t=>t())),D=e}(n.after_update),i(n.on_destroy),n.fragment&&n.fragment.d(e),
|
|
50
|
+
// TODO null out other refs, including component.$$ (but need to
|
|
51
|
+
// preserve final state?)
|
|
52
|
+
n.on_destroy=n.fragment=null,n.ctx=[])}function Y(t,e){-1===t.$$.dirty[0]&&(L.push(t),P||(P=!0,A.then(N)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function U(s,o,l,u,h,c,m,f=[-1]){const p=a;E(s);const g=s.$$={fragment:null,ctx:[],
|
|
53
|
+
// state
|
|
54
|
+
props:c,update:t,not_equal:h,bound:n(),
|
|
55
|
+
// lifecycle
|
|
56
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(p?p.$$.context:[])),
|
|
57
|
+
// everything else
|
|
58
|
+
callbacks:n(),dirty:f,skip_bound:!1,root:o.target||p.$$.root};m&&m(g.root);let y=!1;if(g.ctx=l?l(s,o.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return g.ctx&&h(g.ctx[t],g.ctx[t]=i)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](i),y&&Y(s,t)),e})):[],g.update(),y=!0,i(g.before_update),
|
|
59
|
+
// `false` as a special case of no DOM component
|
|
60
|
+
g.fragment=!!u&&u(g.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
62
|
+
g.fragment&&g.fragment.l(t),t.forEach(d)}else
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
|
+
g.fragment&&g.fragment.c();o.intro&&((_=s.$$.fragment)&&_.i&&(R.delete(_),_.i(v))),function(t,n,s,o){const{fragment:a,after_update:l}=t.$$;a&&a.m(n,s),o||
|
|
65
|
+
// onMount happens before the initial afterUpdate
|
|
66
|
+
H((()=>{const n=t.$$.on_mount.map(e).filter(r);
|
|
67
|
+
// if the component was destroyed immediately
|
|
68
|
+
// it will update the `$$.on_destroy` reference to `null`.
|
|
69
|
+
// the destructured on_destroy may still reference to the old array
|
|
70
|
+
t.$$.on_destroy?t.$$.on_destroy.push(...n):
|
|
71
|
+
// Edge case - component was destroyed immediately,
|
|
72
|
+
// most likely as a result of a binding initialising
|
|
73
|
+
i(n),t.$$.on_mount=[]})),l.forEach(H)}(s,o.target,o.anchor,o.customElement),N()}var _,v;E(p)}let I;"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);
|
|
74
|
+
// @ts-ignore todo: improve typings
|
|
75
|
+
for(const t in this.$$.slotted)
|
|
76
|
+
// @ts-ignore todo: improve typings
|
|
77
|
+
this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){B(this,1),this.$destroy=t}$on(e,n){
|
|
78
|
+
// TODO should this delegate to addEventListener?
|
|
79
|
+
if(!r(n))return t;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function F(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var G=function(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return F(null==e&&n.path)}},n.exports),n.exports}((function(t,e){t.exports=function(){var e,n;function i(){return e.apply(null,arguments)}
|
|
80
|
+
// This is done to register the method called with moment()
|
|
81
|
+
// without creating circular dependencies.
|
|
82
|
+
function r(t){e=t}function s(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){
|
|
83
|
+
// IE8 will treat undefined and null as object if it wasn't for
|
|
84
|
+
// input != null
|
|
85
|
+
return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(a(t,e))return!1;return!0}function u(t){return void 0===t}function h(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function c(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var n,i=[],r=t.length;for(n=0;n<r;++n)i.push(e(t[n],n));return i}function m(t,e){for(var n in e)a(e,n)&&(t[n]=e[n]);return a(e,"toString")&&(t.toString=e.toString),a(e,"valueOf")&&(t.valueOf=e.valueOf),t}function f(t,e,n,i){return Xn(t,e,n,i,!0).utc()}function p(){
|
|
86
|
+
// We need to deep clone this object.
|
|
87
|
+
return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(t){return null==t._pf&&(t._pf=p()),t._pf}function y(t){if(null==t._isValid){var e=g(t),i=n.call(e.parsedDateParts,(function(t){return null!=t})),r=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i);if(t._strict&&(r=r&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return r;t._isValid=r}return t._isValid}function _(t){var e=f(NaN);return null!=t?m(g(e),t):g(e).userInvalidated=!0,e}
|
|
88
|
+
// Plugins that add properties should also add the key here (null value),
|
|
89
|
+
// so we can properly clone ourselves.
|
|
90
|
+
n=Array.prototype.some?Array.prototype.some:function(t){var e,n=Object(this),i=n.length>>>0;for(e=0;e<i;e++)if(e in n&&t.call(this,n[e],e,n))return!0;return!1};var v=i.momentProperties=[],b=!1;function w(t,e){var n,i,r,s=v.length;if(u(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),u(e._i)||(t._i=e._i),u(e._f)||(t._f=e._f),u(e._l)||(t._l=e._l),u(e._strict)||(t._strict=e._strict),u(e._tzm)||(t._tzm=e._tzm),u(e._isUTC)||(t._isUTC=e._isUTC),u(e._offset)||(t._offset=e._offset),u(e._pf)||(t._pf=g(e)),u(e._locale)||(t._locale=e._locale),s>0)for(n=0;n<s;n++)u(r=e[i=v[n]])||(t[i]=r);return t}
|
|
91
|
+
// Moment prototype object
|
|
92
|
+
function T(t){w(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),
|
|
93
|
+
// Prevent infinite loop in case updateOffset creates new moment
|
|
94
|
+
// objects.
|
|
95
|
+
!1===b&&(b=!0,i.updateOffset(this),b=!1)}function E(t){return t instanceof T||null!=t&&null!=t._isAMomentObject}function S(t){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function L(t,e){var n=!0;return m((function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,t),n){var r,s,o,l=[],u=arguments.length;for(s=0;s<u;s++){if(r="","object"==typeof arguments[s]){for(o in r+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[s];l.push(r)}S(t+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)}),e)}var M,D={};function k(t,e){null!=i.deprecationHandler&&i.deprecationHandler(t,e),D[t]||(S(e),D[t]=!0)}function A(t){return"undefined"!=typeof Function&&t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function P(t){var e,n;for(n in t)a(t,n)&&(A(e=t[n])?this[n]=e:this["_"+n]=e);this._config=t,
|
|
96
|
+
// Lenient ordinal parsing accepts just a number in addition to
|
|
97
|
+
// number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
|
|
98
|
+
// TODO: Remove "ordinalParse" fallback in next major release.
|
|
99
|
+
this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function H(t,e){var n,i=m({},t);for(n in e)a(e,n)&&(o(t[n])&&o(e[n])?(i[n]={},m(i[n],t[n]),m(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)a(t,n)&&!a(e,n)&&o(t[n])&&(
|
|
100
|
+
// make sure changes to properties don't modify parent config
|
|
101
|
+
i[n]=m({},i[n]));return i}function O(t){null!=t&&this.set(t)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,M=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)a(t,e)&&n.push(e);return n};var C={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function N(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return A(i)?i.call(e,n):i}function x(t,e,n){var i=""+Math.abs(t),r=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Y={},U={};
|
|
102
|
+
// token: 'M'
|
|
103
|
+
// padded: ['MM', 2]
|
|
104
|
+
// ordinal: 'Mo'
|
|
105
|
+
// callback: function () { this.month() + 1 }
|
|
106
|
+
function I(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(U[t]=r),e&&(U[e[0]]=function(){return x(r.apply(this,arguments),e[1],e[2])}),n&&(U[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function G(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function $(t){var e,n,i=t.match(R);for(e=0,n=i.length;e<n;e++)U[i[e]]?i[e]=U[i[e]]:i[e]=G(i[e]);return function(e){var r,s="";for(r=0;r<n;r++)s+=A(i[r])?i[r].call(e,t):i[r];return s}}
|
|
107
|
+
// format date using native date object
|
|
108
|
+
function V(t,e){return t.isValid()?(e=j(e,t.localeData()),Y[e]=Y[e]||$(e),Y[e](t)):t.localeData().invalidDate()}function j(t,e){var n=5;function i(t){return e.longDateFormat(t)||t}for(B.lastIndex=0;n>=0&&B.test(t);)t=t.replace(B,i),B.lastIndex=0,n-=1;return t}var W={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function z(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(R).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var Z="Invalid date";function X(){return this._invalidDate}var K="%d",q=/\d{1,2}/;function J(t){return this._ordinal.replace("%d",t)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function tt(t,e,n,i){var r=this._relativeTime[n];return A(r)?r(t,e,n,i):r.replace(/%d/i,t)}function et(t,e){var n=this._relativeTime[t>0?"future":"past"];return A(n)?n(e):n.replace(/%s/i,e)}var nt={};function it(t,e){var n=t.toLowerCase();nt[n]=nt[n+"s"]=nt[e]=t}function rt(t){return"string"==typeof t?nt[t]||nt[t.toLowerCase()]:void 0}function st(t){var e,n,i={};for(n in t)a(t,n)&&(e=rt(n))&&(i[e]=t[n]);return i}var ot={};function at(t,e){ot[t]=e}function lt(t){var e,n=[];for(e in t)a(t,e)&&n.push({unit:e,priority:ot[e]});return n.sort((function(t,e){return t.priority-e.priority})),n}function ut(t){return t%4==0&&t%100!=0||t%400==0}function ht(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ct(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=ht(e)),n}function dt(t,e){return function(n){return null!=n?(ft(this,t,n),i.updateOffset(this,e),this):mt(this,t)}}function mt(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function ft(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&ut(t.year())&&1===t.month()&&29===t.date()?(n=ct(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),te(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}
|
|
109
|
+
// MOMENTS
|
|
110
|
+
function pt(t){return A(this[t=rt(t)])?this[t]():this}function gt(t,e){if("object"==typeof t){var n,i=lt(t=st(t)),r=i.length;for(n=0;n<r;n++)this[i[n].unit](t[i[n].unit])}else if(A(this[t=rt(t)]))return this[t](e);return this}var yt,_t=/\d/,// 0 - 9
|
|
111
|
+
vt=/\d\d/,// 00 - 99
|
|
112
|
+
bt=/\d{3}/,// 000 - 999
|
|
113
|
+
wt=/\d{4}/,// 0000 - 9999
|
|
114
|
+
Tt=/[+-]?\d{6}/,// -999999 - 999999
|
|
115
|
+
Et=/\d\d?/,// 0 - 99
|
|
116
|
+
St=/\d\d\d\d?/,// 999 - 9999
|
|
117
|
+
Lt=/\d\d\d\d\d\d?/,// 99999 - 999999
|
|
118
|
+
Mt=/\d{1,3}/,// 0 - 999
|
|
119
|
+
Dt=/\d{1,4}/,// 0 - 9999
|
|
120
|
+
kt=/[+-]?\d{1,6}/,// -999999 - 999999
|
|
121
|
+
At=/\d+/,// 0 - inf
|
|
122
|
+
Pt=/[+-]?\d+/,// -inf - inf
|
|
123
|
+
Ht=/Z|[+-]\d\d:?\d\d/gi,// +00:00 -00:00 +0000 -0000 or Z
|
|
124
|
+
Ot=/Z|[+-]\d\d(?::?\d\d)?/gi,// +00 -00 +00:00 -00:00 +0000 -0000 or Z
|
|
125
|
+
Ct=/[+-]?\d+(\.\d{1,3})?/,// 123456789 123456789.123
|
|
126
|
+
// any word (or two) characters or numbers including two/three word month in arabic.
|
|
127
|
+
// includes scottish gaelic two word and hyphenated months
|
|
128
|
+
Nt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function xt(t,e,n){yt[t]=A(e)?e:function(t,i){return t&&n?n:e}}function Rt(t,e){return a(yt,t)?yt[t](e._strict,e._locale):new RegExp(Bt(t))}
|
|
129
|
+
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
|
|
130
|
+
function Bt(t){return Yt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,n,i,r){return e||n||i||r})))}function Yt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}yt={};var Ut={};function It(t,e){var n,i,r=e;for("string"==typeof t&&(t=[t]),h(e)&&(r=function(t,n){n[e]=ct(t)}),i=t.length,n=0;n<i;n++)Ut[t[n]]=r}function Ft(t,e){It(t,(function(t,n,i,r){i._w=i._w||{},e(t,i._w,i,r)}))}function Gt(t,e,n){null!=e&&a(Ut,t)&&Ut[t](e,n._a,n,t)}var $t,Vt=0,jt=1,Wt=2,zt=3,Zt=4,Xt=5,Kt=6,qt=7,Jt=8;function Qt(t,e){return(t%e+e)%e}function te(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=Qt(e,12);return t+=(e-n)/12,1===n?ut(t)?29:28:31-n%7%2}
|
|
131
|
+
// FORMATTING
|
|
132
|
+
$t=Array.prototype.indexOf?Array.prototype.indexOf:function(t){
|
|
133
|
+
// I know
|
|
134
|
+
var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},I("M",["MM",2],"Mo",(function(){return this.month()+1})),I("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),I("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),
|
|
135
|
+
// ALIASES
|
|
136
|
+
it("month","M"),
|
|
137
|
+
// PRIORITY
|
|
138
|
+
at("month",8),
|
|
139
|
+
// PARSING
|
|
140
|
+
xt("M",Et),xt("MM",Et,vt),xt("MMM",(function(t,e){return e.monthsShortRegex(t)})),xt("MMMM",(function(t,e){return e.monthsRegex(t)})),It(["M","MM"],(function(t,e){e[jt]=ct(t)-1})),It(["MMM","MMMM"],(function(t,e,n,i){var r=n._locale.monthsParse(t,i,n._strict);
|
|
141
|
+
// if we didn't find a month name, mark the date as invalid.
|
|
142
|
+
null!=r?e[jt]=r:g(n).invalidMonth=t}));
|
|
143
|
+
// LOCALES
|
|
144
|
+
var ee="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ne="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ie=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,re=Nt,se=Nt;function oe(t,e){return t?s(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||ie).test(e)?"format":"standalone"][t.month()]:s(this._months)?this._months:this._months.standalone}function ae(t,e){return t?s(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[ie.test(e)?"format":"standalone"][t.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function le(t,e,n){var i,r,s,o=t.toLocaleLowerCase();if(!this._monthsParse)for(
|
|
145
|
+
// this is not used
|
|
146
|
+
this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=f([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(r=$t.call(this._shortMonthsParse,o))?r:null:-1!==(r=$t.call(this._longMonthsParse,o))?r:null:"MMM"===e?-1!==(r=$t.call(this._shortMonthsParse,o))||-1!==(r=$t.call(this._longMonthsParse,o))?r:null:-1!==(r=$t.call(this._longMonthsParse,o))||-1!==(r=$t.call(this._shortMonthsParse,o))?r:null}function ue(t,e,n){var i,r,s;if(this._monthsParseExact)return le.call(this,t,e,n);
|
|
147
|
+
// TODO: add sorting
|
|
148
|
+
// Sorting makes sure if one month (or abbr) is a prefix of another
|
|
149
|
+
// see sorting in computeMonthsParse
|
|
150
|
+
for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){
|
|
151
|
+
// test the regex
|
|
152
|
+
if(
|
|
153
|
+
// make the regex if we don't have it already
|
|
154
|
+
r=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}}
|
|
155
|
+
// MOMENTS
|
|
156
|
+
function he(t,e){var n;if(!t.isValid())
|
|
157
|
+
// No op
|
|
158
|
+
return t;if("string"==typeof e)if(/^\d+$/.test(e))e=ct(e);else
|
|
159
|
+
// TODO: Another silent failure?
|
|
160
|
+
if(!h(e=t.localeData().monthsParse(e)))return t;return n=Math.min(t.date(),te(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function ce(t){return null!=t?(he(this,t),i.updateOffset(this,!0),this):mt(this,"Month")}function de(){return te(this.year(),this.month())}function me(t){return this._monthsParseExact?(a(this,"_monthsRegex")||pe.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=re),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function fe(t){return this._monthsParseExact?(a(this,"_monthsRegex")||pe.call(this),t?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=se),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function pe(){function t(t,e){return e.length-t.length}var e,n,i=[],r=[],s=[];for(e=0;e<12;e++)
|
|
161
|
+
// make the regex if we don't have it already
|
|
162
|
+
n=f([2e3,e]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),s.push(this.months(n,"")),s.push(this.monthsShort(n,""));
|
|
163
|
+
// Sorting makes sure if one month (or abbr) is a prefix of another it
|
|
164
|
+
// will match the longer piece.
|
|
165
|
+
for(i.sort(t),r.sort(t),s.sort(t),e=0;e<12;e++)i[e]=Yt(i[e]),r[e]=Yt(r[e]);for(e=0;e<24;e++)s[e]=Yt(s[e]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}
|
|
166
|
+
// FORMATTING
|
|
167
|
+
// HELPERS
|
|
168
|
+
function ge(t){return ut(t)?366:365}
|
|
169
|
+
// HOOKS
|
|
170
|
+
I("Y",0,0,(function(){var t=this.year();return t<=9999?x(t,4):"+"+t})),I(0,["YY",2],0,(function(){return this.year()%100})),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),
|
|
171
|
+
// ALIASES
|
|
172
|
+
it("year","y"),
|
|
173
|
+
// PRIORITIES
|
|
174
|
+
at("year",1),
|
|
175
|
+
// PARSING
|
|
176
|
+
xt("Y",Pt),xt("YY",Et,vt),xt("YYYY",Dt,wt),xt("YYYYY",kt,Tt),xt("YYYYYY",kt,Tt),It(["YYYYY","YYYYYY"],Vt),It("YYYY",(function(t,e){e[Vt]=2===t.length?i.parseTwoDigitYear(t):ct(t)})),It("YY",(function(t,e){e[Vt]=i.parseTwoDigitYear(t)})),It("Y",(function(t,e){e[Vt]=parseInt(t,10)})),i.parseTwoDigitYear=function(t){return ct(t)+(ct(t)>68?1900:2e3)};
|
|
177
|
+
// MOMENTS
|
|
178
|
+
var ye=dt("FullYear",!0);function _e(){return ut(this.year())}function ve(t,e,n,i,r,s,o){
|
|
179
|
+
// can't just apply() to create a date:
|
|
180
|
+
// https://stackoverflow.com/q/181348
|
|
181
|
+
var a;
|
|
182
|
+
// the date constructor remaps years 0-99 to 1900-1999
|
|
183
|
+
return t<100&&t>=0?(
|
|
184
|
+
// preserve leap years using a full 400 year cycle, then reset
|
|
185
|
+
a=new Date(t+400,e,n,i,r,s,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,i,r,s,o),a}function be(t){var e,n;
|
|
186
|
+
// the Date.UTC function remaps years 0-99 to 1900-1999
|
|
187
|
+
return t<100&&t>=0?(
|
|
188
|
+
// preserve leap years using a full 400 year cycle, then reset
|
|
189
|
+
(n=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}
|
|
190
|
+
// start-of-first-week - start-of-year
|
|
191
|
+
function we(t,e,n){var// first-week day -- which january is always in the first week (4 for iso, 1 for other)
|
|
192
|
+
i=7+e-n;return-(7+be(t,0,i).getUTCDay()-e)%7+i-1}
|
|
193
|
+
// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
|
|
194
|
+
function Te(t,e,n,i,r){var s,o,a=1+7*(e-1)+(7+n-i)%7+we(t,i,r);return a<=0?o=ge(s=t-1)+a:a>ge(t)?(s=t+1,o=a-ge(t)):(s=t,o=a),{year:s,dayOfYear:o}}function Ee(t,e,n){var i,r,s=we(t.year(),e,n),o=Math.floor((t.dayOfYear()-s-1)/7)+1;return o<1?i=o+Se(r=t.year()-1,e,n):o>Se(t.year(),e,n)?(i=o-Se(t.year(),e,n),r=t.year()+1):(r=t.year(),i=o),{week:i,year:r}}function Se(t,e,n){var i=we(t,e,n),r=we(t+1,e,n);return(ge(t)-i+r)/7}
|
|
195
|
+
// FORMATTING
|
|
196
|
+
// HELPERS
|
|
197
|
+
// LOCALES
|
|
198
|
+
function Le(t){return Ee(t,this._week.dow,this._week.doy).week}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),
|
|
199
|
+
// ALIASES
|
|
200
|
+
it("week","w"),it("isoWeek","W"),
|
|
201
|
+
// PRIORITIES
|
|
202
|
+
at("week",5),at("isoWeek",5),
|
|
203
|
+
// PARSING
|
|
204
|
+
xt("w",Et),xt("ww",Et,vt),xt("W",Et),xt("WW",Et,vt),Ft(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=ct(t)}));var Me={dow:0,// Sunday is the first day of the week.
|
|
205
|
+
doy:6};function De(){return this._week.dow}function ke(){return this._week.doy}
|
|
206
|
+
// MOMENTS
|
|
207
|
+
function Ae(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Pe(t){var e=Ee(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}
|
|
208
|
+
// FORMATTING
|
|
209
|
+
// HELPERS
|
|
210
|
+
function He(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Oe(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}
|
|
211
|
+
// LOCALES
|
|
212
|
+
function Ce(t,e){return t.slice(e,7).concat(t.slice(0,e))}I("d",0,"do","day"),I("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),I("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),I("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),
|
|
213
|
+
// ALIASES
|
|
214
|
+
it("day","d"),it("weekday","e"),it("isoWeekday","E"),
|
|
215
|
+
// PRIORITY
|
|
216
|
+
at("day",11),at("weekday",11),at("isoWeekday",11),
|
|
217
|
+
// PARSING
|
|
218
|
+
xt("d",Et),xt("e",Et),xt("E",Et),xt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),xt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),xt("dddd",(function(t,e){return e.weekdaysRegex(t)})),Ft(["dd","ddd","dddd"],(function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);
|
|
219
|
+
// if we didn't get a weekday name, mark the date as invalid
|
|
220
|
+
null!=r?e.d=r:g(n).invalidWeekday=t})),Ft(["d","e","E"],(function(t,e,n,i){e[i]=ct(t)}));var Ne="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Re="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Be=Nt,Ye=Nt,Ue=Nt;function Ie(t,e){var n=s(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ce(n,this._week.dow):t?n[t.day()]:n}function Fe(t){return!0===t?Ce(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Ge(t){return!0===t?Ce(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function $e(t,e,n){var i,r,s,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(r=$t.call(this._weekdaysParse,o))?r:null:"ddd"===e?-1!==(r=$t.call(this._shortWeekdaysParse,o))?r:null:-1!==(r=$t.call(this._minWeekdaysParse,o))?r:null:"dddd"===e?-1!==(r=$t.call(this._weekdaysParse,o))||-1!==(r=$t.call(this._shortWeekdaysParse,o))||-1!==(r=$t.call(this._minWeekdaysParse,o))?r:null:"ddd"===e?-1!==(r=$t.call(this._shortWeekdaysParse,o))||-1!==(r=$t.call(this._weekdaysParse,o))||-1!==(r=$t.call(this._minWeekdaysParse,o))?r:null:-1!==(r=$t.call(this._minWeekdaysParse,o))||-1!==(r=$t.call(this._weekdaysParse,o))||-1!==(r=$t.call(this._shortWeekdaysParse,o))?r:null}function Ve(t,e,n){var i,r,s;if(this._weekdaysParseExact)return $e.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){
|
|
221
|
+
// test the regex
|
|
222
|
+
if(
|
|
223
|
+
// make the regex if we don't have it already
|
|
224
|
+
r=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}
|
|
225
|
+
// MOMENTS
|
|
226
|
+
function je(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=He(t,this.localeData()),this.add(t-e,"d")):e}function We(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function ze(t){if(!this.isValid())return null!=t?this:NaN;
|
|
227
|
+
// behaves the same as moment#day except
|
|
228
|
+
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
|
|
229
|
+
// as a setter, sunday should belong to the previous week.
|
|
230
|
+
if(null!=t){var e=Oe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ze(t){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Be),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Xe(t){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ye),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ke(t){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||qe.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ue),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function qe(){function t(t,e){return e.length-t.length}var e,n,i,r,s,o=[],a=[],l=[],u=[];for(e=0;e<7;e++)
|
|
231
|
+
// make the regex if we don't have it already
|
|
232
|
+
n=f([2e3,1]).day(e),i=Yt(this.weekdaysMin(n,"")),r=Yt(this.weekdaysShort(n,"")),s=Yt(this.weekdays(n,"")),o.push(i),a.push(r),l.push(s),u.push(i),u.push(r),u.push(s);
|
|
233
|
+
// Sorting makes sure if one weekday (or abbr) is a prefix of another it
|
|
234
|
+
// will match the longer piece.
|
|
235
|
+
o.sort(t),a.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}
|
|
236
|
+
// FORMATTING
|
|
237
|
+
function Je(){return this.hours()%12||12}function Qe(){return this.hours()||24}function tn(t,e){I(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}
|
|
238
|
+
// PARSING
|
|
239
|
+
function en(t,e){return e._meridiemParse}
|
|
240
|
+
// LOCALES
|
|
241
|
+
function nn(t){
|
|
242
|
+
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
|
|
243
|
+
// Using charAt should be more compatible.
|
|
244
|
+
return"p"===(t+"").toLowerCase().charAt(0)}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Je),I("k",["kk",2],0,Qe),I("hmm",0,0,(function(){return""+Je.apply(this)+x(this.minutes(),2)})),I("hmmss",0,0,(function(){return""+Je.apply(this)+x(this.minutes(),2)+x(this.seconds(),2)})),I("Hmm",0,0,(function(){return""+this.hours()+x(this.minutes(),2)})),I("Hmmss",0,0,(function(){return""+this.hours()+x(this.minutes(),2)+x(this.seconds(),2)})),tn("a",!0),tn("A",!1),
|
|
245
|
+
// ALIASES
|
|
246
|
+
it("hour","h"),
|
|
247
|
+
// PRIORITY
|
|
248
|
+
at("hour",13),xt("a",en),xt("A",en),xt("H",Et),xt("h",Et),xt("k",Et),xt("HH",Et,vt),xt("hh",Et,vt),xt("kk",Et,vt),xt("hmm",St),xt("hmmss",Lt),xt("Hmm",St),xt("Hmmss",Lt),It(["H","HH"],zt),It(["k","kk"],(function(t,e,n){var i=ct(t);e[zt]=24===i?0:i})),It(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),It(["h","hh"],(function(t,e,n){e[zt]=ct(t),g(n).bigHour=!0})),It("hmm",(function(t,e,n){var i=t.length-2;e[zt]=ct(t.substr(0,i)),e[Zt]=ct(t.substr(i)),g(n).bigHour=!0})),It("hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[zt]=ct(t.substr(0,i)),e[Zt]=ct(t.substr(i,2)),e[Xt]=ct(t.substr(r)),g(n).bigHour=!0})),It("Hmm",(function(t,e,n){var i=t.length-2;e[zt]=ct(t.substr(0,i)),e[Zt]=ct(t.substr(i))})),It("Hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[zt]=ct(t.substr(0,i)),e[Zt]=ct(t.substr(i,2)),e[Xt]=ct(t.substr(r))}));var rn=/[ap]\.?m?\.?/i,
|
|
249
|
+
// Setting the hour should keep the time, because the user explicitly
|
|
250
|
+
// specified which hour they want. So trying to maintain the same hour (in
|
|
251
|
+
// a new timezone) makes sense. Adding/subtracting hours does not follow
|
|
252
|
+
// this rule.
|
|
253
|
+
sn=dt("Hours",!0);function on(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var an,ln={calendar:C,longDateFormat:W,invalidDate:Z,ordinal:K,dayOfMonthOrdinalParse:q,relativeTime:Q,months:ee,monthsShort:ne,week:Me,weekdays:Ne,weekdaysMin:Re,weekdaysShort:xe,meridiemParse:rn},un={},hn={};
|
|
254
|
+
// internal storage for locale config files
|
|
255
|
+
function cn(t,e){var n,i=Math.min(t.length,e.length);for(n=0;n<i;n+=1)if(t[n]!==e[n])return n;return i}function dn(t){return t?t.toLowerCase().replace("_","-"):t}
|
|
256
|
+
// pick the locale from the array
|
|
257
|
+
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
|
|
258
|
+
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
|
|
259
|
+
function mn(t){for(var e,n,i,r,s=0;s<t.length;){for(e=(r=dn(t[s]).split("-")).length,n=(n=dn(t[s+1]))?n.split("-"):null;e>0;){if(i=pn(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&cn(r,n)>=e-1)
|
|
260
|
+
//the next array item is better than a shallower substring of this one
|
|
261
|
+
break;e--}s++}return an}function fn(t){
|
|
262
|
+
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
|
263
|
+
return null!=t.match("^[^/\\\\]*$")}function pn(e){var n=null;
|
|
264
|
+
// TODO: Find a better way to register and load all the locales in Node
|
|
265
|
+
if(void 0===un[e]&&t&&t.exports&&fn(e))try{n=an._abbr,F(),gn(n)}catch(t){
|
|
266
|
+
// mark as not found to avoid repeating expensive file require call causing high CPU
|
|
267
|
+
// when trying to find en-US, en_US, en-us for every format call
|
|
268
|
+
un[e]=null;// null means not found
|
|
269
|
+
}return un[e]}
|
|
270
|
+
// This function will load locale and then set the global locale. If
|
|
271
|
+
// no arguments are passed in, it will simply return the current global
|
|
272
|
+
// locale key.
|
|
273
|
+
function gn(t,e){var n;return t&&((n=u(e)?vn(t):yn(t,e))?
|
|
274
|
+
// moment.duration._locale = moment._locale = data;
|
|
275
|
+
an=n:"undefined"!=typeof console&&console.warn&&
|
|
276
|
+
//warn user if arguments are passed but the locale could not be set
|
|
277
|
+
console.warn("Locale "+t+" not found. Did you forget to load it?")),an._abbr}function yn(t,e){if(null!==e){var n,i=ln;if(e.abbr=t,null!=un[t])k("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=un[t]._config;else if(null!=e.parentLocale)if(null!=un[e.parentLocale])i=un[e.parentLocale]._config;else{if(null==(n=pn(e.parentLocale)))return hn[e.parentLocale]||(hn[e.parentLocale]=[]),hn[e.parentLocale].push({name:t,config:e}),null;i=n._config}return un[t]=new O(H(i,e)),hn[t]&&hn[t].forEach((function(t){yn(t.name,t.config)})),
|
|
278
|
+
// backwards compat for now: also set the locale
|
|
279
|
+
// make sure we set the locale AFTER all child locales have been
|
|
280
|
+
// created, so we won't end up with the child locale set.
|
|
281
|
+
gn(t),un[t]}
|
|
282
|
+
// useful for testing
|
|
283
|
+
return delete un[t],null}function _n(t,e){if(null!=e){var n,i,r=ln;null!=un[t]&&null!=un[t].parentLocale?
|
|
284
|
+
// Update existing child locale in-place to avoid memory-leaks
|
|
285
|
+
un[t].set(H(un[t]._config,e)):(
|
|
286
|
+
// MERGE
|
|
287
|
+
null!=(i=pn(t))&&(r=i._config),e=H(r,e),null==i&&(
|
|
288
|
+
// updateLocale is called for creating a new locale
|
|
289
|
+
// Set abbr so it will have a name (getters return
|
|
290
|
+
// undefined otherwise).
|
|
291
|
+
e.abbr=t),(n=new O(e)).parentLocale=un[t],un[t]=n),
|
|
292
|
+
// backwards compat for now: also set the locale
|
|
293
|
+
gn(t)}else
|
|
294
|
+
// pass null for config to unupdate, useful for tests
|
|
295
|
+
null!=un[t]&&(null!=un[t].parentLocale?(un[t]=un[t].parentLocale,t===gn()&&gn(t)):null!=un[t]&&delete un[t]);return un[t]}
|
|
296
|
+
// returns locale data
|
|
297
|
+
function vn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return an;if(!s(t)){if(
|
|
298
|
+
//short-circuit everything else
|
|
299
|
+
e=pn(t))return e;t=[t]}return mn(t)}function bn(){return M(un)}function wn(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[jt]<0||n[jt]>11?jt:n[Wt]<1||n[Wt]>te(n[Vt],n[jt])?Wt:n[zt]<0||n[zt]>24||24===n[zt]&&(0!==n[Zt]||0!==n[Xt]||0!==n[Kt])?zt:n[Zt]<0||n[Zt]>59?Zt:n[Xt]<0||n[Xt]>59?Xt:n[Kt]<0||n[Kt]>999?Kt:-1,g(t)._overflowDayOfYear&&(e<Vt||e>Wt)&&(e=Wt),g(t)._overflowWeeks&&-1===e&&(e=qt),g(t)._overflowWeekday&&-1===e&&(e=Jt),g(t).overflow=e),t}
|
|
300
|
+
// iso 8601 regex
|
|
301
|
+
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
|
|
302
|
+
var Tn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Sn=/Z|[+-]\d\d(?::?\d\d)?/,Ln=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],
|
|
303
|
+
// iso time formats and regexes
|
|
304
|
+
Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Dn=/^\/?Date\((-?\d+)/i,
|
|
305
|
+
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
|
|
306
|
+
kn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,An={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};
|
|
307
|
+
// date from iso format
|
|
308
|
+
function Pn(t){var e,n,i,r,s,o,a=t._i,l=Tn.exec(a)||En.exec(a),u=Ln.length,h=Mn.length;if(l){for(g(t).iso=!0,e=0,n=u;e<n;e++)if(Ln[e][1].exec(l[1])){r=Ln[e][0],i=!1!==Ln[e][2];break}if(null==r)return void(t._isValid=!1);if(l[3]){for(e=0,n=h;e<n;e++)if(Mn[e][1].exec(l[3])){
|
|
309
|
+
// match[2] should be 'T' or space
|
|
310
|
+
s=(l[2]||" ")+Mn[e][0];break}if(null==s)return void(t._isValid=!1)}if(!i&&null!=s)return void(t._isValid=!1);if(l[4]){if(!Sn.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=r+(s||"")+(o||""),Gn(t)}else t._isValid=!1}function Hn(t,e,n,i,r,s){var o=[On(t),ne.indexOf(e),parseInt(n,10),parseInt(i,10),parseInt(r,10)];return s&&o.push(parseInt(s,10)),o}function On(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function Cn(t){
|
|
311
|
+
// Remove comments and folding whitespace and replace multiple-spaces with a single space
|
|
312
|
+
return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Nn(t,e,n){return!t||xe.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(g(n).weekdayMismatch=!0,n._isValid=!1,!1)}function xn(t,e,n){if(t)return An[t];if(e)
|
|
313
|
+
// the only allowed military tz is Z
|
|
314
|
+
return 0;var i=parseInt(n,10),r=i%100;return(i-r)/100*60+r}
|
|
315
|
+
// date and time from ref 2822 format
|
|
316
|
+
function Rn(t){var e,n=kn.exec(Cn(t._i));if(n){if(e=Hn(n[4],n[3],n[2],n[5],n[6],n[7]),!Nn(n[1],e,t))return;t._a=e,t._tzm=xn(n[8],n[9],n[10]),t._d=be.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),g(t).rfc2822=!0}else t._isValid=!1}
|
|
317
|
+
// date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
|
|
318
|
+
function Bn(t){var e=Dn.exec(t._i);null===e?(Pn(t),!1===t._isValid&&(delete t._isValid,Rn(t),!1===t._isValid&&(delete t._isValid,t._strict?t._isValid=!1:
|
|
319
|
+
// Final attempt, use Input Fallback
|
|
320
|
+
i.createFromInputFallback(t)))):t._d=new Date(+e[1])}
|
|
321
|
+
// Pick the first defined of two or three arguments.
|
|
322
|
+
function Yn(t,e,n){return null!=t?t:null!=e?e:n}function Un(t){
|
|
323
|
+
// hooks is actually the exported moment object
|
|
324
|
+
var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}
|
|
325
|
+
// convert an array to a date.
|
|
326
|
+
// the array should mirror the parameters below
|
|
327
|
+
// note: all values past the year are optional and will default to the lowest possible value.
|
|
328
|
+
// [year, month, day , hour, minute, second, millisecond]
|
|
329
|
+
function In(t){var e,n,i,r,s,o=[];if(!t._d){
|
|
330
|
+
// Default to current date.
|
|
331
|
+
// * if no year, month, day of month are given, default to today
|
|
332
|
+
// * if day of month is given, default month and year
|
|
333
|
+
// * if month is given, default only year
|
|
334
|
+
// * if year is given, don't default anything
|
|
335
|
+
for(i=Un(t),
|
|
336
|
+
//compute day of the year from weeks and weekdays
|
|
337
|
+
t._w&&null==t._a[Wt]&&null==t._a[jt]&&Fn(t),
|
|
338
|
+
//if the day of the year is set, figure out what it is
|
|
339
|
+
null!=t._dayOfYear&&(s=Yn(t._a[Vt],i[Vt]),(t._dayOfYear>ge(s)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=be(s,0,t._dayOfYear),t._a[jt]=n.getUTCMonth(),t._a[Wt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=i[e];
|
|
340
|
+
// Zero out whatever was not defaulted, including time
|
|
341
|
+
for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];
|
|
342
|
+
// Check for 24:00:00.000
|
|
343
|
+
24===t._a[zt]&&0===t._a[Zt]&&0===t._a[Xt]&&0===t._a[Kt]&&(t._nextDay=!0,t._a[zt]=0),t._d=(t._useUTC?be:ve).apply(null,o),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),
|
|
344
|
+
// Apply timezone offset from input. The actual utcOffset can be changed
|
|
345
|
+
// with parseZone.
|
|
346
|
+
null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[zt]=24),
|
|
347
|
+
// check for mismatching day of week
|
|
348
|
+
t._w&&void 0!==t._w.d&&t._w.d!==r&&(g(t).weekdayMismatch=!0)}}function Fn(t){var e,n,i,r,s,o,a,l,u;null!=(e=t._w).GG||null!=e.W||null!=e.E?(s=1,o=4,
|
|
349
|
+
// TODO: We need to take the current isoWeekYear, but that depends on
|
|
350
|
+
// how we interpret now (local, utc, fixed offset). So create
|
|
351
|
+
// a now version of current config (take local/utc/offset flags, and
|
|
352
|
+
// create now).
|
|
353
|
+
n=Yn(e.GG,t._a[Vt],Ee(Kn(),1,4).year),i=Yn(e.W,1),((r=Yn(e.E,1))<1||r>7)&&(l=!0)):(s=t._locale._week.dow,o=t._locale._week.doy,u=Ee(Kn(),s,o),n=Yn(e.gg,t._a[Vt],u.year),
|
|
354
|
+
// Default to current week.
|
|
355
|
+
i=Yn(e.w,u.week),null!=e.d?((
|
|
356
|
+
// weekday -- low day numbers are considered next week
|
|
357
|
+
r=e.d)<0||r>6)&&(l=!0):null!=e.e?(
|
|
358
|
+
// local weekday -- counting starts from beginning of week
|
|
359
|
+
r=e.e+s,(e.e<0||e.e>6)&&(l=!0)):
|
|
360
|
+
// default to beginning of week
|
|
361
|
+
r=s),i<1||i>Se(n,s,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(a=Te(n,i,r,s,o),t._a[Vt]=a.year,t._dayOfYear=a.dayOfYear)}
|
|
362
|
+
// constant that refers to the ISO standard
|
|
363
|
+
// date from string and format string
|
|
364
|
+
function Gn(t){
|
|
365
|
+
// TODO: Move this to another part of the creation flow to prevent circular deps
|
|
366
|
+
if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],g(t).empty=!0;
|
|
367
|
+
// This array is used to make a Date, either with `new Date` or `Date.UTC`
|
|
368
|
+
var e,n,r,s,o,a,l,u=""+t._i,h=u.length,c=0;for(l=(r=j(t._f,t._locale).match(R)||[]).length,e=0;e<l;e++)s=r[e],(n=(u.match(Rt(s,t))||[])[0])&&((o=u.substr(0,u.indexOf(n))).length>0&&g(t).unusedInput.push(o),u=u.slice(u.indexOf(n)+n.length),c+=n.length),
|
|
369
|
+
// don't parse if it's not a known token
|
|
370
|
+
U[s]?(n?g(t).empty=!1:g(t).unusedTokens.push(s),Gt(s,n,t)):t._strict&&!n&&g(t).unusedTokens.push(s);
|
|
371
|
+
// add remaining unparsed input length to the string
|
|
372
|
+
g(t).charsLeftOver=h-c,u.length>0&&g(t).unusedInput.push(u),
|
|
373
|
+
// clear _12h flag if hour is <= 12
|
|
374
|
+
t._a[zt]<=12&&!0===g(t).bigHour&&t._a[zt]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,
|
|
375
|
+
// handle meridiem
|
|
376
|
+
t._a[zt]=$n(t._locale,t._a[zt],t._meridiem),null!==(
|
|
377
|
+
// handle era
|
|
378
|
+
a=g(t).era)&&(t._a[Vt]=t._locale.erasConvertYear(a,t._a[Vt])),In(t),wn(t)}else Rn(t);else Pn(t)}function $n(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(
|
|
379
|
+
// Fallback
|
|
380
|
+
(i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}
|
|
381
|
+
// date from string and array of format strings
|
|
382
|
+
function Vn(t){var e,n,i,r,s,o,a=!1,l=t._f.length;if(0===l)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;r<l;r++)s=0,o=!1,e=w({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],Gn(e),y(e)&&(o=!0),
|
|
383
|
+
// if there is any input that was not parsed add a penalty for that format
|
|
384
|
+
s+=g(e).charsLeftOver,
|
|
385
|
+
//or tokens
|
|
386
|
+
s+=10*g(e).unusedTokens.length,g(e).score=s,a?s<i&&(i=s,n=e):(null==i||s<i||o)&&(i=s,n=e,o&&(a=!0));m(t,n||e)}function jn(t){if(!t._d){var e=st(t._i),n=void 0===e.day?e.date:e.day;t._a=d([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),In(t)}}function Wn(t){var e=new T(wn(zn(t)));return e._nextDay&&(
|
|
387
|
+
// Adding is smart enough around DST
|
|
388
|
+
e.add(1,"d"),e._nextDay=void 0),e}function zn(t){var e=t._i,n=t._f;return t._locale=t._locale||vn(t._l),null===e||void 0===n&&""===e?_({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),E(e)?new T(wn(e)):(c(e)?t._d=e:s(n)?Vn(t):n?Gn(t):Zn(t),y(t)||(t._d=null),t))}function Zn(t){var e=t._i;u(e)?t._d=new Date(i.now()):c(e)?t._d=new Date(e.valueOf()):"string"==typeof e?Bn(t):s(e)?(t._a=d(e.slice(0),(function(t){return parseInt(t,10)})),In(t)):o(e)?jn(t):h(e)?
|
|
389
|
+
// from milliseconds
|
|
390
|
+
t._d=new Date(e):i.createFromInputFallback(t)}function Xn(t,e,n,i,r){var a={};return!0!==e&&!1!==e||(i=e,e=void 0),!0!==n&&!1!==n||(i=n,n=void 0),(o(t)&&l(t)||s(t)&&0===t.length)&&(t=void 0),
|
|
391
|
+
// object construction must be done this way.
|
|
392
|
+
// https://github.com/moment/moment/issues/1423
|
|
393
|
+
a._isAMomentObject=!0,a._useUTC=a._isUTC=r,a._l=n,a._i=t,a._f=e,a._strict=i,Wn(a)}function Kn(t,e,n,i){return Xn(t,e,n,i,!1)}i.createFromInputFallback=L("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),i.ISO_8601=function(){},
|
|
394
|
+
// constant that refers to the RFC 2822 form
|
|
395
|
+
i.RFC_2822=function(){};var qn=L("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Kn.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:_()})),Jn=L("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Kn.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:_()}));
|
|
396
|
+
// Pick a moment m from moments so that m[fn](other) is true for all
|
|
397
|
+
// other. This relies on the function fn to be transitive.
|
|
398
|
+
|
|
399
|
+
// moments should either be an array of moment objects or an array, whose
|
|
400
|
+
// first element is an array of moment objects.
|
|
401
|
+
function Qn(t,e){var n,i;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return Kn();for(n=e[0],i=1;i<e.length;++i)e[i].isValid()&&!e[i][t](n)||(n=e[i]);return n}
|
|
402
|
+
// TODO: Use [].sort instead?
|
|
403
|
+
function ti(){return Qn("isBefore",[].slice.call(arguments,0))}function ei(){return Qn("isAfter",[].slice.call(arguments,0))}var ni=function(){return Date.now?Date.now():+new Date},ii=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ri(t){var e,n,i=!1,r=ii.length;for(e in t)if(a(t,e)&&(-1===$t.call(ii,e)||null!=t[e]&&isNaN(t[e])))return!1;for(n=0;n<r;++n)if(t[ii[n]]){if(i)return!1;// only allow non-integers for smallest unit
|
|
404
|
+
parseFloat(t[ii[n]])!==ct(t[ii[n]])&&(i=!0)}return!0}function si(){return this._isValid}function oi(){return Ai(NaN)}function ai(t){var e=st(t),n=e.year||0,i=e.quarter||0,r=e.month||0,s=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,h=e.millisecond||0;this._isValid=ri(e),
|
|
405
|
+
// representation for dateAddRemove
|
|
406
|
+
this._milliseconds=+h+1e3*u+// 1000
|
|
407
|
+
6e4*l+// 1000 * 60
|
|
408
|
+
1e3*a*60*60,//using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
|
|
409
|
+
// Because of dateAddRemove treats 24 hours as different from a
|
|
410
|
+
// day when working around DST, we need to store them separately
|
|
411
|
+
this._days=+o+7*s,
|
|
412
|
+
// It is impossible to translate months into days without knowing
|
|
413
|
+
// which months you are are talking about, so we have to store
|
|
414
|
+
// it separately.
|
|
415
|
+
this._months=+r+3*i+12*n,this._data={},this._locale=vn(),this._bubble()}function li(t){return t instanceof ai}function ui(t){return t<0?-1*Math.round(-1*t):Math.round(t)}
|
|
416
|
+
// compare two arrays, return the number of differences
|
|
417
|
+
function hi(t,e,n){var i,r=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),o=0;for(i=0;i<r;i++)(n&&t[i]!==e[i]||!n&&ct(t[i])!==ct(e[i]))&&o++;return o+s}
|
|
418
|
+
// FORMATTING
|
|
419
|
+
function ci(t,e){I(t,0,0,(function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+x(~~(t/60),2)+e+x(~~t%60,2)}))}ci("Z",":"),ci("ZZ",""),
|
|
420
|
+
// PARSING
|
|
421
|
+
xt("Z",Ot),xt("ZZ",Ot),It(["Z","ZZ"],(function(t,e,n){n._useUTC=!0,n._tzm=mi(Ot,t)}));
|
|
422
|
+
// HELPERS
|
|
423
|
+
// timezone chunker
|
|
424
|
+
// '+10:00' > ['10', '00']
|
|
425
|
+
// '-1530' > ['-15', '30']
|
|
426
|
+
var di=/([\+\-]|\d\d)/gi;function mi(t,e){var n,i,r=(e||"").match(t);return null===r?null:0===(i=60*(n=((r[r.length-1]||[])+"").match(di)||["-",0,0])[1]+ct(n[2]))?0:"+"===n[0]?i:-i}
|
|
427
|
+
// Return a moment from input, that is local/utc/zone equivalent to model.
|
|
428
|
+
function fi(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(E(t)||c(t)?t.valueOf():Kn(t).valueOf())-n.valueOf(),
|
|
429
|
+
// Use low-level api, because this fn is low-level api.
|
|
430
|
+
n._d.setTime(n._d.valueOf()+r),i.updateOffset(n,!1),n):Kn(t).local()}function pi(t){
|
|
431
|
+
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
|
|
432
|
+
// https://github.com/moment/moment/pull/1871
|
|
433
|
+
return-Math.round(t._d.getTimezoneOffset())}
|
|
434
|
+
// HOOKS
|
|
435
|
+
// This function will be called whenever a moment is mutated.
|
|
436
|
+
// It is intended to keep the offset in sync with the timezone.
|
|
437
|
+
// MOMENTS
|
|
438
|
+
// keepLocalTime = true means only change the timezone, without
|
|
439
|
+
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
|
|
440
|
+
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
|
|
441
|
+
// +0200, so we adjust the time as needed, to be valid.
|
|
442
|
+
// Keeping the time actually adds/subtracts (one hour)
|
|
443
|
+
// from the actual represented time. That is why we call updateOffset
|
|
444
|
+
// a second time. In case it wants us to change the offset again
|
|
445
|
+
// _changeInProgress == true case, then we have to adjust, because
|
|
446
|
+
// there is no such time in the given timezone.
|
|
447
|
+
function gi(t,e,n){var r,s=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=mi(Ot,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(r=pi(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),s!==t&&(!e||this._changeInProgress?Ni(this,Ai(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:pi(this)}function yi(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function _i(t){return this.utcOffset(0,t)}function vi(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(pi(this),"m")),this}function bi(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=mi(Ht,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this}function wi(t){return!!this.isValid()&&(t=t?Kn(t).utcOffset():0,(this.utcOffset()-t)%60==0)}function Ti(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ei(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t,e={};return w(e,this),(e=zn(e))._a?(t=e._isUTC?f(e._a):Kn(e._a),this._isDSTShifted=this.isValid()&&hi(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Si(){return!!this.isValid()&&!this._isUTC}function Li(){return!!this.isValid()&&this._isUTC}function Mi(){return!!this.isValid()&&this._isUTC&&0===this._offset}
|
|
448
|
+
// ASP.NET json date format regex
|
|
449
|
+
i.updateOffset=function(){};var Di=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
|
|
450
|
+
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
|
|
451
|
+
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
|
|
452
|
+
// and further modified to allow for strings containing both week and day
|
|
453
|
+
ki=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ai(t,e){var n,i,r,s=t,
|
|
454
|
+
// matching against regexp is expensive, do it on demand
|
|
455
|
+
o=null;return li(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:h(t)||!isNaN(+t)?(s={},e?s[e]=+t:s.milliseconds=+t):(o=Di.exec(t))?(n="-"===o[1]?-1:1,s={y:0,d:ct(o[Wt])*n,h:ct(o[zt])*n,m:ct(o[Zt])*n,s:ct(o[Xt])*n,ms:ct(ui(1e3*o[Kt]))*n}):(o=ki.exec(t))?(n="-"===o[1]?-1:1,s={y:Pi(o[2],n),M:Pi(o[3],n),w:Pi(o[4],n),d:Pi(o[5],n),h:Pi(o[6],n),m:Pi(o[7],n),s:Pi(o[8],n)}):null==s?
|
|
456
|
+
// checks for null or undefined
|
|
457
|
+
s={}:"object"==typeof s&&("from"in s||"to"in s)&&(r=Oi(Kn(s.from),Kn(s.to)),(s={}).ms=r.milliseconds,s.M=r.months),i=new ai(s),li(t)&&a(t,"_locale")&&(i._locale=t._locale),li(t)&&a(t,"_isValid")&&(i._isValid=t._isValid),i}function Pi(t,e){
|
|
458
|
+
// We'd normally use ~~inp for this, but unfortunately it also
|
|
459
|
+
// converts floats to ints.
|
|
460
|
+
// inp may be undefined, so careful calling replace on it.
|
|
461
|
+
var n=t&&parseFloat(t.replace(",","."));
|
|
462
|
+
// apply sign while we're at it
|
|
463
|
+
return(isNaN(n)?0:n)*e}function Hi(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Oi(t,e){var n;return t.isValid()&&e.isValid()?(e=fi(e,t),t.isBefore(e)?n=Hi(t,e):((n=Hi(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}
|
|
464
|
+
// TODO: remove 'name' arg after deprecation is removed
|
|
465
|
+
function Ci(t,e){return function(n,i){var r;
|
|
466
|
+
//invert the arguments, but complain about it
|
|
467
|
+
return null===i||isNaN(+i)||(k(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),Ni(this,Ai(n,i),t),this}}function Ni(t,e,n,r){var s=e._milliseconds,o=ui(e._days),a=ui(e._months);t.isValid()&&(r=null==r||r,a&&he(t,mt(t,"Month")+a*n),o&&ft(t,"Date",mt(t,"Date")+o*n),s&&t._d.setTime(t._d.valueOf()+s*n),r&&i.updateOffset(t,o||a))}Ai.fn=ai.prototype,Ai.invalid=oi;var xi=Ci(1,"add"),Ri=Ci(-1,"subtract");function Bi(t){return"string"==typeof t||t instanceof String}
|
|
468
|
+
// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
|
|
469
|
+
function Yi(t){return E(t)||c(t)||Bi(t)||h(t)||Ii(t)||Ui(t)||null==t}function Ui(t){var e,n,i=o(t)&&!l(t),r=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=s.length;for(e=0;e<u;e+=1)n=s[e],r=r||a(t,n);return i&&r}function Ii(t){var e=s(t),n=!1;return e&&(n=0===t.filter((function(e){return!h(e)&&Bi(t)})).length),e&&n}function Fi(t){var e,n,i=o(t)&&!l(t),r=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(e=0;e<s.length;e+=1)n=s[e],r=r||a(t,n);return i&&r}function Gi(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function $i(t,e){
|
|
470
|
+
// Support for single parameter, formats only overload to the calendar function
|
|
471
|
+
1===arguments.length&&(arguments[0]?Yi(arguments[0])?(t=arguments[0],e=void 0):Fi(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));
|
|
472
|
+
// We want to compare the start of today, vs this.
|
|
473
|
+
// Getting start-of-today depends on whether we're local/utc/offset or not.
|
|
474
|
+
var n=t||Kn(),r=fi(n,this).startOf("day"),s=i.calendarFormat(this,r)||"sameElse",o=e&&(A(e[s])?e[s].call(this,n):e[s]);return this.format(o||this.localeData().calendar(s,this,Kn(n)))}function Vi(){return new T(this)}function ji(t,e){var n=E(t)?t:Kn(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=rt(e)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())}function Wi(t,e){var n=E(t)?t:Kn(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=rt(e)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())}function zi(t,e,n,i){var r=E(t)?t:Kn(t),s=E(e)?e:Kn(e);return!!(this.isValid()&&r.isValid()&&s.isValid())&&("("===(i=i||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===i[1]?this.isBefore(s,n):!this.isAfter(s,n))}function Zi(t,e){var n,i=E(t)?t:Kn(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=rt(e)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))}function Xi(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function Ki(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function qi(t,e,n){var i,r,s;if(!this.isValid())return NaN;if(!(i=fi(t,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),e=rt(e)){case"year":s=Ji(this,i)/12;break;case"month":s=Ji(this,i);break;case"quarter":s=Ji(this,i)/3;break;case"second":s=(this-i)/1e3;break;// 1000
|
|
475
|
+
case"minute":s=(this-i)/6e4;break;// 1000 * 60
|
|
476
|
+
case"hour":s=(this-i)/36e5;break;// 1000 * 60 * 60
|
|
477
|
+
case"day":s=(this-i-r)/864e5;break;// 1000 * 60 * 60 * 24, negate dst
|
|
478
|
+
case"week":s=(this-i-r)/6048e5;break;// 1000 * 60 * 60 * 24 * 7, negate dst
|
|
479
|
+
default:s=this-i}return n?s:ht(s)}function Ji(t,e){if(t.date()<e.date())
|
|
480
|
+
// end-of-month calculations work correct when the start month has more
|
|
481
|
+
// days than the end month.
|
|
482
|
+
return-Ji(e,t);
|
|
483
|
+
// difference in months
|
|
484
|
+
var n=12*(e.year()-t.year())+(e.month()-t.month()),
|
|
485
|
+
// b is in (anchor - 1 month, anchor + 1 month)
|
|
486
|
+
i=t.clone().add(n,"months");
|
|
487
|
+
//check for negative zero, return zero if negative zero
|
|
488
|
+
return-(n+(e-i<0?(e-i)/(i-t.clone().add(n-1,"months")):(e-i)/(t.clone().add(n+1,"months")-i)))||0}function Qi(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function tr(t){if(!this.isValid())return null;var e=!0!==t,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?V(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?
|
|
489
|
+
// native implementation is ~50x faster, use it when we can
|
|
490
|
+
e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",V(n,"Z")):V(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}
|
|
491
|
+
/**
|
|
492
|
+
* Return a human readable representation of a moment that can
|
|
493
|
+
* also be evaluated to get a new moment which is the same
|
|
494
|
+
*
|
|
495
|
+
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
|
|
496
|
+
*/function er(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,n,i,r="moment",s="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),t="["+r+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",i=s+'[")]',this.format(t+e+n+i)}function nr(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)}function ir(t,e){return this.isValid()&&(E(t)&&t.isValid()||Kn(t).isValid())?Ai({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function rr(t){return this.from(Kn(),t)}function sr(t,e){return this.isValid()&&(E(t)&&t.isValid()||Kn(t).isValid())?Ai({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function or(t){return this.to(Kn(),t)}
|
|
497
|
+
// If passed a locale key, it will set the locale for this
|
|
498
|
+
// instance. Otherwise, it will return the locale configuration
|
|
499
|
+
// variables for this instance.
|
|
500
|
+
function ar(t){var e;return void 0===t?this._locale._abbr:(null!=(e=vn(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lr=L("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function ur(){return this._locale}var hr=1e3,cr=60*hr,dr=60*cr,mr=3506328*dr;
|
|
501
|
+
// actual modulo - handles negative numbers (for dates before 1970):
|
|
502
|
+
function fr(t,e){return(t%e+e)%e}function pr(t,e,n){
|
|
503
|
+
// the date constructor remaps years 0-99 to 1900-1999
|
|
504
|
+
return t<100&&t>=0?new Date(t+400,e,n)-mr:new Date(t,e,n).valueOf()}function gr(t,e,n){
|
|
505
|
+
// Date.UTC remaps years 0-99 to 1900-1999
|
|
506
|
+
return t<100&&t>=0?Date.UTC(t+400,e,n)-mr:Date.UTC(t,e,n)}function yr(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gr:pr,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fr(e+(this._isUTC?0:this.utcOffset()*cr),dr);break;case"minute":e=this._d.valueOf(),e-=fr(e,cr);break;case"second":e=this._d.valueOf(),e-=fr(e,hr)}return this._d.setTime(e),i.updateOffset(this,!0),this}function _r(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gr:pr,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=dr-fr(e+(this._isUTC?0:this.utcOffset()*cr),dr)-1;break;case"minute":e=this._d.valueOf(),e+=cr-fr(e,cr)-1;break;case"second":e=this._d.valueOf(),e+=hr-fr(e,hr)-1}return this._d.setTime(e),i.updateOffset(this,!0),this}function vr(){return this._d.valueOf()-6e4*(this._offset||0)}function br(){return Math.floor(this.valueOf()/1e3)}function wr(){return new Date(this.valueOf())}function Tr(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Er(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Sr(){
|
|
507
|
+
// new Date(NaN).toJSON() === null
|
|
508
|
+
return this.isValid()?this.toISOString():null}function Lr(){return y(this)}function Mr(){return m({},g(this))}function Dr(){return g(this).overflow}function kr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ar(t,e){var n,r,s,o=this._eras||vn("en")._eras;for(n=0,r=o.length;n<r;++n)switch("string"==typeof o[n].since&&(
|
|
509
|
+
// truncate time
|
|
510
|
+
s=i(o[n].since).startOf("day"),o[n].since=s.valueOf()),typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":
|
|
511
|
+
// truncate time
|
|
512
|
+
s=i(o[n].until).startOf("day").valueOf(),o[n].until=s.valueOf()}return o}function Pr(t,e,n){var i,r,s,o,a,l=this.eras();for(t=t.toUpperCase(),i=0,r=l.length;i<r;++i)if(s=l[i].name.toUpperCase(),o=l[i].abbr.toUpperCase(),a=l[i].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(o===t)return l[i];break;case"NNNN":if(s===t)return l[i];break;case"NNNNN":if(a===t)return l[i]}else if([s,o,a].indexOf(t)>=0)return l[i]}function Hr(t,e){var n=t.since<=t.until?1:-1;return void 0===e?i(t.since).year():i(t.since).year()+(e-t.offset)*n}function Or(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t){if(
|
|
513
|
+
// truncate time
|
|
514
|
+
n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until)return i[t].name;if(i[t].until<=n&&n<=i[t].since)return i[t].name}return""}function Cr(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t){if(
|
|
515
|
+
// truncate time
|
|
516
|
+
n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until)return i[t].narrow;if(i[t].until<=n&&n<=i[t].since)return i[t].narrow}return""}function Nr(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t){if(
|
|
517
|
+
// truncate time
|
|
518
|
+
n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until)return i[t].abbr;if(i[t].until<=n&&n<=i[t].since)return i[t].abbr}return""}function xr(){var t,e,n,r,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=s[t].since<=s[t].until?1:-1,
|
|
519
|
+
// truncate time
|
|
520
|
+
r=this.clone().startOf("day").valueOf(),s[t].since<=r&&r<=s[t].until||s[t].until<=r&&r<=s[t].since)return(this.year()-i(s[t].since).year())*n+s[t].offset;return this.year()}function Rr(t){return a(this,"_erasNameRegex")||$r.call(this),t?this._erasNameRegex:this._erasRegex}function Br(t){return a(this,"_erasAbbrRegex")||$r.call(this),t?this._erasAbbrRegex:this._erasRegex}function Yr(t){return a(this,"_erasNarrowRegex")||$r.call(this),t?this._erasNarrowRegex:this._erasRegex}function Ur(t,e){return e.erasAbbrRegex(t)}function Ir(t,e){return e.erasNameRegex(t)}function Fr(t,e){return e.erasNarrowRegex(t)}function Gr(t,e){return e._eraYearOrdinalRegex||At}function $r(){var t,e,n=[],i=[],r=[],s=[],o=this.eras();for(t=0,e=o.length;t<e;++t)i.push(Yt(o[t].name)),n.push(Yt(o[t].abbr)),r.push(Yt(o[t].narrow)),s.push(Yt(o[t].name)),s.push(Yt(o[t].abbr)),s.push(Yt(o[t].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}
|
|
521
|
+
// FORMATTING
|
|
522
|
+
function Vr(t,e){I(0,[t,t.length],0,e)}
|
|
523
|
+
// MOMENTS
|
|
524
|
+
function jr(t){return qr.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Wr(t){return qr.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function zr(){return Se(this.year(),1,4)}function Zr(){return Se(this.isoWeekYear(),1,4)}function Xr(){var t=this.localeData()._week;return Se(this.year(),t.dow,t.doy)}function Kr(){var t=this.localeData()._week;return Se(this.weekYear(),t.dow,t.doy)}function qr(t,e,n,i,r){var s;return null==t?Ee(this,i,r).year:(e>(s=Se(t,i,r))&&(e=s),Jr.call(this,t,e,n,i,r))}function Jr(t,e,n,i,r){var s=Te(t,e,n,i,r),o=be(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}
|
|
525
|
+
// FORMATTING
|
|
526
|
+
// MOMENTS
|
|
527
|
+
function Qr(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}
|
|
528
|
+
// FORMATTING
|
|
529
|
+
I("N",0,0,"eraAbbr"),I("NN",0,0,"eraAbbr"),I("NNN",0,0,"eraAbbr"),I("NNNN",0,0,"eraName"),I("NNNNN",0,0,"eraNarrow"),I("y",["y",1],"yo","eraYear"),I("y",["yy",2],0,"eraYear"),I("y",["yyy",3],0,"eraYear"),I("y",["yyyy",4],0,"eraYear"),xt("N",Ur),xt("NN",Ur),xt("NNN",Ur),xt("NNNN",Ir),xt("NNNNN",Fr),It(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,n,i){var r=n._locale.erasParse(t,i,n._strict);r?g(n).era=r:g(n).invalidEra=t})),xt("y",At),xt("yy",At),xt("yyy",At),xt("yyyy",At),xt("yo",Gr),It(["y","yy","yyy","yyyy"],Vt),It(["yo"],(function(t,e,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Vt]=n._locale.eraYearOrdinalParse(t,r):e[Vt]=parseInt(t,10)})),I(0,["gg",2],0,(function(){return this.weekYear()%100})),I(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Vr("gggg","weekYear"),Vr("ggggg","weekYear"),Vr("GGGG","isoWeekYear"),Vr("GGGGG","isoWeekYear"),
|
|
530
|
+
// ALIASES
|
|
531
|
+
it("weekYear","gg"),it("isoWeekYear","GG"),
|
|
532
|
+
// PRIORITY
|
|
533
|
+
at("weekYear",1),at("isoWeekYear",1),
|
|
534
|
+
// PARSING
|
|
535
|
+
xt("G",Pt),xt("g",Pt),xt("GG",Et,vt),xt("gg",Et,vt),xt("GGGG",Dt,wt),xt("gggg",Dt,wt),xt("GGGGG",kt,Tt),xt("ggggg",kt,Tt),Ft(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=ct(t)})),Ft(["gg","GG"],(function(t,e,n,r){e[r]=i.parseTwoDigitYear(t)})),I("Q",0,"Qo","quarter"),
|
|
536
|
+
// ALIASES
|
|
537
|
+
it("quarter","Q"),
|
|
538
|
+
// PRIORITY
|
|
539
|
+
at("quarter",7),
|
|
540
|
+
// PARSING
|
|
541
|
+
xt("Q",_t),It("Q",(function(t,e){e[jt]=3*(ct(t)-1)})),I("D",["DD",2],"Do","date"),
|
|
542
|
+
// ALIASES
|
|
543
|
+
it("date","D"),
|
|
544
|
+
// PRIORITY
|
|
545
|
+
at("date",9),
|
|
546
|
+
// PARSING
|
|
547
|
+
xt("D",Et),xt("DD",Et,vt),xt("Do",(function(t,e){
|
|
548
|
+
// TODO: Remove "ordinalParse" fallback in next major release.
|
|
549
|
+
return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),It(["D","DD"],Wt),It("Do",(function(t,e){e[Wt]=ct(t.match(Et)[0])}));
|
|
550
|
+
// MOMENTS
|
|
551
|
+
var ts=dt("Date",!0);
|
|
552
|
+
// FORMATTING
|
|
553
|
+
// HELPERS
|
|
554
|
+
// MOMENTS
|
|
555
|
+
function es(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}
|
|
556
|
+
// FORMATTING
|
|
557
|
+
I("DDD",["DDDD",3],"DDDo","dayOfYear"),
|
|
558
|
+
// ALIASES
|
|
559
|
+
it("dayOfYear","DDD"),
|
|
560
|
+
// PRIORITY
|
|
561
|
+
at("dayOfYear",4),
|
|
562
|
+
// PARSING
|
|
563
|
+
xt("DDD",Mt),xt("DDDD",bt),It(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=ct(t)})),I("m",["mm",2],0,"minute"),
|
|
564
|
+
// ALIASES
|
|
565
|
+
it("minute","m"),
|
|
566
|
+
// PRIORITY
|
|
567
|
+
at("minute",14),
|
|
568
|
+
// PARSING
|
|
569
|
+
xt("m",Et),xt("mm",Et,vt),It(["m","mm"],Zt);
|
|
570
|
+
// MOMENTS
|
|
571
|
+
var ns=dt("Minutes",!1);
|
|
572
|
+
// FORMATTING
|
|
573
|
+
I("s",["ss",2],0,"second"),
|
|
574
|
+
// ALIASES
|
|
575
|
+
it("second","s"),
|
|
576
|
+
// PRIORITY
|
|
577
|
+
at("second",15),
|
|
578
|
+
// PARSING
|
|
579
|
+
xt("s",Et),xt("ss",Et,vt),It(["s","ss"],Xt);
|
|
580
|
+
// MOMENTS
|
|
581
|
+
var is,rs,ss=dt("Seconds",!1);
|
|
582
|
+
// FORMATTING
|
|
583
|
+
for(I("S",0,0,(function(){return~~(this.millisecond()/100)})),I(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),I(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),I(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),I(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),I(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),I(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),
|
|
584
|
+
// ALIASES
|
|
585
|
+
it("millisecond","ms"),
|
|
586
|
+
// PRIORITY
|
|
587
|
+
at("millisecond",16),
|
|
588
|
+
// PARSING
|
|
589
|
+
xt("S",Mt,_t),xt("SS",Mt,vt),xt("SSS",Mt,bt),is="SSSS";is.length<=9;is+="S")xt(is,At);function os(t,e){e[Kt]=ct(1e3*("0."+t))}for(is="S";is.length<=9;is+="S")It(is,os);
|
|
590
|
+
// MOMENTS
|
|
591
|
+
function as(){return this._isUTC?"UTC":""}function ls(){return this._isUTC?"Coordinated Universal Time":""}rs=dt("Milliseconds",!1),
|
|
592
|
+
// FORMATTING
|
|
593
|
+
I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var us=T.prototype;function hs(t){return Kn(1e3*t)}function cs(){return Kn.apply(null,arguments).parseZone()}function ds(t){return t}us.add=xi,us.calendar=$i,us.clone=Vi,us.diff=qi,us.endOf=_r,us.format=nr,us.from=ir,us.fromNow=rr,us.to=sr,us.toNow=or,us.get=pt,us.invalidAt=Dr,us.isAfter=ji,us.isBefore=Wi,us.isBetween=zi,us.isSame=Zi,us.isSameOrAfter=Xi,us.isSameOrBefore=Ki,us.isValid=Lr,us.lang=lr,us.locale=ar,us.localeData=ur,us.max=Jn,us.min=qn,us.parsingFlags=Mr,us.set=gt,us.startOf=yr,us.subtract=Ri,us.toArray=Tr,us.toObject=Er,us.toDate=wr,us.toISOString=tr,us.inspect=er,"undefined"!=typeof Symbol&&null!=Symbol.for&&(us[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),us.toJSON=Sr,us.toString=Qi,us.unix=br,us.valueOf=vr,us.creationData=kr,us.eraName=Or,us.eraNarrow=Cr,us.eraAbbr=Nr,us.eraYear=xr,us.year=ye,us.isLeapYear=_e,us.weekYear=jr,us.isoWeekYear=Wr,us.quarter=us.quarters=Qr,us.month=ce,us.daysInMonth=de,us.week=us.weeks=Ae,us.isoWeek=us.isoWeeks=Pe,us.weeksInYear=Xr,us.weeksInWeekYear=Kr,us.isoWeeksInYear=zr,us.isoWeeksInISOWeekYear=Zr,us.date=ts,us.day=us.days=je,us.weekday=We,us.isoWeekday=ze,us.dayOfYear=es,us.hour=us.hours=sn,us.minute=us.minutes=ns,us.second=us.seconds=ss,us.millisecond=us.milliseconds=rs,us.utcOffset=gi,us.utc=_i,us.local=vi,us.parseZone=bi,us.hasAlignedHourOffset=wi,us.isDST=Ti,us.isLocal=Si,us.isUtcOffset=Li,us.isUtc=Mi,us.isUTC=Mi,us.zoneAbbr=as,us.zoneName=ls,us.dates=L("dates accessor is deprecated. Use date instead.",ts),us.months=L("months accessor is deprecated. Use month instead",ce),us.years=L("years accessor is deprecated. Use year instead",ye),us.zone=L("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yi),us.isDSTShifted=L("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ei);var ms=O.prototype;function fs(t,e,n,i){var r=vn(),s=f().set(i,e);return r[n](s,t)}function ps(t,e,n){if(h(t)&&(e=t,t=void 0),t=t||"",null!=e)return fs(t,e,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=fs(t,i,n,"month");return r}
|
|
594
|
+
// ()
|
|
595
|
+
// (5)
|
|
596
|
+
// (fmt, 5)
|
|
597
|
+
// (fmt)
|
|
598
|
+
// (true)
|
|
599
|
+
// (true, 5)
|
|
600
|
+
// (true, fmt, 5)
|
|
601
|
+
// (true, fmt)
|
|
602
|
+
function gs(t,e,n,i){"boolean"==typeof t?(h(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,h(e)&&(n=e,e=void 0),e=e||"");var r,s=vn(),o=t?s._week.dow:0,a=[];if(null!=n)return fs(e,(n+o)%7,i,"day");for(r=0;r<7;r++)a[r]=fs(e,(r+o)%7,i,"day");return a}function ys(t,e){return ps(t,e,"months")}function _s(t,e){return ps(t,e,"monthsShort")}function vs(t,e,n){return gs(t,e,n,"weekdays")}function bs(t,e,n){return gs(t,e,n,"weekdaysShort")}function ws(t,e,n){return gs(t,e,n,"weekdaysMin")}ms.calendar=N,ms.longDateFormat=z,ms.invalidDate=X,ms.ordinal=J,ms.preparse=ds,ms.postformat=ds,ms.relativeTime=tt,ms.pastFuture=et,ms.set=P,ms.eras=Ar,ms.erasParse=Pr,ms.erasConvertYear=Hr,ms.erasAbbrRegex=Br,ms.erasNameRegex=Rr,ms.erasNarrowRegex=Yr,ms.months=oe,ms.monthsShort=ae,ms.monthsParse=ue,ms.monthsRegex=fe,ms.monthsShortRegex=me,ms.week=Le,ms.firstDayOfYear=ke,ms.firstDayOfWeek=De,ms.weekdays=Ie,ms.weekdaysMin=Ge,ms.weekdaysShort=Fe,ms.weekdaysParse=Ve,ms.weekdaysRegex=Ze,ms.weekdaysShortRegex=Xe,ms.weekdaysMinRegex=Ke,ms.isPM=nn,ms.meridiem=on,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ct(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),
|
|
603
|
+
// Side effect imports
|
|
604
|
+
i.lang=L("moment.lang is deprecated. Use moment.locale instead.",gn),i.langData=L("moment.langData is deprecated. Use moment.localeData instead.",vn);var Ts=Math.abs;function Es(){var t=this._data;return this._milliseconds=Ts(this._milliseconds),this._days=Ts(this._days),this._months=Ts(this._months),t.milliseconds=Ts(t.milliseconds),t.seconds=Ts(t.seconds),t.minutes=Ts(t.minutes),t.hours=Ts(t.hours),t.months=Ts(t.months),t.years=Ts(t.years),this}function Ss(t,e,n,i){var r=Ai(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}
|
|
605
|
+
// supports only 2.0-style add(1, 's') or add(duration)
|
|
606
|
+
function Ls(t,e){return Ss(this,t,e,1)}
|
|
607
|
+
// supports only 2.0-style subtract(1, 's') or subtract(duration)
|
|
608
|
+
function Ms(t,e){return Ss(this,t,e,-1)}function Ds(t){return t<0?Math.floor(t):Math.ceil(t)}function ks(){var t,e,n,i,r,s=this._milliseconds,o=this._days,a=this._months,l=this._data;
|
|
609
|
+
// if we have a mix of positive and negative values, bubble down first
|
|
610
|
+
// check: https://github.com/moment/moment/issues/2166
|
|
611
|
+
return s>=0&&o>=0&&a>=0||s<=0&&o<=0&&a<=0||(s+=864e5*Ds(Ps(a)+o),o=0,a=0),
|
|
612
|
+
// The following code bubbles up values, see the tests for
|
|
613
|
+
// examples of what that means.
|
|
614
|
+
l.milliseconds=s%1e3,t=ht(s/1e3),l.seconds=t%60,e=ht(t/60),l.minutes=e%60,n=ht(e/60),l.hours=n%24,o+=ht(n/24),a+=
|
|
615
|
+
// convert days to months
|
|
616
|
+
r=ht(As(o)),o-=Ds(Ps(r)),
|
|
617
|
+
// 12 months -> 1 year
|
|
618
|
+
i=ht(a/12),a%=12,l.days=o,l.months=a,l.years=i,this}function As(t){
|
|
619
|
+
// 400 years have 146097 days (taking into account leap year rules)
|
|
620
|
+
// 400 years have 12 months === 4800
|
|
621
|
+
return 4800*t/146097}function Ps(t){
|
|
622
|
+
// the reverse of daysToMonths
|
|
623
|
+
return 146097*t/4800}function Hs(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=rt(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+As(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(
|
|
624
|
+
// handle milliseconds separately because of floating point math errors (issue #1867)
|
|
625
|
+
e=this._days+Math.round(Ps(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;
|
|
626
|
+
// Math.floor prevents floating point math errors here
|
|
627
|
+
case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}
|
|
628
|
+
// TODO: Use this.as('ms')?
|
|
629
|
+
function Os(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ct(this._months/12):NaN}function Cs(t){return function(){return this.as(t)}}var Ns=Cs("ms"),xs=Cs("s"),Rs=Cs("m"),Bs=Cs("h"),Ys=Cs("d"),Us=Cs("w"),Is=Cs("M"),Fs=Cs("Q"),Gs=Cs("y");function $s(){return Ai(this)}function Vs(t){return t=rt(t),this.isValid()?this[t+"s"]():NaN}function js(t){return function(){return this.isValid()?this._data[t]:NaN}}var Ws=js("milliseconds"),zs=js("seconds"),Zs=js("minutes"),Xs=js("hours"),Ks=js("days"),qs=js("months"),Js=js("years");function Qs(){return ht(this.days()/7)}var to=Math.round,eo={ss:44,// a few seconds to seconds
|
|
630
|
+
s:45,// seconds to minute
|
|
631
|
+
m:45,// minutes to hour
|
|
632
|
+
h:22,// hours to day
|
|
633
|
+
d:26,// days to month/week
|
|
634
|
+
w:null,// weeks to month
|
|
635
|
+
M:11};
|
|
636
|
+
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
|
|
637
|
+
function no(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}function io(t,e,n,i){var r=Ai(t).abs(),s=to(r.as("s")),o=to(r.as("m")),a=to(r.as("h")),l=to(r.as("d")),u=to(r.as("M")),h=to(r.as("w")),c=to(r.as("y")),d=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||o<=1&&["m"]||o<n.m&&["mm",o]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(d=d||h<=1&&["w"]||h<n.w&&["ww",h]),(d=d||u<=1&&["M"]||u<n.M&&["MM",u]||c<=1&&["y"]||["yy",c])[2]=e,d[3]=+t>0,d[4]=i,no.apply(null,d)}
|
|
638
|
+
// This function allows you to set the rounding function for relative time strings
|
|
639
|
+
function ro(t){return void 0===t?to:"function"==typeof t&&(to=t,!0)}
|
|
640
|
+
// This function allows you to set a threshold for relative time strings
|
|
641
|
+
function so(t,e){return void 0!==eo[t]&&(void 0===e?eo[t]:(eo[t]=e,"s"===t&&(eo.ss=e-1),!0))}function oo(t,e){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,s=eo;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(r=t),"object"==typeof e&&(s=Object.assign({},eo,e),null!=e.s&&null==e.ss&&(s.ss=e.s-1)),i=io(this,!r,s,n=this.localeData()),r&&(i=n.pastFuture(+this,i)),n.postformat(i)}var ao=Math.abs;function lo(t){return(t>0)-(t<0)||+t}function uo(){
|
|
642
|
+
// for ISO strings we do not use the normal bubbling rules:
|
|
643
|
+
// * milliseconds bubble up until they become hours
|
|
644
|
+
// * days do not bubble at all
|
|
645
|
+
// * months bubble up until they become years
|
|
646
|
+
// This is because there is no context-free conversion between hours and days
|
|
647
|
+
// (think of clock changes)
|
|
648
|
+
// and also not between days and months (28-31 days per month)
|
|
649
|
+
if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i,r,s,o,a,l=ao(this._milliseconds)/1e3,u=ao(this._days),h=ao(this._months),c=this.asSeconds();return c?(
|
|
650
|
+
// 3600 seconds -> 60 minutes -> 1 hour
|
|
651
|
+
t=ht(l/60),e=ht(t/60),l%=60,t%=60,
|
|
652
|
+
// 12 months -> 1 year
|
|
653
|
+
n=ht(h/12),h%=12,
|
|
654
|
+
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
|
|
655
|
+
i=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=c<0?"-":"",s=lo(this._months)!==lo(c)?"-":"",o=lo(this._days)!==lo(c)?"-":"",a=lo(this._milliseconds)!==lo(c)?"-":"",r+"P"+(n?s+n+"Y":"")+(h?s+h+"M":"")+(u?o+u+"D":"")+(e||t||l?"T":"")+(e?a+e+"H":"")+(t?a+t+"M":"")+(l?a+i+"S":"")):"P0D"}var ho=ai.prototype;return ho.isValid=si,ho.abs=Es,ho.add=Ls,ho.subtract=Ms,ho.as=Hs,ho.asMilliseconds=Ns,ho.asSeconds=xs,ho.asMinutes=Rs,ho.asHours=Bs,ho.asDays=Ys,ho.asWeeks=Us,ho.asMonths=Is,ho.asQuarters=Fs,ho.asYears=Gs,ho.valueOf=Os,ho._bubble=ks,ho.clone=$s,ho.get=Vs,ho.milliseconds=Ws,ho.seconds=zs,ho.minutes=Zs,ho.hours=Xs,ho.days=Ks,ho.weeks=Qs,ho.months=qs,ho.years=Js,ho.humanize=oo,ho.toISOString=uo,ho.toString=uo,ho.toJSON=uo,ho.locale=ar,ho.localeData=ur,ho.toIsoString=L("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",uo),ho.lang=lr,
|
|
656
|
+
// FORMATTING
|
|
657
|
+
I("X",0,0,"unix"),I("x",0,0,"valueOf"),
|
|
658
|
+
// PARSING
|
|
659
|
+
xt("x",Pt),xt("X",Ct),It("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t))})),It("x",(function(t,e,n){n._d=new Date(ct(t))})),
|
|
660
|
+
//! moment.js
|
|
661
|
+
i.version="2.29.4",r(Kn),i.fn=us,i.min=ti,i.max=ei,i.now=ni,i.utc=f,i.unix=hs,i.months=ys,i.isDate=c,i.locale=gn,i.invalid=_,i.duration=Ai,i.isMoment=E,i.weekdays=vs,i.parseZone=cs,i.localeData=vn,i.isDuration=li,i.monthsShort=_s,i.weekdaysMin=ws,i.defineLocale=yn,i.updateLocale=_n,i.locales=bn,i.weekdaysShort=bs,i.normalizeUnits=rt,i.relativeTimeRounding=ro,i.relativeTimeThreshold=so,i.calendarFormat=Gi,i.prototype=us,
|
|
662
|
+
// currently HTML5 input type only supports 24-hour formats
|
|
663
|
+
i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",// <input type="datetime-local" />
|
|
664
|
+
DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",// <input type="datetime-local" step="1" />
|
|
665
|
+
DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",// <input type="datetime-local" step="0.001" />
|
|
666
|
+
DATE:"YYYY-MM-DD",// <input type="date" />
|
|
667
|
+
TIME:"HH:mm",// <input type="time" />
|
|
668
|
+
TIME_SECONDS:"HH:mm:ss",// <input type="time" step="1" />
|
|
669
|
+
TIME_MS:"HH:mm:ss.SSS",// <input type="time" step="0.001" />
|
|
670
|
+
WEEK:"GGGG-[W]WW",// <input type="week" />
|
|
671
|
+
MONTH:"YYYY-MM"},i}()}));const $=[];
|
|
672
|
+
/**
|
|
673
|
+
* Creates a `Readable` store that allows reading by subscription.
|
|
674
|
+
* @param value initial value
|
|
675
|
+
* @param {StartStopNotifier} [start]
|
|
676
|
+
*/
|
|
677
|
+
/**
|
|
678
|
+
* Create a `Writable` store that allows both updating and reading by subscription.
|
|
679
|
+
* @param {*=}value initial value
|
|
680
|
+
* @param {StartStopNotifier=} start
|
|
681
|
+
*/
|
|
682
|
+
function V(e,n=t){let i;const r=new Set;function o(t){if(s(e,t)&&(e=t,i)){// store is ready
|
|
683
|
+
const t=!$.length;for(const t of r)t[1](),$.push(t,e);if(t){for(let t=0;t<$.length;t+=2)$[t][0]($[t+1]);$.length=0}}}return{set:o,update:function(t){o(t(e))},subscribe:function(s,a=t){const l=[s,a];return r.add(l),1===r.size&&(i=n(o)||t),s(e),()=>{r.delete(l),0===r.size&&i&&(i(),i=null)}}}}function j(e,n,s){const o=!Array.isArray(e),a=o?[e]:e,l=n.length<2;return h=e=>{let s=!1;const h=[];let c=0,d=t;const m=()=>{if(c)return;d();const i=n(o?h[0]:h,e);l?e(i):d=r(i)?i:t},f=a.map(((t,e)=>u(t,(t=>{h[e]=t,c&=~(1<<e),s&&m()}),(()=>{c|=1<<e}))));return s=!0,m(),function(){i(f),d(),
|
|
684
|
+
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
|
685
|
+
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
|
686
|
+
// invoke this derived store.
|
|
687
|
+
s=!1}},{subscribe:V(s,h).subscribe};var h}var W=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===z}(t)}
|
|
688
|
+
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
689
|
+
(t)};var z="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Z(t,e){return!1!==e.clone&&e.isMergeableObject(t)?Q((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function X(t,e,n){return t.concat(e).map((function(t){return Z(t,n)}))}function K(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function q(t,e){try{return e in t}catch(t){return!1}}
|
|
690
|
+
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
691
|
+
function J(t,e,n){var i={};return n.isMergeableObject(t)&&K(t).forEach((function(e){i[e]=Z(t[e],n)})),K(e).forEach((function(r){(function(t,e){return q(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e));// and also unsafe if they're nonenumerable.
|
|
692
|
+
})(t,r)||(q(t,r)&&n.isMergeableObject(e[r])?i[r]=function(t,e){if(!e.customMerge)return Q;var n=e.customMerge(t);return"function"==typeof n?n:Q}(r,n)(t[r],e[r],n):i[r]=Z(e[r],n))})),i}function Q(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||X,n.isMergeableObject=n.isMergeableObject||W,
|
|
693
|
+
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
694
|
+
// implementations can use it. The caller may not replace it.
|
|
695
|
+
n.cloneUnlessOtherwiseSpecified=Z;var i=Array.isArray(e);return i===Array.isArray(t)?i?n.arrayMerge(t,e,n):J(t,e,n):Z(e,n)}Q.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return Q(t,n,e)}),{})};var tt=Q,et=function(t,e){return et=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},et(t,e)};function nt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}et(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var it,rt,st,ot=function(){return ot=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ot.apply(this,arguments)};function at(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}
|
|
696
|
+
/**
|
|
697
|
+
* Type Guards
|
|
698
|
+
*/
|
|
699
|
+
function lt(t){return t.type===rt.literal}function ut(t){return t.type===rt.argument}function ht(t){return t.type===rt.number}function ct(t){return t.type===rt.date}function dt(t){return t.type===rt.time}function mt(t){return t.type===rt.select}function ft(t){return t.type===rt.plural}function pt(t){return t.type===rt.pound}function gt(t){return t.type===rt.tag}function yt(t){return!(!t||"object"!=typeof t||t.type!==st.number)}function _t(t){return!(!t||"object"!=typeof t||t.type!==st.dateTime)}
|
|
700
|
+
// @generated from regex-gen.ts
|
|
701
|
+
"function"==typeof SuppressedError&&SuppressedError,function(t){
|
|
702
|
+
/** Argument is unclosed (e.g. `{0`) */
|
|
703
|
+
t[t.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",
|
|
704
|
+
/** Argument is empty (e.g. `{}`). */
|
|
705
|
+
t[t.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",
|
|
706
|
+
/** Argument is malformed (e.g. `{foo!}``) */
|
|
707
|
+
t[t.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",
|
|
708
|
+
/** Expect an argument type (e.g. `{foo,}`) */
|
|
709
|
+
t[t.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",
|
|
710
|
+
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
711
|
+
t[t.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",
|
|
712
|
+
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
713
|
+
t[t.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",
|
|
714
|
+
/** The number skeleton is invalid. */
|
|
715
|
+
t[t.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",
|
|
716
|
+
/** The date time skeleton is invalid. */
|
|
717
|
+
t[t.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",
|
|
718
|
+
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
719
|
+
t[t.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",
|
|
720
|
+
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
721
|
+
t[t.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",
|
|
722
|
+
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
723
|
+
t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",
|
|
724
|
+
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
725
|
+
t[t.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",
|
|
726
|
+
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
727
|
+
t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
728
|
+
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
729
|
+
t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
730
|
+
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
731
|
+
t[t.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",
|
|
732
|
+
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
733
|
+
t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",
|
|
734
|
+
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
735
|
+
t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",
|
|
736
|
+
/**
|
|
737
|
+
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
738
|
+
* (e.g. `{foo, plural, one}`)
|
|
739
|
+
*/
|
|
740
|
+
t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",
|
|
741
|
+
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
742
|
+
t[t.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",
|
|
743
|
+
/**
|
|
744
|
+
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
745
|
+
* (e.g. {foo, plural, one {#} one {#}})
|
|
746
|
+
*/
|
|
747
|
+
t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",
|
|
748
|
+
/** Duplicate selectors in `select` argument.
|
|
749
|
+
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
750
|
+
*/
|
|
751
|
+
t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",
|
|
752
|
+
/** Plural or select argument option must have `other` clause. */
|
|
753
|
+
t[t.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",
|
|
754
|
+
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
755
|
+
t[t.INVALID_TAG=23]="INVALID_TAG",
|
|
756
|
+
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
757
|
+
t[t.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
758
|
+
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
759
|
+
t[t.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
|
760
|
+
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
761
|
+
t[t.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(it||(it={})),function(t){
|
|
762
|
+
/**
|
|
763
|
+
* Raw text
|
|
764
|
+
*/
|
|
765
|
+
t[t.literal=0]="literal",
|
|
766
|
+
/**
|
|
767
|
+
* Variable w/o any format, e.g `var` in `this is a {var}`
|
|
768
|
+
*/
|
|
769
|
+
t[t.argument=1]="argument",
|
|
770
|
+
/**
|
|
771
|
+
* Variable w/ number format
|
|
772
|
+
*/
|
|
773
|
+
t[t.number=2]="number",
|
|
774
|
+
/**
|
|
775
|
+
* Variable w/ date format
|
|
776
|
+
*/
|
|
777
|
+
t[t.date=3]="date",
|
|
778
|
+
/**
|
|
779
|
+
* Variable w/ time format
|
|
780
|
+
*/
|
|
781
|
+
t[t.time=4]="time",
|
|
782
|
+
/**
|
|
783
|
+
* Variable w/ select format
|
|
784
|
+
*/
|
|
785
|
+
t[t.select=5]="select",
|
|
786
|
+
/**
|
|
787
|
+
* Variable w/ plural format
|
|
788
|
+
*/
|
|
789
|
+
t[t.plural=6]="plural",
|
|
790
|
+
/**
|
|
791
|
+
* Only possible within plural argument.
|
|
792
|
+
* This is the `#` symbol that will be substituted with the count.
|
|
793
|
+
*/
|
|
794
|
+
t[t.pound=7]="pound",
|
|
795
|
+
/**
|
|
796
|
+
* XML-like tag
|
|
797
|
+
*/
|
|
798
|
+
t[t.tag=8]="tag"}(rt||(rt={})),function(t){t[t.number=0]="number",t[t.dateTime=1]="dateTime"}(st||(st={}));var vt=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,bt=/(?:[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;
|
|
799
|
+
/**
|
|
800
|
+
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
801
|
+
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
802
|
+
* with some tweaks
|
|
803
|
+
*/
|
|
804
|
+
/**
|
|
805
|
+
* Parse Date time skeleton into Intl.DateTimeFormatOptions
|
|
806
|
+
* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
807
|
+
* @public
|
|
808
|
+
* @param skeleton skeleton string
|
|
809
|
+
*/
|
|
810
|
+
function wt(t){var e={};return t.replace(bt,(function(t){var n=t.length;switch(t[0]){
|
|
811
|
+
// Era
|
|
812
|
+
case"G":e.era=4===n?"long":5===n?"narrow":"short";break;
|
|
813
|
+
// Year
|
|
814
|
+
case"y":e.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");
|
|
815
|
+
// Quarter
|
|
816
|
+
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
817
|
+
// Month
|
|
818
|
+
case"M":case"L":e.month=["numeric","2-digit","short","long","narrow"][n-1];break;
|
|
819
|
+
// Week
|
|
820
|
+
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":e.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");
|
|
821
|
+
// Weekday
|
|
822
|
+
case"E":e.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");e.weekday=["short","long","narrow","short"][n-4];break;
|
|
823
|
+
// Period
|
|
824
|
+
case"a":// AM, PM
|
|
825
|
+
e.hour12=!0;break;case"b":// am, pm, noon, midnight
|
|
826
|
+
case"B":// flexible day periods
|
|
827
|
+
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
828
|
+
// Hour
|
|
829
|
+
case"h":e.hourCycle="h12",e.hour=["numeric","2-digit"][n-1];break;case"H":e.hourCycle="h23",e.hour=["numeric","2-digit"][n-1];break;case"K":e.hourCycle="h11",e.hour=["numeric","2-digit"][n-1];break;case"k":e.hourCycle="h24",e.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");
|
|
830
|
+
// Minute
|
|
831
|
+
case"m":e.minute=["numeric","2-digit"][n-1];break;
|
|
832
|
+
// Second
|
|
833
|
+
case"s":e.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
834
|
+
// Zone
|
|
835
|
+
case"z":// 1..3, 4: specific non-location format
|
|
836
|
+
e.timeZoneName=n<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
|
837
|
+
case"O":// 1, 4: miliseconds in day short, long
|
|
838
|
+
case"v":// 1, 4: generic non-location format
|
|
839
|
+
case"V":// 1, 2, 3, 4: time zone ID or city
|
|
840
|
+
case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
841
|
+
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
842
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),e}
|
|
843
|
+
// @generated from regex-gen.ts
|
|
844
|
+
var Tt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var Et=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,St=/^(@+)?(\+|#+)?[rs]?$/g,Lt=/(\*)(0+)|(#+)(0+)|(0+)/g,Mt=/^(0+)$/;function Dt(t){var e={};return"r"===t[t.length-1]?e.roundingPriority="morePrecision":"s"===t[t.length-1]&&(e.roundingPriority="lessPrecision"),t.replace(St,(function(t,n,i){
|
|
845
|
+
// @@@ case
|
|
846
|
+
return"string"!=typeof i?(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length):"+"===i?e.minimumSignificantDigits=n.length:"#"===n[0]?e.maximumSignificantDigits=n.length:(e.minimumSignificantDigits=n.length,e.maximumSignificantDigits=n.length+("string"==typeof i?i.length:0)),""})),e}function kt(t){switch(t){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 At(t){
|
|
847
|
+
// Engineering
|
|
848
|
+
var e;if("E"===t[0]&&"E"===t[1]?(e={notation:"engineering"},t=t.slice(2)):"E"===t[0]&&(e={notation:"scientific"},t=t.slice(1)),e){var n=t.slice(0,2);if("+!"===n?(e.signDisplay="always",t=t.slice(2)):"+?"===n&&(e.signDisplay="exceptZero",t=t.slice(2)),!Mt.test(t))throw new Error("Malformed concise eng/scientific notation");e.minimumIntegerDigits=t.length}return e}function Pt(t){var e=kt(t);return e||{}}
|
|
849
|
+
/**
|
|
850
|
+
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
851
|
+
*/function Ht(t){for(var e={},n=0,i=t;n<i.length;n++){var r=i[n];switch(r.stem){case"percent":case"%":e.style="percent";continue;case"%x100":e.style="percent",e.scale=100;continue;case"currency":e.style="currency",e.currency=r.options[0];continue;case"group-off":case",_":e.useGrouping=!1;continue;case"precision-integer":case".":e.maximumFractionDigits=0;continue;case"measure-unit":case"unit":e.style="unit",e.unit=r.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":e.notation="compact",e.compactDisplay="short";continue;case"compact-long":case"KK":e.notation="compact",e.compactDisplay="long";continue;case"scientific":e=ot(ot(ot({},e),{notation:"scientific"}),r.options.reduce((function(t,e){return ot(ot({},t),Pt(e))}),{}));continue;case"engineering":e=ot(ot(ot({},e),{notation:"engineering"}),r.options.reduce((function(t,e){return ot(ot({},t),Pt(e))}),{}));continue;case"notation-simple":e.notation="standard";continue;
|
|
852
|
+
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
853
|
+
case"unit-width-narrow":e.currencyDisplay="narrowSymbol",e.unitDisplay="narrow";continue;case"unit-width-short":e.currencyDisplay="code",e.unitDisplay="short";continue;case"unit-width-full-name":e.currencyDisplay="name",e.unitDisplay="long";continue;case"unit-width-iso-code":e.currencyDisplay="symbol";continue;case"scale":e.scale=parseFloat(r.options[0]);continue;
|
|
854
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
855
|
+
case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Lt,(function(t,n,i,r,s,o){if(n)e.minimumIntegerDigits=i.length;else{if(r&&s)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
|
856
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
857
|
+
if(Mt.test(r.stem))e.minimumIntegerDigits=r.stem.length;else if(Et.test(r.stem)){
|
|
858
|
+
// Precision
|
|
859
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
860
|
+
// precision-integer case
|
|
861
|
+
if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Et,(function(t,n,i,r,s,o){
|
|
862
|
+
// .000* case (before ICU67 it was .000+)
|
|
863
|
+
return"*"===i?e.minimumFractionDigits=n.length:r&&"#"===r[0]?e.maximumFractionDigits=r.length:s&&o?(e.minimumFractionDigits=s.length,e.maximumFractionDigits=s.length+o.length):(e.minimumFractionDigits=n.length,e.maximumFractionDigits=n.length),""}));var s=r.options[0];
|
|
864
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
865
|
+
"w"===s?e=ot(ot({},e),{trailingZeroDisplay:"stripIfInteger"}):s&&(e=ot(ot({},e),Dt(s)))}
|
|
866
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
867
|
+
else if(St.test(r.stem))e=ot(ot({},e),Dt(r.stem));else{var o=kt(r.stem);o&&(e=ot(ot({},e),o));var a=At(r.stem);a&&(e=ot(ot({},e),a))}}return e}
|
|
868
|
+
// @generated from time-data-gen.ts
|
|
869
|
+
// prettier-ignore
|
|
870
|
+
var Ot,Ct={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"]};
|
|
871
|
+
/**
|
|
872
|
+
* Returns the best matching date time pattern if a date time skeleton
|
|
873
|
+
* pattern is provided with a locale. Follows the Unicode specification:
|
|
874
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns
|
|
875
|
+
* @param skeleton date time skeleton pattern that possibly includes j, J or C
|
|
876
|
+
* @param locale
|
|
877
|
+
*/
|
|
878
|
+
/**
|
|
879
|
+
* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)
|
|
880
|
+
* of the given `locale` to the corresponding time pattern.
|
|
881
|
+
* @param locale
|
|
882
|
+
*/
|
|
883
|
+
function Nt(t){var e=t.hourCycle;if(void 0===e&&
|
|
884
|
+
// @ts-ignore hourCycle(s) is not identified yet
|
|
885
|
+
t.hourCycles&&
|
|
886
|
+
// @ts-ignore
|
|
887
|
+
t.hourCycles.length&&(
|
|
888
|
+
// @ts-ignore
|
|
889
|
+
e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
|
890
|
+
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
891
|
+
var n,i=t.language;return"root"!==i&&(n=t.maximize().region),(Ct[n||""]||Ct[i||""]||Ct["".concat(i,"-001")]||Ct["001"])[0]}var xt=new RegExp("^".concat(vt.source,"*")),Rt=new RegExp("".concat(vt.source,"*$"));function Bt(t,e){return{start:t,end:e}}
|
|
892
|
+
// #region Ponyfills
|
|
893
|
+
// Consolidate these variables up top for easier toggling during debugging
|
|
894
|
+
var Yt=!!String.prototype.startsWith,Ut=!!String.fromCodePoint,It=!!Object.fromEntries,Ft=!!String.prototype.codePointAt,Gt=!!String.prototype.trimStart,$t=!!String.prototype.trimEnd,Vt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},jt=!0;try{
|
|
895
|
+
/**
|
|
896
|
+
* legacy Edge or Xbox One browser
|
|
897
|
+
* Unicode flag support: supported
|
|
898
|
+
* Pattern_Syntax support: not supported
|
|
899
|
+
* See https://github.com/formatjs/formatjs/issues/2822
|
|
900
|
+
*/
|
|
901
|
+
jt="a"===(null===(Ot=Qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Ot?void 0:Ot[0])}catch(t){jt=!1}var Wt,zt=Yt?// Native
|
|
902
|
+
function(t,e,n){return t.startsWith(e,n)}:// For IE11
|
|
903
|
+
function(t,e,n){return t.slice(n,n+e.length)===e},Zt=Ut?String.fromCodePoint:// IE11
|
|
904
|
+
function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n,i="",r=t.length,s=0;r>s;){if((n=t[s++])>1114111)throw RangeError(n+" is not a valid code point");i+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return i},Xt=
|
|
905
|
+
// native
|
|
906
|
+
It?Object.fromEntries:// Ponyfill
|
|
907
|
+
function(t){for(var e={},n=0,i=t;n<i.length;n++){var r=i[n],s=r[0],o=r[1];e[s]=o}return e},Kt=Ft?// Native
|
|
908
|
+
function(t,e){return t.codePointAt(e)}:// IE 11
|
|
909
|
+
function(t,e){var n=t.length;if(!(e<0||e>=n)){var i,r=t.charCodeAt(e);return r<55296||r>56319||e+1===n||(i=t.charCodeAt(e+1))<56320||i>57343?r:i-56320+(r-55296<<10)+65536}},qt=Gt?// Native
|
|
910
|
+
function(t){return t.trimStart()}:// Ponyfill
|
|
911
|
+
function(t){return t.replace(xt,"")},Jt=$t?// Native
|
|
912
|
+
function(t){return t.trimEnd()}:// Ponyfill
|
|
913
|
+
function(t){return t.replace(Rt,"")};
|
|
914
|
+
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
915
|
+
function Qt(t,e){return new RegExp(t,e)}
|
|
916
|
+
// #endregion
|
|
917
|
+
if(jt){
|
|
918
|
+
// Native
|
|
919
|
+
var te=Qt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Wt=function(t,e){var n;return te.lastIndex=e,null!==(n=te.exec(t)[1])&&void 0!==n?n:""}}else
|
|
920
|
+
// IE11
|
|
921
|
+
Wt=function(t,e){for(var n=[];;){var i=Kt(t,e);if(void 0===i||ie(i)||re(i))break;n.push(i),e+=i>=65536?2:1}return Zt.apply(void 0,n)};var ee=/** @class */function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,n){for(var i=[];!this.isEOF();){var r=this.char();if(123/* `{` */===r){if((s=this.parseArgument(t,n)).err)return s;i.push(s.val)}else{if(125/* `}` */===r&&t>0)break;if(35/* `#` */!==r||"plural"!==e&&"selectordinal"!==e){if(60/* `<` */===r&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(it.UNMATCHED_CLOSING_TAG,Bt(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===r&&!this.ignoreTag&&ne(this.peek()||0)){if((s=this.parseTag(t,e)).err)return s;i.push(s.val)}else{var s;if((s=this.parseLiteral(t,e)).err)return s;i.push(s.val)}}else{var o=this.clonePosition();this.bump(),i.push({type:rt.pound,location:Bt(o,this.clonePosition())})}}}return{val:i,err:null}},
|
|
922
|
+
/**
|
|
923
|
+
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
|
924
|
+
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
|
925
|
+
* are accepted:
|
|
926
|
+
*
|
|
927
|
+
* ```
|
|
928
|
+
* tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
|
|
929
|
+
* tagName ::= [a-z] (PENChar)*
|
|
930
|
+
* PENChar ::=
|
|
931
|
+
* "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
|
|
932
|
+
* [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
|
|
933
|
+
* [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
|
|
934
|
+
* ```
|
|
935
|
+
*
|
|
936
|
+
* [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
|
|
937
|
+
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
|
938
|
+
* since other tag-based engines like React allow it
|
|
939
|
+
*/
|
|
940
|
+
t.prototype.parseTag=function(t,e){var n=this.clonePosition();this.bump();// `<`
|
|
941
|
+
var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
|
942
|
+
// Self closing tag
|
|
943
|
+
return{val:{type:rt.literal,value:"<".concat(i,"/>"),location:Bt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(t+1,e,!0);if(r.err)return r;var s=r.val,o=this.clonePosition();
|
|
944
|
+
// Expecting a close tag
|
|
945
|
+
if(this.bumpIf("</")){if(this.isEOF()||!ne(this.char()))return this.error(it.INVALID_TAG,Bt(o,this.clonePosition()));var a=this.clonePosition();return i!==this.parseTagName()?this.error(it.UNMATCHED_CLOSING_TAG,Bt(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:rt.tag,value:i,children:s,location:Bt(n,this.clonePosition())},err:null}:this.error(it.INVALID_TAG,Bt(o,this.clonePosition())))}return this.error(it.UNCLOSED_TAG,Bt(n,this.clonePosition()))}return this.error(it.INVALID_TAG,Bt(n,this.clonePosition()))},
|
|
946
|
+
/**
|
|
947
|
+
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
948
|
+
*/
|
|
949
|
+
t.prototype.parseTagName=function(){var t,e=this.offset();// the first tag name character
|
|
950
|
+
for(this.bump();!this.isEOF()&&(45/* '-' */===(t=this.char())||46/* '.' */===t||t>=48&&t<=57/* 0..9 */||95/* '_' */===t||t>=97&&t<=122/** a..z */||t>=65&&t<=90/* A..Z */||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var n=this.clonePosition(),i="";;){var r=this.tryParseQuote(e);if(r)i+=r;else{var s=this.tryParseUnquoted(t,e);if(s)i+=s;else{var o=this.tryParseLeftAngleBracket();if(!o)break;i+=o}}}var a=Bt(n,this.clonePosition());return{val:{type:rt.literal,value:i,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(ne(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t;
|
|
951
|
+
/** See `parseTag` function docs. */},
|
|
952
|
+
/**
|
|
953
|
+
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
|
954
|
+
* a character that requires quoting (that is, "only where needed"), and works the same in
|
|
955
|
+
* nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
|
|
956
|
+
*/
|
|
957
|
+
t.prototype.tryParseQuote=function(t){if(this.isEOF()||39/* `'` */!==this.char())return null;
|
|
958
|
+
// Parse escaped char following the apostrophe, or early return if there is no escaped char.
|
|
959
|
+
// Check if is valid escaped character
|
|
960
|
+
switch(this.peek()){case 39/* `'` */:
|
|
961
|
+
// double quote, should return as a single quote.
|
|
962
|
+
return this.bump(),this.bump(),"'";
|
|
963
|
+
// '{', '<', '>', '}'
|
|
964
|
+
case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
965
|
+
if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();// apostrophe
|
|
966
|
+
var e=[this.char()];// escaped char
|
|
967
|
+
// read chars until the optional closing apostrophe is found
|
|
968
|
+
for(this.bump();!this.isEOF();){var n=this.char();if(39/* `'` */===n){if(39/* `'` */!==this.peek()){
|
|
969
|
+
// Optional closing apostrophe.
|
|
970
|
+
this.bump();break}e.push(39),
|
|
971
|
+
// Bump one more time because we need to skip 2 characters.
|
|
972
|
+
this.bump()}else e.push(n);this.bump()}return Zt.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var n=this.char();return 60/* `<` */===n||123/* `{` */===n||35/* `#` */===n&&("plural"===e||"selectordinal"===e)||125/* `}` */===n&&t>0?null:(this.bump(),Zt(n))},t.prototype.parseArgument=function(t,e){var n=this.clonePosition();if(this.bump(),// `{`
|
|
973
|
+
this.bumpSpace(),this.isEOF())return this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,Bt(n,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(it.EMPTY_ARGUMENT,Bt(n,this.clonePosition()));
|
|
974
|
+
// argument name
|
|
975
|
+
var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(it.MALFORMED_ARGUMENT,Bt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,Bt(n,this.clonePosition()));switch(this.char()){
|
|
976
|
+
// Simple argument: `{name}`
|
|
977
|
+
case 125/* `}` */:// `}`
|
|
978
|
+
return this.bump(),{val:{type:rt.argument,
|
|
979
|
+
// value does not include the opening and closing braces.
|
|
980
|
+
value:i,location:Bt(n,this.clonePosition())},err:null};
|
|
981
|
+
// Argument with options: `{name, format, ...}`
|
|
982
|
+
case 44/* `,` */:return this.bump(),// `,`
|
|
983
|
+
this.bumpSpace(),this.isEOF()?this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,Bt(n,this.clonePosition())):this.parseArgumentOptions(t,e,i,n);default:return this.error(it.MALFORMED_ARGUMENT,Bt(n,this.clonePosition()))}},
|
|
984
|
+
/**
|
|
985
|
+
* Advance the parser until the end of the identifier, if it is currently on
|
|
986
|
+
* an identifier character. Return an empty string otherwise.
|
|
987
|
+
*/
|
|
988
|
+
t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),n=Wt(this.message,e),i=e+n.length;return this.bumpTo(i),{value:n,location:Bt(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,n,i){var r,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
|
989
|
+
// Parse this range:
|
|
990
|
+
// {name, type, style}
|
|
991
|
+
// ^---^
|
|
992
|
+
switch(o){case"":
|
|
993
|
+
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
994
|
+
return this.error(it.EXPECT_ARGUMENT_TYPE,Bt(s,a));case"number":case"date":case"time":
|
|
995
|
+
// Parse this range:
|
|
996
|
+
// {name, number, style}
|
|
997
|
+
// ^-------^
|
|
998
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(m=Jt(y.val)).length)return this.error(it.EXPECT_ARGUMENT_STYLE,Bt(this.clonePosition(),this.clonePosition()));l={style:m,styleLocation:Bt(u,this.clonePosition())}}if((_=this.tryParseArgumentClose(i)).err)return _;var h=Bt(i,this.clonePosition());
|
|
999
|
+
// Extract style or skeleton
|
|
1000
|
+
if(l&&zt(null==l?void 0:l.style,"::",0)){
|
|
1001
|
+
// Skeleton starts with `::`.
|
|
1002
|
+
var c=qt(l.style.slice(2));if("number"===o)return(y=this.parseNumberSkeletonFromString(c,l.styleLocation)).err?y:{val:{type:rt.number,value:n,location:h,style:y.val},err:null};if(0===c.length)return this.error(it.EXPECT_DATE_TIME_SKELETON,h);var d=c;
|
|
1003
|
+
// Get "best match" pattern only if locale is passed, if not, let it
|
|
1004
|
+
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
1005
|
+
// for unsupported patterns.
|
|
1006
|
+
this.locale&&(d=function(t,e){for(var n="",i=0;i<t.length;i++){var r=t.charAt(i);if("j"===r){for(var s=0;i+1<t.length&&t.charAt(i+1)===r;)s++,i++;var o=1+(1&s),a=s<2?1:3+(s>>1),l=Nt(e);for("H"!=l&&"k"!=l||(a=0);a-- >0;)n+="a";for(;o-- >0;)n=l+n}else n+="J"===r?"H":r}return n}(c,this.locale));var m={type:st.dateTime,pattern:d,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?wt(d):{}};return{val:{type:"date"===o?rt.date:rt.time,value:n,location:h,style:m},err:null}}
|
|
1007
|
+
// Regular style or no style.
|
|
1008
|
+
return{val:{type:"number"===o?rt.number:"date"===o?rt.date:rt.time,value:n,location:h,style:null!==(r=null==l?void 0:l.style)&&void 0!==r?r:null},err:null};case"plural":case"selectordinal":case"select":
|
|
1009
|
+
// Parse this range:
|
|
1010
|
+
// {name, plural, options}
|
|
1011
|
+
// ^---------^
|
|
1012
|
+
var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(it.EXPECT_SELECT_ARGUMENT_OPTIONS,Bt(f,ot({},f)));this.bumpSpace();
|
|
1013
|
+
// Parse offset:
|
|
1014
|
+
// {name, plural, offset:1, options}
|
|
1015
|
+
// ^-----^
|
|
1016
|
+
// or the first option:
|
|
1017
|
+
// {name, plural, one {...} other {...}}
|
|
1018
|
+
// ^--^
|
|
1019
|
+
var p=this.parseIdentifierIfPossible(),g=0;if("select"!==o&&"offset"===p.value){if(!this.bumpIf(":"))return this.error(it.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Bt(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(it.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,it.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;
|
|
1020
|
+
// Parse another identifier for option parsing
|
|
1021
|
+
this.bumpSpace(),p=this.parseIdentifierIfPossible(),g=y.val}var _,v=this.tryParsePluralOrSelectOptions(t,o,e,p);if(v.err)return v;if((_=this.tryParseArgumentClose(i)).err)return _;var b=Bt(i,this.clonePosition());return"select"===o?{val:{type:rt.select,value:n,options:Xt(v.val),location:b},err:null}:{val:{type:rt.plural,value:n,options:Xt(v.val),offset:g,pluralType:"plural"===o?"cardinal":"ordinal",location:b},err:null};default:return this.error(it.INVALID_ARGUMENT_TYPE,Bt(s,a))}},t.prototype.tryParseArgumentClose=function(t){
|
|
1022
|
+
// Parse: {value, number, ::currency/GBP }
|
|
1023
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(it.EXPECT_ARGUMENT_CLOSING_BRACE,Bt(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
1024
|
+
/**
|
|
1025
|
+
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
|
1026
|
+
*/
|
|
1027
|
+
t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
|
1028
|
+
// Treat apostrophe as quoting but include it in the style part.
|
|
1029
|
+
// Find the end of the quoted literal text.
|
|
1030
|
+
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(it.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Bt(n,this.clonePosition()));this.bump();break;case 123/* `{` */:t+=1,this.bump();break;case 125/* `}` */:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var n=[];try{n=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");
|
|
1031
|
+
// Parse the skeleton
|
|
1032
|
+
for(var e=[],n=0,i=t.split(Tt).filter((function(t){return t.length>0}));n<i.length;n++){var r=i[n].split("/");if(0===r.length)throw new Error("Invalid number skeleton");for(var s=r[0],o=r.slice(1),a=0,l=o;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");e.push({stem:s,options:o})}return e}(t)}catch(t){return this.error(it.INVALID_NUMBER_SKELETON,e)}return{val:{type:st.number,tokens:n,location:e,parsedOptions:this.shouldParseSkeletons?Ht(n):{}},err:null}},
|
|
1033
|
+
/**
|
|
1034
|
+
* @param nesting_level The current nesting level of messages.
|
|
1035
|
+
* This can be positive when parsing message fragment in select or plural argument options.
|
|
1036
|
+
* @param parent_arg_type The parent argument's type.
|
|
1037
|
+
* @param parsed_first_identifier If provided, this is the first identifier-like selector of
|
|
1038
|
+
* the argument. It is a by-product of a previous parsing attempt.
|
|
1039
|
+
* @param expecting_close_tag If true, this message is directly or indirectly nested inside
|
|
1040
|
+
* between a pair of opening and closing tags. The nested message will not parse beyond
|
|
1041
|
+
* the closing tag boundary.
|
|
1042
|
+
*/
|
|
1043
|
+
t.prototype.tryParsePluralOrSelectOptions=function(t,e,n,i){
|
|
1044
|
+
// Parse:
|
|
1045
|
+
// one {one apple}
|
|
1046
|
+
// ^--^
|
|
1047
|
+
for(var r,s=!1,o=[],a=new Set,l=i.value,u=i.location;;){if(0===l.length){var h=this.clonePosition();if("select"===e||!this.bumpIf("="))break;
|
|
1048
|
+
// Try parse `={number}` selector
|
|
1049
|
+
var c=this.tryParseDecimalInteger(it.EXPECT_PLURAL_ARGUMENT_SELECTOR,it.INVALID_PLURAL_ARGUMENT_SELECTOR);if(c.err)return c;u=Bt(h,this.clonePosition()),l=this.message.slice(h.offset,this.offset())}
|
|
1050
|
+
// Duplicate selector clauses
|
|
1051
|
+
if(a.has(l))return this.error("select"===e?it.DUPLICATE_SELECT_ARGUMENT_SELECTOR:it.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);"other"===l&&(s=!0),
|
|
1052
|
+
// Parse:
|
|
1053
|
+
// one {one apple}
|
|
1054
|
+
// ^----------^
|
|
1055
|
+
this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===e?it.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:it.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Bt(this.clonePosition(),this.clonePosition()));var m=this.parseMessage(t+1,e,n);if(m.err)return m;var f=this.tryParseArgumentClose(d);if(f.err)return f;o.push([l,{value:m.val,location:Bt(d,this.clonePosition())}]),
|
|
1056
|
+
// Keep track of the existing selectors
|
|
1057
|
+
a.add(l),
|
|
1058
|
+
// Prep next selector clause.
|
|
1059
|
+
this.bumpSpace(),l=(r=this.parseIdentifierIfPossible()).value,u=r.location}return 0===o.length?this.error("select"===e?it.EXPECT_SELECT_ARGUMENT_SELECTOR:it.EXPECT_PLURAL_ARGUMENT_SELECTOR,Bt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(it.MISSING_OTHER_CLAUSE,Bt(this.clonePosition(),this.clonePosition())):{val:o,err:null}},t.prototype.tryParseDecimalInteger=function(t,e){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var r=!1,s=0;!this.isEOF();){var o=this.char();if(!(o>=48/* `0` */&&o<=57/* `9` */))break;r=!0,s=10*s+(o-48),this.bump()}var a=Bt(i,this.clonePosition());return r?Vt(s*=n)?{val:s,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){
|
|
1060
|
+
// This is much faster than `Object.assign` or spread.
|
|
1061
|
+
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
|
1062
|
+
/**
|
|
1063
|
+
* Return the code point at the current position of the parser.
|
|
1064
|
+
* Throws if the index is out of bound.
|
|
1065
|
+
*/
|
|
1066
|
+
t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=Kt(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},
|
|
1067
|
+
/** Bump the parser to the next UTF-16 code unit. */
|
|
1068
|
+
t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10/* '\n' */===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
|
1069
|
+
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
1070
|
+
this.position.offset+=t<65536?1:2)}},
|
|
1071
|
+
/**
|
|
1072
|
+
* If the substring starting at the current position of the parser has
|
|
1073
|
+
* the given prefix, then bump the parser to the character immediately
|
|
1074
|
+
* following the prefix and return true. Otherwise, don't bump the parser
|
|
1075
|
+
* and return false.
|
|
1076
|
+
*/
|
|
1077
|
+
t.prototype.bumpIf=function(t){if(zt(this.message,t,this.offset())){for(var e=0;e<t.length;e++)this.bump();return!0}return!1},
|
|
1078
|
+
/**
|
|
1079
|
+
* Bump the parser until the pattern character is found and return `true`.
|
|
1080
|
+
* Otherwise bump to the end of the file and return `false`.
|
|
1081
|
+
*/
|
|
1082
|
+
t.prototype.bumpUntil=function(t){var e=this.offset(),n=this.message.indexOf(t,e);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},
|
|
1083
|
+
/**
|
|
1084
|
+
* Bump the parser to the target offset.
|
|
1085
|
+
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
|
1086
|
+
*/
|
|
1087
|
+
t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
|
1088
|
+
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
1089
|
+
t.prototype.bumpSpace=function(){for(;!this.isEOF()&&ie(this.char());)this.bump()},
|
|
1090
|
+
/**
|
|
1091
|
+
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
1092
|
+
* If the input has been exhausted, then this returns null.
|
|
1093
|
+
*/
|
|
1094
|
+
t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),n=this.message.charCodeAt(e+(t>=65536?2:1));return null!=n?n:null},t}();
|
|
1095
|
+
/**
|
|
1096
|
+
* This check if codepoint is alphabet (lower & uppercase)
|
|
1097
|
+
* @param codepoint
|
|
1098
|
+
* @returns
|
|
1099
|
+
*/function ne(t){return t>=97&&t<=122||t>=65&&t<=90}
|
|
1100
|
+
/**
|
|
1101
|
+
* Code point equivalent of regex `\p{White_Space}`.
|
|
1102
|
+
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
1103
|
+
*/
|
|
1104
|
+
function ie(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}
|
|
1105
|
+
/**
|
|
1106
|
+
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
|
1107
|
+
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
1108
|
+
*/function re(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function se(t){t.forEach((function(t){if(delete t.location,mt(t)||ft(t))for(var e in t.options)delete t.options[e].location,se(t.options[e].value);else ht(t)&&yt(t.style)||(ct(t)||dt(t))&&_t(t.style)?delete t.style.location:gt(t)&&se(t.children)}))}function oe(t,e){void 0===e&&(e={}),e=ot({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new ee(t,e).parse();if(n.err){var i=SyntaxError(it[n.err.kind]);
|
|
1109
|
+
// @ts-expect-error Assign to error object
|
|
1110
|
+
throw i.location=n.err.location,
|
|
1111
|
+
// @ts-expect-error Assign to error object
|
|
1112
|
+
i.originalMessage=n.err.message,i}return(null==e?void 0:e.captureLocation)||se(n.val),n.val}
|
|
1113
|
+
|
|
1114
|
+
// Main
|
|
1115
|
+
|
|
1116
|
+
function ae(t,e){var n=e&&e.cache?e.cache:pe,i=e&&e.serializer?e.serializer:de;return(e&&e.strategy?e.strategy:ce)(t,{cache:n,serializer:i})}
|
|
1117
|
+
|
|
1118
|
+
// Strategy
|
|
1119
|
+
|
|
1120
|
+
function le(t,e,n,i){var r,s=null==(r=i)||"number"==typeof r||"boolean"==typeof r?i:n(i),o=e.get(s);return void 0===o&&(o=t.call(this,i),e.set(s,o)),o}function ue(t,e,n){var i=Array.prototype.slice.call(arguments,3),r=n(i),s=e.get(r);return void 0===s&&(s=t.apply(this,i),e.set(r,s)),s}function he(t,e,n,i,r){return n.bind(e,t,i,r)}function ce(t,e){return he(t,this,1===t.length?le:ue,e.cache.create(),e.serializer)}
|
|
1121
|
+
// Serializer
|
|
1122
|
+
var de=function(){return JSON.stringify(arguments)};
|
|
1123
|
+
|
|
1124
|
+
// Cache
|
|
1125
|
+
|
|
1126
|
+
function me(){this.cache=Object.create(null)}me.prototype.get=function(t){return this.cache[t]},me.prototype.set=function(t,e){this.cache[t]=e};var fe,pe={create:function(){
|
|
1127
|
+
// @ts-ignore
|
|
1128
|
+
return new me}},ge={variadic:function(t,e){return he(t,this,ue,e.cache.create(),e.serializer)},monadic:function(t,e){return he(t,this,le,e.cache.create(),e.serializer)}};!function(t){
|
|
1129
|
+
// When we have a placeholder but no value to format
|
|
1130
|
+
t.MISSING_VALUE="MISSING_VALUE",
|
|
1131
|
+
// When value supplied is invalid
|
|
1132
|
+
t.INVALID_VALUE="INVALID_VALUE",
|
|
1133
|
+
// When we need specific Intl API but it's not available
|
|
1134
|
+
t.MISSING_INTL_API="MISSING_INTL_API"}(fe||(fe={}));var ye,_e=/** @class */function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.code=n,r.originalMessage=i,r}return nt(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),ve=/** @class */function(t){function e(e,n,i,r){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),fe.INVALID_VALUE,r)||this}return nt(e,t),e}(_e),be=/** @class */function(t){function e(e,n,i){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(n),fe.INVALID_VALUE,i)||this}return nt(e,t),e}(_e),we=/** @class */function(t){function e(e,n){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(n,'"'),fe.MISSING_VALUE,n)||this}return nt(e,t),e}(_e);function Te(t){return"function"==typeof t}
|
|
1135
|
+
// TODO(skeleton): add skeleton support
|
|
1136
|
+
function Ee(t,e,n,i,r,s,
|
|
1137
|
+
// For debugging
|
|
1138
|
+
o){
|
|
1139
|
+
// Hot path for straight simple msg translations
|
|
1140
|
+
if(1===t.length&<(t[0]))return[{type:ye.literal,value:t[0].value}];for(var a=[],l=0,u=t;l<u.length;l++){var h=u[l];
|
|
1141
|
+
// Exit early for string parts.
|
|
1142
|
+
if(lt(h))a.push({type:ye.literal,value:h.value});else
|
|
1143
|
+
// TODO: should this part be literal type?
|
|
1144
|
+
// Replace `#` in plural rules with the actual numeric value.
|
|
1145
|
+
if(pt(h))"number"==typeof s&&a.push({type:ye.literal,value:n.getNumberFormat(e).format(s)});else{var c=h.value;
|
|
1146
|
+
// Enforce that all required values are provided by the caller.
|
|
1147
|
+
if(!r||!(c in r))throw new we(c,o);var d=r[c];if(ut(h))d&&"string"!=typeof d&&"number"!=typeof d||(d="string"==typeof d||"number"==typeof d?String(d):""),a.push({type:"string"==typeof d?ye.literal:ye.object,value:d});else
|
|
1148
|
+
// Recursively format plural and select parts' option — which can be a
|
|
1149
|
+
// nested pattern structure. The choosing of the option to use is
|
|
1150
|
+
// abstracted-by and delegated-to the part helper object.
|
|
1151
|
+
if(ct(h)){var m="string"==typeof h.style?i.date[h.style]:_t(h.style)?h.style.parsedOptions:void 0;a.push({type:ye.literal,value:n.getDateTimeFormat(e,m).format(d)})}else if(dt(h)){m="string"==typeof h.style?i.time[h.style]:_t(h.style)?h.style.parsedOptions:i.time.medium;a.push({type:ye.literal,value:n.getDateTimeFormat(e,m).format(d)})}else if(ht(h)){(m="string"==typeof h.style?i.number[h.style]:yt(h.style)?h.style.parsedOptions:void 0)&&m.scale&&(d*=m.scale||1),a.push({type:ye.literal,value:n.getNumberFormat(e,m).format(d)})}else{if(gt(h)){var f=h.children,p=h.value,g=r[p];if(!Te(g))throw new be(p,"function",o);var y=g(Ee(f,e,n,i,r,s).map((function(t){return t.value})));Array.isArray(y)||(y=[y]),a.push.apply(a,y.map((function(t){return{type:"string"==typeof t?ye.literal:ye.object,value:t}})))}if(mt(h)){if(!(_=h.options[d]||h.options.other))throw new ve(h.value,d,Object.keys(h.options),o);a.push.apply(a,Ee(_.value,e,n,i,r))}else if(ft(h)){var _;if(!(_=h.options["=".concat(d)])){if(!Intl.PluralRules)throw new _e('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',fe.MISSING_INTL_API,o);var v=n.getPluralRules(e,{type:h.pluralType}).select(d-(h.offset||0));_=h.options[v]||h.options.other}if(!_)throw new ve(h.value,d,Object.keys(h.options),o);a.push.apply(a,Ee(_.value,e,n,i,r,d-(h.offset||0)))}else;}}}return function(t){return t.length<2?t:t.reduce((function(t,e){var n=t[t.length-1];return n&&n.type===ye.literal&&e.type===ye.literal?n.value+=e.value:t.push(e),t}),[])}(a)}
|
|
1152
|
+
/*
|
|
1153
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
1154
|
+
Copyrights licensed under the New BSD License.
|
|
1155
|
+
See the accompanying LICENSE file for terms.
|
|
1156
|
+
*/
|
|
1157
|
+
// -- MessageFormat --------------------------------------------------------
|
|
1158
|
+
function Se(t,e){return e?Object.keys(t).reduce((function(n,i){var r,s;return n[i]=(r=t[i],(s=e[i])?ot(ot(ot({},r||{}),s||{}),Object.keys(r).reduce((function(t,e){return t[e]=ot(ot({},r[e]),s[e]||{}),t}),{})):r),n}),ot({},t)):t}function Le(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}!function(t){t[t.literal=0]="literal",t[t.object=1]="object"}(ye||(ye={}));var Me=/** @class */function(){function t(e,n,i,r){var s,o=this;if(void 0===n&&(n=t.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(t){var e=o.formatToParts(t);
|
|
1159
|
+
// Hot path for straight simple msg translations
|
|
1160
|
+
if(1===e.length)return e[0].value;var n=e.reduce((function(t,e){return t.length&&e.type===ye.literal&&"string"==typeof t[t.length-1]?t[t.length-1]+=e.value:t.push(e.value),t}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(t){return Ee(o.ast,o.locales,o.formatters,o.formats,t,void 0,o.message)},this.resolvedOptions=function(){return{locale:o.resolvedLocale.toString()}},this.getAst=function(){return o.ast},
|
|
1161
|
+
// Defined first because it's used to build the format pattern.
|
|
1162
|
+
this.locales=n,this.resolvedLocale=t.resolveLocale(n),"string"==typeof e){if(this.message=e,!t.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
1163
|
+
// Parse string messages into an AST.
|
|
1164
|
+
this.ast=t.__parse(e,{ignoreTag:null==r?void 0:r.ignoreTag,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
|
1165
|
+
// Creates a new object with the specified `formats` merged with the default
|
|
1166
|
+
// formats.
|
|
1167
|
+
this.formats=Se(t.formats,i),this.formatters=r&&r.formatters||(void 0===(s=this.formatterCache)&&(s={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ae((function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new((t=Intl.NumberFormat).bind.apply(t,at([void 0],e,!1)))}),{cache:Le(s.number),strategy:ge.variadic}),getDateTimeFormat:ae((function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new((t=Intl.DateTimeFormat).bind.apply(t,at([void 0],e,!1)))}),{cache:Le(s.dateTime),strategy:ge.variadic}),getPluralRules:ae((function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new((t=Intl.PluralRules).bind.apply(t,at([void 0],e,!1)))}),{cache:Le(s.pluralRules),strategy:ge.variadic})})}return Object.defineProperty(t,"defaultLocale",{get:function(){return t.memoizedDefaultLocale||(t.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),t.memoizedDefaultLocale},enumerable:!1,configurable:!0}),t.memoizedDefaultLocale=null,t.resolveLocale=function(t){var e=Intl.NumberFormat.supportedLocalesOf(t);return e.length>0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])},t.__parse=oe,
|
|
1168
|
+
// Default format options used as the prototype of the `formats` provided to the
|
|
1169
|
+
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
1170
|
+
// and Intl.DateTimeFormat instances.
|
|
1171
|
+
t.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"}}},t}();const De={},ke=(t,e,n)=>n?(e in De||(De[e]={}),t in De[e]||(De[e][t]=n),n):n,Ae=(t,e)=>{if(null==e)return;if(e in De&&t in De[e])return De[e][t];const n=tn(e);for(let i=0;i<n.length;i++){const r=Ce(n[i],t);if(r)return ke(t,e,r)}};let Pe;const He=V({});function Oe(t){return t in Pe}function Ce(t,e){if(!Oe(t))return null;const n=function(t){return Pe[t]||null}(t);return function(t,e){if(null==e)return;if(e in t)return t[e];const n=e.split(".");let i=t;for(let t=0;t<n.length;t++)if("object"==typeof i){if(t>0){const e=n.slice(t,n.length).join(".");if(e in i){i=i[e];break}}i=i[n[t]]}else i=void 0;return i}(n,e)}function Ne(t,...e){delete De[t],He.update((n=>(n[t]=tt.all([n[t]||{},...e]),n)))}j([He],(([t])=>Object.keys(t))),He.subscribe((t=>Pe=t));const xe={};function Re(t){return xe[t]}function Be(t){return null!=t&&tn(t).some((t=>{var e;return null==(e=Re(t))?void 0:e.size}))}function Ye(t,e){const n=Promise.all(e.map((e=>(function(t,e){xe[t].delete(e),0===xe[t].size&&delete xe[t]}(t,e),e().then((t=>t.default||t))))));return n.then((e=>Ne(t,...e)))}const Ue={};function Ie(t){if(!Be(t))return t in Ue?Ue[t]:Promise.resolve();const e=function(t){return tn(t).map((t=>{const e=Re(t);return[t,e?[...e]:[]]})).filter((([,t])=>t.length>0))}(t);return Ue[t]=Promise.all(e.map((([t,e])=>Ye(t,e)))).then((()=>{if(Be(t))return Ie(t);delete Ue[t]})),Ue[t]}const Fe={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 Ge(){return Fe}const $e=V(!1);var Ve=Object.defineProperty,je=Object.defineProperties,We=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Ke=(t,e,n)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;let qe;const Je=V(null);function Qe(t){return t.split("-").map(((t,e,n)=>n.slice(0,e+1).join("-"))).reverse()}function tn(t,e=Ge().fallbackLocale){const n=Qe(t);return e?[...new Set([...n,...Qe(e)])]:n}function en(){return null!=qe?qe:void 0}Je.subscribe((t=>{qe=null!=t?t:void 0,"undefined"!=typeof window&&null!=t&&document.documentElement.setAttribute("lang",t)}));const nn=(rn=((t,e)=>{for(var n in e||(e={}))Ze.call(e,n)&&Ke(t,n,e[n]);if(ze)for(var n of ze(e))Xe.call(e,n)&&Ke(t,n,e[n]);return t})({},Je),je(rn,We({set:t=>{if(t&&function(t){if(null==t)return;const e=tn(t);for(let t=0;t<e.length;t++){const n=e[t];if(Oe(n))return n}}(t)&&Be(t)){const{loadingDelay:e}=Ge();let n;return"undefined"!=typeof window&&null!=en()&&e?n=window.setTimeout((()=>$e.set(!0)),e):$e.set(!0),Ie(t).then((()=>{Je.set(t)})).finally((()=>{clearTimeout(n),$e.set(!1)}))}return Je.set(t)}})));var rn;const sn=t=>{const e=Object.create(null);return n=>{const i=JSON.stringify(n);return i in e?e[i]:e[i]=t(n)}};var on=Object.defineProperty,an=Object.getOwnPropertySymbols,ln=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,hn=(t,e,n)=>e in t?on(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,cn=(t,e)=>{for(var n in e||(e={}))ln.call(e,n)&&hn(t,n,e[n]);if(an)for(var n of an(e))un.call(e,n)&&hn(t,n,e[n]);return t},dn=(t,e)=>{var n={};for(var i in t)ln.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&an)for(var i of an(t))e.indexOf(i)<0&&un.call(t,i)&&(n[i]=t[i]);return n};const mn=(t,e)=>{const{formats:n}=Ge();if(t in n&&e in n[t])return n[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},fn=sn((t=>{var e=t,{locale:n,format:i}=e,r=dn(e,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return i&&(r=mn("number",i)),new Intl.NumberFormat(n,r)})),pn=sn((t=>{var e=t,{locale:n,format:i}=e,r=dn(e,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return i?r=mn("date",i):0===Object.keys(r).length&&(r=mn("date","short")),new Intl.DateTimeFormat(n,r)})),gn=sn((t=>{var e=t,{locale:n,format:i}=e,r=dn(e,["locale","format"]);if(null==n)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return i?r=mn("time",i):0===Object.keys(r).length&&(r=mn("time","short")),new Intl.DateTimeFormat(n,r)})),yn=sn((
|
|
1172
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1173
|
+
(t,e=en())=>new Me(t,e,Ge().formats,{ignoreTag:Ge().ignoreTag}))),_n=(t,e={})=>{var n,i,r,s;let o=e;"object"==typeof t&&(o=t,t=o.id);const{values:a,locale:l=en(),default:u}=o;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let h=Ae(t,l);if(h){if("string"!=typeof h)return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof h}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),h}else h=null!=(s=null!=(r=null==(i=(n=Ge()).handleMissingMessage)?void 0:i.call(n,{locale:l,id:t,defaultValue:u}))?r:u)?s:t;if(!a)return h;let c=h;try{c=yn(h,l).format(a)}catch(e){e instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,e.message)}return c},vn=(t,e)=>((t={})=>{var e=t,{locale:n=en()}=e,i=dn(e,["locale"]);return gn(cn({locale:n},i))})(e).format(t),bn=(t,e)=>((t={})=>{var e=t,{locale:n=en()}=e,i=dn(e,["locale"]);return pn(cn({locale:n},i))})(e).format(t),wn=(t,e)=>((t={})=>{var e=t,{locale:n=en()}=e,i=dn(e,["locale"]);return fn(cn({locale:n},i))})(e).format(t),Tn=(t,e=en())=>Ae(t,e),En=j([nn,He],(()=>_n));function Sn(t,e){Ne(t,e)}j([nn],(()=>vn)),j([nn],(()=>bn)),j([nn],(()=>wn)),j([nn,He],(()=>Tn));const Ln={en:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},"zh-hk":{noLimitToDisplay:"使用者尚未設定儲值限額...",depositLimitHeader:"存款限額",spentAmount:"花費金額",remainingAmount:"剩餘數量",limitPeriod:"限制期限",displayedProduct:"產品",futureLimit:"未來限制",additionalLink1:"最後存款交易詳情",additionalLink2:"定期存款",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},de:{noLimitToDisplay:"Der Benutzer hat kein Einzahlungslimit festgelegt...",depositLimitHeader:"Einzahlungslimit",spentAmount:"Ausgegebener Betrag",remainingAmount:"Restbetrag",limitPeriod:"Begrenzungszeitraum",displayedProduct:"Produkt",futureLimit:"Zukünftige Grenze",additionalLink1:"Details zur letzten Einzahlungstransaktion",additionalLink2:"Einzahlung im Zeitraum",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},it:{noLimitToDisplay:"L'utente non ha impostato un limite di deposito...",depositLimitHeader:"Limite di deposito",spentAmount:"Importo speso",remainingAmount:"Importo residuo",limitPeriod:"Periodo limite",displayedProduct:"Prodotto",futureLimit:"Limite futuro",additionalLink1:"Dettagli della transazione dell'ultimo deposito",additionalLink2:"Deposito nel periodo",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},fr:{noLimitToDisplay:"L'utilisateur n'a pas fixé de limite de dépôt...",depositLimitHeader:"Limite de dépôt",spentAmount:"Montant dépensé",remainingAmount:"Montant restant",limitPeriod:"Délai limite",displayedProduct:"Produit",futureLimit:"Limite future",additionalLink1:"Détails de la transaction du dernier dépôt",additionalLink2:"Dépôt en période",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},es:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},el:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},tr:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},ru:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},ro:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},hr:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},hu:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},pl:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},pt:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},sl:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"},sr:{noLimitToDisplay:"The user has not set a deposit limit...",depositLimitHeader:"Deposit limit",spentAmount:"Spent amount",remainingAmount:"Remaining amount",limitPeriod:"Limit period",displayedProduct:"Product",futureLimit:"Future limit",additionalLink1:"Last deposit transaction details",additionalLink2:"Deposit in period",limitRemoved:"This limit has been removed and is valid until",limitUpdated:"This limit will be applied beginning with",changeLimitLabel:"Change limit",futureAmount:"Future amount"}};var Mn="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='12' width='6' viewBox='0 0 256 512'%3e%3c!--!Font Awesome Free 6.5.1 by %40fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons%2c Inc.--%3e%3cpath fill='%2318a0fb' d='M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z'/%3e%3c/svg%3e",Dn="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3c!-- Uploaded to: SVG Repo%2c www.svgrepo.com%2c Generator: SVG Repo Mixer Tools --%3e%3csvg fill='%23a9b6ce' width='800px' height='800px' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M11%2c9h4a1%2c1%2c0%2c0%2c0%2c0-2H13V6a1%2c1%2c0%2c0%2c0-2%2c0V7a3%2c3%2c0%2c0%2c0%2c0%2c6h2a1%2c1%2c0%2c0%2c1%2c0%2c2H9a1%2c1%2c0%2c0%2c0%2c0%2c2h2v1a1%2c1%2c0%2c0%2c0%2c2%2c0V17a3%2c3%2c0%2c0%2c0%2c0-6H11a1%2c1%2c0%2c0%2c1%2c0-2Zm1-8A11%2c11%2c0%2c1%2c0%2c23%2c12%2c11%2c11%2c0%2c0%2c0%2c12%2c1Zm0%2c20a9%2c9%2c0%2c1%2c1%2c9-9A9%2c9%2c0%2c0%2c1%2c12%2c21Z'/%3e%3c/svg%3e";
|
|
1174
|
+
/* ../general-animation-loading/src/GeneralAnimationLoading.svelte generated by Svelte v3.59.2 */
|
|
1175
|
+
function kn(e){let n;return{c(){n=m("div"),n.innerHTML='<section class="LoaderContainer" part="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>',this.c=t},m(t,i){c(t,n,i),
|
|
1176
|
+
/*div5_binding*/e[3](n)},p:t,i:t,o:t,d(t){t&&d(n)
|
|
1177
|
+
/*div5_binding*/,e[3](null)}}}function An(t,e,n){let i,{clientstyling:r=""}=e,{clientstylingurl:s=""}=e;return t.$$set=t=>{"clientstyling"in t&&n(1,r=t.clientstyling),"clientstylingurl"in t&&n(2,s=t.clientstylingurl)},t.$$.update=()=>{/*clientstyling, customStylingContainer*/3&t.$$.dirty&&r&&i&&(()=>{let t=document.createElement("style");t.innerHTML=r,i.appendChild(t)})(),/*clientstylingurl, customStylingContainer*/5&t.$$.dirty&&s&&i&&(()=>{let t=new URL(s),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{i.appendChild(e)}),1),setTimeout((()=>{}),500)}))})()},[i,r,s,function(t){M[t?"unshift":"push"]((()=>{i=t,n(0,i)}))}]}
|
|
1178
|
+
/* src/PlayerRglimits.svelte generated by Svelte v3.59.2 */
|
|
1179
|
+
function Pn(t,e,n){const i=t.slice();return i[46]=e[n],i}
|
|
1180
|
+
// (238:2) {:else}
|
|
1181
|
+
function Hn(t){let e,n,i,r,s,o,a,u,g;function _(t,e){/*isLoading*/
|
|
1182
|
+
return t[6]?xn:Nn}let v=_(t),b=v(t),w=/*multipleDepositLimits*/t[9]&&Vn(t);function T(t,e){/*isGaugeLoading*/
|
|
1183
|
+
return t[7]?zn:Wn}let E=T(t),S=E(t);return{c(){e=m("div"),n=m("h2"),i=m("img"),s=f(" Deposit limit"),o=p(),b.c(),a=p(),w&&w.c(),u=p(),g=m("div"),S.c(),y(i,"class","HeaderIcon"),y(i,"alt","user"),l(i.src,r=Dn)||y(i,"src",r),y(n,"class","LimitTypeHeader"),y(e,"class","ContentLeft"),y(g,"class","ContentRight")},m(t,r){c(t,e,r),h(e,n),h(n,i),h(n,s),h(e,o),b.m(e,null),h(e,a),w&&w.m(e,null),c(t,u,r),c(t,g,r),S.m(g,null)},p(t,n){v===(v=_(t))&&b?b.p(t,n):(b.d(1),b=v(t),b&&(b.c(),b.m(e,a))),/*multipleDepositLimits*/t[9]?w?w.p(t,n):(w=Vn(t),w.c(),w.m(e,null)):w&&(w.d(1),w=null),E===(E=T(t))&&S?S.p(t,n):(S.d(1),S=E(t),S&&(S.c(),S.m(g,null)))},d(t){t&&d(e),b.d(),w&&w.d(),t&&d(u),t&&d(g),S.d()}}}
|
|
1184
|
+
// (236:25)
|
|
1185
|
+
function On(t){let e,n;return{c(){e=m("strong"),n=f(/*errorMessage*/t[15]),y(e,"class","ErrorMessage")},m(t,i){c(t,e,i),h(e,n)},p(t,e){/*errorMessage*/32768&e[0]&&v(n,/*errorMessage*/t[15])},d(t){t&&d(e)}}}
|
|
1186
|
+
// (234:2) {#if noLimitToDisplay}
|
|
1187
|
+
function Cn(t){let e,n,i=/*$_*/t[16]("noLimitToDisplay")+"";return{c(){e=m("p"),n=f(i)},m(t,i){c(t,e,i),h(e,n)},p(t,e){/*$_*/65536&e[0]&&i!==(i=/*$_*/t[16]("noLimitToDisplay")+"")&&v(n,i)},d(t){t&&d(e)}}}
|
|
1188
|
+
// (243:6) {:else}
|
|
1189
|
+
function Nn(t){let e,n,i,r,s,o,a,u,g,_,b,w,T,E,S,L,M,D,k,A,P,H,O,C,N,x,R,B,Y,U,I,F,G,$,V,j,W,z,Z,X,K,q,J,Q,tt,et,nt,it,rt,st,ot=/*$_*/t[16]("spentAmount")+"",at=/*$_*/t[16]("remainingAmount")+"",lt=/*$_*/t[16]("limitPeriod")+"",ut=/*$_*/t[16]("displayedProduct")+"",ht=/*displayedLimit*/t[10].spentAmount+"",ct=/*displayedLimit*/t[10].limitCurrency+"",dt=/*displayedLimit*/t[10].remainingAmount+"",mt=/*displayedLimit*/t[10].limitCurrency+"",ft=/*displayedLimit*/t[10].limitPeriod+"",pt=/*displayedLimit*/t[10].limitProducts+"",gt=/*displayedLimit*/!0===t[10].isUpdated&&Rn(t),yt=/*displayedLimit*/!0===t[10].isUpdated&&Bn(t),_t=/*displayedLimit*/(!0===t[10].isRemoved||/*displayedLimit*/!0===t[10].isUpdated)&&Yn(t),vt=/*sessiontype*/"admin"===t[0]&&Fn(t);return{c(){e=m("div"),n=m("span"),i=f(ot),r=f(":"),s=p(),o=m("span"),a=f(at),u=f(":"),g=p(),gt&>.c(),_=p(),b=m("span"),w=f(lt),T=f(":"),E=p(),S=m("span"),L=f(ut),M=f(":"),D=p(),k=m("div"),A=m("p"),P=m("img"),O=p(),C=f(ht),N=p(),x=f(ct),R=p(),B=m("p"),Y=m("img"),I=p(),F=f(dt),G=p(),$=f(mt),V=p(),yt&&yt.c(),j=p(),W=m("p"),z=m("img"),X=p(),K=f(ft),q=p(),J=m("p"),Q=m("img"),et=p(),nt=f(pt),it=p(),_t&&_t.c(),rt=p(),vt&&vt.c(),st=f(""),y(e,"class","DetailsContainer Entries"),y(P,"class","TextIcon"),y(P,"alt","user"),l(P.src,H=Mn)||y(P,"src",H),y(Y,"class","TextIcon"),y(Y,"alt","user"),l(Y.src,U=Mn)||y(Y,"src",U),y(z,"class","TextIcon"),y(z,"alt","user"),l(z.src,Z=Mn)||y(z,"src",Z),y(Q,"class","TextIcon"),y(Q,"alt","user"),l(Q.src,tt=Mn)||y(Q,"src",tt),y(k,"class","TextContainer")},m(t,l){c(t,e,l),h(e,n),h(n,i),h(n,r),h(e,s),h(e,o),h(o,a),h(o,u),h(e,g),gt&>.m(e,null),h(e,_),h(e,b),h(b,w),h(b,T),h(e,E),h(e,S),h(S,L),h(S,M),c(t,D,l),c(t,k,l),h(k,A),h(A,P),h(A,O),h(A,C),h(A,N),h(A,x),h(k,R),h(k,B),h(B,Y),h(B,I),h(B,F),h(B,G),h(B,$),h(k,V),yt&&yt.m(k,null),h(k,j),h(k,W),h(W,z),h(W,X),h(W,K),h(k,q),h(k,J),h(J,Q),h(J,et),h(J,nt),c(t,it,l),_t&&_t.m(t,l),c(t,rt,l),vt&&vt.m(t,l),c(t,st,l)},p(t,n){/*$_*/65536&n[0]&&ot!==(ot=/*$_*/t[16]("spentAmount")+"")&&v(i,ot),/*$_*/65536&n[0]&&at!==(at=/*$_*/t[16]("remainingAmount")+"")&&v(a,at),/*displayedLimit*/!0===t[10].isUpdated?gt?gt.p(t,n):(gt=Rn(t),gt.c(),gt.m(e,_)):gt&&(gt.d(1),gt=null),/*$_*/65536&n[0]&<!==(lt=/*$_*/t[16]("limitPeriod")+"")&&v(w,lt),/*$_*/65536&n[0]&&ut!==(ut=/*$_*/t[16]("displayedProduct")+"")&&v(L,ut),/*displayedLimit*/1024&n[0]&&ht!==(ht=/*displayedLimit*/t[10].spentAmount+"")&&v(C,ht),/*displayedLimit*/1024&n[0]&&ct!==(ct=/*displayedLimit*/t[10].limitCurrency+"")&&v(x,ct),/*displayedLimit*/1024&n[0]&&dt!==(dt=/*displayedLimit*/t[10].remainingAmount+"")&&v(F,dt),/*displayedLimit*/1024&n[0]&&mt!==(mt=/*displayedLimit*/t[10].limitCurrency+"")&&v($,mt),/*displayedLimit*/!0===t[10].isUpdated?yt?yt.p(t,n):(yt=Bn(t),yt.c(),yt.m(k,j)):yt&&(yt.d(1),yt=null),/*displayedLimit*/1024&n[0]&&ft!==(ft=/*displayedLimit*/t[10].limitPeriod+"")&&v(K,ft),/*displayedLimit*/1024&n[0]&&pt!==(pt=/*displayedLimit*/t[10].limitProducts+"")&&v(nt,pt),/*displayedLimit*/!0===t[10].isRemoved||/*displayedLimit*/!0===t[10].isUpdated?_t?_t.p(t,n):(_t=Yn(t),_t.c(),_t.m(rt.parentNode,rt)):_t&&(_t.d(1),_t=null),/*sessiontype*/"admin"===t[0]?vt?vt.p(t,n):(vt=Fn(t),vt.c(),vt.m(st.parentNode,st)):vt&&(vt.d(1),vt=null)},d(t){t&&d(e),gt&>.d(),t&&d(D),t&&d(k),yt&&yt.d(),t&&d(it),_t&&_t.d(t),t&&d(rt),vt&&vt.d(t),t&&d(st)}}}
|
|
1190
|
+
// (241:6) {#if isLoading}
|
|
1191
|
+
function xn(t){let e;return{c(){e=m("general-animation-loading"),_(e,"clientstyling",/*clientstyling*/t[3]),_(e,"clientstylingurl",/*clientstylingurl*/t[4])},m(t,n){c(t,e,n)},p(t,n){/*clientstyling*/8&n[0]&&_(e,"clientstyling",/*clientstyling*/t[3]),/*clientstylingurl*/16&n[0]&&_(e,"clientstylingurl",/*clientstylingurl*/t[4])},d(t){t&&d(e)}}}
|
|
1192
|
+
// (247:10) {#if displayedLimit.isUpdated === true}
|
|
1193
|
+
function Rn(t){let e,n,i,r=/*$_*/t[16]("futureAmount")+"";return{c(){e=m("span"),n=f(r),i=f(":")},m(t,r){c(t,e,r),h(e,n),h(e,i)},p(t,e){/*$_*/65536&e[0]&&r!==(r=/*$_*/t[16]("futureAmount")+"")&&v(n,r)},d(t){t&&d(e)}}}
|
|
1194
|
+
// (256:10) {#if displayedLimit.isUpdated === true}
|
|
1195
|
+
function Bn(t){let e,n,i,r,s,o,a,u=/*displayedLimit*/t[10].updateAmount+"",g=/*displayedLimit*/t[10].limitCurrency+"";return{c(){e=m("p"),n=m("img"),r=p(),s=f(u),o=p(),a=f(g),y(n,"class","TextIcon"),y(n,"alt","user"),l(n.src,i=Mn)||y(n,"src",i)},m(t,i){c(t,e,i),h(e,n),h(e,r),h(e,s),h(e,o),h(e,a)},p(t,e){/*displayedLimit*/1024&e[0]&&u!==(u=/*displayedLimit*/t[10].updateAmount+"")&&v(s,u),/*displayedLimit*/1024&e[0]&&g!==(g=/*displayedLimit*/t[10].limitCurrency+"")&&v(a,g)},d(t){t&&d(e)}}}
|
|
1196
|
+
// (262:8) {#if displayedLimit.isRemoved === true || displayedLimit.isUpdated === true }
|
|
1197
|
+
function Yn(t){let e,n,i=/*displayedLimit*/!0===t[10].isRemoved&&Un(t),r=/*displayedLimit*/!0===t[10].isUpdated&&In(t);return{c(){e=m("div"),i&&i.c(),n=p(),r&&r.c(),y(e,"class","ExtraInfoContainer")},m(t,s){c(t,e,s),i&&i.m(e,null),h(e,n),r&&r.m(e,null)},p(t,s){/*displayedLimit*/!0===t[10].isRemoved?i?i.p(t,s):(i=Un(t),i.c(),i.m(e,n)):i&&(i.d(1),i=null),/*displayedLimit*/!0===t[10].isUpdated?r?r.p(t,s):(r=In(t),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},d(t){t&&d(e),i&&i.d(),r&&r.d()}}}
|
|
1198
|
+
// (264:12) {#if displayedLimit.isRemoved === true}
|
|
1199
|
+
function Un(t){let e,n,i,r,s=/*$_*/t[16]("limitRemoved")+"",o=/*displayedLimit*/t[10].expiresString+"";return{c(){e=m("span"),n=f(s),i=f(": "),r=f(o)},m(t,s){c(t,e,s),h(e,n),h(e,i),h(e,r)},p(t,e){/*$_*/65536&e[0]&&s!==(s=/*$_*/t[16]("limitRemoved")+"")&&v(n,s),/*displayedLimit*/1024&e[0]&&o!==(o=/*displayedLimit*/t[10].expiresString+"")&&v(r,o)},d(t){t&&d(e)}}}
|
|
1200
|
+
// (267:12) {#if displayedLimit.isUpdated === true}
|
|
1201
|
+
function In(t){let e,n,i,r,s=/*$_*/t[16]("limitUpdated")+"",o=/*displayedLimit*/t[10].expiresString+"";return{c(){e=m("span"),n=f(s),i=f(": "),r=f(o)},m(t,s){c(t,e,s),h(e,n),h(e,i),h(e,r)},p(t,e){/*$_*/65536&e[0]&&s!==(s=/*$_*/t[16]("limitUpdated")+"")&&v(n,s),/*displayedLimit*/1024&e[0]&&o!==(o=/*displayedLimit*/t[10].expiresString+"")&&v(r,o)},d(t){t&&d(e)}}}
|
|
1202
|
+
// (272:8) {#if sessiontype === 'admin'}
|
|
1203
|
+
function Fn(t){let e;function n(t,e){/*transdetailsurl*/
|
|
1204
|
+
return t[1]?$n:/*transactionspageurl*/t[2]?Gn:void 0}let i=n(t),r=i&&i(t);return{c(){e=m("div"),r&&r.c(),y(e,"class","UsefulLinksSection")},m(t,n){c(t,e,n),r&&r.m(e,null)},p(t,s){i===(i=n(t))&&r?r.p(t,s):(r&&r.d(1),r=i&&i(t),r&&(r.c(),r.m(e,null)))},d(t){t&&d(e),r&&r.d()}}}
|
|
1205
|
+
// (276:42)
|
|
1206
|
+
function Gn(t){let e,n,i=/*$_*/t[16]("additionalLink2")+"";return{c(){e=m("a"),n=f(i),y(e,"href",/*transactionspageurl*/t[2]),y(e,"target","_blank")},m(t,i){c(t,e,i),h(e,n)},p(t,r){/*$_*/65536&r[0]&&i!==(i=/*$_*/t[16]("additionalLink2")+"")&&v(n,i),/*transactionspageurl*/4&r[0]&&y(e,"href",/*transactionspageurl*/t[2])},d(t){t&&d(e)}}}
|
|
1207
|
+
// (274:12) {#if transdetailsurl}
|
|
1208
|
+
function $n(t){let e,n,i=/*$_*/t[16]("additionalLink1")+"";return{c(){e=m("a"),n=f(i),y(e,"href",/*transdetailsurl*/t[1]),y(e,"target","_blank")},m(t,i){c(t,e,i),h(e,n)},p(t,r){/*$_*/65536&r[0]&&i!==(i=/*$_*/t[16]("additionalLink1")+"")&&v(n,i),/*transdetailsurl*/2&r[0]&&y(e,"href",/*transdetailsurl*/t[1])},d(t){t&&d(e)}}}
|
|
1209
|
+
// (282:6) {#if multipleDepositLimits}
|
|
1210
|
+
function Vn(t){let e,n,r,s,o,a,l,u,_=/*$_*/t[16]("changeLimitLabel")+"",b=/*limitPeriodList*/t[11],T=[];for(let e=0;e<b.length;e+=1)T[e]=jn(Pn(t,b,e));return{c(){e=m("div"),n=m("label"),r=f(_),s=f(":"),o=p(),a=m("select");for(let t=0;t<T.length;t+=1)T[t].c();y(n,"for","LimitPeriod"),y(a,"id","LimitPeriod"),/*selectedLimitPeriod*/void 0===t[12]&&H((()=>/*select_change_handler*/t[26].call(a))),y(e,"class","MultipleSelectContainer")},m(i,d){c(i,e,d),h(e,n),h(n,r),h(n,s),h(e,o),h(e,a);for(let t=0;t<T.length;t+=1)T[t]&&T[t].m(a,null);w(a,/*selectedLimitPeriod*/t[12],!0),l||(u=[g(a,"change",/*select_change_handler*/t[26]),g(a,"change",/*handlePeriodChange*/t[17])],l=!0)},p(t,e){if(/*$_*/65536&e[0]&&_!==(_=/*$_*/t[16]("changeLimitLabel")+"")&&v(r,_),/*limitPeriodList*/2048&e[0]){let n;for(b=/*limitPeriodList*/t[11],n=0;n<b.length;n+=1){const i=Pn(t,b,n);T[n]?T[n].p(i,e):(T[n]=jn(i),T[n].c(),T[n].m(a,null))}for(;n<T.length;n+=1)T[n].d(1);T.length=b.length}/*selectedLimitPeriod, limitPeriodList*/6144&e[0]&&w(a,/*selectedLimitPeriod*/t[12])},d(t){t&&d(e),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(T,t),l=!1,i(u)}}}
|
|
1211
|
+
// (286:12) {#each limitPeriodList as value}
|
|
1212
|
+
function jn(t){let e,n,i,r,s=/*value*/t[46]+"";return{c(){e=m("option"),n=f(s),i=p(),e.__value=r=/*value*/t[46],e.value=e.__value},m(t,r){c(t,e,r),h(e,n),h(e,i)},p(t,i){/*limitPeriodList*/2048&i[0]&&s!==(s=/*value*/t[46]+"")&&v(n,s),/*limitPeriodList*/2048&i[0]&&r!==(r=/*value*/t[46])&&(e.__value=r,e.value=e.__value)},d(t){t&&d(e)}}}
|
|
1213
|
+
// (298:6) {:else}
|
|
1214
|
+
function Wn(t){let e,n,i,r,s,o,a,l,u,g,_,w,T,E,S,L,M,D,k,A,P,H,O,C,N,x,R,B,Y,U,I,F,G,$=/*displayedLimit*/t[10].totalAmount+"",V=/*displayedLimit*/t[10].limitCurrency+"",j=/*displayedLimit*/t[10].spentAmount+"",W=/*displayedLimit*/t[10].limitCurrency+"",z=/*displayedLimit*/t[10].limitCurrency+"",Z=/*displayedLimit*/t[10].totalAmount+"",X=/*displayedLimit*/t[10].limitCurrency+"";return{c(){e=m("div"),n=f($),i=p(),r=f(V),s=p(),o=m("div"),a=m("div"),l=m("div"),u=p(),g=m("div"),_=f(j),w=p(),T=f(W),E=p(),S=m("div"),L=p(),M=m("div"),D=p(),k=m("div"),A=p(),P=m("div"),H=m("div"),O=m("strong"),O.textContent="0",C=p(),N=m("span"),x=f(z),R=p(),B=m("div"),Y=m("strong"),U=f(Z),I=p(),F=m("span"),G=f(X),y(e,"class","AmountContainer"),y(l,"class","GaugeFill"),b(l,"--transform-value","rotate("+/*gaugeValue*/t[13]+"turn)"),y(g,"class","GaugeCover"),y(S,"class","GaugeCoverMin"),y(M,"class","GaugeNeedleCover"),y(k,"class","GaugeNeedle"),b(k,"--transform-needle-value","rotate("+/*gaugeNeedleValue*/t[14]+"turn)"),y(a,"class","GaugeBody"),y(o,"class","Gauge"),y(O,"class","MinContent"),y(N,"class","MinContentCurrency"),y(H,"class","Min"),y(Y,"class","MaxContent"),y(F,"class","MaxContentCurrency"),y(B,"class","Max"),y(P,"class","MinMaxContainer")},m(t,d){c(t,e,d),h(e,n),h(e,i),h(e,r),c(t,s,d),c(t,o,d),h(o,a),h(a,l),h(a,u),h(a,g),h(g,_),h(g,w),h(g,T),h(a,E),h(a,S),h(a,L),h(a,M),h(a,D),h(a,k),c(t,A,d),c(t,P,d),h(P,H),h(H,O),h(H,C),h(H,N),h(N,x),h(P,R),h(P,B),h(B,Y),h(Y,U),h(B,I),h(B,F),h(F,G)},p(t,e){/*displayedLimit*/1024&e[0]&&$!==($=/*displayedLimit*/t[10].totalAmount+"")&&v(n,$),/*displayedLimit*/1024&e[0]&&V!==(V=/*displayedLimit*/t[10].limitCurrency+"")&&v(r,V),/*gaugeValue*/8192&e[0]&&b(l,"--transform-value","rotate("+/*gaugeValue*/t[13]+"turn)"),/*displayedLimit*/1024&e[0]&&j!==(j=/*displayedLimit*/t[10].spentAmount+"")&&v(_,j),/*displayedLimit*/1024&e[0]&&W!==(W=/*displayedLimit*/t[10].limitCurrency+"")&&v(T,W),/*gaugeNeedleValue*/16384&e[0]&&b(k,"--transform-needle-value","rotate("+/*gaugeNeedleValue*/t[14]+"turn)"),/*displayedLimit*/1024&e[0]&&z!==(z=/*displayedLimit*/t[10].limitCurrency+"")&&v(x,z),/*displayedLimit*/1024&e[0]&&Z!==(Z=/*displayedLimit*/t[10].totalAmount+"")&&v(U,Z),/*displayedLimit*/1024&e[0]&&X!==(X=/*displayedLimit*/t[10].limitCurrency+"")&&v(G,X)},d(t){t&&d(e),t&&d(s),t&&d(o),t&&d(A),t&&d(P)}}}
|
|
1215
|
+
// (296:6) {#if isGaugeLoading}
|
|
1216
|
+
function zn(t){let e;return{c(){e=m("general-animation-loading"),_(e,"clientstyling",/*clientstyling*/t[3]),_(e,"clientstylingurl",/*clientstylingurl*/t[4])},m(t,n){c(t,e,n)},p(t,n){/*clientstyling*/8&n[0]&&_(e,"clientstyling",/*clientstyling*/t[3]),/*clientstylingurl*/16&n[0]&&_(e,"clientstylingurl",/*clientstylingurl*/t[4])},d(t){t&&d(e)}}}function Zn(e){let n;function i(t,e){/*noLimitToDisplay*/
|
|
1217
|
+
return t[8]?Cn:/*errorMessage*/t[15]?On:Hn}let r=i(e),s=r(e);return{c(){n=m("div"),s.c(),this.c=t,y(n,"class","LimitsContainer")},m(t,i){c(t,n,i),s.m(n,null),
|
|
1218
|
+
/*div_binding*/e[27](n)},p(t,e){r===(r=i(t))&&s?s.p(t,e):(s.d(1),s=r(t),s&&(s.c(),s.m(n,null)))},i:t,o:t,d(t){t&&d(n),s.d(),
|
|
1219
|
+
/*div_binding*/e[27](null)}}}function Xn(t,e,n){let i;var r,s;r=En,s=t=>n(16,i=t),t.$$.on_destroy.push(u(r,s));let o,a,{session:l=""}=e,{sessiontype:h=""}=e,{userid:c=""}=e,{endpoint:d=""}=e,{transdetailsurl:m=""}=e,{transactionspageurl:f=""}=e,{clientstyling:p=""}=e,{clientstylingurl:g=""}=e,{lang:y="en"}=e,{translationurl:_=""}=e,{datetimeformat:v=""}=e,b=!1,w=!1,T="",E="",L=!0,D=!0,k=!1,A={spentAmount:"",limitCurrency:"EUR",remainingAmount:"",limitType:"",limitProducts:[]},P=[],H="",O=[],C=0,N=.75,x=0,R="";Object.keys(Ln).forEach((t=>{Sn(t,Ln[t])}));const B=t=>{n(15,R=t)},Y=t=>{n(6,L=!0);const e=new URLSearchParams({limitDefinitionId:t.id}),i=new URL(`${d}/v1/player/${E}/limits/monetary/balance?${e}`);fetch(i,{method:"GET",headers:{"X-SessionId":T,"X-Session-Type":h}}).then((t=>t.json())).then((e=>{if(e&&e.error)throw new Error(e.error);F(e.limitBalances[0],t)})).catch((t=>{B(t)})).finally((()=>{n(6,L=!1)}))},U=()=>{new Promise(((t,e)=>{const n=new URL(`${d}/v1/player/${E}/limits/monetary/`);fetch(n,{method:"GET",headers:{"X-SessionId":T,"X-Session-Type":h}}).then((t=>t.json())).then((n=>n&&n.error?e(n.error):t(n.limits.length>0?n.limits.filter((t=>"Deposit"===t.type)):[]))).catch((t=>e(t)))})).then((t=>{if(O=t,0===O.length)return n(6,L=!1),void n(8,a=!0);if(O.length>1){const t={Daily:0,Weekly:1,Monthly:2};O.forEach((t=>{-1===P.indexOf(`${t.period} - ${t.products[0]}`)&&P.push(`${t.period} - ${t.products[0]}`)})),n(9,k=!0),n(11,P=P.sort(((e,n)=>t[e.split(" ")[0]]-t[n.split(" ")[0]])))}Y(O[0])}),(t=>{n(6,L=!1),B(t)}))},I=t=>G(t).utc(!0).format(v||"DD/MM/YYYY HH:mm:ss"),F=(t,e)=>{n(12,H=`${t.limitPeriod} - ${t.limitProducts[0]}`);const i=((t,e)=>{const n=e.find((e=>e.playerLimitId===t));return n?{updateAmount:n.updateAmount,expires:n.applyAt,expiresString:I(n.applyAt),id:n.id,isRemoved:n.updateAmount<1,isUpdated:n.updateAmount>0}:{updateAmount:"",expires:"",expiresString:"",id:"",isRemoved:!1,isUpdated:!1}})(e.id,e.schedules);n(10,A=Object.assign({totalAmount:t.limitAmount,spentAmount:parseFloat(t.spentBalance.amount).toFixed(2),limitCurrency:t.limitCurrency,remainingAmount:parseFloat(t.limitAmount-t.spentBalance.amount).toFixed(2),limitPeriod:t.limitPeriod,limitProducts:t.limitProducts[0],product:t.limitWalletTypes},i)),$(A)},$=t=>{x=0,x=100*t.spentAmount/t.totalAmount,x=parseFloat(x).toFixed(2);let e=.5*t.spentAmount/t.totalAmount;n(13,C=Number(parseFloat(e).toFixed(3))),n(13,C=C>.5?.5:C),n(14,N=.75),n(14,N=Number(parseFloat(e+N).toFixed(3))),n(14,N=N>1.25?1.25:N),n(7,D=!1)};S((()=>{setTimeout((()=>{n(24,b=!0)}),50)}));const V=()=>{var t;t=y,nn.set(t)};return t.$$set=t=>{"session"in t&&n(18,l=t.session),"sessiontype"in t&&n(0,h=t.sessiontype),"userid"in t&&n(19,c=t.userid),"endpoint"in t&&n(20,d=t.endpoint),"transdetailsurl"in t&&n(1,m=t.transdetailsurl),"transactionspageurl"in t&&n(2,f=t.transactionspageurl),"clientstyling"in t&&n(3,p=t.clientstyling),"clientstylingurl"in t&&n(4,g=t.clientstylingurl),"lang"in t&&n(21,y=t.lang),"translationurl"in t&&n(22,_=t.translationurl),"datetimeformat"in t&&n(23,v=t.datetimeformat)},t.$$.update=()=>{/*isMounted, session, userid*/17563648&t.$$.dirty[0]&&b&&l&&c&&(n(25,w=!0),T=l,E=c),/*isMounted, isLoggedIn*/50331648&t.$$.dirty[0]&&b&&w&&U(),/*clientstyling, customStylingContainer*/40&t.$$.dirty[0]&&p&&o&&(()=>{let t=document.createElement("style");t.innerHTML=p,o.appendChild(t)})(),/*clientstylingurl, customStylingContainer*/48&t.$$.dirty[0]&&g&&o&&(()=>{let t=new URL(g),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{o.appendChild(e)}),1),setTimeout((()=>{}),500)}))})(),/*lang*/2097152&t.$$.dirty[0]&&y&&V(),/*translationurl*/4194304&t.$$.dirty[0]&&_&&(()=>{let t=new URL(_);fetch(t.href).then((t=>t.json())).then((t=>{Object.keys(t).forEach((e=>{Sn(e,t[e])}))})).catch((t=>{console.log(t)}))})()},[h,m,f,p,g,o,L,D,a,k,A,P,H,C,N,R,i,()=>{let t=O.find((t=>`${t.period} - ${t.products[0]}`===H));Y(t)},l,c,d,y,_,v,b,w,function(){H=function(t){const e=t.querySelector(":checked");return e&&e.__value}(this),n(12,H),n(11,P)},function(t){M[t?"unshift":"push"]((()=>{o=t,n(5,o)}))}]}!customElements.get("general-animation-loading")&&customElements.define("general-animation-loading",class extends I{constructor(t){super();const e=document.createElement("style");e.textContent=".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}",this.shadowRoot.appendChild(e),U(this,{target:this.shadowRoot,props:T(this.attributes),customElement:!0},An,kn,s,{clientstyling:1,clientstylingurl:2},null),t&&(t.target&&c(t.target,this,t.anchor),t.props&&(this.$set(t.props),N()))}static get observedAttributes(){return["clientstyling","clientstylingurl"]}get clientstyling(){return this.$$.ctx[1]}set clientstyling(t){this.$$set({clientstyling:t}),N()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),N()}});class Kn extends I{constructor(t){super();const e=document.createElement("style");e.textContent='*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.ErrorMessage{margin:0 15px;font-size:12px;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.LimitsContainer{display:flex;width:100%;max-width:620px;min-height:150px;border:1px solid var(--emw--color-contrast, #07072A);border-radius:20px;overflow:hidden;box-shadow:0.6em 0.6em 0.4em var(--emw--color-gray-150, #a9b6ce)}@container (max-width: 720px){.LimitsContainer{max-width:355px}}.ContentLeft{padding:1rem;width:318px;line-height:20px}.LimitTypeHeader{color:var(--emw--color-gray-150, #a9b6ce);margin-bottom:20px;max-width:225px}.HeaderIcon{height:20px;width:20px;color:var(--emw--color-gray-150, #a9b6ce)}.DetailsContainer{margin-bottom:15px;display:inline}.DetailsContainer span{float:left;clear:both}.ContentRight{min-width:300px;padding:1rem;display:flex;justify-content:center;flex-direction:column}.AmountContainer{padding:0.3rem;font-size:xx-large;text-align:center;border:1px solid var(--emw--color-contrast, #07072A);border-radius:20px;box-shadow:0.16em 0.16em 0.1em var(--emw--color-gray-150, #a9b6ce);background-color:#F5F5F5}.TextContainer{display:inline-block;padding-left:5px}.TextContainer p{width:100%;display:block;clear:both;font-weight:bold}.ExtraInfoContainer{padding:1rem 0;color:var(--emfe-w-color-red, #ed0909)}.UsefulLinksSection{padding-top:5px}.UsefulLinksSection a{float:left;clear:both;color:var(--emw--color-contrast, #07072A)}.MultipleSelectContainer{float:left;padding-top:1rem;clear:both}.MultipleSelectContainer label{float:left;padding-right:5px}.MultipleSelectContainer select{float:right;background:var(--emw--color-gray-150, #a9b6ce);border-radius:5px;margin:2px}.TextIcon{color:var(--emw--color-primary, #D0046C)}.Gauge{width:100%;font-family:"Roboto", sans-serif;font-size:32px;color:black;margin-top:1rem}.GaugeBody{width:100%;height:0;padding-bottom:50%;background:var(--emw--color-gray-100, #E6E6E6);position:relative;border-top-left-radius:100% 200%;border-top-right-radius:100% 200%;overflow:hidden}.GaugeFill{position:absolute;top:100%;left:0;width:inherit;height:100%;background:var(--emw--color-primary, #D0046C);transform-origin:center top;transform:var(--transform-value);transition:transform 0.2s ease-out}.GaugeCover{width:75%;height:150%;background:var(--emw--color-white, #FFFFFF);position:absolute;border-radius:50%;top:25%;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;padding-bottom:47%;box-sizing:border-box;font-size:20px}.GaugeCoverMin{width:50px;height:50px;background:var(--emw--color-primary, #D0046C);position:relative;top:6.7rem;left:50%;border-radius:50%;transform:translateX(-50%)}.GaugeNeedleCover{width:8%;height:16%;background:var(--emw--color-black, #000000);position:absolute;top:90%;left:50%;border:4px solid var(--emw--color-white, #FFFFFF);border-radius:50%;transform:translateX(-50%);transition:transform 0.2s ease-out}.GaugeNeedle{width:0.2rem;height:3.5rem;background:linear-gradient(0deg, #000000 0, #000000 55%, #c5c5c5 55%, #c5c5c5 90%, #000000 90%, #000000 100%);display:inline-block;left:49.5%;position:absolute;bottom:1%;transform:var(--transform-needle-value);transform-origin:bottom;transition:transform 0.2s ease-out}.Min{width:50%;float:left}.Max{width:49%;float:right;text-align:right}',this.shadowRoot.appendChild(e),U(this,{target:this.shadowRoot,props:T(this.attributes),customElement:!0},Xn,Zn,s,{session:18,sessiontype:0,userid:19,endpoint:20,transdetailsurl:1,transactionspageurl:2,clientstyling:3,clientstylingurl:4,lang:21,translationurl:22,datetimeformat:23},null,[-1,-1]),t&&(t.target&&c(t.target,this,t.anchor),t.props&&(this.$set(t.props),N()))}static get observedAttributes(){return["session","sessiontype","userid","endpoint","transdetailsurl","transactionspageurl","clientstyling","clientstylingurl","lang","translationurl","datetimeformat"]}get session(){return this.$$.ctx[18]}set session(t){this.$$set({session:t}),N()}get sessiontype(){return this.$$.ctx[0]}set sessiontype(t){this.$$set({sessiontype:t}),N()}get userid(){return this.$$.ctx[19]}set userid(t){this.$$set({userid:t}),N()}get endpoint(){return this.$$.ctx[20]}set endpoint(t){this.$$set({endpoint:t}),N()}get transdetailsurl(){return this.$$.ctx[1]}set transdetailsurl(t){this.$$set({transdetailsurl:t}),N()}get transactionspageurl(){return this.$$.ctx[2]}set transactionspageurl(t){this.$$set({transactionspageurl:t}),N()}get clientstyling(){return this.$$.ctx[3]}set clientstyling(t){this.$$set({clientstyling:t}),N()}get clientstylingurl(){return this.$$.ctx[4]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),N()}get lang(){return this.$$.ctx[21]}set lang(t){this.$$set({lang:t}),N()}get translationurl(){return this.$$.ctx[22]}set translationurl(t){this.$$set({translationurl:t}),N()}get datetimeformat(){return this.$$.ctx[23]}set datetimeformat(t){this.$$set({datetimeformat:t}),N()}}return!customElements.get("player-rglimits")&&customElements.define("player-rglimits",Kn),Kn}));
|
|
1220
|
+
//# sourceMappingURL=player-rglimits.js.map
|