test-jsonata
Version:
JSON query and transformation language
1 lines • 103 kB
JavaScript
var runtime=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,i=Object.create(a.prototype),o=new O(n||[]);return i._invoke=function(e,t,r){var n=f;return function(a,i){if(n===d)throw new Error("Generator is already running");if(n===h){if("throw"===a)throw i;return P()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var s=S(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=p(e,t,r);if("normal"===u.type){if(n=r.done?h:l,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(e,r,o),i}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",l="suspendedYield",d="executing",h="completed",g={};function v(){}function b(){}function m(){}var y={};y[i]=function(){return this};var k=Object.getPrototypeOf,x=k&&k(k(R([])));x&&x!==r&&n.call(x,i)&&(y=x);var w=m.prototype=v.prototype=Object.create(y);function E(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function A(e,t){var r;this._invoke=function(a,i){function o(){return new t(function(r,o){!function r(a,i,o,s){var u=p(e[a],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(e){r("next",e,o,s)},function(e){r("throw",e,o,s)}):t.resolve(f).then(function(e){c.value=e,o(c)},function(e){return r("throw",e,o,s)})}s(u.arg)}(a,i,r,o)})}return r=r?r.then(o,o):o()}}function S(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method))return g;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var a=p(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}return{next:P}}function P(){return{value:t,done:!0}}return b.prototype=w.constructor=m,m.constructor=b,b.displayName=u(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},E(A.prototype),A.prototype[o]=function(){return this},e.AsyncIterator=A,e.async=function(t,r,n,a,i){void 0===i&&(i=Promise);var o=new A(c(t,r,n,a),i);return e.isGeneratorFunction(r)?o:o.next().then(function(e){return e.done?e.value:o.next()})},E(w),u(w,s,"Generator"),w[i]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;D(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(e){Function("r","regeneratorRuntime = r")(runtime)}Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},String.fromCodePoint||function(e){var t=function(t){for(var r=[],n=0,a="",i=0,o=arguments.length;i!==o;++i){var s=+arguments[i];if(!(s<1114111&&s>>>0===s))throw RangeError("Invalid code point: "+s);s<=65535?n=r.push(s):(s-=65536,n=r.push(55296+(s>>10),s%1024+56320)),n>=16383&&(a+=e.apply(null,r),r.length=0)}return a+e.apply(null,r)};try{Object.defineProperty(String,"fromCodePoint",{value:t,configurable:!0,writable:!0})}catch(e){String.fromCodePoint=t}}(String.fromCharCode),Object.is||(Object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}),String.prototype.codePointAt||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(n!=n&&(n=0),!(n<0||n>=r)){var a,i=t.charCodeAt(n);return i>=55296&&i<=56319&&r>n+1&&(a=t.charCodeAt(n+1))>=56320&&a<=57343?1024*(i-55296)+a-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t}(),Math.log10=Math.log10||function(e){return Math.log(e)*Math.LOG10E},function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsonata=e()}}(function(){return function(){return function e(t,r,n){function a(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(i)return i(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[o]={exports:{}};t[o][0].call(p.exports,function(e){return a(t[o][1][e]||e)},p,p.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}}()({1:[function(e,t,r){"use strict";var n=e("./utils"),a=function(){var e=n.stringToArray,t=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],a=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],i=["Thousand","Million","Billion","Trillion"];var o={};t.forEach(function(e,t){o[e.toLowerCase()]=t}),r.forEach(function(e,t){o[e.toLowerCase()]=t}),a.forEach(function(e,t){var r=e.toLowerCase();o[r]=10*(t+2),o[r.substring(0,e.length-1)+"ieth"]=o[r]}),o.hundredth=100,i.forEach(function(e,t){var r=e.toLowerCase(),n=Math.pow(10,3*(t+1));o[r]=n,o[r+"th"]=n});var s=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],u={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function c(e,t){if(void 0!==e)return l(e=Math.floor(e),h(t))}var p={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},f={UPPER:"upper",LOWER:"lower",TITLE:"title"};function l(n,o){var u,c=n<0;switch(n=Math.abs(n),o.primary){case p.LETTERS:u=function(e,t){for(var r=[],n=t.charCodeAt(0);e>0;)r.unshift(String.fromCharCode((e-1)%26+n)),e=Math.floor((e-1)/26);return r.join("")}(n,o.case===f.UPPER?"A":"a");break;case p.ROMAN:u=function e(t){for(var r=0;r<s.length;r++){var n=s[r];if(t>=n[0])return n[1]+e(t-n[0])}return""}(n),o.case===f.UPPER&&(u=u.toUpperCase());break;case p.WORDS:u=function(e,n){return function e(n,o,s){var u="";if(n<=19)u=(o?" and ":"")+(s?r[n]:t[n]);else if(n<100){var c=Math.floor(n/10),p=n%10;u=(o?" and ":"")+a[c-2],p>0?u+="-"+e(p,!1,s):s&&(u=u.substring(0,u.length-1)+"ieth")}else if(n<1e3){var f=Math.floor(n/100),l=n%100;u=(o?", ":"")+t[f]+" Hundred",l>0?u+=e(l,!0,s):s&&(u+="th")}else{var d=Math.floor(Math.log10(n)/3);d>i.length&&(d=i.length);var h=Math.pow(10,3*d),g=Math.floor(n/h),v=n-g*h;u=(o?", ":"")+e(g,!1,!1)+" "+i[d-1],v>0?u+=e(v,!0,s):s&&(u+="th")}return u}(e,!1,n)}(n,o.ordinal),o.case===f.UPPER?u=u.toUpperCase():o.case===f.LOWER&&(u=u.toLowerCase());break;case p.DECIMAL:u=""+n;var l=o.mandatoryDigits-u.length;if(l>0){var d=new Array(l+1).join("0");u=d+u}if(48!==o.zeroCode&&(u=e(u).map(function(e){return String.fromCodePoint(e.codePointAt(0)+o.zeroCode-48)}).join("")),o.regular)for(var h=Math.floor((u.length-1)/o.groupingSeparators.position);h>0;h--){var g=u.length-h*o.groupingSeparators.position;u=u.substr(0,g)+o.groupingSeparators.character+u.substr(g)}else o.groupingSeparators.reverse().forEach(function(e){var t=u.length-e.position;u=u.substr(0,t)+e.character+u.substr(t)});if(o.ordinal){var v={1:"st",2:"nd",3:"rd"}[u[u.length-1]];(!v||u.length>1&&"1"===u[u.length-2])&&(v="th"),u+=v}break;case p.SEQUENCE:throw{code:"D3130",value:o.token}}return c&&(u="-"+u),u}var d=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function h(t){var r,n={type:"integer",primary:p.DECIMAL,case:f.LOWER,ordinal:!1},a=t.lastIndexOf(";");switch(-1===a?r=t:(r=t.substring(0,a),"o"===t.substring(a+1)[0]&&(n.ordinal=!0)),r){case"A":n.case=f.UPPER;case"a":n.primary=p.LETTERS;break;case"I":n.case=f.UPPER;case"i":n.primary=p.ROMAN;break;case"W":n.case=f.UPPER,n.primary=p.WORDS;break;case"Ww":n.case=f.TITLE,n.primary=p.WORDS;break;case"w":n.primary=p.WORDS;break;default:var i=null,o=0,s=0,u=[],c=0;if(e(r).map(function(e){return e.codePointAt(0)}).reverse().forEach(function(e){for(var t=!1,r=0;r<d.length;r++){var n=d[r];if(e>=n&&e<=n+9){if(t=!0,o++,c++,null===i)i=n;else if(n!==i)throw{code:"D3131"};break}}t||(35===e?(c++,s++):u.push({position:c,character:String.fromCodePoint(e)}))}),o>0){n.primary=p.DECIMAL,n.zeroCode=i,n.mandatoryDigits=o,n.optionalDigits=s;var l=function(e){if(0===e.length)return 0;for(var t=e[0].character,r=1;r<e.length;r++)if(e[r].character!==t)return 0;for(var n=e.map(function(e){return e.position}),a=n.reduce(function e(t,r){return 0===r?t:e(r,t%r)}),i=1;i<=n.length;i++)if(-1===n.indexOf(i*a))return 0;return a}(u);l>0?(n.regular=!0,n.groupingSeparators={position:l,character:u[0].character}):(n.regular=!1,n.groupingSeparators=u)}else n.primary=p.SEQUENCE,n.token=r}return n}var g={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function v(e){for(var t=[],r={type:"datetime",parts:t},n=function(r,n){if(n>r){var a=e.substring(r,n);a=a.split("]]").join("]"),t.push({type:"literal",value:a})}},a=0,i=0;i<e.length;){if("["===e.charAt(i)){if("["===e.charAt(i+1)){n(a,i),t.push({type:"literal",value:"["}),a=i+=2;continue}if(n(a,i),a=i,-1===(i=e.indexOf("]",a)))throw{code:"D3135"};var o,s=e.substring(a+1,i),u={type:"marker",component:(s=s.split(/\s+/).join("")).charAt(0)},c=s.lastIndexOf(",");if(-1!==c){var p=s.substring(c+1),l=p.indexOf("-"),d=void 0,v=void 0,b=function(e){return void 0===e||"*"===e?void 0:parseInt(e)};-1===l?d=p:(d=p.substring(0,l),v=p.substring(l+1));var m={min:b(d),max:b(v)};u.width=m,o=s.substring(1,c)}else o=s.substring(1);if(1===o.length)u.presentation1=o;else if(o.length>1){var y=o.charAt(o.length-1);-1!=="atco".indexOf(y)?(u.presentation2=y,"o"===y&&(u.ordinal=!0),u.presentation1=o.substring(0,o.length-1)):u.presentation1=o}else u.presentation1=g[u.component];if(void 0===u.presentation1)throw{code:"D3132",value:u.component};if("n"===u.presentation1[0])u.names=f.LOWER;else if("N"===u.presentation1[0])"n"===u.presentation1[1]?u.names=f.TITLE:u.names=f.UPPER;else if(-1!=="YMDdFWwXxHhmsf".indexOf(u.component)){var k=u.presentation1;if(u.presentation2&&(k+=";"+u.presentation2),u.integerFormat=h(k),u.width&&void 0!==u.width.min&&u.integerFormat.mandatoryDigits<u.width.min&&(u.integerFormat.mandatoryDigits=u.width.min),"Y"===u.component)if(u.n=-1,u.width&&void 0!==u.width.max)u.n=u.width.max,u.integerFormat.mandatoryDigits=u.n;else{var x=u.integerFormat.mandatoryDigits+u.integerFormat.optionalDigits;x>=2&&(u.n=x)}}"Z"!==u.component&&"z"!==u.component||(u.integerFormat=h(u.presentation1)),t.push(u),a=i+1}i++}return n(a,i),r}var b=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],y=function(e){var t=Date.UTC(e.year,e.month),r=new Date(t).getUTCDay();return 0===r&&(r=7),r>4?t+864e5*(8-r):t-864e5*(r-1)},k=function e(t,r){return{year:t,month:r,nextMonth:function(){return 11===r?e(t+1,0):e(t,r+1)},previousMonth:function(){return 0===r?e(t-1,11):e(t,r-1)},nextYear:function(){return e(t+1,r)},previousYear:function(){return e(t-1,r)}}},x=function(e,t){return(t-e)/6048e5+1},w=function(e,t){var r;switch(t){case"Y":r=e.getUTCFullYear();break;case"M":r=e.getUTCMonth()+1;break;case"D":r=e.getUTCDate();break;case"d":r=(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0))/864e5+1;break;case"F":0===(r=e.getUTCDay())&&(r=7);break;case"W":var n=k(e.getUTCFullYear(),0),a=y(n),i=Date.UTC(n.year,e.getUTCMonth(),e.getUTCDate()),o=x(a,i);if(o>52)i>=y(n.nextYear())&&(o=1);else if(o<1){var s=y(n.previousYear());o=x(s,i)}r=Math.floor(o);break;case"w":var u=k(e.getUTCFullYear(),e.getUTCMonth()),c=y(u),p=Date.UTC(u.year,u.month,e.getUTCDate()),f=x(c,p);if(f>4)p>=y(u.nextMonth())&&(f=1);else if(f<1){var l=y(u.previousMonth());f=x(l,p)}r=Math.floor(f);break;case"X":var d=k(e.getUTCFullYear(),0),h=y(d),g=y(d.nextYear()),v=e.getTime();r=v<h?d.year-1:v>=g?d.year+1:d.year;break;case"x":var b=k(e.getUTCFullYear(),e.getUTCMonth()),m=y(b),w=b.nextMonth(),E=y(w),A=e.getTime();r=A<m?b.previousMonth().month+1:A>=E?w.month+1:b.month+1;break;case"H":r=e.getUTCHours();break;case"h":r=e.getUTCHours(),0===(r%=12)&&(r=12);break;case"P":r=e.getUTCHours()>=12?"pm":"am";break;case"m":r=e.getUTCMinutes();break;case"s":r=e.getUTCSeconds();break;case"f":r=e.getUTCMilliseconds();break;case"Z":case"z":break;case"C":case"E":r="ISO"}return r},E=null;function A(e,t,r){var n=0,a=0;if(void 0!==r){var i=parseInt(r);n=Math.floor(i/100),a=i%100}var o;void 0===t?(null===E&&(E=v("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),o=E):o=v(t);var s=new Date(e+60*(60*n+a)*1e3),u="";return o.parts.forEach(function(e){"literal"===e.type?u+=e.value:u+=function(e,t){var r=w(e,t.component);if(-1!=="YMDdFWwXxHhms".indexOf(t.component))if("Y"===t.component&&-1!==t.n&&(r%=Math.pow(10,t.n)),t.names){if("M"===t.component||"x"===t.component)r=m[r-1];else{if("F"!==t.component)throw{code:"D3133",value:t.component};r=b[r]}t.names===f.UPPER?r=r.toUpperCase():t.names===f.LOWER&&(r=r.toLowerCase()),t.width&&r.length>t.width.max&&(r=r.substring(0,t.width.max))}else r=l(r,t.integerFormat);else if("f"===t.component)r=l(r,t.integerFormat);else if("Z"===t.component||"z"===t.component){var i=100*n+a;if(t.integerFormat.regular)r=l(i,t.integerFormat);else{var o=t.integerFormat.mandatoryDigits;if(1===o||2===o)r=l(n,t.integerFormat),0!==a&&(r+=":"+c(a,"00"));else{if(3!==o&&4!==o)throw{code:"D3134",value:o};r=l(i,t.integerFormat)}}i>=0&&(r="+"+r),"z"===t.component&&(r="GMT"+r),0===i&&"t"===t.presentation2&&(r="Z")}return r}(s,e)}),u}function S(e){var t={};if("datetime"===e.type)t.type="datetime",t.parts=e.parts.map(function(e){var t={};if("literal"===e.type)t.regex=e.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if("Z"===e.component||"z"===e.component){var r;Array.isArray(e.integerFormat.groupingSeparators)||(r=e.integerFormat.groupingSeparators),t.regex="","z"===e.component&&(t.regex="GMT"),t.regex+="[-+][0-9]+",r&&(t.regex+=r.character+"[0-9]+"),t.parse=function(t){"z"===e.component&&(t=t.substring(3));var n=0,a=0;r?(n=Number.parseInt(t.substring(0,t.indexOf(r.character))),a=Number.parseInt(t.substring(t.indexOf(r.character)+1))):t.length-1<=2?n=Number.parseInt(t):(n=Number.parseInt(t.substring(0,3)),a=Number.parseInt(t.substring(3)));return 60*n+a}}else if(e.integerFormat)t=S(e.integerFormat);else{t.regex="[a-zA-Z]+";var n={};if("M"===e.component||"x"===e.component)m.forEach(function(t,r){e.width&&e.width.max?n[t.substring(0,e.width.max)]=r+1:n[t]=r+1});else if("F"===e.component)b.forEach(function(t,r){r>0&&(e.width&&e.width.max?n[t.substring(0,e.width.max)]=r:n[t]=r)});else{if("P"!==e.component)throw{code:"D3133",value:e.component};n={am:0,AM:0,pm:1,PM:1}}t.parse=function(e){return n[e]}}return t.component=e.component,t});else{t.type="integer";var r=e.case===f.UPPER;switch(e.primary){case p.LETTERS:t.regex=r?"[A-Z]+":"[a-z]+",t.parse=function(e){return function(e,t){for(var r=t.charCodeAt(0),n=0,a=0;a<e.length;a++)n+=(e.charCodeAt(e.length-a-1)-r+1)*Math.pow(26,a);return n}(e,r?"A":"a")};break;case p.ROMAN:t.regex=r?"[MDCLXVI]+":"[mdclxvi]+",t.parse=function(e){return function(e){for(var t=0,r=1,n=e.length-1;n>=0;n--){var a=e[n],i=u[a];i<r?t-=i:(r=i,t+=i)}return t}(r?e:e.toUpperCase())};break;case p.WORDS:t.regex="(?:"+Object.keys(o).concat("and","[\\-, ]").join("|")+")+",t.parse=function(e){return t=e.toLowerCase(),r=t.split(/,\s|\sand\s|[\s\\-]/).map(function(e){return o[e]}),n=[0],r.forEach(function(e){if(e<100){var t=n.pop();t>=1e3&&(n.push(t),t=0),n.push(t+e)}else n.push(n.pop()*e)}),n.reduce(function(e,t){return e+t},0);var t,r,n};break;case p.DECIMAL:t.regex="[0-9]+",e.ordinal&&(t.regex+="(?:th|st|nd|rd)"),t.parse=function(t){var r=t;return e.ordinal&&(r=t.substring(0,t.length-2)),e.regular?r=r.split(",").join(""):e.groupingSeparators.forEach(function(e){r=r.split(e.character).join("")}),48!==e.zeroCode&&(r=r.split("").map(function(t){return String.fromCodePoint(t.codePointAt(0)-e.zeroCode+48)}).join("")),parseInt(r)};break;case p.SEQUENCE:throw{code:"D3130",value:e.token}}}return t}var T=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");return{formatInteger:c,parseInteger:function(e,t){if(void 0!==e)return S(h(t)).parse(e)},fromMillis:function(e,t,r){if(void 0!==e)return A.call(this,e,t,r)},toMillis:function(e,t){if(void 0!==e){if(void 0===t){if(!T.test(e))throw{stack:(new Error).stack,code:"D3110",value:e};return Date.parse(e)}return function(e,t){var r=S(v(t)),n="^"+r.parts.map(function(e){return"("+e.regex+")"}).join("")+"$",a=new RegExp(n,"i").exec(e);if(null!==a){for(var i={},o=1;o<a.length;o++){var s=r.parts[o-1];s.parse&&(i[s.component]=s.parse(a[o]))}if(0===Object.getOwnPropertyNames(i).length)return;var u=0,c=function(e){u<<=1,u+=e?1:0},p=function(e){return!(~e&u||!(e&u))};"YXMxWwdD".split("").forEach(function(e){return c(i[e])});var f=!p(161)&&p(130),l=p(84),d=!l&&p(72);u=0,"PHhmsf".split("").forEach(function(e){return c(i[e])});var h=!p(23)&&p(47),g=(f?"YD":l?"XxwF":d?"XWF":"YMD")+(h?"Phmsf":"Hmsf"),b=this.environment.timestamp,m=!1,y=!1;if(g.split("").forEach(function(e){if(void 0===i[e])m?(i[e]=-1!=="MDd".indexOf(e)?1:0,y=!0):i[e]=w(b,e);else if(m=!0,y)throw{code:"D3136"}}),i.M>0?i.M-=1:i.M=0,f){var k=Date.UTC(i.Y,0),x=1e3*(i.d-1)*60*60*24,E=new Date(k+x);i.M=E.getUTCMonth(),i.D=E.getUTCDate()}if(l)throw{code:"D3136"};if(d)throw{code:"D3136"};h&&(i.H=12===i.h?0:i.h,1===i.P&&(i.H+=12));var A=Date.UTC(i.Y,i.M,i.D,i.H,i.m,i.s,i.f);return(i.Z||i.z)&&(A-=60*(i.Z||i.z)*1e3),A}}.call(this,e,t)}}}}();t.exports=a},{"./utils":6}],2:[function(e,t,r){(function(r){(function(){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=e("./utils"),i=function(){var e=regeneratorRuntime.mark(O),t=regeneratorRuntime.mark(R),i=regeneratorRuntime.mark(P),o=regeneratorRuntime.mark(Y),s=regeneratorRuntime.mark(M),u=regeneratorRuntime.mark(U),c=regeneratorRuntime.mark(N),p=regeneratorRuntime.mark(I),f=regeneratorRuntime.mark(L),l=regeneratorRuntime.mark(z),d=regeneratorRuntime.mark($),h=regeneratorRuntime.mark(q),g=a.isNumeric,v=a.isArrayOfStrings,b=a.isArrayOfNumbers,m=a.createSequence,y=a.isSequence,k=a.isFunction,x=a.isLambda,w=a.isIterable,E=a.getFunctionArity,A=a.isDeepEqual,S=a.stringToArray;function T(e,t,r){if(void 0!==e){var n=S(e),a=n.length;if(a+t<0&&(t=0),void 0!==r){if(r<=0)return"";var i=t>=0?t+r:a+t+r;return n.slice(t,i).join("")}return n.slice(t).join("")}}function D(e){if(void 0!==e)return S(e).length}function O(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.apply(this,[r]),!w(n)){e.next=4;break}return e.delegateYield(n,"t0",3);case 3:n=e.t0;case 4:if(!n||"number"==typeof n.start||"number"===n.end||Array.isArray(n.groups)||k(n.next)){e.next=6;break}throw{code:"T1010",stack:(new Error).stack};case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}},e,this)}function R(e,r){var n,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==e){t.next=2;break}return t.abrupt("return",void 0);case 2:if("string"!=typeof r){t.next=6;break}n=-1!==e.indexOf(r),t.next=9;break;case 6:return t.delegateYield(O(r,e),"t0",7);case 7:a=t.t0,n=void 0!==a;case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}},t)}function P(e,t,r){var n,a,o;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==e){i.next=2;break}return i.abrupt("return",void 0);case 2:if(!(r<0)){i.next=4;break}throw{stack:(new Error).stack,value:r,code:"D3040",index:3};case 4:if(n=m(),!(void 0===r||r>0)){i.next=17;break}return a=0,i.delegateYield(O(t,e),"t0",8);case 8:if(void 0===(o=i.t0)){i.next=17;break}case 10:if(void 0===o||!(void 0===r||a<r)){i.next=17;break}return n.push({match:o.match,index:o.start,groups:o.groups}),i.delegateYield(O(o.next),"t1",13);case 13:o=i.t1,a++,i.next=10;break;case 17:return i.abrupt("return",n);case 18:case"end":return i.stop()}},i)}function Y(e,t,r,n){var a,i,s,u,c,p,f,l;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0!==e){o.next=2;break}return o.abrupt("return",void 0);case 2:if(a=this,""!==t){o.next=5;break}throw{code:"D3010",stack:(new Error).stack,value:t,index:2};case 5:if(!(n<0)){o.next=7;break}throw{code:"D3011",stack:(new Error).stack,value:n,index:4};case 7:if(i="string"==typeof r?function(e){for(var t="",n=0,a=r.indexOf("$",n);-1!==a&&n<r.length;){t+=r.substring(n,a),n=a+1;var i=r.charAt(n);if("$"===i)t+="$",n++;else if("0"===i)t+=e.match,n++;else{var o;if(o=0===e.groups.length?1:Math.floor(Math.log(e.groups.length)*Math.LOG10E)+1,a=parseInt(r.substring(n,n+o),10),o>1&&a>e.groups.length&&(a=parseInt(r.substring(n,n+o-1),10)),isNaN(a))t+="$";else{if(e.groups.length>0){var s=e.groups[a-1];void 0!==s&&(t+=s)}n+=a.toString().length}}a=r.indexOf("$",n)}return t+=r.substring(n)}:r,s="",u=0,!(void 0===n||n>0)){o.next=44;break}if(c=0,"string"!=typeof t){o.next=18;break}for(p=e.indexOf(t,u);-1!==p&&(void 0===n||c<n);)s+=e.substring(u,p),s+=r,u=p+t.length,c++,p=e.indexOf(t,u);s+=e.substring(u),o.next=42;break;case 18:return o.delegateYield(O(t,e),"t0",19);case 19:if(void 0===(f=o.t0)){o.next=41;break}case 21:if(void 0===f||!(void 0===n||c<n)){o.next=38;break}if(s+=e.substring(u,f.start),l=i.apply(a,[f]),!w(l)){o.next=27;break}return o.delegateYield(l,"t1",26);case 26:l=o.t1;case 27:if("string"!=typeof l){o.next=31;break}s+=l,o.next=32;break;case 31:throw{code:"D3012",stack:(new Error).stack,value:l};case 32:return u=f.start+f.match.length,c++,o.delegateYield(O(f.next),"t2",35);case 35:f=o.t2,o.next=21;break;case 38:s+=e.substring(u),o.next=42;break;case 41:s=e;case 42:o.next=45;break;case 44:s=e;case 45:return o.abrupt("return",s);case 46:case"end":return o.stop()}},o,this)}function M(e,t,r){var n,a,i,o;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==e){s.next=2;break}return s.abrupt("return",void 0);case 2:if(!(r<0)){s.next=4;break}throw{code:"D3020",stack:(new Error).stack,value:r,index:3};case 4:if(n=[],!(void 0===r||r>0)){s.next=27;break}if("string"!=typeof t){s.next=10;break}n=e.split(t,r),s.next=27;break;case 10:return a=0,s.delegateYield(O(t,e),"t0",12);case 12:if(void 0===(i=s.t0)){s.next=26;break}o=0;case 15:if(void 0===i||!(void 0===r||a<r)){s.next=23;break}return n.push(e.substring(o,i.start)),o=i.end,s.delegateYield(O(i.next),"t1",19);case 19:i=s.t1,a++,s.next=15;break;case 23:(void 0===r||a<r)&&n.push(e.substring(o)),s.next=27;break;case 26:n.push(e);case 27:return s.abrupt("return",n);case 28:case"end":return s.stop()}},s)}function j(e,t){var r;if(void 0!==e){if(t){var n=e.toString().split("e");e=+(n[0]+"e"+(n[1]?+n[1]+t:t))}var a=(r=Math.round(e))-e;return.5===Math.abs(a)&&1===Math.abs(r%2)&&(r-=1),t&&(r=+((n=r.toString().split("e"))[0]+"e"+(n[1]?+n[1]-t:-t))),Object.is(r,-0)&&(r=0),r}}function C(e){if(void 0!==e){var t=!1;if(Array.isArray(e)){if(1===e.length)t=C(e[0]);else if(e.length>1){t=e.filter(function(e){return C(e)}).length>0}}else"string"==typeof e?e.length>0&&(t=!0):g(e)?0!==e&&(t=!0):null!==e&&"object"===n(e)?Object.keys(e).length>0&&(t=!0):"boolean"==typeof e&&!0===e&&(t=!0);return t}}function F(e,t,r,n){var a=[t],i=E(e);return i>=2&&a.push(r),i>=3&&a.push(n),a}function U(e,t){var r,n,a,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0!==e){o.next=2;break}return o.abrupt("return",void 0);case 2:r=m(),n=0;case 4:if(!(n<e.length)){o.next=12;break}return a=F(t,e[n],n,e),o.delegateYield(t.apply(this,a),"t0",7);case 7:void 0!==(i=o.t0)&&r.push(i);case 9:n++,o.next=4;break;case 12:return o.abrupt("return",r);case 13:case"end":return o.stop()}},u,this)}function N(e,t){var r,n,a,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0!==e){o.next=2;break}return o.abrupt("return",void 0);case 2:r=m(),n=0;case 4:if(!(n<e.length)){o.next=13;break}return a=e[n],i=F(t,a,n,e),o.delegateYield(t.apply(this,i),"t0",8);case 8:C(o.t0)&&r.push(a);case 10:n++,o.next=4;break;case 13:return o.abrupt("return",r);case 14:case"end":return o.stop()}},c,this)}function I(e,t){var r,n,a,i,o,s,u;return regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(void 0!==e){c.next=2;break}return c.abrupt("return",void 0);case 2:r=!1,a=0;case 4:if(!(a<e.length)){c.next=22;break}if(i=e[a],o=!0,void 0===t){c.next=12;break}return s=F(t,i,a,e),c.delegateYield(t.apply(this,s),"t0",10);case 10:u=c.t0,o=C(u);case 12:if(!o){c.next=19;break}if(r){c.next=18;break}n=i,r=!0,c.next=19;break;case 18:throw{stack:(new Error).stack,code:"D3138",index:a};case 19:a++,c.next=4;break;case 22:if(r){c.next=24;break}throw{stack:(new Error).stack,code:"D3139"};case 24:return c.abrupt("return",n);case 25:case"end":return c.stop()}},p,this)}function L(e,t,r){var n,a,i,o;return regeneratorRuntime.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(void 0!==e){s.next=2;break}return s.abrupt("return",void 0);case 2:if(!((a=E(t))<2)){s.next=5;break}throw{stack:(new Error).stack,code:"D3050",index:1};case 5:void 0===r&&e.length>0?(n=e[0],i=1):(n=r,i=0);case 6:if(!(i<e.length)){s.next=15;break}return o=[n,e[i]],a>=3&&o.push(i),a>=4&&o.push(e),s.delegateYield(t.apply(this,o),"t0",11);case 11:n=s.t0,i++,s.next=6;break;case 15:return s.abrupt("return",n);case 16:case"end":return s.stop()}},f,this)}function _(e,t){return void 0===e?t:void 0===t?e:(Array.isArray(e)||(e=m(e)),Array.isArray(t)||(t=[t]),e.concat(t))}function z(e,t){var r,n,a,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:r=m(),o.t0=regeneratorRuntime.keys(e);case 2:if((o.t1=o.t0()).done){o.next=10;break}return n=o.t1.value,a=F(t,e[n],n,e),o.delegateYield(t.apply(this,a),"t2",6);case 6:void 0!==(i=o.t2)&&r.push(i),o.next=2;break;case 10:return o.abrupt("return",r);case 11:case"end":return o.stop()}},l,this)}function $(e,t){var r,n,a,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(void 0!==e){o.next=2;break}return o.abrupt("return",void 0);case 2:if(!(e.length<=1)){o.next=4;break}return o.abrupt("return",e);case 4:if(void 0!==t){o.next=10;break}if(b(e)||v(e)){o.next=7;break}throw{stack:(new Error).stack,code:"D3070",index:1};case 7:r=regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t>r);case 1:case"end":return e.stop()}},e)}),o.next=11;break;case 10:r=t;case 11:return n=regeneratorRuntime.mark(function e(t,n){var a,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=regeneratorRuntime.mark(function e(t,n,a){return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(0!==n.length){i.next=4;break}Array.prototype.push.apply(t,a),i.next=16;break;case 4:if(0!==a.length){i.next=8;break}Array.prototype.push.apply(t,n),i.next=16;break;case 8:return i.delegateYield(r(n[0],a[0]),"t0",9);case 9:if(!i.t0){i.next=14;break}return t.push(a[0]),i.delegateYield(e(t,n,a.slice(1)),"t1",12);case 12:i.next=16;break;case 14:return t.push(n[0]),i.delegateYield(e(t,n.slice(1),a),"t2",16);case 16:case"end":return i.stop()}},e)}),i=[],e.delegateYield(a(i,t,n),"t0",3);case 3:return e.abrupt("return",i);case 4:case"end":return e.stop()}},e)}),a=regeneratorRuntime.mark(function e(t){var r,a,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(Array.isArray(t)&&!(t.length<=1)){o.next=4;break}return o.abrupt("return",t);case 4:return r=Math.floor(t.length/2),a=t.slice(0,r),i=t.slice(r),o.delegateYield(e(a),"t0",8);case 8:return a=o.t0,o.delegateYield(e(i),"t1",10);case 10:return i=o.t1,o.delegateYield(n(a,i),"t2",12);case 12:return o.abrupt("return",o.t2);case 13:case"end":return o.stop()}},e)}),o.delegateYield(a(e),"t0",14);case 14:return i=o.t0,o.abrupt("return",i);case 16:case"end":return o.stop()}},d)}function q(e,t){var r,n,a,i;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:r={},o.t0=regeneratorRuntime.keys(e);case 2:if((o.t1=o.t0()).done){o.next=11;break}return n=o.t1.value,a=e[n],i=F(t,a,n,e),o.delegateYield(t.apply(this,i),"t2",7);case 7:C(o.t2)&&(r[n]=a),o.next=2;break;case 11:return 0===Object.keys(r).length&&(r=void 0),o.abrupt("return",r);case 13:case"end":return o.stop()}},h,this)}return{sum:function(e){if(void 0!==e){var t=0;return e.forEach(function(e){t+=e}),t}},count:function(e){return void 0===e?0:e.length},max:function(e){if(void 0!==e&&0!==e.length)return Math.max.apply(Math,e)},min:function(e){if(void 0!==e&&0!==e.length)return Math.min.apply(Math,e)},average:function(e){if(void 0!==e&&0!==e.length){var t=0;return e.forEach(function(e){t+=e}),t/e.length}},string:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0!==e){var r;if("string"==typeof e)r=e;else if(k(e))r="";else{if("number"==typeof e&&!isFinite(e))throw{code:"D3001",value:e,stack:(new Error).stack};var n=t?2:0;Array.isArray(e)&&e.outerWrapper&&(e=e[0]),r=JSON.stringify(e,function(e,t){return null!=t&&t.toPrecision&&g(t)?Number(t.toPrecision(15)):t&&k(t)?"":t},n)}return r}},substring:T,substringBefore:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(0,r):e}},substringAfter:function(e,t){if(void 0!==e){var r=e.indexOf(t);return r>-1?e.substr(r+t.length):e}},lowercase:function(e){if(void 0!==e)return e.toLowerCase()},uppercase:function(e){if(void 0!==e)return e.toUpperCase()},length:D,trim:function(e){if(void 0!==e){var t=e.replace(/[ \t\n\r]+/gm," ");return" "===t.charAt(0)&&(t=t.substring(1))," "===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1)),t}},pad:function(e,t,r){if(void 0!==e){var n;void 0!==r&&0!==r.length||(r=" ");var a=Math.abs(t)-D(e);if(a>0){var i=new Array(a+1).join(r);r.length>1&&(i=T(i,0,a)),n=t>0?e+i:i+e}else n=e;return n}},match:P,contains:R,replace:Y,split:M,join:function(e,t){if(void 0!==e)return void 0===t&&(t=""),e.join(t)},formatNumber:function(e,t,r){if(void 0!==e){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(e){n[e]=r[e]});for(var a=[],i=n["zero-digit"].charCodeAt(0),o=i;o<i+10;o++)a.push(String.fromCharCode(o));var s=a.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),u=t.split(n["pattern-separator"]);if(u.length>2)throw{code:"D3080",stack:(new Error).stack};var c=u.map(function(e){var t,r,a,i,o=function(){for(var t,r=0;r<e.length;r++)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(0,r)}(),u=function(){for(var t,r=e.length-1;r>=0;r--)if(t=e.charAt(r),-1!==s.indexOf(t)&&t!==n["exponent-separator"])return e.substring(r+1)}(),c=e.substring(o.length,e.length-u.length),p=e.indexOf(n["exponent-separator"],o.length);-1===p||p>e.length-u.length?(t=c,r=void 0):(t=c.substring(0,p),r=c.substring(p+1));var f=t.indexOf(n["decimal-separator"]);return-1===f?(a=t,i=u):(a=t.substring(0,f),i=t.substring(f+1)),{prefix:o,suffix:u,activePart:c,mantissaPart:t,exponentPart:r,integerPart:a,fractionalPart:i,subpicture:e}});c.forEach(function(e){var t,r,i=e.subpicture,o=i.indexOf(n["decimal-separator"]);o!==i.lastIndexOf(n["decimal-separator"])&&(t="D3081"),i.indexOf(n.percent)!==i.lastIndexOf(n.percent)&&(t="D3082"),i.indexOf(n["per-mille"])!==i.lastIndexOf(n["per-mille"])&&(t="D3083"),-1!==i.indexOf(n.percent)&&-1!==i.indexOf(n["per-mille"])&&(t="D3084");var u=!1;for(r=0;r<e.mantissaPart.length;r++){var c=e.mantissaPart.charAt(r);if(-1!==a.indexOf(c)||c===n.digit){u=!0;break}}u||(t="D3085"),-1!==e.activePart.split("").map(function(e){return-1===s.indexOf(e)?"p":"a"}).join("").indexOf("p")&&(t="D3086"),-1!==o?i.charAt(o-1)!==n["grouping-separator"]&&i.charAt(o+1)!==n["grouping-separator"]||(t="D3087"):e.integerPart.charAt(e.integerPart.length-1)===n["grouping-separator"]&&(t="D3088"),-1!==i.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(t="D3089");var p=e.integerPart.indexOf(n.digit);-1!==p&&e.integerPart.substring(0,p).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3090"),-1!==(p=e.fractionalPart.lastIndexOf(n.digit))&&e.fractionalPart.substring(p).split("").filter(function(e){return a.indexOf(e)>-1}).length>0&&(t="D3091");var f="string"==typeof e.exponentPart;if(f&&e.exponentPart.length>0&&(-1!==i.indexOf(n.percent)||-1!==i.indexOf(n["per-mille"]))&&(t="D3092"),f&&(0===e.exponentPart.length||e.exponentPart.split("").filter(function(e){return-1===a.indexOf(e)}).length>0)&&(t="D3093"),t)throw{code:t,stack:(new Error).stack}});var p,f,l,d,h=c.map(function(e){var t=function(t,r){for(var i=[],o=t.indexOf(n["grouping-separator"]);-1!==o;){var s=(r?t.substring(0,o):t.substring(o)).split("").filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length;i.push(s),o=e.integerPart.indexOf(n["grouping-separator"],o+1)}return i},r=t(e.integerPart),i=function(e){if(0===e.length)return 0;for(var t=e.reduce(function e(t,r){return 0===r?t:e(r,t%r)}),r=1;r<=e.length;r++)if(-1===e.indexOf(r*t))return 0;return t}(r),o=t(e.fractionalPart,!0),s=e.integerPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length,u=s,c=e.fractionalPart.split(""),p=c.filter(function(e){return-1!==a.indexOf(e)}).length,f=c.filter(function(e){return-1!==a.indexOf(e)||e===n.digit}).length,l="string"==typeof e.exponentPart;0===s&&0===f&&(l?(p=1,f=1):s=1),l&&0===s&&-1!==e.integerPart.indexOf(n.digit)&&(s=1),0===s&&0===p&&(p=1);var d=0;return l&&(d=e.exponentPart.split("").filter(function(e){return-1!==a.indexOf(e)}).length),{integerPartGroupingPositions:r,regularGrouping:i,minimumIntegerPartSize:s,scalingFactor:u,prefix:e.prefix,fractionalPartGroupingPositions:o,minimumFactionalPartSize:p,maximumFactionalPartSize:f,minimumExponentSize:d,suffix:e.suffix,picture:e.subpicture}}),g=n["minus-sign"],v=n["zero-digit"],b=n["decimal-separator"],m=n["grouping-separator"];if(1===h.length&&(h.push(JSON.parse(JSON.stringify(h[0]))),h[1].prefix=g+h[1].prefix),f=-1!==(p=e>=0?h[0]:h[1]).picture.indexOf(n.percent)?100*e:-1!==p.picture.indexOf(n["per-mille"])?1e3*e:e,0===p.minimumExponentSize)l=f;else{var y=Math.pow(10,p.scalingFactor),k=Math.pow(10,p.scalingFactor-1);for(l=f,d=0;l<k;)l*=10,d-=1;for(;l>y;)l/=10,d+=1}var x=function(e,t){var r=Math.abs(e).toFixed(t);return"0"!==v&&(r=r.split("").map(function(e){return e>="0"&&e<="9"?a[e.charCodeAt(0)-48]:e}).join("")),r},w=x(j(l,p.maximumFactionalPartSize),p.maximumFactionalPartSize),E=w.indexOf(".");for(-1===E?w+=b:w=w.replace(".",b);w.charAt(0)===v;)w=w.substring(1);for(;w.charAt(w.length-1)===v;)w=w.substring(0,w.length-1);E=w.indexOf(b);var A=p.minimumIntegerPartSize-E,S=p.minimumFactionalPartSize-(w.length-E-1);if(w=(A>0?new Array(A+1).join(v):"")+w,w+=S>0?new Array(S+1).join(v):"",E=w.indexOf(b),p.regularGrouping>0)for(var T=Math.floor((E-1)/p.regularGrouping),D=1;D<=T;D++)w=[w.slice(0,E-D*p.regularGrouping),m,w.slice(E-D*p.regularGrouping)].join("");else p.integerPartGroupingPositions.forEach(function(e){w=[w.slice(0,E-e),m,w.slice(E-e)].join(""),E++});if(E=w.indexOf(b),p.fractionalPartGroupingPositions.forEach(function(e){w=[w.slice(0,e+E+1),m,w.slice(e+E+1)].join("")}),E=w.indexOf(b),-1!==p.picture.indexOf(b)&&E!==w.length-1||(w=w.substring(0,w.length-1)),void 0!==d){var O=x(d,0);(A=p.minimumExponentSize-O.length)>0&&(O=new Array(A+1).join(v)+O),w=w+n["exponent-separator"]+(d<0?g:"")+O}return w=p.prefix+w+p.suffix}},formatBase:function(e,t){if(void 0!==e){if(e=j(e),(t=void 0===t?10:j(t))<2||t>36)throw{code:"D3100",stack:(new Error).stack,value:t};return e.toString(t)}},number:function(e){var t;if(void 0!==e){if("number"==typeof e)t=e;else if("string"==typeof e&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(e)&&!isNaN(parseFloat(e))&&isFinite(e))t=parseFloat(e);else if(!0===e)t=1;else{if(!1!==e)throw{code:"D3030",value:e,stack:(new Error).stack,index:1};t=0}return t}},floor:function(e){if(void 0!==e)return Math.floor(e)},ceil:function(e){if(void 0!==e)return Math.ceil(e)},round:j,abs:function(e){if(void 0!==e)return Math.abs(e)},sqrt:function(e){if(void 0!==e){if(e<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:e};return Math.sqrt(e)}},power:function(e,t){var r;if(void 0!==e){if(r=Math.pow(e,t),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:e,exp:t};return r}},random:function(){return Math.random()},boolean:C,not:function(e){if(void 0!==e)return!C(e)},map:U,zip:function(){for(var e=[],t=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,t.map(function(e){return Array.isArray(e)?e.length:0})),n=0;n<r;n++){var a=t.map(function(e){return e[n]});e.push(a)}return e},filter:N,single:I,foldLeft:L,sift:q,keys:function e(t){var r=m();if(Array.isArray(t)){var a={};t.forEach(function(t){e(t).forEach(function(e){a[e]=!0})}),r=e(a)}else null===t||"object"!==n(t)||x(t)||Object.keys(t).forEach(function(e){return r.push(e)});return r},lookup:function e(t,r){var a;if(Array.isArray(t)){a=m();for(var i=0;i<t.length;i++){var o=e(t[i],r);void 0!==o&&(Array.isArray(o)?o.forEach(function(e){return a.push(e)}):a.push(o))}}else null!==t&&"object"===n(t)&&(a=t[r]);return a},append:_,exists:function(e){return void 0!==e},spread:function e(t){var r=m();if(Array.isArray(t))t.forEach(function(t){r=_(r,e(t))});else if(null===t||"object"!==n(t)||x(t))r=t;else for(var a in t){var i={};i[a]=t[a],r.push(i)}return r},merge:function(e){if(void 0!==e){var t={};return e.forEach(function(e){for(var r in e)t[r]=e[r]}),t}},reverse:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=e.length,r=new Array(t),n=0;n<t;n++)r[t-n-1]=e[n];return r}},each:z,error:function(e){throw{code:"D3137",stack:(new Error).stack,message:e||"$error() function evaluated"}},assert:function(e,t){if(!e)throw{code:"D3141",stack:(new Error).stack,message:t||"$assert() statement failed"}},type:function(e){if(void 0!==e)return null===e?"null":g(e)?"number":"string"==typeof e?"string":"boolean"==typeof e?"boolean":Array.isArray(e)?"array":k(e)?"function":"object"},sort:$,shuffle:function(e){if(void 0!==e){if(e.length<=1)return e;for(var t=new Array(e.length),r=0;r<e.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(t[r]=t[n]),t[n]=e[r]}return t}},distinct:function(e){if(void 0!==e){if(!Array.isArray(e)||e.length<=1)return e;for(var t=y(e)?m():[],r=0;r<e.length;r++){for(var n=e[r],a=!1,i=0;i<t.length;i++)if(A(n,t[i])){a=!0;break}a||t.push(n)}return t}},base64encode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.btoa:function(e){return new r.Buffer.from(e,"binary").toString("base64")})(e)},base64decode:function(e){if(void 0!==e)return("undefined"!=typeof window?window.atob:function(e){return new r.Buffer(e,"base64").toString("binary")})(e)},encodeUrlComponent:function(e){if(void 0!==e){var t;try{t=encodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrlComponent"}}return t}},encodeUrl:function(e){if(void 0!==e){var t;try{t=encodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"encodeUrl"}}return t}},decodeUrlComponent:function(e){if(void 0!==e){var t;try{t=decodeURIComponent(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrlComponent"}}return t}},decodeUrl:function(e){if(void 0!==e){var t;try{t=decodeURI(e)}catch(t){throw{code:"D3140",stack:(new Error).stack,value:e,functionName:"decodeUrl"}}return t}}}}();t.exports=i}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":6}],3:[function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=e("./datetime"),i=e("./functions"),o=e("./utils"),s=e("./parser"),u=e("./signature"),c=function(){var e=regeneratorRuntime.mark(I),t=regeneratorRuntime.mark(L),r=regeneratorRuntime.mark(z),c=regeneratorRuntime.mark($),p=regeneratorRuntime.mark(q),f=regeneratorRuntime.mark(W),l=regeneratorRuntime.mark(G),d=regeneratorRuntime.mark(H),h=regeneratorRuntime.mark(ne),g=regeneratorRuntime.mark(oe),v=regeneratorRuntime.mark(se),b=regeneratorRuntime.mark(ue),m=regeneratorRuntime.mark(fe),y=regeneratorRuntime.mark(he),k=regeneratorRuntime.mark(ge),x=regeneratorRuntime.mark(ve),w=regeneratorRuntime.mark(be),E=regeneratorRuntime.mark(ye),A=regeneratorRuntime.mark(xe),S=regeneratorRuntime.mark(Ae),T=regeneratorRuntime.mark(De),D=o.isNumeric,O=o.isArrayOfStrings,R=o.isArrayOfNumbers,P=o.createSequence,Y=o.isSequence,M=o.isFunction,j=o.isLambda,C=o.isIterable,F=o.getFunctionArity,U=o.isDeepEqual,N=Oe(null);function I(t,r,n){var a,i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(i=n.lookup("__evaluate_entry"))&&i(t,r,n),e.t0=t.type,e.next="path"===e.t0?5:"binary"===e.t0?8:"unary"===e.t0?11:"name"===e.t0?14:"string"===e.t0?16:"number"===e.t0?16:"value"===e.t0?16:"wildcard"===e.t0?18:"descendant"===e.t0?20:"parent"===e.t0?22:"condition"===e.t0?24:"block"===e.t0?27:"bind"===e.t0?30:"regex"===e.t0?33:"function"===e.t0?35:"variable"===e.t0?38:"lambda"===e.t0?40:"partial"===e.t0?42:"apply"===e.t0?45:"transform"===e.t0?48:50;break;case 5:return e.delegateYield(L(t,r,n),"t1",6);case 6:return a=e.t1,e.abrupt("break",50);case 8:return e.delegateYield(G(t,r,n),"t2",9);case 9:return a=e.t2,e.abrupt("break",50);case 11:return e.delegateYield(H(t,r,n),"t3",12);case 12:return a=e.t3,e.abrupt("break",50);case 14:return a=Z(t,r,n),e.abrupt("break",50);case 16:return a=B(t),e.abrupt("break",50);case 18:return a=J(t,r),e.abrupt("break",50);case 20:return a=X(t,r),e.abrupt("break",50);case 22:return a=n.lookup(t.slot.label),e.abrupt("break",50);case 24:return e.delegateYield(se(t,r,n),"t4",25);case 25:return a=e.t4,e.abrupt("break",50);case 27:return e.delegateYield(ue(t,r,n),"t5",28);case 28:return a=e.t5,e.abrupt("break",50);case 30:return e.delegateYield(oe(t,r,n),"t6",31);case 31:return a=e.t6,e.abrupt("break",50);case 33:return a=ce(t),e.abrupt("break",50);case 35:return e.delegateYield(ge(t,r,n),"t7",36);case 36:return a=e.t7,e.abrupt("break",50);case 38:return a=pe(t,r,n),e.abrupt("break",50);case 40:return a=me(t,r,n),e.abrupt("break",50);case 42:return e.delegateYield(ye(t,r,n),"t8",43);case 43:return a=e.t8,e.abrupt("break",50);case 45:return e.delegateYield(he(t,r,n),"t9",46);case 46:return a=e.t9,e.abrupt("break",50);case 48:return a=le(t,r,n),e.abrupt("break",50);case 50:if(!n.async||null!=a&&"function"==typeof a.then||(a=Promise.resolve(a)),!n.async||"function"!=typeof a.then||!t.nextFunction||"function"!=typeof a[t.nextFunction]){e.next=54;break}e.next=57;break;case 54:return e.next=56,a;case 56:a=e.sent;case 57:if(!Object.prototype.hasOwnProperty.call(t,"predicate")){e.next=65;break}o=0;case 59:if(!(o<t.predicate.length)){e.next=65;break}return e.delegateYield(W(t.predicate[o].expr,a,n),"t10",61);case 61:a=e.t10;case 62:o++,e.next=59;break;case 65:if("path"===t.type||!Object.prototype.hasOwnProperty.call(t,"group")){e.next=68;break}return e.delegateYield(ne(t.group,a,n),"t11",67);case 67:a=e.t11;case 68:return(s=n.lookup("__evaluate_exit"))&&s(t,r,n,a),a&&Y(a)&&!a.tupleStream&&(t.keepArray&&(a.keepSingleton=!0),0===a.length?a=void 0:1===a.length&&(a=a.keepSingleton?a:a[0])),e.abrupt("return",a);case 72:case"end":return e.stop()}},e)}function L(e,r,n){var a,i,o,s,u,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=Array.isArray(r)&&"variable"!==e.steps[0].type?r:P(r),o=!1,s=void 0,u=0;case 4:if(!(u<e.steps.length)){t.next=25;break}if((c=e.steps[u]).tuple&&(o=!0),0!==u||!c.consarray){t.next=12;break}return t.delegateYield(I(c,a,n),"t0",9);case 9:i=t.t0,t.next=19;break;case 12:if(!o){t.next=17;break}return t.delegateYield(q(c,a,s,n),"t1",14);case 14:s=t.t1,t.next=19;break;case 17:return t.delegateYield(z(c,a,n,u===e.steps.length-1),"t2",18);case 18:i=t.t2;case 19:if(o||void 0!==i&&0!==i.length){t.next=21;break}return t.abrupt("break",25);case 21:void 0===c.focus&&(a=i);case 22:u++,t.next=4;break;case 25:if(o)if(e.tuple)i=s;else for(i=P(),u=0;u<s.length;u++)i.push(s[u]["@"]);if(e.keepSingletonArray&&(Y(i)||(i=P(i)),i.keepSingleton=!0),!e.hasOwnProperty("group")){t.next=30;break}return t.delegateYield(ne(e.group,o?s:i,n),"t3",29);case 29:i=t.t3;case 30:return t.abrupt("return",i);case 31:case"end":return t.stop()}},t)}function _(e,t){var r=Oe(e);for(var n in t)r.bind(n,t[n]);return r}function z(e,t,n,a){var i,o,s,u,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if("sort"!==e.type){r.next=7;break}return r.delegateYield(fe(e,t,n),"t0",2);case 2:if(i=r.t0,!e.stages){r.next=6;break}return r.delegateYield($(e.stages,i,n),"t1",5);case 5:i=r.t1;case 6:return r.abrupt("return",i);case 7:i=P(),o=0;case 9:if(!(o<t.length)){r.next=24;break}return r.delegateYield(I(e,t[o],n),"t2",11);case 11:if(s=r.t2,!e.stages){r.next=20;break}u=0;case 14:if(!(u<e.stages.length)){r.next=20;break}return r.delegateYield(W(e.stages[u].expr,s,n),"t3",16);case 16:s=r.t3;case 17:u++,r.next=14;break;case 20:void 0!==s&&i.push(s);case 21:o++,r.next=9;break;case 24:return c=P(),a&&1===i.length&&Array.isArray(i[0])&&!Y(i[0])?c=i