2 lines
No EOL
67 KiB
JavaScript
2 lines
No EOL
67 KiB
JavaScript
/* OxJS v0.2.0 | (c) 2024 0x2620 | MIT License | oxjs.org */
|
||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Ox={})}(this,function(exports){"use strict";function typeOf(e){const t=Object.prototype.toString.call(e).slice(8,-1).toLowerCase();if("object"===t){if(null===e)return"null";if(e instanceof Array)return"array";if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return"number"===t&&isNaN$1(e)?"nan":t}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isDate(e){return e instanceof Date&&!isNaN$1(e)}function isDefined(e){return void 0!==e}function isElement(e){return!(!e||1!==e.nodeType)}function isEmpty$1(e){return null==e||(isArray(e)||isString(e)?0===e.length:!!isObject(e)&&0===Object.keys(e).length)}function isEqual(e,t){if(e===t)return!0;const n=typeOf(e);if(n!==typeOf(t))return!1;if("array"===n){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!isEqual(e[n],t[n]))return!1;return!0}if("object"===n){const n=Object.keys(e).sort();if(!isEqual(n,Object.keys(t).sort()))return!1;for(const r of n)if(!isEqual(e[r],t[r]))return!1;return!0}return"date"===n?e.getTime()===t.getTime():"regexp"===n?e.toString()===t.toString():"nan"===n}function isFalse(e){return!1===e}function isFunction(e){return"function"==typeof e}function isInfinity(e){return e===1/0||e===-1/0}function isInt(e){return isNumber(e)&&e===Math.floor(e)&&!isInfinity(e)}function isNaN$1(e){return e!=e}function isNull(e){return null===e}function isNumber(e){return"number"==typeof e&&!isNaN$1(e)}function isObject(e){return null!==e&&"object"==typeof e&&!isArray(e)&&!isDate(e)&&!isRegExp(e)}function isRegExp(e){return e instanceof RegExp}function isString(e){return"string"==typeof e}function isTrue(e){return!0===e}function isUndefined(e){return void 0===e}var Type={typeOf:typeOf,isArray:isArray,isBoolean:isBoolean,isDate:isDate,isDefined:isDefined,isElement:isElement,isEmpty:isEmpty$1,isEqual:isEqual,isFalse:isFalse,isFunction:isFunction,isInfinity:isInfinity,isInt:isInt,isNaN:isNaN$1,isNull:isNull,isNumber:isNumber,isObject:isObject,isRegExp:isRegExp,isString:isString,isTrue:isTrue,isUndefined:isUndefined},TypeUtils=Object.freeze({__proto__:null,default:Type,isArray:isArray,isBoolean:isBoolean,isDate:isDate,isDefined:isDefined,isElement:isElement,isEmpty:isEmpty$1,isEqual:isEqual,isFalse:isFalse,isFunction:isFunction,isInfinity:isInfinity,isInt:isInt,isNaN:isNaN$1,isNull:isNull,isNumber:isNumber,isObject:isObject,isRegExp:isRegExp,isString:isString,isTrue:isTrue,isUndefined:isUndefined,typeOf:typeOf});function forEach(e,t,n){const r=typeOf(e);let a,o;if("object"===r){for(o in e)if(e.hasOwnProperty(o)&&!1===t.call(n,e[o],o,e))break}else if("array"===r||"string"===r)for(a=0;a<e.length&&!1!==t.call(n,e[a],a,e);a++);return e}function len(e){const t=typeOf(e);return"array"===t||"string"===t?e.length:"object"===t?Object.keys(e).length:0}function extend(...e){let t=e[0]||{},n=!1,r=1;for("boolean"==typeof t&&(n=t,t=e[1]||{},r=2);r<e.length;r++){const a=e[r];if(a)for(const e in a)if(a.hasOwnProperty(e)){const r=t[e],o=a[e];if(t===o)continue;if(n&&o&&(isObject(o)||isArray(o))){let a;a=isArray(o)?r&&isArray(r)?r:[]:r&&isObject(r)?r:{},t[e]=extend(n,a,o)}else void 0!==o&&(t[e]=o)}}return t}function map(e,t,n){const r=typeOf(e),a=[];return forEach(e,function(r,o){a.push(t.call(n,r,o,e))}),"string"===r?a.join(""):a}function filter(e,t,n){const r=typeOf(e),a="object"===r?{}:[];return forEach(e,function(o,i){t.call(n,o,i,e)&&("object"===r?a[i]=o:a.push(o))}),"string"===r?a.join(""):a}function find(e,t,n){let r;return forEach(e,function(a,o){if(t.call(n,a,o,e))return r=a,!1}),r}function every(e,t,n){let r=!0;return forEach(e,function(a,o){if(!t.call(n,a,o,e))return r=!1,!1}),r}function some(e,t,n){let r=!1;return forEach(e,function(a,o){if(t.call(n,a,o,e))return r=!0,!1}),r}function keys$1(e){return isObject(e)?Object.keys(e):isArray(e)||isString(e)?Array.from({length:e.length},(e,t)=>t):[]}function values$1(e){return isObject(e)?Object.values(e):isArray(e)?[...e]:isString(e)?e.split(""):[]}const STACK_LENGTH=5e4;function slice(e,t,n){try{const r=Array.prototype.slice.call(e,t,n);if(0===r.length&&e.length>0)throw new Error("Broken slice implementation");return r}catch(r){const a=void 0===n?[t]:[t,n],o=[];let i,s;for("string"===typeOf(e)&&(e=e.split("")),s=e.length,i=0;i<s;i++)o[i]=e[i];return Array.prototype.slice.apply(o,a)}}function max(e){var t=values$1(e);return t.length<STACK_LENGTH?Math.max.apply(null,t):t.reduce(function(e,t){return Math.max(e,t)},-1/0)}function min(e){var t=values$1(e);return t.length<STACK_LENGTH?Math.min.apply(null,t):t.reduce(function(e,t){return Math.min(e,t)},1/0)}var Collection={forEach:forEach,len:len,extend:extend,map:map,filter:filter,find:find,every:every,some:some,keys:keys$1,values:values$1,slice:slice,max:max,min:min},CollectionUtils=Object.freeze({__proto__:null,default:Collection,every:every,extend:extend,filter:filter,find:find,forEach:forEach,keys:keys$1,len:len,map:map,max:max,min:min,slice:slice,some:some,values:values$1});function documentReady(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function $(e,t=document){if("string"==typeof e){const n=t.querySelectorAll(e);return 1===n.length?n[0]:Array.from(n)}return e}function createElement(e,t={},n=[]){const r=document.createElement(e);for(const[e,n]of Object.entries(t))"style"===e&&"object"==typeof n?Object.assign(r.style,n):"class"===e?r.className=n:e.startsWith("on")?r.addEventListener(e.slice(2).toLowerCase(),n):r.setAttribute(e,n);return n.forEach(e=>{"string"==typeof e?r.appendChild(document.createTextNode(e)):e&&r.appendChild(e)}),r}var DOM={documentReady:documentReady,$:$,createElement:createElement},DOMUtils=Object.freeze({__proto__:null,$:$,createElement:createElement,default:DOM,documentReady:documentReady});async function getFile(e,t){try{const n=await fetch(e),r=await n.text();return t&&t(r),r}catch(n){return console.error("Failed to get file:",e,n),t&&t(null),null}}async function getJSON(e,t){try{const n=await fetch(e),r=await n.json();return t&&t(r),r}catch(n){return console.error("Failed to get JSON:",e,n),t&&t(null),null}}async function post(e,t,n){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json();return n&&n(a),a}catch(t){return console.error("Failed to post:",e,t),n&&n(null),null}}var Request={getFile:getFile,getJSON:getJSON,post:post},RequestUtils=Object.freeze({__proto__:null,default:Request,getFile:getFile,getJSON:getJSON,post:post});let LOCALE="en";const LOCALES={};async function setLocale(e,t){LOCALE=e,t&&t()}function _(e,t={}){return e}var Locale={LOCALE:LOCALE,LOCALES:LOCALES,setLocale:setLocale,_:_},LocaleUtils=Object.freeze({__proto__:null,get LOCALE(){return LOCALE},LOCALES:LOCALES,_:_,default:Locale,setLocale:setLocale});function wrap(e){return{value:e,_wrapped:!0}}const Core={wrap:wrap};function localStorage(e){let t;try{t=window.localStorage||{},t.setItem("OxJS.test",""),t.removeItem("OxJS.test")}catch(e){t={}}function n(r,a){let o;if(0===arguments.length){o={};for(const n in t)n.startsWith(e+".")&&(o[n.slice(e.length+1)]=JSON.parse(t[n]))}else if(1===arguments.length&&"string"==typeof r){const n=t[e+"."+r];o=void 0===n?void 0:JSON.parse(n)}else{const i="object"==typeof r?r:{[r]:a};for(const[n,r]of Object.entries(i))t[e+"."+n]=JSON.stringify(r);o=n}return o}return n.delete=function(...r){return(0===r.length?Object.keys(n()):r).forEach(n=>{delete t[e+"."+n]}),n},n}function loop(...e){const t=e.length,n=t>2?e[0]:0,r=e[t>2?1:0],a=4===t?e[2]:n<=r?1:-1,o=e[t-1];let i;for(i=n;(a>0?i<r:i>r)&&!1!==o(i);i+=a);return i}function cache(e,t){var n={},r=(t=t||{}).async,a=t.key||JSON.stringify;return function(){var t=Array.prototype.slice.call(arguments),o=r?t.pop():null,i=a(t);if(i in n){if(!r)return n[i];setTimeout(function(){o(n[i])},0)}else{if(!r)return n[i]=e.apply(this,t);e.apply(this,t.concat(function(e){n[i]=e,o(e)}))}}}function debounce(e,t,n){var r;return function(){var a=this,o=arguments,i=n&&!r;clearTimeout(r),r=setTimeout(function(){r=null,n||e.apply(a,o)},t),i&&e.apply(a,o)}}function sequence(){var e=Array.prototype.slice.call(arguments);return function(){var t=Array.prototype.slice.call(arguments),n=this;e.forEach(function(e){e.apply(n,t)})}}function throttle(e,t){var n,r,a,o,i=0,s=function(){i=Date.now(),n=null,o=e.apply(r,a),n||(r=a=null)};return function(){var u=Date.now(),c=t-(u-i);return r=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),i=u,o=e.apply(r,a),n||(r=a=null)):n||(n=setTimeout(s,c)),o}}function bind(e,t){var n=Array.prototype.slice.call(arguments,2);return function(){return e.apply(t,n.concat(Array.prototype.slice.call(arguments)))}}function identity(e){return e}function noop(){}function once(e){var t,n=!1;return function(){return n||(n=!0,t=e.apply(this,arguments)),t}}function constant(e){return function(){return e}}function compose(){var e=Array.prototype.slice.call(arguments);return function(){for(var t=Array.prototype.slice.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}}function pipe(){var e=Array.prototype.slice.call(arguments);return function(){for(var t=Array.prototype.slice.call(arguments),n=0;n<e.length;n++)t=[e[n].apply(this,t)];return t[0]}}function memoize(e,t){var n={};return t=t||identity,function(){var r=t.apply(this,arguments);return r in n||(n[r]=e.apply(this,arguments)),n[r]}}function partial(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(this,t.concat(Array.prototype.slice.call(arguments)))}}!function(){const e=localStorage("Ox"),t=e("log")||{filter:[],filterEnabled:!0};function n(...e){return 0===e.length?t:n.log(...e)}n.filter=function(r){return void 0!==r&&(n.filter.enable(),t.filter=Array.isArray(r)?r:[r],e("log",t)),t.filter},n.filter.add=function(e){const r=Array.isArray(e)?e:[e];return n.filter([...new Set([...t.filter,...r])])},n.filter.disable=function(){t.filterEnabled=!1,e("log",t)},n.filter.enable=function(){t.filterEnabled=!0,e("log",t)},n.filter.remove=function(e){const r=Array.isArray(e)?e:[e];return n.filter(t.filter.filter(e=>!r.includes(e)))},n.log=function(...e){if(!t.filterEnabled||t.filter.includes(e[0])){const t=new Date,n=`${t.toTimeString().split(" ")[0]}.${t.getMilliseconds().toString().padStart(3,"0")}`;return e.unshift(n),window.console&&window.console.log&&window.console.log(...e),e.join(" ")}}}();var Function={cache:cache,debounce:debounce,sequence:sequence,throttle:throttle,bind:bind,identity:identity,noop:noop,once:once,constant:constant,compose:compose,pipe:pipe,memoize:memoize,partial:partial},FunctionUtils=Object.freeze({__proto__:null,bind:bind,cache:cache,compose:compose,constant:constant,debounce:debounce,default:Function,identity:identity,memoize:memoize,noop:noop,once:once,partial:partial,pipe:pipe,sequence:sequence,throttle:throttle});function applyPolyfills(){Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),Array.prototype.forEach||(Array.prototype.forEach=function(e,t){var n,r;if(null==this)throw new TypeError("this is null or not defined");var a=Object(this),o=a.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),r=0;r<o;){var i;r in a&&(i=a[r],e.call(n,i,r,a)),r++}}),Array.prototype.map||(Array.prototype.map=function(e,t){var n,r,a;if(null==this)throw new TypeError("this is null or not defined");var o=Object(this),i=o.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),r=new Array(i),a=0;a<i;){var s,u;a in o&&(s=o[a],u=e.call(n,s,a,o),r[a]=u),a++}return r}),Array.prototype.filter||(Array.prototype.filter=function(e){if(null==this)throw new TypeError;var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var r=[],a=arguments.length>=2?arguments[1]:void 0,o=0;o<n;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&r.push(i)}return r}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),a=r.length>>>0;if(0===a)return-1;var o=+t||0;if(Math.abs(o)===1/0&&(o=0),o>=a)return-1;for(n=Math.max(o>=0?o:a-Math.abs(o),0);n<a;){if(n in r&&r[n]===e)return n;n++}return-1}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),Date.now||(Date.now=function(){return(new Date).getTime()}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),"undefined"==typeof JSON&&(window.JSON={parse:function(str){return eval("("+str+")")},stringify:function(e){var t=typeof e;if("object"!==t||null===e)return"string"===t&&(e='"'+e+'"'),String(e);var n,r,a=[],o=e&&e.constructor===Array;for(n in e)"string"===(t=typeof(r=e[n]))?r='"'+r+'"':"object"===t&&null!==r&&(r=JSON.stringify(r)),a.push((o?"":'"'+n+'":')+String(r));return(o?"[":"{")+String(a)+(o?"]":"}")}})}function clone(e,t){var n=typeOf(e);if(!1===t||"object"!==n&&"array"!==n)return e;if("array"===n)return e.map(function(e){return clone(e,t)});var r={};return forEach(e,function(e,n){r[n]=!1!==t&&(isObject(e)||isArray(e))?clone(e,t):e}),r}function contains(e,t){return Object.keys(e).some(function(n){return e[n]===t})}function except(e,t){var n={};return Object.keys(e).forEach(function(r){-1===t.indexOf(r)&&(n[r]=e[r])}),n}function keyOf(e,t){var n;return forEach(e,function(e,r){if(e===t)return n=r,!1}),n}function keys(e){return Object.keys(e)}function mapObject(e,t){var n={};return forEach(e,function(r,a){n[a]=t(r,a,e)}),n}function merge(){for(var e=arguments[0],t=1;t<arguments.length;t++)forEach(arguments[t],function(t,n){e[n]=t});return e}function only(e,t){var n={};return t.forEach(function(t){t in e&&(n[t]=e[t])}),n}function serialize(e){var t=[];return forEach(e,function(e,n){isUndefined(e)||t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}),t.join("&")}function unserialize(e){var t={};return e.split("&").forEach(function(e){var n=e.split("=");n[0]&&(t[decodeURIComponent(n[0])]=n[1]?decodeURIComponent(n[1]):"")}),t}function values(e){return Object.keys(e).map(function(t){return e[t]})}function getset(e,t,n){return function(){var r,a=Array.prototype.slice.call(arguments);return 0===a.length?r=e:1===a.length&&"string"==typeof a[0]?r=e[a[0]]:(forEach(a=makeObject(a),function(t,n){e[n]=t}),t&&t.call(n||null,a),r=this),r}}function isEmpty(e){return 0===Object.keys(e).length}function makeObject(e){var t={};return isObject(e[0])?t=e[0]:2===e.length?t[e[0]]=e[1]:isArray(e[0])&&e[0].forEach(function(n){t[n]=e[1]}),t}var Object$1={clone:clone,contains:contains,except:except,keyOf:keyOf,keys:keys,mapObject:mapObject,merge:merge,only:only,serialize:serialize,unserialize:unserialize,values:values,getset:getset,isEmpty:isEmpty,makeObject:makeObject},ObjectUtils=Object.freeze({__proto__:null,clone:clone,contains:contains,default:Object$1,except:except,getset:getset,isEmpty:isEmpty,keyOf:keyOf,keys:keys,makeObject:makeObject,mapObject:mapObject,merge:merge,only:only,serialize:serialize,unserialize:unserialize,values:values});const E=Math.E,LN2=Math.LN2,LN10=Math.LN10,LOG2E=Math.LOG2E,LOG10E=Math.LOG10E,PI=Math.PI,SQRT1_2=Math.SQRT1_2,SQRT2=Math.SQRT2,EARTH_RADIUS=6371e3,MAX_LATITUDE=85.05112878,MIN_LATITUDE=-85.05112878,BASE_32_ALIASES={I:"1",L:"1",O:"0",U:"V"},BASE_32_DIGITS="0123456789ABCDEFGHJKMNPQRSTVWXYZ",SECONDS_PER_MINUTE=60,SECONDS_PER_HOUR=3600,SECONDS_PER_DAY=86400,SECONDS_PER_WEEK=604800,SECONDS_PER_YEAR=31536e3,MILLISECONDS_PER_SECOND=1e3,MILLISECONDS_PER_MINUTE=6e4,MILLISECONDS_PER_HOUR=36e5,MILLISECONDS_PER_DAY=864e5,MILLISECONDS_PER_WEEK=6048e5,MONTHS$1=["January","February","March","April","May","June","July","August","September","October","November","December"],MONTHS_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],WEEKDAYS$1=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],WEEKDAYS_SHORT=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],COLORS={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},HTTP_STATUS={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};var Constants={E:E,LN2:LN2,LN10:LN10,LOG2E:LOG2E,LOG10E:LOG10E,PI:PI,SQRT1_2:SQRT1_2,SQRT2:SQRT2,EARTH_RADIUS:EARTH_RADIUS,MAX_LATITUDE:MAX_LATITUDE,MIN_LATITUDE:MIN_LATITUDE,BASE_32_ALIASES:BASE_32_ALIASES,BASE_32_DIGITS:BASE_32_DIGITS,SECONDS_PER_MINUTE:SECONDS_PER_MINUTE,SECONDS_PER_HOUR:SECONDS_PER_HOUR,SECONDS_PER_DAY:SECONDS_PER_DAY,SECONDS_PER_WEEK:SECONDS_PER_WEEK,SECONDS_PER_YEAR:SECONDS_PER_YEAR,MILLISECONDS_PER_SECOND:MILLISECONDS_PER_SECOND,MILLISECONDS_PER_MINUTE:MILLISECONDS_PER_MINUTE,MILLISECONDS_PER_HOUR:MILLISECONDS_PER_HOUR,MILLISECONDS_PER_DAY:MILLISECONDS_PER_DAY,MILLISECONDS_PER_WEEK:MILLISECONDS_PER_WEEK,MONTHS:MONTHS$1,MONTHS_SHORT:MONTHS_SHORT,WEEKDAYS:WEEKDAYS$1,WEEKDAYS_SHORT:WEEKDAYS_SHORT,COLORS:COLORS,HTTP_STATUS:HTTP_STATUS},Constants$1=Object.freeze({__proto__:null,BASE_32_ALIASES:BASE_32_ALIASES,BASE_32_DIGITS:BASE_32_DIGITS,COLORS:COLORS,E:E,EARTH_RADIUS:EARTH_RADIUS,HTTP_STATUS:HTTP_STATUS,LN10:LN10,LN2:LN2,LOG10E:LOG10E,LOG2E:LOG2E,MAX_LATITUDE:MAX_LATITUDE,MILLISECONDS_PER_DAY:MILLISECONDS_PER_DAY,MILLISECONDS_PER_HOUR:MILLISECONDS_PER_HOUR,MILLISECONDS_PER_MINUTE:MILLISECONDS_PER_MINUTE,MILLISECONDS_PER_SECOND:MILLISECONDS_PER_SECOND,MILLISECONDS_PER_WEEK:MILLISECONDS_PER_WEEK,MIN_LATITUDE:MIN_LATITUDE,MONTHS:MONTHS$1,MONTHS_SHORT:MONTHS_SHORT,PI:PI,SECONDS_PER_DAY:SECONDS_PER_DAY,SECONDS_PER_HOUR:SECONDS_PER_HOUR,SECONDS_PER_MINUTE:SECONDS_PER_MINUTE,SECONDS_PER_WEEK:SECONDS_PER_WEEK,SECONDS_PER_YEAR:SECONDS_PER_YEAR,SQRT1_2:SQRT1_2,SQRT2:SQRT2,WEEKDAYS:WEEKDAYS$1,WEEKDAYS_SHORT:WEEKDAYS_SHORT,default:Constants});function acosh(e){return Math.log(e+Math.sqrt(e*e-1))}function asinh(e){return Math.log(e+Math.sqrt(e*e+1))}function atanh(e){return.5*Math.log((1+e)/(1-e))}function cosh(e){return(Math.exp(e)+Math.exp(-e))/2}function deg(e){return 180*e/Math.PI}function divmod(e,t){var n=Math.floor(e/t);return[n,e-n*t]}function limit(e,t,n){return Math.min(Math.max(e,t),n)}function log(e,t){return Math.log(e)/Math.log(t||Math.E)}function mod(e,t){var n=e%t;return n>=0?n:n+t}function rad(e){return e*Math.PI/180}function random(e,t){return 0===arguments.length?Math.random():1===arguments.length?Math.floor(Math.random()*e):e+Math.floor(Math.random()*(t-e))}function round(e,t){var n=Math.pow(10,t||0);return Math.round(e*n)/n}function sign(e){return e>0?1:e<0?-1:0}function sinh(e){return(Math.exp(e)-Math.exp(-e))/2}function sum$1(e){return e.reduce(function(e,t){return e+(isNumber(t)?t:0)},0)}function tanh(e){return sinh(e)/cosh(e)}function getBearing(e,t){var n=rad(e.lat),r=rad(t.lat),a=rad(e.lng),o=rad(t.lng),i=Math.sin(o-a)*Math.cos(r),s=Math.cos(n)*Math.sin(r)-Math.sin(n)*Math.cos(r)*Math.cos(o-a);return(deg(Math.atan2(i,s))+360)%360}function getCenter(e){var t=0,n=0;return e.forEach(function(e){t+=e.lat,n+=e.lng}),{lat:t/e.length,lng:n/e.length}}function getCircle(e,t,n){var r=360/(n=n||36);return Array.from({length:n},function(n,a){return getPoint(e,r*a,t)})}function getDistance(e,t){var n=rad(e.lat),r=rad(t.lat),a=rad(t.lat-e.lat),o=rad(t.lng-e.lng),i=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2);return 6371e3*(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)))}function getPoint(e,t,n){var r=rad(e.lat),a=rad(e.lng);t=rad(t),n/=6371e3;var o=Math.asin(Math.sin(r)*Math.cos(n)+Math.cos(r)*Math.sin(n)*Math.cos(t)),i=a+Math.atan2(Math.sin(t)*Math.sin(n)*Math.cos(r),Math.cos(n)-Math.sin(r)*Math.sin(o));return{lat:deg(o),lng:deg(i)}}var Math$1={acosh:acosh,asinh:asinh,atanh:atanh,cosh:cosh,deg:deg,divmod:divmod,limit:limit,log:log,mod:mod,rad:rad,random:random,round:round,sign:sign,sinh:sinh,sum:sum$1,tanh:tanh,getBearing:getBearing,getCenter:getCenter,getCircle:getCircle,getDistance:getDistance,getPoint:getPoint},MathUtils=Object.freeze({__proto__:null,acosh:acosh,asinh:asinh,atanh:atanh,cosh:cosh,default:Math$1,deg:deg,divmod:divmod,getBearing:getBearing,getCenter:getCenter,getCircle:getCircle,getDistance:getDistance,getPoint:getPoint,limit:limit,log:log,mod:mod,rad:rad,random:random,round:round,sign:sign,sinh:sinh,sum:sum$1,tanh:tanh});function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function clean(e){return e.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")}function endsWith$1(e,t){return e.slice(-t.length)===t}function format(e,...t){return e.replace(/\{(\d+)\}/g,function(e,n){return isUndefined(t[n])?e:t[n]})}function isValidEmail(e){return/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(e)}function lowercase(e){return e.toLowerCase()}function pad$1(e,t,n,r){e=String(e),n=n||" ",r=r||"left";var a=Math.max(0,t-e.length),o=repeat(n,Math.ceil(a/n.length)).slice(0,a);return"left"===r||"both"===r?o+e:e+o}function parsePath$1(e){var t=/^(.+\/)?(.+?)(\.[^.]+)?$/.exec(e)||[];return{pathname:e,dirname:t[1]||"",filename:t[2]||"",extension:t[3]?t[3].slice(1):""}}function parseURL(e){var t=/^(?:(https?:)\/\/)?([\w.-]+)(:\d+)?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/.exec(e)||[];return{protocol:t[1]||"",hostname:t[2]||"",port:t[3]?t[3].slice(1):"",pathname:t[4]||"/",search:t[5]||"",hash:t[6]||""}}function removeHTML(e){return e.replace(/<[^>]*>/g,"")}function repeat(e,t){return new Array(t+1).join(e)}function reverse(e){return e.split("").reverse().join("")}function startsWith$1(e,t){return e.slice(0,t.length)===t}function stripTags$1(e){return e.replace(/<[^>]+>/g,"")}function toCamelCase(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function toDashes(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()})}function toNumber(e){return+e}function toTitleCase(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})}function toUnderscores(e){return e.replace(/[A-Z]/g,function(e){return"_"+e.toLowerCase()})}function truncate(e,t,n,r){if(n=n||"...",r=r||"right",e.length<=t)return e;if(t=Math.max(t-n.length,0),"left"===r)return n+e.slice(-t);if("center"===r){var a=Math.ceil(t/2),o=Math.floor(t/2);return e.slice(0,a)+n+e.slice(-o)}return e.slice(0,t)+n}function uppercase(e){return e.toUpperCase()}function words(e){return e.split(/\s+/).filter(function(e){return e.length>0})}function wordwrap(e,t,n,r){t=t||80,n=n||"\n";var a=[],o=e.split(" "),i="";return o.forEach(function(e){i&&(i+" "+e).length>t?(a.push(i),i=e):i=i?i+" "+e:e}),i&&a.push(i),a.join(n)}const char=String.fromCharCode;function splice(e,t,n){const r=e.split("");return Array.prototype.splice.apply(r,slice(arguments,1)),r.join("")}var String$1={capitalize:capitalize,clean:clean,endsWith:endsWith$1,format:format,isValidEmail:isValidEmail,lowercase:lowercase,pad:pad$1,parsePath:parsePath$1,parseURL:parseURL,removeHTML:removeHTML,repeat:repeat,reverse:reverse,startsWith:startsWith$1,stripTags:stripTags$1,toCamelCase:toCamelCase,toDashes:toDashes,toNumber:toNumber,toTitleCase:toTitleCase,toUnderscores:toUnderscores,truncate:truncate,uppercase:uppercase,words:words,wordwrap:wordwrap,char:char,splice:splice},StringUtils=Object.freeze({__proto__:null,capitalize:capitalize,char:char,clean:clean,default:String$1,endsWith:endsWith$1,format:format,isValidEmail:isValidEmail,lowercase:lowercase,pad:pad$1,parsePath:parsePath$1,parseURL:parseURL,removeHTML:removeHTML,repeat:repeat,reverse:reverse,splice:splice,startsWith:startsWith$1,stripTags:stripTags$1,toCamelCase:toCamelCase,toDashes:toDashes,toNumber:toNumber,toTitleCase:toTitleCase,toUnderscores:toUnderscores,truncate:truncate,uppercase:uppercase,words:words,wordwrap:wordwrap});function api(e,t){var n,r,a={cache:(t=t||{}).cache,enums:t.enums?(n=t.enums,r={},forEach(n,function(e,t){r[t]=e}),r):{},geo:t.geo,map:t.map||{},sort:t.sort||[],sums:t.sums||[],unique:t.unique||"id"},o=function(t,n){var r,o,s,c={},l={data:{},status:{code:200,text:"ok"}};return(t=t||{}).query?(t.query.conditions=i(t.query.conditions),l.data.items=e.filter(function(e){return u(e,t.query)})):l.data.items=clone(e),t.sort&&l.data.items.length>1&&(o=[],t.sort=(s=t.sort.concat(a.sort),s.map(function(e){return isString(e)?{key:e.slice(1),operator:"+"==e[0]?"+":"-"}:e})).filter(function(e){var t=-1==o.indexOf(e.key);return t&&o.push(e.key),t}),t.sort.forEach(function(e){var t=e.key;a.enums[t]?c[t]=function(e){return a.enums[t].indexOf(e)}:a.map[t]&&(c[t]=a.map[t])}),l.data.items=sortBy$1(l.data.items,t.sort,c)),t.positions?(r={},t.positions.forEach(function(e){r[e]=getIndex(l.data.items,a.unique,e)}),l.data={positions:r}):t.keys?(isUndefined(t.range)||(l.data.items=l.data.items.slice(t.range[0],t.range[1])),t.keys&&(l.data.items=l.data.items.map(function(e){var n={};return t.keys.forEach(function(t){n[t]=e[t]}),n})),l.data={items:l.data.items}):(r={},a.sums.forEach(function(e){r[e]=sum(l.data.items,e)}),l.data=extend(r,{items:l.data.items.length})),n&&n(l),l};function i(e){return e.map(function(e){var t=extend({},e);return t.conditions?t.conditions=i(t.conditions):t.value=isArray(t.value)?t.value.map(s):s(t.value),t})}function s(e){return isString(e)?e.toLowerCase():e}function u(e,t){var n="&"==t.operator;return forEach(t.conditions,function(r){var a=r.conditions?u(e,r):function(e,t){var n=t.key,r=t.operator.replace(/^!/,""),a=t.value,o=map[n]?map[n](e[n],e):e[n],i={"=":function(e,t){return isArray(t)?t.indexOf(e)>-1:isString(e)?e.toLowerCase().indexOf(t)>-1:e===t},"==":function(e,t){return isArray(t)?t.indexOf(e)>-1:e===t},"<":function(e,t){return isString(e)?-1==e.toLowerCase().localeCompare(t):e<t},"<=":function(e,t){return isString(e)?e.toLowerCase().localeCompare(t)<1:e<=t},">":function(e,t){return isString(e)?1==e.toLowerCase().localeCompare(t):e>t},">=":function(e,t){return isString(e)?e.toLowerCase().localeCompare(t)>-1:e>=t},"^":function(e,t){return isArray(t)?t.some(function(t){return startsWith(e,t)}):startsWith(e,t)},$:function(e,t){return isArray(t)?t.some(function(t){return endsWith(e,t)}):endsWith(e,t)}}[r](o,a);return"!"==t.operator[0]?!i:i}(e,r);return a&&"|"==t.operator?(n=!0,!1):a||"&"!=t.operator?void 0:(n=!1,!1)}),n}return o.enums=a.enums,o.map=a.map,o.sort=a.sort,o.sums=a.sums,a.cache&&(o=cache(o,{async:!0})),o}function compact(e){return filter(e,function(e){return null!=e})}function count(e,t){return filter(e,t||identity).length}function sort(e,t){var n=getSortValues(t?e.map(t):e);return e.sort(function(e,r){return e=t?t(e):e,r=t?t(r):r,n[e]<n[r]?-1:n[e]>n[r]?1:0})}function unique(e,t){var n=[];return e.length&&(t?e.forEach(function(e){var r=t(e);n.some(function(e){return t(e)===r})||n.push(e)}):n=e.filter(function(t,n){return e.indexOf(t)==n})),n}function zip(){var e=Array.prototype.slice.call(arguments);return e[0].map(function(t,n){return e.map(function(e){return e[n]})})}function startsWith(e,t){return isString(e)&&0===e.toLowerCase().indexOf(t)}function endsWith(e,t){return isString(e)&&e.toLowerCase().indexOf(t)===e.length-t.length}function getIndex(e,t,n){var r=-1;return e.some(function(e,a){if(e[t]===n)return r=a,!0}),r}function sum(e,t){return e.reduce(function(e,n){return e+(n[t]||0)},0)}function sortBy$1(e,t,n){var r={};return(t=t||[]).forEach(function(t){var a=t.key,o=n&&n[a]?n[a]:identity;r[a]={},e.forEach(function(e){var t=o(e[a],e);r[a][t]||(r[a][t]=getSortValue(isString(t)?t.toLowerCase():t))})}),e.sort(function(e,a){var o=0;return t.some(function(t){var i=t.key,s=n&&n[i]?n[i]:identity,u=s(e[i],e),c=s(a[i],a),l=r[i][u],f=r[i][c];return l<f?o="+"==t.operator?-1:1:l>f&&(o="+"==t.operator?1:-1),0!==o}),o})}function getSortValue(e){var t=e;return isString(e)&&(t=e.toLowerCase().replace(/^\W+/,"").replace(/\d+/g,function(e){return e.padStart(16,"0")})),t}function getSortValues(e){var t={};return e.forEach(function(e){t[e]||(t[e]=getSortValue(e))}),t}function last$1(e,t){var n;return 1==arguments.length?n=e[e.length-1]:(e[e.length-1]=t,n=e),n}function makeArray(e){var t=typeOf(e);return"arguments"==t||"nodelist"==t?slice(e):"array"==t?e:[e]}function range(){var e=[];return loop.apply(null,slice(arguments).concat(function(t){e.push(t)})),e}var Array$1={api:api,compact:compact,count:count,sort:sort,unique:unique,zip:zip,last:last$1,makeArray:makeArray,range:range,slice:slice,max:max,min:min,forEach:forEach,len:len,map:map,filter:filter,values:values,keyOf:keyOf,isEmpty:isEmpty,contains:contains,random:random,char:char,splice:splice,clean:clean,repeat:repeat,loop:loop},ArrayUtils=Object.freeze({__proto__:null,api:api,char:char,clean:clean,compact:compact,contains:contains,count:count,default:Array$1,filter:filter,forEach:forEach,isEmpty:isEmpty,keyOf:keyOf,last:last$1,len:len,loop:loop,makeArray:makeArray,map:map,max:max,min:min,random:random,range:range,repeat:repeat,slice:slice,sort:sort,splice:splice,unique:unique,values:values,zip:zip});function getDayName(e,t){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][getDayOfWeek(e,t)]}function getDayOfWeek(e,t){return e=makeDate(e),t?e.getUTCDay():e.getDay()}function getDayOfYear(e,t){const n=(e=makeDate(e))-new Date(Date.UTC(getFullYear(e,t),0,1));return Math.floor(n/864e5)+1}function getDaysInMonth(e,t){return new Date(e,t+1,0).getDate()}function getDaysInYear(e){return isLeapYear(e)?366:365}function getFirstDayOfWeek(e,t){const n=getDayOfWeek(e=makeDate(e),t);return new Date(e.getTime()-864e5*n)}function getFullYear(e,t){return e=makeDate(e),t?e.getUTCFullYear():e.getFullYear()}function getHours(e,t){return e=makeDate(e),t?e.getUTCHours():e.getHours()}function getISODate(e,t){return formatDate$1(e,"%Y-%m-%d",t)}function getISOWeek(e,t){const n=getFullYear(e=makeDate(e),t),r=getFirstThursday(n,t),a=Math.floor((e-r)/6048e5)+1;if(a<1)return getISOWeek(new Date(n-1,11,31),t);if(a>52){if(e>=getFirstThursday(n+1,t))return 1}return a}function getISOYear(e,t){const n=getFullYear(e=makeDate(e),t),r=getISOWeek(e,t);return 1===r&&11===getMonth(e,t)?n+1:r>=52&&0===getMonth(e,t)?n-1:n}function getMinutes(e,t){return e=makeDate(e),t?e.getUTCMinutes():e.getMinutes()}function getMonth(e,t){return e=makeDate(e),t?e.getUTCMonth():e.getMonth()}function getMonthName(e,t){return["January","February","March","April","May","June","July","August","September","October","November","December"][getMonth(e,t)]}function getSeconds(e,t){return e=makeDate(e),t?e.getUTCSeconds():e.getSeconds()}function getMilliseconds(e,t){return e=makeDate(e),t?e.getUTCMilliseconds():e.getMilliseconds()}function getTimezoneOffset(e){return makeDate(e).getTimezoneOffset()}function getTimezoneOffsetString(e){const t=getTimezoneOffset(e),n=t<=0?"+":"-",r=Math.floor(Math.abs(t)/60),a=Math.abs(t)%60;return n+pad(r,2)+":"+pad(a,2)}function getUnixTime(e){return Math.floor(makeDate(e).getTime()/1e3)}function getWeek(e,t){e=makeDate(e);const n=new Date(Date.UTC(getFullYear(e,t),0,1)),r=Math.floor((e-n)/864e5);return Math.ceil((r+getDayOfWeek(n,t)+1)/7)}function isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}function isValidDate(e){return e=makeDate(e),!isNaN(e.getTime())}function makeDate(e){return isDate(e)?e:isString(e)||isNumber(e)?new Date(e):isUndefined(e)?new Date:new Date(e)}function formatDate$1(e,t,n){e=makeDate(e);const r={"%a":()=>getDayName(e,n).substr(0,3),"%A":()=>getDayName(e,n),"%b":()=>getMonthName(e,n).substr(0,3),"%B":()=>getMonthName(e,n),"%c":()=>e.toLocaleString(),"%d":()=>pad(getDate(e,n),2),"%e":()=>pad(getDate(e,n),2," "),"%H":()=>pad(getHours(e,n),2),"%I":()=>pad((getHours(e,n)+11)%12+1,2),"%j":()=>pad(getDayOfYear(e,n),3),"%k":()=>pad(getHours(e,n),2," "),"%l":()=>pad((getHours(e,n)+11)%12+1,2," "),"%m":()=>pad(getMonth(e,n)+1,2),"%M":()=>pad(getMinutes(e,n),2),"%p":()=>getHours(e,n)<12?"AM":"PM","%S":()=>pad(getSeconds(e,n),2),"%u":()=>getDayOfWeek(e,n)||7,"%U":()=>pad(getWeek(e,n),2),"%V":()=>pad(getISOWeek(e,n),2),"%w":()=>getDayOfWeek(e,n),"%W":()=>pad(getWeek(e,n),2),"%x":()=>e.toLocaleDateString(),"%X":()=>e.toLocaleTimeString(),"%y":()=>pad(getFullYear(e,n)%100,2),"%Y":()=>getFullYear(e,n),"%z":()=>getTimezoneOffsetString(e),"%Z":()=>"","%%":()=>"%"};return(t=t||"%Y-%m-%d %H:%M:%S").replace(/%[a-zA-Z%]/g,e=>r[e]?r[e]():e)}function parseDate$1(e,t,n){return new Date(e)}function getDate(e,t){return e=makeDate(e),t?e.getUTCDate():e.getDate()}function getDay(e,t){return getDayOfWeek(e,t)}function getISODay(e,t){const n=getDayOfWeek(e,t);return 0===n?7:n}function getDayOfTheYear(e,t){return getDayOfYear(e,t)}function getFirstDayOfTheYear(e,t){const n=getFullYear(e=makeDate(e),t);return new Date(Date.UTC(n,0,1))}function setDate(e,t,n){return e=makeDate(e),n?e.setUTCDate(t):e.setDate(t),e}function setFullYear(e,t,n){return e=makeDate(e),n?e.setUTCFullYear(t):e.setFullYear(t),e}function setMonth(e,t,n){return e=makeDate(e),n?e.setUTCMonth(t):e.setMonth(t),e}function setHours(e,t,n){return e=makeDate(e),n?e.setUTCHours(t):e.setHours(t),e}function setMinutes(e,t,n){return e=makeDate(e),n?e.setUTCMinutes(t):e.setMinutes(t),e}function setSeconds(e,t,n){return e=makeDate(e),n?e.setUTCSeconds(t):e.setSeconds(t),e}function getFirstThursday(e,t){const n=new Date(Date.UTC(e,0,1)),r=(11-getDayOfWeek(n,t))%7;return new Date(n.getTime()+864e5*r)}function pad(e,t,n){n=n||"0";const r=String(e);return n.repeat(Math.max(0,t-r.length))+r}var Date$1={getDayName:getDayName,getDayOfWeek:getDayOfWeek,getDayOfYear:getDayOfYear,getDaysInMonth:getDaysInMonth,getDaysInYear:getDaysInYear,getFirstDayOfWeek:getFirstDayOfWeek,getFullYear:getFullYear,getHours:getHours,getISODate:getISODate,getISOWeek:getISOWeek,getISOYear:getISOYear,getMinutes:getMinutes,getMonth:getMonth,getMonthName:getMonthName,getSeconds:getSeconds,getMilliseconds:getMilliseconds,getTimezoneOffset:getTimezoneOffset,getTimezoneOffsetString:getTimezoneOffsetString,getUnixTime:getUnixTime,getWeek:getWeek,isLeapYear:isLeapYear,isValidDate:isValidDate,makeDate:makeDate,formatDate:formatDate$1,parseDate:parseDate$1,getDate:getDate,getDay:getDay,getISODay:getISODay,getDayOfTheYear:getDayOfTheYear,getFirstDayOfTheYear:getFirstDayOfTheYear,setDate:setDate,setFullYear:setFullYear,setMonth:setMonth,setHours:setHours,setMinutes:setMinutes,setSeconds:setSeconds},DateUtils=Object.freeze({__proto__:null,default:Date$1,formatDate:formatDate$1,getDate:getDate,getDay:getDay,getDayName:getDayName,getDayOfTheYear:getDayOfTheYear,getDayOfWeek:getDayOfWeek,getDayOfYear:getDayOfYear,getDaysInMonth:getDaysInMonth,getDaysInYear:getDaysInYear,getFirstDayOfTheYear:getFirstDayOfTheYear,getFirstDayOfWeek:getFirstDayOfWeek,getFullYear:getFullYear,getHours:getHours,getISODate:getISODate,getISODay:getISODay,getISOWeek:getISOWeek,getISOYear:getISOYear,getMilliseconds:getMilliseconds,getMinutes:getMinutes,getMonth:getMonth,getMonthName:getMonthName,getSeconds:getSeconds,getTimezoneOffset:getTimezoneOffset,getTimezoneOffsetString:getTimezoneOffsetString,getUnixTime:getUnixTime,getWeek:getWeek,isLeapYear:isLeapYear,isValidDate:isValidDate,makeDate:makeDate,parseDate:parseDate$1,setDate:setDate,setFullYear:setFullYear,setHours:setHours,setMinutes:setMinutes,setMonth:setMonth,setSeconds:setSeconds});function last(e){return e[e.length-1]}function sortBy(e,t){return e.slice().sort(function(e,n){var r=Array.isArray(t)?t.map(t=>e[t]):e[t],a=Array.isArray(t)?t.map(e=>n[e]):n[t];return r>a?1:r<a?-1:0})}const WEEKDAYS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],SHORT_WEEKDAYS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"],SHORT_MONTHS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],AMPM=["AM","PM"],BCAD=["BC","AD"],PREFIXES=["","k","M","G","T","P"];function formatArea(e,t){var n=e>=1e6?"k":"";return t=isUndefined(t)?8:t,formatNumber((n?e/1e6:e).toPrecision(t))+" "+n+"m²"}function formatCount(e,t,n){return n=(n||t+"s")+(2===e?"{2}":""),(0===e?_("no"):formatNumber(e))+" "+_(1===e?t:n)}function formatCurrency(e,t,n){return t+formatNumber(e,n)}var formatPatterns=[["%",function(){return"%{%}"}],["c",function(){return"%D %r"}],["D",function(){return"%m/%d/%y"}],["ED",function(){return"%ES %T"}],["Ed",function(){return"%ES %R"}],["EL",function(){return _("%A, %B %e, %Y")}],["El",function(){return _("%B %e, %Y")}],["EM",function(){return _("%a, %b %e, %Y")}],["Em",function(){return _("%b %e, %Y")}],["ES",function(){return _("%m/%d/%Y")}],["Es",function(){return _("%m/%d/%y")}],["ET",function(){return _("%I:%M:%S %p")}],["Et",function(){return _("%I:%M %p")}],["F",function(){return"%Y-%m-%d"}],["h",function(){return"%b"}],["R",function(){return"%H:%M"}],["r",function(){return"%I:%M:%S %p"}],["T",function(){return"%H:%M:%S"}],["v",function(){return"%e-%b-%Y"}],["\\+",function(){return"%a %b %e %H:%M:%S %Z %Y"}],["A",function(e,t){return _(WEEKDAYS[(getDay(e,t)+6)%7])}],["a",function(e,t){return _(SHORT_WEEKDAYS[(getDay(e,t)+6)%7])}],["B",function(e,t){return _(MONTHS[getMonth(e,t)])}],["b",function(e,t){return _(SHORT_MONTHS[getMonth(e,t)])}],["C",function(e,t){return Math.floor(getFullYear(e,t)/100).toString()}],["d",function(e,t){return pad$1(getDate(e,t),2)}],["e",function(e,t){return pad$1(getDate(e,t),2," ")}],["G",function(e,t){return getISOYear(e,t)}],["g",function(e,t){return getISOYear(e,t).toString().slice(-2)}],["H",function(e,t){return pad$1(getHours(e,t),2)}],["I",function(e,t){return pad$1((getHours(e,t)+11)%12+1,2)}],["j",function(e,t){return pad$1(getDayOfTheYear(e,t),3)}],["k",function(e,t){return pad$1(getHours(e,t),2," ")}],["l",function(e,t){return pad$1((getHours(e,t)+11)%12+1,2," ")}],["M",function(e,t){return pad$1(getMinutes(e,t),2)}],["m",function(e,t){return pad$1(getMonth(e,t)+1,2)}],["p",function(e,t){return _(AMPM[Math.floor(getHours(e,t)/12)])}],["Q",function(e,t){return Math.floor(getMonth(e,t)/4)+1}],["S",function(e,t){return pad$1(getSeconds(e,t),2)}],["s",function(e,t){return Math.floor((+e-(t?getTimezoneOffset(e):0))/1e3)}],["U",function(e,t){return pad$1(getWeek(e,t),2)}],["u",function(e,t){return getISODay(e,t)}],["V",function(e,t){return pad$1(getISOWeek(e,t),2)}],["W",function(e,t){return pad$1(Math.floor((getDayOfTheYear(e,t)+(getFirstDayOfTheYear(e,t)||7)-2)/7),2)}],["w",function(e,t){return getDay(e,t)}],["X",function(e,t){var n=getFullYear(e,t);return Math.abs(n)+" "+_(BCAD[n<0?0:1])}],["x",function(e,t){var n=getFullYear(e,t);return Math.abs(n)+(n<1e3?" "+_(BCAD[n<0?0:1]):"")}],["Y",function(e,t){return getFullYear(e,t)}],["y",function(e,t){return getFullYear(e,t).toString().slice(-2)}],["Z",function(e,t){return t?"UTC":(e.toString().split("(")[1]||"").replace(")","")}],["z",function(e,t){return t?"+0000":getTimezoneOffsetString(e)}],["n",function(){return"\n"}],["t",function(){return"\t"}],["\\{%\\}",function(){return"%"}]].map(function(e){return[new RegExp("%"+e[0],"g"),e[1]]});function formatDate(e,t,n){return""===e?"":(e=makeDate(e),formatPatterns.forEach(function(r){t=t.replace(r[0],function(){return r[1](e,n)})}),t)}function formatDateRange(e,t,n){t=t||formatDate(new Date,"%Y-%m-%d");var r,a=!1,o=[e,t],i=o.map(function(e){return parseDate(e)}),s=o.map(function(e){var t=compact(/(-?\d+)-?(\d+)?-?(\d+)? ?(\d+)?:?(\d+)?:?(\d+)?/.exec(e));return t.shift(),t.map(function(e){return parseInt(e,10)})}),u=s.map(function(e){return e.length}),c=s[0][0]<0?"%X":"%Y",l=[c,"%B "+c,"%a, %b %e, "+c,"%a, %b %e, "+c+", %H:%M","%a, %b %e, "+c+", %H:%M","%a, %b %e, "+c+", %H:%M:%S"];return u[0]==u[1]&&(a=!0,loop(u[0],function(e){if(e<u[0]-1&&s[0][e]!=s[1][e]||e==u[0]-1&&s[0][e]!=s[1][e]-1)return a=!1,!1})),a?r=[formatDate(i[0],l[u[0]-1],n)]:(r=[formatDate(i[0],l[u[0]-1],n),formatDate(i[1],l[u[1]-1],n)],s[0][0]==s[1][0]&&u[0]<=3&&u[1]<=3&&(r[0]=formatDate(i[0],l[u[0]-1].replace(new RegExp(",? "+c),""),n)),s[0][0]==s[1][0]&&s[0][1]==s[1][1]&&s[0][2]==s[1][2]&&(r[1]=r[1].split(", ").pop())),r.join(" - ").replace(/ /g," ")}function formatDateRangeDuration(e,t,n){t=t||formatDate(new Date,"%Y-%m-%d");var r=parseDate(e),a=[e,t].map(function(e){return parseDate(e)}),o=["year","month","day","hour","minute","second"],i=[];return r&&o.forEach(function(e,t){for(;;){if("month"==e){var o=getDate(r,n);setDate(r,Math.min(o,getDaysInMonth(getFullYear(r,n),getMonth(r,n)+2)),n)}if("year"==e?setFullYear(r,getFullYear(r,n)+1,n):"month"==e?setMonth(r,getMonth(r,n)+1,n):"day"==e?setDate(r,getDate(r,n)+1,n):"hour"==e?setHours(r,getHours(r,n)+1,n):"minute"==e?setMinutes(r,getMinutes(r,n)+1,n):"second"==e&&setSeconds(r,getSeconds(r,n)+1,n),!(r<=a[1])){"year"==e?setFullYear(r,getFullYear(r,n)-1,n):"month"==e?setMonth(r,getMonth(r,n)-1,n):"day"==e?setDate(r,getDate(r,n)-1,n):"hour"==e?setHours(r,getHours(r,n)-1,n):"minute"==e?setMinutes(r,getMinutes(r,n)-1,n):"second"==e&&setSeconds(r,getSeconds(r,n)-1,n),"month"==e&&setDate(r,o,n);break}i[t]=(i[t]||0)+1}}),filter(map(i,function(e,t){return e?e+" "+o[t]+(e>1?"s":""):""})).join(" ")}function formatDegrees(e,t){var n=0,r=e<0?"-":"",a=formatDuration(Math.round(3600*Math.abs(e))).split(":");return 4==a.length&&(n=parseInt(a.shift(),10)),a[0]=24*n+parseInt(a[0],10),(t?"":r)+a[0]+"°"+a[1]+"'"+a[2]+'"'+("lat"==t?e<0?"S":"N":"lng"==t?e<0?"W":"E":"")}function formatDimensions(e,t){return e.map(function(e){return formatNumber(e)}).join(" × ")+(t?" "+t:"")}const formatResolution=formatDimensions;function formatDuration(e){for(var t=last(arguments),n="short"==t||"long"==t?t:"none",r=isNumber(arguments[1])?arguments[1]:0,a=(e=round(Math.abs(e),r),[Math.floor(e/31536e3),Math.floor(e%31536e3/86400),Math.floor(e%86400/3600),Math.floor(e%3600/60),formatNumber(e%60,r)]),o="short"==n?["y","d","h","m","s"]:"long"==n?["year","day","hour","minute","second"]:[],i=[a[0].toString().length,a[0]?3:a[1].toString().length,2,2,r?r+3:2];!a[0]&&a.length>("none"==n?3:1);)a.shift(),o.shift(),i.shift();return filter(map(a,function(e,t){return"none"==n?pad$1(e,"left",i[t],"0"):(isNumber(e)?e:parseFloat(e))?e+("long"==n?" ":"")+_(o[t]+("long"==n?1==e?"":2==e?"s{2}":"s":"")):""})).join("none"==n?":":" ")}function formatISBN(e,t,n){var r="";function a(e){var t=10==e.length?11:10;return(mod(t-sum$1(e.slice(0,-1).split("").map(function(t,n){return 10==e.length?parseInt(t)*(10-n):parseInt(t)*(n%2==0?1:3)})),t)+"").replace("10","X")}return 10==(e=e.toUpperCase().replace(/[^\dX]/g,"")).length&&(e=e.slice(0,-1).replace(/\D/g,"")+e.slice(-1)),10!=e.length&&13!=e.length||e.slice(-1)!=a(e)||(e.length==t?r=e:10!=e.length&&"978"!=e.slice(0,3)||(r=(e=10==e.length?"978"+e:e.slice(3)).slice(0,-1)+a(e))),n?[r.slice(-13,-10),r.slice(-10,-9),r.slice(-9,-6),r.slice(-6,-1),r.slice(-1)].join("-").replace(/^-+/,""):r}function formatNumber(e,t){for(var n=[],r=Math.abs(e).toFixed(t).split(".");r[0];)n.unshift(r[0].slice(-3)),r[0]=r[0].slice(0,-3);return r[0]=n.join(_(",")),(e<0?"-":"")+r.join(_("."))}function formatOrdinal(e){var t=formatNumber(e),n=t.length,r=t[n-1],a=n>1&&"1"==t[n-2],o=n>1&&!a;return t+=_("1"!=r||a?"2"!=r||a?"3"!=r||a?"th"+(contains("123",r)&&a?"{1"+r+"}":""):"rd"+(o?"{23}":""):"nd"+(o?"{22}":""):"st"+(o?"{21}":""))}function formatPercent(e,t,n){return formatNumber(e/t*100,n)+_("%")}function formatRoman(e){var t="";return forEach({M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},function(n,r){for(;e>=n;)t+=r,e-=n}),t}function formatSRT(e){return"\ufeff"+sortBy(e,["in","out"]).map(function(e,t){return[t+1,["in","out"].map(function(t){return formatDuration(e[t],3).replace(".",",")}).join(" --\x3e "),e.text].join("\r\n")}).join("\r\n\r\n")+"\r\n\r\n"}function formatString(e,t,n){return e.replace(/\{([^}]+)\}/g,function(e,r){for(var a,o=r.replace(/\\\./g,"\n").split(".").map(function(e){return e.replace(/\n/g,".")}),i=t||{};o.length;){if(!i[a=o.shift()]){i=null;break}i=i[a]}return null!==i?i:n?"{"+r+"}":""})}function formatUnit(e,t,n){return formatNumber(e,n)+(/^[:%]/.test(t)?"":" ")+t}function formatValue(e,t,n){var r,a=n?1024:1e3,o=PREFIXES.length;return forEach(PREFIXES,function(i,s){if(e<Math.pow(a,s+1)||s==o-1)return r=formatNumber(e/Math.pow(a,s),s?s-1:0)+" "+i+(i&&n?"i":"")+t,!1}),r}function parseDate(e,t){return new Date(e)}var Format={formatArea:formatArea,formatCount:formatCount,formatCurrency:formatCurrency,formatDate:formatDate,parseDate:parseDate,formatDateRange:formatDateRange,formatDateRangeDuration:formatDateRangeDuration,formatDegrees:formatDegrees,formatDimensions:formatDimensions,formatResolution:formatResolution,formatDuration:formatDuration,formatISBN:formatISBN,formatNumber:formatNumber,formatOrdinal:formatOrdinal,formatPercent:formatPercent,formatRoman:formatRoman,formatSRT:formatSRT,formatString:formatString,formatUnit:formatUnit,formatValue:formatValue},FormatUtils=Object.freeze({__proto__:null,default:Format,formatArea:formatArea,formatCount:formatCount,formatCurrency:formatCurrency,formatDate:formatDate,formatDateRange:formatDateRange,formatDateRangeDuration:formatDateRangeDuration,formatDegrees:formatDegrees,formatDimensions:formatDimensions,formatDuration:formatDuration,formatISBN:formatISBN,formatNumber:formatNumber,formatOrdinal:formatOrdinal,formatPercent:formatPercent,formatResolution:formatResolution,formatRoman:formatRoman,formatSRT:formatSRT,formatString:formatString,formatUnit:formatUnit,formatValue:formatValue,parseDate:parseDate});function hsl(e){var t,n,r=[0,0,0];return 3==arguments.length&&(e=slice(arguments)),t=max(e=clone(e).map(function(e){return e/255})),n=min(e),r[2]=.5*(t+n),t==n?(r[0]=0,r[1]=0):(t==e[0]?r[0]=(60*(e[1]-e[2])/(t-n)+360)%360:t==e[1]?r[0]=60*(e[2]-e[0])/(t-n)+120:t==e[2]&&(r[0]=60*(e[0]-e[1])/(t-n)+240),r[2]<=.5?r[1]=(t-n)/(2*r[2]):r[1]=(t-n)/(2-2*r[2])),r}function rgb(e){var t,n,r,a=[0,0,0];return 3==arguments.length&&(e=slice(arguments)),(e=clone(e))[0]/=360,0==e[1]?a=[e[2],e[2],e[2]]:(n=e[2]<.5?e[2]*(1+e[1]):e[1]+e[2]-e[1]*e[2],t=2*e[2]-n,a.forEach(function(o,i){(r=e[0]+1*(1-i)/3)<0?r++:r>1&&r--,a[i]=r<1/6?t+6*(n-t)*r:r<.5?n:r<2/3?t+6*(n-t)*(2/3-r):t})),a.map(function(e){return Math.round(255*e)})}function toHex(e){return e.map(function(e){return pad$1(e.toString(16).toUpperCase(),"left",2,"0")}).join("")}function toRGB(e){return range(3).map(function(t){return parseInt(e.substr(2*t,2),16)})}var ColorUtils=Object.freeze({__proto__:null,hsl:hsl,rgb:rgb,toHex:toHex,toRGB:toRGB});function encodeBase26(e){for(var t="";e;)t=String.fromCharCode(65+(e-1)%26)+t,e=Math.floor((e-1)/26);return t}function decodeBase26(e){return e.toUpperCase().split("").reverse().reduce(function(e,t,n){return e+(t.charCodeAt(0)-64)*Math.pow(26,n)},0)}function encodeBase32(e){return map(e.toString(32),function(e){return BASE_32_DIGITS[parseInt(e,32)]})}function decodeBase32(e){return parseInt(map(e.toUpperCase(),function(e){var t=BASE_32_DIGITS.indexOf(BASE_32_ALIASES[e]||e);return-1==t?" ":t.toString(32)}),32)}function encodeBase64(e){return btoa(encodeBase256(e)).replace(/=/g,"")}function decodeBase64(e){return decodeBase256(atob(e))}function encodeBase128(e){for(var t="";e;)t=char(127&e)+t,e>>=7;return t}function decodeBase128(e){return e.split("").reverse().reduce(function(e,t,n){return e+(t.charCodeAt(0)<<7*n)},0)}function encodeBase256(e){for(var t="";e;)t=char(255&e)+t,e>>=8;return t}function decodeBase256(e){return e.split("").reverse().reduce(function(e,t,n){return e+(t.charCodeAt(0)<<8*n)},0)}function encodeDeflate(e,t){var n,r,a=1+(e=encodeUTF8(e)).length,o=canvas(Math.ceil(a/3),1),i=(3-a%3)%3;for(e=char(i)+e+repeat("ÿ",i),loop(o.data.length,function(t){o.data[t]=t%4<3?e.charCodeAt(t-parseInt(t/4)):255}),o.context.putImageData(o.imageData,0,0),n=(e=atob(o.canvas.toDataURL().split(",")[1])).slice(16,20)+e.slice(29,33),r=e.slice(33,-12);r;)n+=(a=r.slice(0,4))+r.slice(8,12+(a=decodeBase256(a))),r=r.slice(12+a);return t&&t(n),n}function decodeDeflate(e,t){var n,r=new Image,a="‰PNG\r\n\n\0\0\0\rIHDR"+e.slice(0,4)+"\0\0\0\b\0\0\0"+e.slice(4,8),o=e.slice(8);function i(){throw new RangeError("Deflate codec can't decode data.")}for(;o;)a+=(n=o.slice(0,4))+"IDAT"+o.slice(4,8+(n=decodeBase256(n))),o=o.slice(8+n);a+="\0\0\0\0IEND®B`‚",r.onload=function(){e=slice(canvas(r).data).map(function(e,t){return t%4<3?char(e):""}).join("");try{e=decodeUTF8(e.slice(1,-e.charCodeAt(0)||void 0))}catch(e){i()}t(e)},r.onerror=i,r.src="data:image/png;base64,"+btoa(a)}function decodeURICompat(e){return decodeURI(function e(t){return t.toString().replace(/%(?![0-9A-Fa-f]{2})/g,"%25").replace(/(%[0-9A-Fa-f]{2})+/g,function(t){var n,r=t.split("%").slice(1);try{n=decodeURI("%"+r.join("%"))}catch(e){}return n||"%25"+r[0]+e(t.slice(3))})}(e))}function decodeURIComponentCompat(e){return decodeURIComponent(function e(t){return t.toString().replace(/%(?![0-9A-Fa-f]{2})/g,"%25").replace(/(%[0-9A-Fa-f]{2})+/g,function(t){var n,r=t.split("%").slice(1);try{n=decodeURIComponent("%"+r.join("%"))}catch(e){}return n||"%25"+r[0]+e(t.slice(3))})}(e))}function encodeUTF8(e){return map(e,function(e){var t=e.charCodeAt(0);return t<128?e:t<2048?String.fromCharCode(t>>6|192)+String.fromCharCode(63&t|128):String.fromCharCode(t>>12|224)+String.fromCharCode(t>>6&63|128)+String.fromCharCode(63&t|128)})}function decodeUTF8(e){var t,n=0,r=e.length,a="";function o(e,t){throw new RangeError("UTF-8 codec can't decode byte 0x"+e.toString(16).toUpperCase()+" at position "+t)}for(;n<r;)(t=[e.charCodeAt(n),e.charCodeAt(n+1),e.charCodeAt(n+2)])[0]<128?(a+=e[n],n++):t[0]>=192&&t[0]<240&&n<r-(t[0]<224?1:2)?t[1]>=128&&t[1]<192?t[0]<224?(a+=String.fromCharCode((31&t[0])<<6|63&t[1]),n+=2):t[2]>=128&&t[2]<192?(a+=String.fromCharCode((15&t[0])<<12|(63&t[1])<<6|63&t[2]),n+=3):o(t[2],n+2):o(t[1],n+1):o(t[0],n);return a}function encodeEmailAddress$1(e,t){var n=["mailto:"+e,t||e].map(function(e){return map(e,function(e){var t=e.charCodeAt(0);return":"==e?":":"&#"+(Math.random()<.5?t:"x"+t.toString(16))+";"})});return'<a href="'+n[0]+'">'+n[1]+"</a>"}!function(){function e(t){return t.toString().replace(/%(?![0-9A-Fa-f]{2})/g,"%25").replace(/(%[0-9A-Fa-f]{2})+/g,function(t){var n,r=t.split("%").slice(1);return forEach(range(1,r.length+1),function(a){var o=range(a).map(function(e){return char(parseInt(r[e],16))}).join("");try{return decodeUTF8(o),n=t.slice(0,3*a)+e(t.slice(3*a)),!1}catch(e){}}),n||"%25"+r[0]+e(t.slice(3))})}decodeURIFn=function(t){return decodeURI(e(t))},decodeURIComponentFn=function(t){return decodeURIComponent(e(t))}}();var EncodingUtils=Object.freeze({__proto__:null,decodeBase128:decodeBase128,decodeBase256:decodeBase256,decodeBase26:decodeBase26,decodeBase32:decodeBase32,decodeBase64:decodeBase64,decodeDeflate:decodeDeflate,decodeURI:decodeURICompat,decodeURICompat:decodeURICompat,decodeURIComponent:decodeURIComponentCompat,decodeURIComponentCompat:decodeURIComponentCompat,decodeUTF8:decodeUTF8,encodeBase128:encodeBase128,encodeBase256:encodeBase256,encodeBase26:encodeBase26,encodeBase32:encodeBase32,encodeBase64:encodeBase64,encodeDeflate:encodeDeflate,encodeEmailAddress:encodeEmailAddress$1,encodeUTF8:encodeUTF8});function escapeRegExp(e){return(e+"").replace(/([\/\\^$*+?.\-|(){}[\]])/g,"\\$1")}var RegExpUtils=Object.freeze({__proto__:null,escapeRegExp:escapeRegExp}),defaultTags=[{name:"b"},{name:"bdi"},{name:"code"},{name:"em"},{name:"i"},{name:"q"},{name:"s"},{name:"span"},{name:"strong"},{name:"sub"},{name:"sup"},{name:"u"},{name:"blockquote"},{name:"cite"},{name:"div",optional:["style"],validate:{style:/^direction: rtl$/}},{name:"h1"},{name:"h2"},{name:"h3"},{name:"h4"},{name:"h5"},{name:"h6"},{name:"p"},{name:"pre"},{name:"li"},{name:"ol"},{name:"ul"},{name:"dl"},{name:"dt"},{name:"dd"},{name:"table"},{name:"tbody"},{name:"td"},{name:"tfoot"},{name:"th"},{name:"thead"},{name:"tr"},{name:"[]"},{name:"a",required:["href"],optional:["target"],validate:{href:/^((https?:\/\/|\/|mailto:).*?)/,target:/^_blank$/}},{name:"br"},{name:"iframe",optional:["width","height"],required:["src"],validate:{width:/^\d+$/,height:/^\d+$/,src:/^((https?:\/\/|\/).*?)/}},{name:"img",optional:["width","height"],required:["src"],validate:{width:/^\d+$/,height:/^\d+$/,src:/^((https?:\/\/|\/).*?)/}},{name:"figure"},{name:"figcaption"}],htmlEntities={'"':""","&":"&","'":"'","<":"<",">":">"},regexp={entity:/&[^\s]+?;/g,html:/[<&]/,tag:new RegExp("<\\/?("+["a","b","br","code","i","s","span","u"].join("|")+")\\/?>","gi")},salt=range(2).map(function(){return range(16).map(function(){return char(65+random(26))}).join("")});function addLinksInternal(e,t){return e.replace(/\b((https?:\/\/|www\.).+?)([.,:;!?)\]]*?(\s|$))/gi,function(e,t,n,r){return formatString('<a href="{prefix}{url}">{url}</a>{end}',{end:r,prefix:n="www."==n.toLowerCase()?"http://":"",url:t})}).replace(/\b([0-9A-Z.+\-_]+@(?:[0-9A-Z\-]+\.)+[A-Z]{2,6})\b/gi,'<a href="mailto:$1">$1</a>')}function decodeHTMLEntitiesInternal(e){return e.replace(new RegExp("("+values(htmlEntities).join("|")+")","g"),function(e){return keyOf(htmlEntities,e)}).replace(/&#([0-9A-FX]+);/gi,function(e,t){return char(/^X/i.test(t)?parseInt(t.slice(1),16):parseInt(t,10))})}function splitHTMLTags(e,t){var n=!1,r=[""];return t=t||[],forEach(e,function(e,a){n||"<"!=e||-1!=t.indexOf(a)||(n=!0,r.push("")),r[r.length-1]+=e,n&&">"==e&&(n=!1,r.push(""))}),r}function addLinks(e,t){var n=!1;return t?splitHTMLTags(e).map(function(e,t){var r=t%2;return r&&(/^<a/.test(e)?n=!0:/^<\/a/.test(e)&&(n=!1)),r||n?e:addLinksInternal(e)}).join(""):normalizeHTML(addLinksInternal(e))}function encodeEmailAddress(e,t){var n=["mailto:"+e,t||e].map(function(e){return map(e,function(e){var t=e.charCodeAt(0);return":"==e?":":"&#"+(Math.random()<.5?t:"x"+t.toString(16))+";"})});return'<a href="'+n[0]+'">'+n[1]+"</a>"}function encodeHTMLEntities(e,t){return map(String(e),function(e){var n=e.charCodeAt(0);return n<128?e=e in htmlEntities?htmlEntities[e]:e:t&&(e="&#x"+pad$1(n.toString(16).toUpperCase(),"left",4,"0")+";"),e})}function decodeHTMLEntities(e,t){return t?decodeHTMLEntities(normalizeHTML(e)):decodeHTMLEntitiesInternal(e)}function highlight(e,t,n,r){if(!t)return e;var a=0,o=[],i=[],s=0,u=isRegExp(t)?t:new RegExp(escapeRegExp(t),"gi"),c=['<span class="'+n+'">',"</span>"],l=[];function f(t){t.forEach(function(t){e=splice(e,t.position,t.length,t.value),i.forEach(function(e){t.position<e.position?e.position+=t.value.length-t.length:t.position<e.position+e.value.length&&(e.value=splice(e.value,t.position-e.position,t.length,t.value))})})}return r&®exp.html.test(e)?(splitHTMLTags(e=e.replace(regexp.tag,function(e,t,n){return l.push({length:0,position:n,value:e}),""}).replace(regexp.entity,function(e,t){var n=decodeHTMLEntitiesInternal(e);return o.push({length:n.length,position:t,value:e}),n}),o.map(function(e){var t=e.position+s;return s+=e.length-e.value.length,t})).forEach(function(e,t){t%2==0&&e.replace(u,function(e,t){i.push({position:a+t,value:e})}),a+=e.length}),f(o),f(l),i.reverse().forEach(function(t){e=splice(e,t.position,t.value.length,c.join(t.value))}),i.length&&l.length&&(e=normalizeHTML(e))):(e=encodeHTMLEntities(e.replace(u,function(e){return i.push(c.join(encodeHTMLEntities(e))),salt.join(i.length-1)})),i.forEach(function(t,n){e=e.replace(new RegExp(salt.join(n)),t)})),e}function normalizeHTML(e){if(!regexp.html.test(e))return e;if("undefined"!=typeof document){var t=document.createElement("div");return t.innerHTML=e,t.innerHTML}return e}function parseMarkdown(e){var t=[];return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/(?:^|\n)```(.*)\n([^`]+)\n```/g,function(e,n,r){return t.push("<pre><code"+(n?' class="'+n+'"':"")+">"+r.trim().replace(/</g,"<")+"\n</code></pre>"),salt.join(t.length-1)}).replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,n,r,a,o){return t.push(n+"<code>"+a.trim().replace(/</g,"<")+"</code>"),salt.join(t.length-1)}).replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>").replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>").replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,function(e,t,n,r,a,o,i,s){return'<a href="'+encodeHTMLEntities(a)+'"'+(s?' title="'+encodeHTMLEntities(s)+'"':"")+">"+n+"</a>"}).replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'<a href="$1">$1</a>').replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(e,t){return encodeEmailAddress(t)}).replace(/\n\n/g,"<br><br>").replace(new RegExp(salt.join("(\\d+)"),"g"),function(e,n){return t[parseInt(n)]})}function sanitizeHTML(e,t,n){n=n||[];var r={},a=0,o=["img","br"],i={},s={},u={},c=(t=t||defaultTags).map(function(e){return i[e.name]=n.concat(e.required||[]).concat(e.optional||[]),s[e.name]=e.required||[],u[e.name]=e.validate||{},e.name});return contains(c,"[]")&&(e=e.replace(/\[((\/|https?:\/\/|mailto:).+?) (.+?)\]/gi,'<a href="$1">$3</a>'),c=c.filter(function(e){return"[]"!=e})),normalizeHTML(e=(e=addLinks(e=splitHTMLTags(e).map(function(e,t){var n,l,f,p,d,g={},m=/([^=\ ]+)="([^"]+)"/g,h=!0;if(t%2&&(d=/<(\/)?([^\ \/]+)(.*?)(\/)?>/g.exec(e))){for(f=!isUndefined(d[1]),p=d[2],l=d[3].trim();n=m.exec(l);)i[p]&&contains(i[p],n[1])&&(g[n[1]]=n[2]);if(f||contains(o,p)||a++,!contains(c,p)||l.length&&isEmpty(g)?h=!1:!f&&s[p]&&s[p].forEach(function(e){isUndefined(g[e])&&(h=!1)}),h&&!isEmpty(g)&&forEach(g,function(e,t){if(!isUndefined(u[p][t])&&!u[p][t].exec(e))return h=!1,!1}),h&&f?h=!r[a]:r[a]=!h,f&&a--,h)return"<"+(f?"/":"")+p+(f||isEmpty(g)?"":" "+values(map(g,function(e,t){return t+'="'+e+'"'})).join(" "))+">"}return encodeHTMLEntities(decodeHTMLEntitiesInternal(e))}).join(""),!0)).replace(/\n\n/g,"<br/><br/>"))}function stripTags(e){return e.replace(/<.*?>/g,"")}var HTMLUtils=Object.freeze({__proto__:null,addLinks:addLinks,decodeHTMLEntities:decodeHTMLEntities,encodeEmailAddress:encodeEmailAddress,encodeHTMLEntities:encodeHTMLEntities,highlight:highlight,normalizeHTML:normalizeHTML,parseMarkdown:parseMarkdown,sanitizeHTML:sanitizeHTML,stripTags:stripTags});function asyncMap(e,t,n,r,a){var o=typeOf(t),i="object"==o?{}:[];a=last$1(arguments),e(t,function(e,t,r,a){n(e,t,r,function(e){i[t]=e,a()})},r=5==arguments.length?r:null,function(){a("string"==o?i.join(""):i)})}function asyncMapFn(e,t,n,r){e=makeArray(e),r=last$1(arguments),n=4==arguments.length?n:null,e.some(Array.isArray)?serialMap(e,function(e,n,r,a){parallelMap(makeArray(e),t,a)},r):parallelMap(e,t,r)}function nonblockingForEach(e,t,n,r,a){var o,i,s,u=0,c=last$1(arguments),l=typeOf(e);r=isFunction(c)?c:arguments[arguments.length-2],e="array"==l||"object"==l?e:slice(e),o="object"==l?Object.keys(e):range(e.length),a=a||1e3,i=len(e),n=5==arguments.length||4==arguments.length&&isFunction(c)?n:null,s=+new Date,function c(){forEach(o.slice(u),function(r){return r in e&&!1===t.call(n,e[r],r,e)?(u=i,!1):(u++,!(+new Date>=s+a)&&void 0)}),u<i?setTimeout(function(){s=+new Date,c()},1):r()}()}function nonblockingMap(e,t,n,r,a){var o=last$1(arguments),i=typeOf(e),s="object"==i?{}:[];r=isFunction(o)?o:arguments[arguments.length-2],n=5==arguments.length||4==arguments.length&&isFunction(o)?n:null,nonblockingForEach(e,function(e,r,a){s[r]=t.call(n,e,r,a)},function(){r("string"==i?s.join(""):s)},a)}function parallelForEach(e,t,n,r){var a,o=0,i=typeOf(e);r=r||(3==arguments.length?arguments[2]:function(){}),e="array"==i||"object"==i?e:slice(e),a=len(e),n=4==arguments.length?n:null,forEach(e,function(e,i,s){t.call(n,e,i,s,function(){++o==a&&r()})})}function parallelMap(){asyncMap.apply(null,[parallelForEach].concat(slice(arguments)))}function serialForEach(e,t,n,r){var a,o,i=0,s=typeOf(e);r=r||(3==arguments.length?arguments[2]:function(){}),e="array"==s||"object"==s?e:slice(e),a="object"==s?Object.keys(e):range(e.length),o=len(e),n=4==arguments.length?n:null,function s(u){!1!==u?a[i]in e?t.call(n,e[a[i]],a[i],e,++i<o?s:r):++i<o?s():r():r()}()}function serialMap(e,t,n,r){asyncMap.apply(null,[serialForEach].concat(slice(arguments)))}var AsyncUtils=Object.freeze({__proto__:null,asyncMapFn:asyncMapFn,nonblockingForEach:nonblockingForEach,nonblockingMap:nonblockingMap,parallelForEach:parallelForEach,parallelMap:parallelMap,serialForEach:serialForEach,serialMap:serialMap});function oshash(e,t){var n=function(e){var t,n,r,a=1,o=[0,0,0,0];for(r=0;r<e.length;r++){n=parseInt(e.charAt(r),10),t=0;do{for(;t<a;)n+=10*o[3-t],o[3-t++]=65535&n,n>>>=16;n&&a++}while(n)}return o}(e.size.toString());function r(e,t){var n,r,a,o;return o=e[3]+t[3],a=e[2]+t[2]+(o>>16),o&=65535,r=e[1]+t[1]+(a>>16),a&=65535,n=e[0]+t[0]+(r>>16),[n&=65535,r&=65535,a,o]}function a(e,t){return t=t||0,[e.charCodeAt(t+6)+(e.charCodeAt(t+7)<<8),e.charCodeAt(t+4)+(e.charCodeAt(t+5)<<8),e.charCodeAt(t+2)+(e.charCodeAt(t+3)<<8),e.charCodeAt(t+0)+(e.charCodeAt(t+1)<<8)]}!function o(i,s){var u,c=65536,l=new FileReader;l.onload=function(i){var u,l,f=i.target.result,p=f.length-8;for(u=0;u<=p;u+=8)n=r(n,a(f,u));e.size<c||s?t((pad$1((l=n)[0].toString(16),"left",4,"0")+pad$1(l[1].toString(16),"left",4,"0")+pad$1(l[2].toString(16),"left",4,"0")+pad$1(l[3].toString(16),"left",4,"0")).toLowerCase()):o(e.size-c,!0)},u=e.mozSlice?e.mozSlice(i,i+c):e.webkitSlice?e.webkitSlice(i,i+c):e.slice(i,i+c);l.readAsBinaryString(u)}(0)}function SHA1(e){function t(e,t){return e<<t|e>>>32-t}function n(e){var t,n="";for(t=7;t>=0;t--)n+=(e>>>4*t&15).toString(16);return n}var r,a,o,i,s,u,c,l,f,p=new Array(80),d=1732584193,g=4023233417,m=2562383102,h=271733878,y=3285377520,S=(e=encodeUTF8(e)).length,E=new Array;for(a=0;a<S-3;a+=4)o=e.charCodeAt(a)<<24|e.charCodeAt(a+1)<<16|e.charCodeAt(a+2)<<8|e.charCodeAt(a+3),E.push(o);switch(S%4){case 0:a=2147483648;break;case 1:a=e.charCodeAt(S-1)<<24|8388608;break;case 2:a=e.charCodeAt(S-2)<<24|e.charCodeAt(S-1)<<16|32768;break;case 3:a=e.charCodeAt(S-3)<<24|e.charCodeAt(S-2)<<16|e.charCodeAt(S-1)<<8|128}for(E.push(a);E.length%16!=14;)E.push(0);for(E.push(S>>>29),E.push(S<<3&4294967295),r=0;r<E.length;r+=16){for(a=0;a<16;a++)p[a]=E[r+a];for(a=16;a<=79;a++)p[a]=t(p[a-3]^p[a-8]^p[a-14]^p[a-16],1);for(i=d,s=g,u=m,c=h,l=y,a=0;a<=19;a++)f=t(i,5)+(s&u|~s&c)+l+p[a]+1518500249&4294967295,l=c,c=u,u=t(s,30),s=i,i=f;for(a=20;a<=39;a++)f=t(i,5)+(s^u^c)+l+p[a]+1859775393&4294967295,l=c,c=u,u=t(s,30),s=i,i=f;for(a=40;a<=59;a++)f=t(i,5)+(s&u|s&c|u&c)+l+p[a]+2400959708&4294967295,l=c,c=u,u=t(s,30),s=i,i=f;for(a=60;a<=79;a++)f=t(i,5)+(s^u^c)+l+p[a]+3395469782&4294967295,l=c,c=u,u=t(s,30),s=i,i=f;d=d+i&4294967295,g=g+s&4294967295,m=m+u&4294967295,h=h+c&4294967295,y=y+l&4294967295}return(f=n(d)+n(g)+n(m)+n(h)+n(y)).toLowerCase()}var HashUtils=Object.freeze({__proto__:null,SHA1:SHA1,oshash:oshash});function parseGeoname(){throw new Error("Geo.parseGeoname not yet migrated to ES modules")}var GeoUtils=Object.freeze({__proto__:null,parseGeoname:parseGeoname});function doc(){throw new Error("JavaScript.doc not yet migrated to ES modules")}function test(){throw new Error("JavaScript.test not yet migrated to ES modules")}function tokenize(){throw new Error("JavaScript.tokenize not yet migrated to ES modules")}var JavaScriptUtils=Object.freeze({__proto__:null,doc:doc,test:test,tokenize:tokenize});function parsePath(){throw new Error("Video.parsePath not yet migrated to ES modules")}var VideoUtils=Object.freeze({__proto__:null,parsePath:parsePath});const Ox=function(e){return wrap(e)};Object.assign(Ox,Core,FunctionUtils,ArrayUtils,StringUtils,TypeUtils,CollectionUtils,MathUtils,ObjectUtils,DateUtils,FormatUtils,ColorUtils,EncodingUtils,RegExpUtils,HTMLUtils,HashUtils,DOMUtils,RequestUtils,AsyncUtils,GeoUtils,JavaScriptUtils,VideoUtils,LocaleUtils,Constants$1),applyPolyfills(),Ox.VERSION="0.2.0",Ox.PATH="/",Ox.LOCALES={},"undefined"!=typeof window&&(window.Ox=Ox),exports.ArrayUtils=ArrayUtils,exports.AsyncUtils=AsyncUtils,exports.CollectionUtils=CollectionUtils,exports.ColorUtils=ColorUtils,exports.Constants=Constants$1,exports.DOMUtils=DOMUtils,exports.DateUtils=DateUtils,exports.EncodingUtils=EncodingUtils,exports.FormatUtils=FormatUtils,exports.GeoUtils=GeoUtils,exports.HTMLUtils=HTMLUtils,exports.HashUtils=HashUtils,exports.JavaScriptUtils=JavaScriptUtils,exports.LocaleUtils=LocaleUtils,exports.MathUtils=MathUtils,exports.ObjectUtils=ObjectUtils,exports.Ox=Ox,exports.RegExpUtils=RegExpUtils,exports.RequestUtils=RequestUtils,exports.StringUtils=StringUtils,exports.TypeUtils=TypeUtils,exports.VideoUtils=VideoUtils,exports.default=Ox,Object.defineProperty(exports,"__esModule",{value:!0})}); |