UNPKG

webgazer

Version:

WebGazer.js is an eye tracking library that uses common webcams to infer the eye-gaze locations of web visitors on a page in real time. The eye tracking model it contains self-calibrates by watching web visitors interact with the web page and trains a map

15 lines 1.7 MB
/*! * * WebGazer.js: Democratizing Webcam Eye Tracking on the Browser * Copyright (c) 2016, Brown WebGazer Team * Licensed under GPLv3. Companies with a valuation of less than $1M can use WebGazer.js under LGPLv3. * */ var webgazer;(()=>{var e={790:(e,t,n)=>{ /*! localForage -- Offline Storage, Improved Version 1.7.3 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */ e.exports=function e(t,n,s){function r(i,o){if(!n[i]){if(!t[i]){if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[i]={exports:{}};t[i][0].call(u.exports,(function(e){var n=t[i][1][e];return r(n||e)}),u,u.exports,e,t,n,s)}return n[i].exports}for(var a=void 0,i=0;i<s.length;i++)r(s[i]);return r}({1:[function(e,t,s){(function(e){"use strict";var n,s,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var a=0,i=new r(c),o=e.document.createTextNode("");i.observe(o,{characterData:!0}),n=function(){o.data=a=++a%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,n=function(){l.port2.postMessage(0)}}var u=[];function c(){var e,t;s=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}s=!1}function h(e){1!==u.push(e)||s||n()}t.exports=h}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var s=e(1);function r(){}var a={},i=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==r&&d(this,e)}function c(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(e,t,n){s((function(){var s;try{s=t(n)}catch(t){return a.reject(e,t)}s===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,s)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var n=!1;function s(t){n||(n=!0,a.reject(e,t))}function r(t){n||(n=!0,a.resolve(e,t))}function i(){t(r,s)}var o=f(i);"error"===o.status&&s(o.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function m(e){return e instanceof this?e:a.resolve(new this(r),e)}function g(e){var t=new this(r);return a.reject(t,e)}function y(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,s=!1;if(!n)return this.resolve([]);for(var i=new Array(n),o=0,l=-1,u=new this(r);++l<n;)c(e[l],l);return u;function c(e,r){function l(e){i[r]=e,++o!==n||s||(s=!0,a.resolve(u,i))}t.resolve(e).then(l,(function(e){s||(s=!0,a.reject(u,e))}))}}function b(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,s=!1;if(!n)return this.resolve([]);for(var i=-1,o=new this(r);++i<n;)l(e[i]);return o;function l(e){t.resolve(e).then((function(e){s||(s=!0,a.resolve(o,e))}),(function(e){s||(s=!0,a.reject(o,e))}))}}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===o||"function"!=typeof t&&this.state===i)return this;var n=new this.constructor(r);return this.state!==l?h(n,this.state===o?e:t,this.outcome):this.queue.push(new c(n,e,t)),n},c.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){a.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=f(p,t);if("error"===n.status)return a.reject(e,n.value);var s=n.value;if(s)d(e,s);else{e.state=o,e.outcome=t;for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callFulfilled(t)}return e},a.reject=function(e,t){e.state=i,e.outcome=t;for(var n=-1,s=e.queue.length;++n<s;)e.queue[n].callRejected(t);return e},u.resolve=m,u.reject=g,u.all=y,u.race=b},{1:1}],3:[function(e,t,s){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){"use strict";var s="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};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var i=a();function o(){try{if(!i)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(r){if("TypeError"!==r.name)throw r;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),s=0;s<e.length;s+=1)n.append(e[s]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var u=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function h(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function p(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",m=void 0,g={},y=Object.prototype.toString,b="readonly",x="readwrite";function w(e){for(var t=e.length,n=new ArrayBuffer(t),s=new Uint8Array(n),r=0;r<t;r++)s[r]=e.charCodeAt(r);return n}function v(e){return new u((function(t){var n=e.transaction(f,x),s=l([""]);n.objectStore(f).put(s,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function k(e){return"boolean"==typeof m?u.resolve(m):v(e).then((function(e){return m=e}))}function I(e){var t=g[e.name],n={};n.promise=new u((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function N(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function T(e,t){return new u((function(n,s){if(g[e.name]=g[e.name]||M(),e.db){if(!t)return n(e.db);I(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var a=i.open.apply(i,r);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(f)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),s(a.error)},a.onsuccess=function(){n(a.result),N(e)}}))}function C(e){return T(e,!1)}function $(e){return T(e,!0)}function E(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),s=e.version<e.db.version,r=e.version>e.db.version;if(s&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function R(e){return new u((function(t,n){var s=new FileReader;s.onerror=n,s.onloadend=function(n){var s=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:s,type:e.type})},s.readAsBinaryString(e)}))}function A(e){return l([w(atob(e.data))],{type:e.type})}function F(e){return e&&e.__local_forage_encoded_blob}function _(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return h(n,e,e),n}function D(e){I(e);for(var t=g[e.name],n=t.forages,s=0;s<n.length;s++){var r=n[s];r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null)}return e.db=null,C(e).then((function(t){return e.db=t,E(e)?$(e):t})).then((function(s){e.db=t.db=s;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=s})).catch((function(t){throw S(e,t),t}))}function O(e,t,n,s){void 0===s&&(s=1);try{var r=e.db.transaction(e.storeName,t);n(null,r)}catch(r){if(s>0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),$(e)})).then((function(){return D(e).then((function(){O(e,t,n,s-1)}))})).catch(n);n(r)}}function M(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(e){var t=this,n={db:null};if(e)for(var s in e)n[s]=e[s];var r=g[n.name];r||(r=M(),g[n.name]=r),r.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=_);var a=[];function i(){return u.resolve()}for(var o=0;o<r.forages.length;o++){var l=r.forages[o];l!==t&&a.push(l._initReady().catch(i))}var c=r.forages.slice(0);return u.all(a).then((function(){return n.db=r.db,C(n)})).then((function(e){return n.db=e,E(n,t._defaultConfig.version)?$(n):e})).then((function(e){n.db=r.db=e,t._dbInfo=n;for(var s=0;s<c.length;s++){var a=c[s];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}}))}function z(e,t){var n=this;e=p(e);var s=new u((function(t,s){n.ready().then((function(){O(n._dbInfo,b,(function(r,a){if(r)return s(r);try{var i=a.objectStore(n._dbInfo.storeName).get(e);i.onsuccess=function(){var e=i.result;void 0===e&&(e=null),F(e)&&(e=A(e)),t(e)},i.onerror=function(){s(i.error)}}catch(e){s(e)}}))})).catch(s)}));return c(s,t),s}function P(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){O(n._dbInfo,b,(function(r,a){if(r)return s(r);try{var i=a.objectStore(n._dbInfo.storeName).openCursor(),o=1;i.onsuccess=function(){var n=i.result;if(n){var s=n.value;F(s)&&(s=A(s));var r=e(s,n.key,o++);void 0!==r?t(r):n.continue()}else t()},i.onerror=function(){s(i.error)}}catch(e){s(e)}}))})).catch(s)}));return c(s,t),s}function B(e,t,n){var s=this;e=p(e);var r=new u((function(n,r){var a;s.ready().then((function(){return a=s._dbInfo,"[object Blob]"===y.call(t)?k(a.db).then((function(e){return e?t:R(t)})):t})).then((function(t){O(s._dbInfo,x,(function(a,i){if(a)return r(a);try{var o=i.objectStore(s._dbInfo.storeName);null===t&&(t=void 0);var l=o.put(t,e);i.oncomplete=function(){void 0===t&&(t=null),n(t)},i.onabort=i.onerror=function(){var e=l.error?l.error:l.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return c(r,n),r}function W(e,t){var n=this;e=p(e);var s=new u((function(t,s){n.ready().then((function(){O(n._dbInfo,x,(function(r,a){if(r)return s(r);try{var i=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){s(i.error)},a.onabort=function(){var e=i.error?i.error:i.transaction.error;s(e)}}catch(e){s(e)}}))})).catch(s)}));return c(s,t),s}function V(e){var t=this,n=new u((function(e,n){t.ready().then((function(){O(t._dbInfo,x,(function(s,r){if(s)return n(s);try{var a=r.objectStore(t._dbInfo.storeName).clear();r.oncomplete=function(){e()},r.onabort=r.onerror=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n}function U(e){var t=this,n=new u((function(e,n){t.ready().then((function(){O(t._dbInfo,b,(function(s,r){if(s)return n(s);try{var a=r.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n}function G(e,t){var n=this,s=new u((function(t,s){e<0?t(null):n.ready().then((function(){O(n._dbInfo,b,(function(r,a){if(r)return s(r);try{var i=a.objectStore(n._dbInfo.storeName),o=!1,l=i.openCursor();l.onsuccess=function(){var n=l.result;n?0===e||o?t(n.key):(o=!0,n.advance(e)):t(null)},l.onerror=function(){s(l.error)}}catch(e){s(e)}}))})).catch(s)}));return c(s,t),s}function H(e){var t=this,n=new u((function(e,n){t.ready().then((function(){O(t._dbInfo,b,(function(s,r){if(s)return n(s);try{var a=r.objectStore(t._dbInfo.storeName).openCursor(),i=[];a.onsuccess=function(){var t=a.result;t?(i.push(t.key),t.continue()):e(i)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n}function j(e,t){t=d.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var s,r=this;if(e.name){var a=e.name===n.name&&r._dbInfo.db?u.resolve(r._dbInfo.db):C(e).then((function(t){var n=g[e.name],s=n.forages;n.db=t;for(var r=0;r<s.length;r++)s[r]._dbInfo.db=t;return t}));s=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;I(e);var s=g[e.name],r=s.forages;t.close();for(var a=0;a<r.length;a++){var o=r[a];o._dbInfo.db=null,o._dbInfo.version=n}var l=new u((function(t,s){var r=i.open(e.name,n);r.onerror=function(e){r.result.close(),s(e)},r.onupgradeneeded=function(){r.result.deleteObjectStore(e.storeName)},r.onsuccess=function(){var e=r.result;e.close(),t(e)}}));return l.then((function(e){s.db=e;for(var t=0;t<r.length;t++){var n=r[t];n._dbInfo.db=e,N(n._dbInfo)}})).catch((function(t){throw(S(e,t)||u.resolve()).catch((function(){})),t}))}})):a.then((function(t){I(e);var n=g[e.name],s=n.forages;t.close();for(var r=0;r<s.length;r++)s[r]._dbInfo.db=null;var a=new u((function(t,n){var s=i.deleteDatabase(e.name);s.onerror=s.onblocked=function(e){var t=s.result;t&&t.close(),n(e)},s.onsuccess=function(){var e=s.result;e&&e.close(),t(e)}}));return a.then((function(e){n.db=e;for(var t=0;t<s.length;t++)N(s[t]._dbInfo)})).catch((function(t){throw(S(e,t)||u.resolve()).catch((function(){})),t}))}))}else s=u.reject("Invalid arguments");return c(s,t),s}var q={_driver:"asyncStorage",_initStorage:L,_support:o(),iterate:P,getItem:z,setItem:B,removeItem:W,clear:V,length:U,key:G,keys:H,dropInstance:j};function K(){return"function"==typeof openDatabase}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y="~~local_forage_type~",Z=/^~~local_forage_type~([^~]+)~/,J="__lfsc__:",Q=J.length,ee="arbf",te="blob",ne="si08",se="ui08",re="uic8",ae="si16",ie="si32",oe="ur16",le="ui32",ue="fl32",ce="fl64",he=Q+ee.length,pe=Object.prototype.toString;function de(e){var t,n,s,r,a,i=.75*e.length,o=e.length,l=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);var u=new ArrayBuffer(i),c=new Uint8Array(u);for(t=0;t<o;t+=4)n=X.indexOf(e[t]),s=X.indexOf(e[t+1]),r=X.indexOf(e[t+2]),a=X.indexOf(e[t+3]),c[l++]=n<<2|s>>4,c[l++]=(15&s)<<4|r>>2,c[l++]=(3&r)<<6|63&a;return u}function fe(e){var t,n=new Uint8Array(e),s="";for(t=0;t<n.length;t+=3)s+=X[n[t]>>2],s+=X[(3&n[t])<<4|n[t+1]>>4],s+=X[(15&n[t+1])<<2|n[t+2]>>6],s+=X[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}function me(e,t){var n="";if(e&&(n=pe.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===pe.call(e.buffer))){var s,r=J;e instanceof ArrayBuffer?(s=e,r+=ee):(s=e.buffer,"[object Int8Array]"===n?r+=ne:"[object Uint8Array]"===n?r+=se:"[object Uint8ClampedArray]"===n?r+=re:"[object Int16Array]"===n?r+=ae:"[object Uint16Array]"===n?r+=oe:"[object Int32Array]"===n?r+=ie:"[object Uint32Array]"===n?r+=le:"[object Float32Array]"===n?r+=ue:"[object Float64Array]"===n?r+=ce:t(new Error("Failed to get type for BinaryArray"))),t(r+fe(s))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n=Y+e.type+"~"+fe(this.result);t(J+te+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}}function ge(e){if(e.substring(0,Q)!==J)return JSON.parse(e);var t,n=e.substring(he),s=e.substring(Q,he);if(s===te&&Z.test(n)){var r=n.match(Z);t=r[1],n=n.substring(r[0].length)}var a=de(n);switch(s){case ee:return a;case te:return l([a],{type:t});case ne:return new Int8Array(a);case se:return new Uint8Array(a);case re:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case oe:return new Uint16Array(a);case ie:return new Int32Array(a);case le:return new Uint32Array(a);case ue:return new Float32Array(a);case ce:return new Float64Array(a);default:throw new Error("Unkown type: "+s)}}var ye={serialize:me,deserialize:ge,stringToBuffer:de,bufferToString:fe};function be(e,t,n,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,s)}function xe(e){var t=this,n={db:null};if(e)for(var s in e)n[s]="string"!=typeof e[s]?e[s].toString():e[s];var r=new u((function(e,s){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return s(e)}n.db.transaction((function(r){be(r,n,(function(){t._dbInfo=n,e()}),(function(e,t){s(t)}))}),s)}));return n.serializer=ye,r}function we(e,t,n,s,r,a){e.executeSql(n,s,r,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?a(e,i):be(e,t,(function(){e.executeSql(n,s,r,a)}),a)}),a):a(e,i)}),a)}function ve(e,t){var n=this;e=p(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){we(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var s=n.rows.length?n.rows.item(0).value:null;s&&(s=r.serializer.deserialize(s)),t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function ke(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){we(n,r,"SELECT * FROM "+r.storeName,[],(function(n,s){for(var a=s.rows,i=a.length,o=0;o<i;o++){var l=a.item(o),u=l.value;if(u&&(u=r.serializer.deserialize(u)),void 0!==(u=e(u,l.key,o+1)))return void t(u)}t()}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Ie(e,t,n,s){var r=this;e=p(e);var a=new u((function(a,i){r.ready().then((function(){void 0===t&&(t=null);var o=t,l=r._dbInfo;l.serializer.serialize(t,(function(t,u){u?i(u):l.db.transaction((function(n){we(n,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(o)}),(function(e,t){i(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(s>0)return void a(Ie.apply(r,[e,o,n,s-1]));i(t)}}))}))})).catch(i)}));return c(a,n),a}function Ne(e,t,n){return Ie.apply(this,[e,t,n,1])}function Se(e,t){var n=this;e=p(e);var s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){we(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Te(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){we(t,s,"DELETE FROM "+s.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Ce(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){we(t,s,"SELECT COUNT(key) as c FROM "+s.storeName,[],(function(t,n){var s=n.rows.item(0).c;e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function $e(e,t){var n=this,s=new u((function(t,s){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){we(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var s=n.rows.length?n.rows.item(0).key:null;t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return c(s,t),s}function Ee(e){var t=this,n=new u((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){we(t,s,"SELECT key FROM "+s.storeName,[],(function(t,n){for(var s=[],r=0;r<n.rows.length;r++)s.push(n.rows.item(r).key);e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n}function Re(e){return new u((function(t,n){e.transaction((function(s){s.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,s){for(var r=[],a=0;a<s.rows.length;a++)r.push(s.rows.item(a).name);t({db:e,storeNames:r})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}function Ae(e,t){t=d.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var s,r=this;return c(s=e.name?new u((function(t){var s;s=e.name===n.name?r._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:s,storeNames:[e.storeName]}):t(Re(s))})).then((function(e){return new u((function(t,n){e.db.transaction((function(s){function r(e){return new u((function(t,n){s.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var a=[],i=0,o=e.storeNames.length;i<o;i++)a.push(r(e.storeNames[i]));u.all(a).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):u.reject("Invalid arguments"),t),s}var Fe={_driver:"webSQLStorage",_initStorage:xe,_support:K(),iterate:ke,getItem:ve,setItem:Ne,removeItem:Se,clear:Te,length:Ce,key:$e,keys:Ee,dropInstance:Ae};function _e(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function De(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Oe(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Me(){return!Oe()||localStorage.length>0}function Le(e){var t=this,n={};if(e)for(var s in e)n[s]=e[s];return n.keyPrefix=De(e,t._defaultConfig),Me()?(t._dbInfo=n,n.serializer=ye,u.resolve()):u.reject()}function ze(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var s=localStorage.key(n);0===s.indexOf(e)&&localStorage.removeItem(s)}}));return c(n,e),n}function Pe(e,t){var n=this;e=p(e);var s=n.ready().then((function(){var t=n._dbInfo,s=localStorage.getItem(t.keyPrefix+e);return s&&(s=t.serializer.deserialize(s)),s}));return c(s,t),s}function Be(e,t){var n=this,s=n.ready().then((function(){for(var t=n._dbInfo,s=t.keyPrefix,r=s.length,a=localStorage.length,i=1,o=0;o<a;o++){var l=localStorage.key(o);if(0===l.indexOf(s)){var u=localStorage.getItem(l);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,l.substring(r),i++)))return u}}}));return c(s,t),s}function We(e,t){var n=this,s=n.ready().then((function(){var t,s=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(s.keyPrefix.length)),t}));return c(s,t),s}function Ve(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,s=[],r=0;r<n;r++){var a=localStorage.key(r);0===a.indexOf(e.keyPrefix)&&s.push(a.substring(e.keyPrefix.length))}return s}));return c(n,e),n}function Ue(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t}function Ge(e,t){var n=this;e=p(e);var s=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(s,t),s}function He(e,t,n){var s=this;e=p(e);var r=s.ready().then((function(){void 0===t&&(t=null);var n=t;return new u((function(r,a){var i=s._dbInfo;i.serializer.serialize(t,(function(t,s){if(s)a(s);else try{localStorage.setItem(i.keyPrefix+e,t),r(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||a(e),a(e)}}))}))}));return c(r,n),r}function je(e,t){if(t=d.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var s,r=this;return s=e.name?new u((function(t){e.storeName?t(De(e,r._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):u.reject("Invalid arguments"),c(s,t),s}var qe={_driver:"localStorageWrapper",_initStorage:Le,_support:_e(),iterate:Be,getItem:Pe,setItem:He,removeItem:Ge,clear:ze,length:Ue,key:We,keys:Ve,dropInstance:je},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var n=e.length,s=0;s<n;){if(Ke(e[s],t))return!0;s++}return!1},Ye=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ze={},Je={},Qe={INDEXEDDB:q,WEBSQL:Fe,LOCALSTORAGE:qe},et=[Qe.INDEXEDDB._driver,Qe.WEBSQL._driver,Qe.LOCALSTORAGE._driver],tt=["dropInstance"],nt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),st={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function rt(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function at(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(Ye(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var it=function(){function e(t){for(var n in r(this,e),Qe)if(Qe.hasOwnProperty(n)){var s=Qe[n],a=s._driver;this[n]=a,Ze[a]||this.defineDriver(s)}this._defaultConfig=at({},st),this._config=at({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":s(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var s=new u((function(t,n){try{var s=e._driver,r=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(r);for(var a=nt.concat("_initStorage"),i=0,o=a.length;i<o;i++){var l=a[i];if((!Xe(tt,l)||e[l])&&"function"!=typeof e[l])return void n(r)}var h=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=u.reject(t);return c(n,arguments[arguments.length-1]),n}},n=0,s=tt.length;n<s;n++){var r=tt[n];e[r]||(e[r]=t(r))}};h();var p=function(n){Ze[s]&&console.info("Redefining LocalForage driver: "+s),Ze[s]=e,Je[s]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(p,n):p(!!e._support):p(!0)}catch(e){n(e)}}));return h(s,t,n),s},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var s=Ze[e]?u.resolve(Ze[e]):u.reject(new Error("Driver not found."));return h(s,t,n),s},e.prototype.getSerializer=function(e){var t=u.resolve(ye);return h(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return h(n,e,e),n},e.prototype.setDriver=function(e,t,n){var s=this;Ye(e)||(e=[e]);var r=this._getSupportedDrivers(e);function a(){s._config.driver=s.driver()}function i(e){return s._extend(e),a(),s._ready=s._initStorage(s._config),s._ready}function o(e){return function(){var t=0;function n(){for(;t<e.length;){var r=e[t];return t++,s._dbInfo=null,s._ready=null,s.getDriver(r).then(i).catch(n)}a();var o=new Error("No available storage method found.");return s._driverSet=u.reject(o),s._driverSet}return n()}}var l=null!==this._driverSet?this._driverSet.catch((function(){return u.resolve()})):u.resolve();return this._driverSet=l.then((function(){var e=r[0];return s._dbInfo=null,s._ready=null,s.getDriver(e).then((function(e){s._driver=e._driver,a(),s._wrapLibraryMethodsWithReady(),s._initDriver=o(r)}))})).catch((function(){a();var e=new Error("No available storage method found.");return s._driverSet=u.reject(e),s._driverSet})),h(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!Je[e]},e.prototype._extend=function(e){at(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,s=e.length;n<s;n++){var r=e[n];this.supports(r)&&t.push(r)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=nt.length;e<t;e++)rt(this,nt[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),ot=new it;t.exports=ot},{3:3}]},{},[4])(4)},570:e=>{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function s(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=s;var r={},a={};function i(e,t){var n,s,i;return t?(i=0<=(e>>>=0)&&e<256)&&(s=a[e])?s:(n=l(e,(0|e)<0?-1:0,!0),i&&(a[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=l(e,e<0?-1:0,!1),i&&(r[e]=n),n)}function o(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=d)return k}else{if(e<=-f)return I;if(e+1>=f)return v}return e<0?o(-e,t).neg():l(e%p|0,e/p|0,t)}function l(e,t,s){return new n(e,t,s)}n.fromInt=i,n.fromNumber=o,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var s;if((s=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===s)return c(e.substring(1),t,n).neg();for(var r=o(u(n,8)),a=g,i=0;i<e.length;i+=8){var l=Math.min(8,e.length-i),h=parseInt(e.substring(i,i+l),n);if(l<8){var p=o(u(n,l));a=a.mul(p).add(o(h))}else a=(a=a.mul(r)).add(o(h))}return a.unsigned=t,a}function h(e,t){return"number"==typeof e?o(e,t):"string"==typeof e?c(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=c,n.fromValue=h;var p=4294967296,d=p*p,f=d/2,m=i(1<<24),g=i(0);n.ZERO=g;var y=i(0,!0);n.UZERO=y;var b=i(1);n.ONE=b;var x=i(1,!0);n.UONE=x;var w=i(-1);n.NEG_ONE=w;var v=l(-1,2147483647,!1);n.MAX_VALUE=v;var k=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=k;var I=l(0,-2147483648,!1);n.MIN_VALUE=I;var N=n.prototype;N.toInt=function(){return this.unsigned?this.low>>>0:this.low},N.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},N.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(I)){var t=o(e),n=this.div(t),s=n.mul(t).sub(this);return n.toString(e)+s.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=o(u(e,6),this.unsigned),a=this,i="";;){var l=a.div(r),c=(a.sub(l.mul(r)).toInt()>>>0).toString(e);if((a=l).isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}},N.getHighBits=function(){return this.high},N.getHighBitsUnsigned=function(){return this.high>>>0},N.getLowBits=function(){return this.low},N.getLowBitsUnsigned=function(){return this.low>>>0},N.getNumBitsAbs=function(){if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},N.isZero=function(){return 0===this.high&&0===this.low},N.eqz=N.isZero,N.isNegative=function(){return!this.unsigned&&this.high<0},N.isPositive=function(){return this.unsigned||this.high>=0},N.isOdd=function(){return!(1&~this.low)},N.isEven=function(){return!(1&this.low)},N.equals=function(e){return s(e)||(e=h(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},N.eq=N.equals,N.notEquals=function(e){return!this.eq(e)},N.neq=N.notEquals,N.ne=N.notEquals,N.lessThan=function(e){return this.comp(e)<0},N.lt=N.lessThan,N.lessThanOrEqual=function(e){return this.comp(e)<=0},N.lte=N.lessThanOrEqual,N.le=N.lessThanOrEqual,N.greaterThan=function(e){return this.comp(e)>0},N.gt=N.greaterThan,N.greaterThanOrEqual=function(e){return this.comp(e)>=0},N.gte=N.greaterThanOrEqual,N.ge=N.greaterThanOrEqual,N.compare=function(e){if(s(e)||(e=h(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},N.comp=N.compare,N.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(b)},N.neg=N.negate,N.add=function(e){s(e)||(e=h(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,a=65535&this.low,i=e.high>>>16,o=65535&e.high,u=e.low>>>16,c=0,p=0,d=0,f=0;return d+=(f+=a+(65535&e.low))>>>16,p+=(d+=r+u)>>>16,c+=(p+=n+o)>>>16,c+=t+i,l((d&=65535)<<16|(f&=65535),(c&=65535)<<16|(p&=65535),this.unsigned)},N.subtract=function(e){return s(e)||(e=h(e)),this.add(e.neg())},N.sub=N.subtract,N.multiply=function(e){if(this.isZero())return g;if(s(e)||(e=h(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(I))return e.isOdd()?I:g;if(e.eq(I))return this.isOdd()?I:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,a=this.low>>>16,i=65535&this.low,u=e.high>>>16,c=65535&e.high,p=e.low>>>16,d=65535&e.low,f=0,y=0,b=0,x=0;return b+=(x+=i*d)>>>16,y+=(b+=a*d)>>>16,b&=65535,y+=(b+=i*p)>>>16,f+=(y+=r*d)>>>16,y&=65535,f+=(y+=a*p)>>>16,y&=65535,f+=(y+=i*c)>>>16,f+=n*d+r*p+a*c+i*u,l((b&=65535)<<16|(x&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},N.mul=N.multiply,N.divide=function(e){if(s(e)||(e=h(e)),e.isZero())throw Error("division by zero");var n,r,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return x;a=y}else{if(this.eq(I))return e.eq(b)||e.eq(w)?I:e.eq(I)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:w:(r=this.sub(e.mul(n)),a=n.add(r.div(e)));if(e.eq(I))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),c=i<=48?1:u(2,i-48),p=o(n),d=p.mul(e);d.isNegative()||d.gt(r);)d=(p=o(n-=c,this.unsigned)).mul(e);p.isZero()&&(p=b),a=a.add(p),r=r.sub(d)}return a},N.div=N.divide,N.modulo=function(e){return s(e)||(e=h(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},N.mod=N.modulo,N.rem=N.modulo,N.not=function(){return l(~this.low,~this.high,this.unsigned)},N.and=function(e){return s(e)||(e=h(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},N.or=function(e){return s(e)||(e=h(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},N.xor=function(e){return s(e)||(e=h(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},N.shiftLeft=function(e){return s(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},N.shl=N.shiftLeft,N.shiftRight=function(e){return s(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},N.shr=N.shiftRight,N.shiftRightUnsigned=function(e){if(s(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},N.shru=N.shiftRightUnsigned,N.shr_u=N.shiftRightUnsigned,N.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},N.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},N.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},N.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},N.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,s){return s?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},312:function(e,t){var n,s,r;s=[e],n=function(e){"use strict";function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e};function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var r={order:2,precision:2,period:null};function a(e,t){var n=[],s=[];e.forEach((function(e,r){null!==e[1]&&(s.push(e),n.push(t[r]))}));var r=s.reduce((function(e,t){return e+t[1]}),0)/s.length,a=s.reduce((function(e,t){var n=t[1]-r;return e+n*n}),0);return 1-s.reduce((function(e,t,s){var r=n[s],a=t[1]-r[1];return e+a*a}),0)/a}function i(e,t){for(var n=e,s=e.length-1,r=[t],a=0;a<s;a++){for(var i=a,o=a+1;o<s;o++)Math.abs(n[a][o])>Math.abs(n[a][i])&&(i=o);for(var l=a;l<s+1;l++){var u=n[l][a];n[l][a]=n[l][i],n[l][i]=u}for(var c=a+1;c<s;c++)for(var h=s;h>=a;h--)n[h][c]-=n[h][a]*n[a][c]/n[a][a]}for(var p=s-1;p>=0;p--){for(var d=0,f=p+1;f<s;f++)d+=n[f][p]*r[f];r[p]=(n[s][p]-d)/n[p][p]}return r}function o(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var l={linear:function(e,t){for(var n=[0,0,0,0,0],s=0,r=0;r<e.length;r++)null!==e[r][1]&&(s++,n[0]+=e[r][0],n[1]+=e[r][1],n[2]+=e[r][0]*e[r][0],n[3]+=e[r][0]*e[r][1],n[4]+=e[r][1]*e[r][1]);var i=s*n[2]-n[0]*n[0],l=s*n[3]-n[0]*n[1],u=0===i?0:o(l/i,t.precision),c=o(n[1]/s-u*n[0]/s,t.precision),h=function(e){return[o(e,t.precision),o(u*e+c,t.precision)]},p=e.map((function(e){return h(e[0])}));return{points:p,predict:h,equation:[u,c],r2:o(a(e,p),t.precision),string:0===c?"y = "+u+"x":"y = "+u+"x + "+c}},exponential:function(e,t){for(var n=[0,0,0,0,0,0],s=0;s<e.length;s++)null!==e[s][1]&&(n[0]+=e[s][0],n[1]+=e[s][1],n[2]+=e[s][0]*e[s][0]*e[s][1],n[3]+=e[s][1]*Math.log(e[s][1]),n[4]+=e[s][0]*e[s][1]*Math.log(e[s][1]),n[5]+=e[s][0]*e[s][1]);var r=n[1]*n[2]-n[5]*n[5],i=Math.exp((n[2]*n[3]-n[5]*n[4])/r),l=(n[1]*n[4]-n[5]*n[3])/r,u=o(i,t.precision),c=o(l,t.precision),h=function(e){return[o(e,t.precision),o(u*Math.exp(c*e),t.precision)]},p=e.map((function(e){return h(e[0])}));return{points:p,predict:h,equation:[u,c],string:"y = "+u+"e^("+c+"x)",r2:o(a(e,p),t.precision)}},logarithmic:function(e,t){for(var n=[0,0,0,0],s=e.length,r=0;r<s;r++)null!==e[r][1]&&(n[0]+=Math.log(e[r][0]),n[1]+=e[r][1]*Math.log(e[r][0]),n[2]+=e[r][1],n[3]+=Math.pow(Math.log(e[r][0]),2));var i=o((s*n[1]-n[2]*n[0])/(s*n[3]-n[0]*n[0]),t.precision),l=o((n[2]-i*n[0])/s,t.precision),u=function(e){return[o(e,t.precision),o(o(l+i*Math.log(e),t.precision),t.precision)]},c=e.map((function(e){return u(e[0])}));return{points:c,predict:u,equation:[l,i],string:"y = "+l+" + "+i+" ln(x)",r2:o(a(e,c),t.precision)}},power:function(e,t){for(var n=[0,0,0,0,0],s=e.length,r=0;r<s;r++)null!==e[r][1]&&(n[0]+=Math.log(e[r][0]),n[1]+=Math.log(e[r][1])*Math.log(e[r][0]),n[2]+=Math.log(e[r][1]),n[3]+=Math.pow(Math.log(e[r][0]),2));var i=(s*n[1]-n[0]*n[2])/(s*n[3]-Math.pow(n[0],2)),l=(n[2]-i*n[0])/s,u=o(Math.exp(l),t.precision),c=o(i,t.precision),h=function(e){return[o(e,t.precision),o(o(u*Math.pow(e,c),t.precision),t.precision)]},p=e.map((function(e){return h(e[0])}));return{points:p,predict:h,equation:[u,c],string:"y = "+u+"x^"+c,r2:o(a(e,p),t.precision)}},polynomial:function(e,t){for(var n=[],r=[],l=0,u=0,c=e.length,h=t.order+1,p=0;p<h;p++){for(var d=0;d<c;d++)null!==e[d][1]&&(l+=Math.pow(e[d][0],p)*e[d][1]);n.push(l),l=0;for(var f=[],m=0;m<h;m++){for(var g=0;g<c;g++)null!==e[g][1]&&(u+=Math.pow(e[g][0],p+m));f.push(u),u=0}r.push(f)}r.push(n);for(var y=i(r,h).map((function(e){return o(e,t.precision)})),b=function(e){return[o(e,t.precision),o(y.reduce((function(t,n,s){return t+n*Math.pow(e,s)}),0),t.precision)]},x=e.map((function(e){return b(e[0])})),w="y = ",v=y.length-1;v>=0;v--)w+=v>1?y[v]+"x^"+v+" + ":1===v?y[v]+"x + ":y[v];return{string:w,points:x,predict:b,equation:[].concat(s(y)).reverse(),r2:o(a(e,x),t.precision)}}};function u(){var e=function(e,s){return n({_round:o},e,t({},s,(function(e,t){return l[s](e,n({},r,t))})))};return Object.keys(l).reduce(e,{})}e.exports=u()},void 0===(r="function"==typeof n?n.apply(t,s):n)||(e.exports=r)},391:(e,t,n)=>{var s=n(180),r=n(181),a=n(31),i=n(67),o=n(833),l=n(717),u=n(801);u.alea=s,u.xor128=r,u.xorwow=a,u.xorshift7=i,u.xor4096=o,u.tychei=l,e.exports=u},180:function(e,t,n){var s;!function(e,r){function a(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n<t.length;n++){var s=.02519603282416938*(e+=t.charCodeAt(n));s-=e=s>>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)};return t}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function o(e,t){var n=new a(e),s=t&&t.state,r=n.next;return r.int32=function(){return 4294967296*n.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,s&&("object"==typeof s&&i(s,n),r.state=function(){return i(n,{})}),r}r&&r.exports?r.exports=o:n.amdD&&n.amdO?void 0===(s=function(){return o}.call(t,n,t,r))||(r.exports=s):this.alea=o}(0,e=n.nmd(e),n.amdD)},717:function(e,t,n){var s;!function(e,r){function a(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,s=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-s|0,s=s<<24^s>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-s|0,t.d=s<<16^n>>>16^r,t.a=r-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var s=0;s<n.length+20;s++)t.b^=0|n.charCodeAt(s),t.next()}function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function o(e,t){var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&i(s,n),r.state=function(){return i(n,{})}),r}r&&r.exports?r.exports=o:n.amdD&&n.amdO?void 0===(s=function(){return o}.call(t,n,t,r))||(r.exports=s):this.tychei=o}(0,e=n.nmd(e),n.amdD)},181:function(e,t,n){var s;!function(e,r){function a(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var s=0;s<n.length+64;s++)t.x^=0|n.charCodeAt(s),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function o(e,t){var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&i(s,n),r.state=function(){return i(n,{})}),r}r&&r.exports?r.exports=o:n.amdD&&n.amdO?void 0===(s=function(){return o}.call(t,n,t,r))||(r.exports=s):this.xor128=o}(0,e=n.nmd(e),n.amdD)},833:function(e,t,n){var s;!function(e,r){function a(e){var t=this;t.next=function(){var e,n,s=t.w,r=t.X,a=t.i;return t.w=s=s+1640531527|0,n=r[a+34&127],e=r[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[a]=n^e,t.i=a,n+(s^s>>>16)|0},function(e,t){var n,s,r,a,i,o=[],l=128;for(t===(0|t)?(s=t,t=null):(t+="\0",s=0,l=Math.max(l,t.length)),r=0,a=-32;a<l;++a)t&&(s^=t.charCodeAt((a+32)%t.length)),0===a&&(i=s),s^=s<<10,s^=s>>>15,s^=s<<4,s^=s>>>13,a>=0&&(i=i+1640531527|0,r=0==(n=o[127&a]^=s+i)?r+1:0);for(r>=128&&(o[127&(t&&t.length||0)]=-1),r=127,a=512;a>0;--a)s=o[r+34&127],n=o[r=r+1&127],s^=s<<13,n^=n<<17,s^=s>>>15,n^=n>>>12,o[r]=s^n;e.w=i,e.X=o,e.i=r}(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function o(e,t){null==e&&(e=+new Date);var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.X&&i(s,n),r.state=function(){return i(n,{})}),r}r&&r.exports?r.exports=o:n.amdD&&n.amdO?void 0===(s=function(){return o}.call(t,n,t,r))||(r.exports=s):this.xor4096=o}(0,e=n.nmd(e),n.amdD)},67:function(e,t,n){var s;!function(e,r){function a(e){var t=this;t.next=function(){var e,n,s=t.x,r=t.i;return e=s[r],n=(e^=e>>>7)^e<<24,n^=(e=s[r+1&7])^e>>>10,n^=(e=s[r+3&7])^e>>>3,n^=(e=s[r+4&7])^e<<7,e=s[r+7&7],n^=(e^=e<<13)^e<<9,s[r]=n,t.i=r+1&7,n},function(e,t){var n,s=[];if(t===(0|t))s[0]=t;else for(t=""+t,n=0;n<t.length;++n)s[7&n]=s[7&n]<<15^t.charCodeAt(n)+s[n+1&7]<<13;for(;s.length<8;)s.push(0);for(n=0;n<8&&0===s[n];++n);for(8==n?s[7]=-1:s[n],e.x=s,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function o(e,t){null==e&&(e=+new Date);var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&(s.x&&i(s,n),r.state=function(){return i(n,{})}),r}r&&r.exports?r.exports=o:n.amdD&&n.amdO?void 0===(s=function(){return o}.call(t,n,t,r))||(r.exports=s):this.xorshift7=o}(0,e=n.nmd(e),n.amdD)},31:function(e,t,n){var s;!function(e,r){function a(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var s=0;s<n.length+64;s++)t.x^=0|n.charCodeAt(s),s==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function o(e,t){var n=new a(e),s=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,s&&("object"==typeof s&&i(s,n),r.state=function(){return i(n,{})}),r}r&&r.exports?r.exports=o:n.amdD&&n.amdO?void 0===(s=function(){return o}.call(t,n,t,r))||(r.exports=s):this.xorwow=o}(0,e=n.nmd(e),n.amdD)},801:function(e,t,n){var s;!function(r,a,i){var o,l=256,u=i.pow(l,6),c=i.pow(2,52),h=2*c,p=255;function d(e,t,n){var s=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),b(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,b(a)]}}():e,3),s),d=new f(s),x=function(){for(var e=d.g(6),t=u,n=0;e<c;)e=(e+n)*l,t*=l,n=d.g(1);for(;e>=h;)e/=2,t/=2,n>>>=1;return(e+n)/t};return x.int32=function(){return 0|d.g(4)},x.quick=function(){return d.g(4)/4294967296},x.double=x,y(b(d.S),a),(t.pass||n||function(e,t,n,s){return s&&(s.S&&m(s,d),e.state=function(){return m(d,{})}),n?(i.random=e,t):e})(x,p,"global"in t?t.global:this==i,t.state)}function f(e){var t,n=e.length,s=this,r=0,a=s.i=s.j=0,i=s.S=[];for(n||(e=[n++]);r<l;)i[r]=r++;for(r=0;r<l;r++)i[r]=i[a=p&a+e[r%n]+(t=i[r])],i[a]=t;(s.g=function(e){for(var t,n=0,r=s.i,a=s.j,i=s.S;e--;)t=i[r=p&r+1],n=n*l+i[p&(i[r]=i[a=p&a+t])+(i[a]=t)];return s.i=r,s.j=a,n})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var n,s=[],r=typeof e;if(t&&"object"==r)for(n in e)try{s.push(g(e[n],t-1))}catch(e){}return s.length?s:"string"==r?e:e+"\0"}function y(e,t){for(var n,s=e+"",r=0;r<s.length;)t[p&r]=p&(n^=19*t[p&r])+s.charCodeAt(r++);return b(t)}function b(e){return String.fromCharCode.apply(0,e)}if(y(i.r