From eb0a6368a54e6c58dff401b87a551b0292818d4b Mon Sep 17 00:00:00 2001 From: Alexandros Dorodoulis Date: Mon, 12 Apr 2021 14:27:02 +0200 Subject: [PATCH] fix: Bump mc to resolve player preview issue --- demo/bundle.js | 1128 ++++++++++++++++++++++++--------------------- package-lock.json | 302 ++---------- package.json | 20 +- 3 files changed, 637 insertions(+), 813 deletions(-) diff --git a/demo/bundle.js b/demo/bundle.js index 3f2a8ce5..f92c9cf8 100644 --- a/demo/bundle.js +++ b/demo/bundle.js @@ -63,7 +63,7 @@ /******/ /******/ var hotApplyOnUpdate = true; /******/ // eslint-disable-next-line no-unused-vars -/******/ var hotCurrentHash = "266d1db48b669b5b17b1"; +/******/ var hotCurrentHash = "95fa5676dc245464b780"; /******/ var hotRequestTimeout = 10000; /******/ var hotCurrentModuleData = {}; /******/ var hotCurrentChildModule; @@ -156,6 +156,7 @@ /******/ _declinedDependencies: {}, /******/ _selfAccepted: false, /******/ _selfDeclined: false, +/******/ _selfInvalidated: false, /******/ _disposeHandlers: [], /******/ _main: hotCurrentChildModule !== moduleId, /******/ @@ -186,6 +187,29 @@ /******/ var idx = hot._disposeHandlers.indexOf(callback); /******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); /******/ }, +/******/ invalidate: function() { +/******/ this._selfInvalidated = true; +/******/ switch (hotStatus) { +/******/ case "idle": +/******/ hotUpdate = {}; +/******/ hotUpdate[moduleId] = modules[moduleId]; +/******/ hotSetStatus("ready"); +/******/ break; +/******/ case "ready": +/******/ hotApplyInvalidatedModule(moduleId); +/******/ break; +/******/ case "prepare": +/******/ case "check": +/******/ case "dispose": +/******/ case "apply": +/******/ (hotQueuedInvalidatedModules = +/******/ hotQueuedInvalidatedModules || []).push(moduleId); +/******/ break; +/******/ default: +/******/ // ignore requests in error states +/******/ break; +/******/ } +/******/ }, /******/ /******/ // Management API /******/ check: hotCheck, @@ -227,7 +251,7 @@ /******/ var hotDeferred; /******/ /******/ // The update info -/******/ var hotUpdate, hotUpdateNewHash; +/******/ var hotUpdate, hotUpdateNewHash, hotQueuedInvalidatedModules; /******/ /******/ function toModuleId(id) { /******/ var isNumber = +id + "" === id; @@ -242,7 +266,7 @@ /******/ hotSetStatus("check"); /******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { /******/ if (!update) { -/******/ hotSetStatus("idle"); +/******/ hotSetStatus(hotApplyInvalidatedModules() ? "ready" : "idle"); /******/ return null; /******/ } /******/ hotRequestedFilesMap = {}; @@ -335,6 +359,11 @@ /******/ if (hotStatus !== "ready") /******/ throw new Error("apply() is only allowed in ready status"); /******/ options = options || {}; +/******/ return hotApplyInternal(options); +/******/ } +/******/ +/******/ function hotApplyInternal(options) { +/******/ hotApplyInvalidatedModules(); /******/ /******/ var cb; /******/ var i; @@ -357,7 +386,11 @@ /******/ var moduleId = queueItem.id; /******/ var chain = queueItem.chain; /******/ module = installedModules[moduleId]; -/******/ if (!module || module.hot._selfAccepted) continue; +/******/ if ( +/******/ !module || +/******/ (module.hot._selfAccepted && !module.hot._selfInvalidated) +/******/ ) +/******/ continue; /******/ if (module.hot._selfDeclined) { /******/ return { /******/ type: "self-declined", @@ -525,10 +558,13 @@ /******/ installedModules[moduleId] && /******/ installedModules[moduleId].hot._selfAccepted && /******/ // removed self-accepted modules should not be required -/******/ appliedUpdate[moduleId] !== warnUnexpectedRequire +/******/ appliedUpdate[moduleId] !== warnUnexpectedRequire && +/******/ // when called invalidate self-accepting is not possible +/******/ !installedModules[moduleId].hot._selfInvalidated /******/ ) { /******/ outdatedSelfAcceptedModules.push({ /******/ module: moduleId, +/******/ parents: installedModules[moduleId].parents.slice(), /******/ errorHandler: installedModules[moduleId].hot._selfAccepted /******/ }); /******/ } @@ -601,7 +637,11 @@ /******/ // Now in "apply" phase /******/ hotSetStatus("apply"); /******/ -/******/ hotCurrentHash = hotUpdateNewHash; +/******/ if (hotUpdateNewHash !== undefined) { +/******/ hotCurrentHash = hotUpdateNewHash; +/******/ hotUpdateNewHash = undefined; +/******/ } +/******/ hotUpdate = undefined; /******/ /******/ // insert new code /******/ for (moduleId in appliedUpdate) { @@ -654,7 +694,8 @@ /******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { /******/ var item = outdatedSelfAcceptedModules[i]; /******/ moduleId = item.module; -/******/ hotCurrentParents = [moduleId]; +/******/ hotCurrentParents = item.parents; +/******/ hotCurrentChildModule = moduleId; /******/ try { /******/ __webpack_require__(moduleId); /******/ } catch (err) { @@ -696,12 +737,35 @@ /******/ return Promise.reject(error); /******/ } /******/ +/******/ if (hotQueuedInvalidatedModules) { +/******/ return hotApplyInternal(options).then(function(list) { +/******/ outdatedModules.forEach(function(moduleId) { +/******/ if (list.indexOf(moduleId) < 0) list.push(moduleId); +/******/ }); +/******/ return list; +/******/ }); +/******/ } +/******/ /******/ hotSetStatus("idle"); /******/ return new Promise(function(resolve) { /******/ resolve(outdatedModules); /******/ }); /******/ } /******/ +/******/ function hotApplyInvalidatedModules() { +/******/ if (hotQueuedInvalidatedModules) { +/******/ if (!hotUpdate) hotUpdate = {}; +/******/ hotQueuedInvalidatedModules.forEach(hotApplyInvalidatedModule); +/******/ hotQueuedInvalidatedModules = undefined; +/******/ return true; +/******/ } +/******/ } +/******/ +/******/ function hotApplyInvalidatedModule(moduleId) { +/******/ if (!Object.prototype.hasOwnProperty.call(hotUpdate, moduleId)) +/******/ hotUpdate[moduleId] = modules[moduleId]; +/******/ } +/******/ /******/ // The module cache /******/ var installedModules = {}; /******/ @@ -790,14 +854,14 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return hotCreateRequire(5)(__webpack_require__.s = 5); +/******/ return hotCreateRequire(4)(__webpack_require__.s = 4); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(global) {!function(e,t){ true?t(exports,__webpack_require__(6),__webpack_require__(7)):undefined}(this,(function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t),a=r(n);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;a--){var o=t[e.placement];o.splice(o.indexOf(e.key),1);var s=this.fromElementDescriptor(e),u=this.toElementFinisherExtras((0,i[a])(s)||s);e=u.element,this.addElementPlacement(e,t),u.finisher&&r.push(u.finisher);var c=u.extras;if(c){for(var l=0;l=0;r--){var i=this.fromClassDescriptor(e),a=this.toClassDescriptor((0,t[r])(i)||i);if(void 0!==a.finisher&&n.push(a.finisher),void 0!==a.elements){e=a.elements;for(var o=0;o0&&void 0!==arguments[0]&&arguments[0],t=e?"_":"-";return ee()+ee()+t+ee()+t+ee()}function ne(e,t){return"".concat(e).concat("___").concat(t)}function re(e,t,n){for(var r=t.split("."),i=e,a=0;a=i.level?this[i.key]=window.console[i.consoleMethod].bind(window.console,"MotorCortex - ".concat(i.key,": ")):this[i.key]=function(){}}this.log=n>=3?window.console.log.bind(window.console,"MotorCortex - "):function(){}}return c(e,[{key:"validateProps",value:function(e,t,n){var r=t(e);if(r.length>0){for(var i="Error on plugin's \"".concat(n.plugin_npm_name,'" "').concat(n.ClassName,'" instantiation. Errors (op props):'),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};return oe(this.checkDelete(e,t))}},{key:"recalcScratchValues",value:function(e){}},{key:"checkAddition",value:function(e){return{result:!0,execute:function(){}}}},{key:"checkEdit",value:function(e,t){return{result:!0,execute:function(){}}}},{key:"checkDelete",value:function(e){return{result:!0,execute:function(){}}}},{key:"checkResizedIncidents",value:function(e){return{result:!0,execute:function(){}}}},{key:"moveTo",value:function(e,t,n){}}],[{key:"type",get:function(){return"plain"}}]),e}();function ue(e){e.descriptor.value=function(e){this.duration=this.duration*e}}var ce="up",le="down",pe="native.tree.bypass",fe=I(null,(function(e){return{F:function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),e(this),this.parentNode=null,this.isNode=!1,Object.prototype.hasOwnProperty.call(n,"id")?this.id=n.id:this.id=te(),this.props=n},d:[{kind:"get",key:"name",value:function(){return Object.prototype.hasOwnProperty.call(this.props,"name")?this.props.name:null}},{kind:"set",key:"name",value:function(e){this.props.name=e}},{kind:"get",key:"delay",value:function(){return Object.prototype.hasOwnProperty.call(this.props,"delay")?this.props.delay:0}},{kind:"set",key:"delay",value:function(e){0!==e&&(this.props.delay=e)}},{kind:"get",key:"hiatus",value:function(){return Object.prototype.hasOwnProperty.call(this.props,"hiatus")?this.props.hiatus:0}},{kind:"set",key:"hiatus",value:function(e){0!==e&&(this.props.hiatus=e)}},{kind:"get",key:"repeats",value:function(){return Object.prototype.hasOwnProperty.call(this.props,"repeats")?this.props.repeats:1}},{kind:"set",key:"repeats",value:function(e){this.props.repeats=e}},{kind:"get",key:"duration",value:function(){return this.repeats*(this.delay+this.props.duration+this.hiatus)}},{kind:"set",key:"duration",value:function(e){var t=e/this.duration;this.props.duration*=t,this.hiatus*=t,this.delay*=t}},{kind:"method",key:"setNewDuration",value:function(e){this.duration=e,this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ce})}},{kind:"method",decorators:[ue],key:"systoleDiastole",value:function(){}},{kind:"get",key:"hasParent",value:function(){return null!==this.parentNode}},{kind:"method",key:"attachToNode",value:function(e){this.parentNode=e}},{kind:"method",key:"detachFromParent",value:function(){this.parentNode=null}},{kind:"method",key:"putMessageOnPipe",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Object.prototype.hasOwnProperty.call(r,"direction")||(r.direction=le),r.direction!==le||Object.prototype.hasOwnProperty.call(r,"positionDelta")||(r.positionDelta=0),r.selfExecute){var i="handle".concat(Z(e)),a="function"==typeof this[i];if(a){var o=this[i](n,t);if(o!==pe){var s={response:o,responder:this};return r.direction===ce?s:[f(f({},s),{},{positionDelta:r.positionDelta})]}}}return r.direction===ce?this.hasParent?this.parentNode.putMessageOnPipe(e,t,n,{selfExecute:!0,direction:ce}):{response:!1,responder:null}:[]}},{kind:"method",key:"bypass",value:function(){return pe}},{kind:"get",key:"positionOnPyramidion",value:function(){return this.getPositionOnPyramidion()}},{kind:"method",key:"getPositionOnPyramidion",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.hasParent){var t=this.putMessageOnPipe("getPositionOnPyramidion",{delta:e,id:this.id},"Parent",{selfExecute:!1,direction:ce});return t.response}return e}}]}})),he="Leaf has already been attached to another Node",de="Negative positioning of childs on nodes is not allowed",me="The Leaf with the requested id couldn't be found on the Tree",ye=I(null,(function(e,t){var n=function(t){h(r,t);var n=v(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,r),t=n.call(this,i),e(y(t)),t.isNode=!0,t.children={},t.calculatedDuration=0,t}return r}(t);return{F:n,d:[{kind:"get",key:"duration",value:function(){return this.calculatedDuration}},{kind:"set",key:"duration",value:function(e){var t=e/this.duration;for(var n in this.props&&Object.prototype.hasOwnProperty.call(this.props,"duration")&&(this.props.duration=e),this.calculatedDuration=e,this.children){var r=this.children[n];this.editPosition(r.id,r.position*t,!0),r.leaf.systoleDiastole(t)}}},{kind:"method",key:"setNewDuration",value:function(e){this.duration=e,this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ce})}},{kind:"method",key:"_calculateDuration",value:function(){var e=0;for(var t in this.children){var n=this.children[t];n.position+n.leaf.duration>e&&(e=n.position+n.leaf.duration)}return e!==this.calculatedDuration&&(this.props&&Object.prototype.hasOwnProperty.call(this.props,"duration")&&(this.props.duration=e),this.calculatedDuration=e,!0)}},{kind:"method",decorators:[ue],key:"systoleDiastole",value:function(){}},{kind:"method",key:"handleRecalcDuration",value:function(e,t){return!this._calculateDuration()||this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ce})}},{kind:"method",key:"getLeafById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object.prototype.hasOwnProperty.call(this.children,e))return this.children[e].leaf;if(t)return null;for(var n in this.children){var r=this.children[n].leaf;if(r.isNode){var i=r.getLeafById(e);if(null!=i)return i}}return null}},{kind:"method",key:"getLeafPosition",value:function(e){if(Object.prototype.hasOwnProperty.call(this.children,e))return this.children[e].position;var t=this.putMessageOnPipe("getLeafPosition",{id:e},"Groups",{selfExecute:!1,direction:le});return t.length>0?t[0].positionDelta+t[0].response:void 0}},{kind:"method",key:"handleGetLeafPosition",value:function(e,t){return this.getLeafPosition(t.id)}},{kind:"method",key:"checkAddition",value:function(e,t){return e.hasParent?{result:!1,reason:he}:t<0?{result:!1,reason:de}:{result:!0}}},{kind:"method",key:"addChild",value:function(e,t){return e.hasParent?{result:!1,reason:he}:(this.children[e.id]={id:e.id,leaf:e,position:t},e.attachToNode(this),this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!0,direction:ce}),{result:!0})}},{kind:"method",key:"checkRemoveChild",value:function(e){return Object.prototype.hasOwnProperty.call(this.children,e)?{result:!0}:{result:!1,reason:me}}},{kind:"method",key:"removeChild",value:function(e){return this.children[e].leaf.detachFromParent(),delete this.children[e],this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!0,direction:ce}),{result:!0}}},{kind:"method",key:"checkEditPosition",value:function(e,t){return t<0?{result:!1,reason:de}:Object.prototype.hasOwnProperty.call(this.children,e)?{result:!0}:{result:!1,reason:me}}},{kind:"method",key:"editPosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Object.prototype.hasOwnProperty.call(this.children,e))return this.children[e].position=t,n||this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!0,direction:ce}),{result:!0}}},{kind:"method",key:"putMessageOnPipe",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Object.prototype.hasOwnProperty.call(i,"direction")||(i.direction=le),i.direction!==le||Object.prototype.hasOwnProperty.call(i,"positionDelta")||(i.positionDelta=0),i.direction===ce)return b(d(n.prototype),"putMessageOnPipe",this).call(this,e,t,r,i);var a=b(d(n.prototype),"putMessageOnPipe",this).call(this,e,t,r,i);if(a.length>0)return a;for(var o in this.children){var s=this.children[o].leaf,u=f(f({},i),{},{selfExecute:!0,positionDelta:i.positionDelta+this.children[o].position});a=a.concat(s.putMessageOnPipe(e,t,r,u))}return a}},{kind:"method",key:"handleGetPositionOnPyramidion",value:function(e,t){var n=t.delta+this.getLeafPosition(t.id);return this.getPositionOnPyramidion(n)}}]}}),fe);function ge(e){e.descriptor.value=function(e){void 0===this.blockID&&(this.blockID=te()),this.DescriptiveIncident.putMessageOnPipe("setBlock",{id:this.blockID,description:e,incidentId:this.DescriptiveIncident.id,realIncidentId:this.id},"rootClip",{selfExecute:!0,direction:ce})}}function ve(e){e.descriptor.value=function(e){return this.id===e?this:this.bypass()}}function xe(e){e.descriptor.value=function(){this.DescriptiveIncident.putMessageOnPipe("unBlock",{id:this.blockID},"rootClip",{selfExecute:!0,direction:ce})}}var be=I(null,(function(e,t){var n=function(t){h(r,t);var n=v(r);function r(t,i){var a;return s(this,r),a=n.call(this,i),e(y(a)),a.mc_plugin_npm_name="motor-cortex-js",a.plugin_channel_class=se,a.hasIncidents=!0,a.onGroupInitialise(),a.calculatedDuration=0,a}return r}(t);return{F:n,d:[{kind:"method",key:"onGroupInitialise",value:function(){}},{kind:"method",key:"handleAddIncident",value:function(e,t){if(this.id===e){var n=(0,t.incidentFromDescription)(t.incident,t.contextData,t.audio);return null===n?this.bypass():n}return this.bypass()}},{kind:"method",key:"handleMoveIncident",value:function(e,t){if(this.id===e){var n=this.getLeafById(t.incidentId,!0);return null===n?this.bypass():n}return this.bypass()}},{kind:"method",key:"handleRemoveIncident",value:function(e,t){if(this.id===e){var n=this.getLeafById(t.incidentId,!0);return null===n?this.bypass():n}return this.bypass()}},{kind:"method",decorators:[ve],key:"handleResize",value:function(){}},{kind:"method",key:"removeChild",value:function(e){this.children[e].leaf.lastWish(),b(d(n.prototype),"removeChild",this).call(this,e)}},{kind:"method",key:"getIncidentsByChannel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={};for(var r in n["motor-cortex-js"]=[{millisecond:e,parentMillisecond:t,incident:this,id:this.id}],this.children){var i=this.children[r],a=i.leaf.getIncidentsByChannel(e+i.position,e);for(var o in a)Object.prototype.hasOwnProperty.call(n,o)?n[o]=n[o].concat(a[o]):n[o]=a[o]}return n}},{kind:"method",key:"lastWish",value:function(){for(var e in this.children)this.children[e].leaf.lastWish()}},{kind:"method",decorators:[ge],key:"setBlock",value:function(){}},{kind:"method",decorators:[xe],key:"unblock",value:function(){}}]}}),ye),we="1.12.0",Ne="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},Me=Array.prototype,Ee=Object.prototype,Se="undefined"!=typeof Symbol?Symbol.prototype:null,Oe=Me.push,Ae=Me.slice,Ce=Ee.toString,ke=Ee.hasOwnProperty,_e="undefined"!=typeof ArrayBuffer,Ie="undefined"!=typeof DataView,Te=Array.isArray,Pe=Object.keys,De=Object.create,Be=_e&&ArrayBuffer.isView,je=isNaN,qe=isFinite,ze=!{toString:null}.propertyIsEnumerable("toString"),Re=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Fe=Math.pow(2,53)-1;function Le(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i=0&&n<=Fe}}function dt(e){return function(t){return null==t?void 0:t[e]}}var mt=dt("byteLength"),yt=ht(mt),gt=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vt=_e?function(e){return Be?Be(e)&&!ot(e):yt(e)&>.test(Ce.call(e))}:ft(!1),xt=dt("length");function bt(e,t){t=function(e){for(var t={},n=e.length,r=0;r":">",'"':""","'":"'","`":"`"},fn=ln(pn),hn=ln(Lt(pn)),dn=Mt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},mn=/(.)^/,yn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},gn=/\\|'|\r|\n|\u2028|\u2029/g;function vn(e){return"\\"+yn[e]}var xn=0;function bn(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var a=Wt(e.prototype),o=e.apply(a,i);return Ue(o)?o:a}var wn=Le((function(e,t){var n=wn.placeholder,r=function(){for(var i=0,a=t.length,o=Array(a),s=0;s1)En(s,t-1,n,r),i=r.length;else for(var u=0,c=s.length;u0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var _n=wn(kn,2);function In(e,t,n){t=on(t,n);for(var r,i=wt(e),a=0,o=i.length;a0?0:i-1;a>=0&&a0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(n&&a&&s)return r[a=n(r,i)]===i?a:-1;if(i!=i)return(a=t(Ae.call(r,o,s),pt))>=0?a+o:-1;for(a=e>0?o:s-1;a>=0&&a0?0:o-1;for(i||(r=t[a?a[s]:s],s+=e);s>=0&&s=3;return t(e,nn(n,i,4),r,a)}}var Vn=Un(1),$n=Un(-1);function Hn(e,t,n){var r=[];return t=on(t,n),Fn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function Gn(e,t,n){t=on(t,n);for(var r=!Mn(e)&&wt(e),i=(r||e).length,a=0;a=0}var Zn=Le((function(e,t,n){var r,i;return tt(t)?i=t:(t=Kt(t),r=t.slice(0,-1),t=t[t.length-1]),Ln(e,(function(e){var a=i;if(!a){if(r&&r.length&&(e=Yt(e,r)),null==e)return;a=e[t]}return null==a?a:a.apply(e,n)}))}));function Kn(e,t){return Ln(e,tn(t))}function Yn(e,t,n){var r,i,a=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=Mn(e)?e:Ft(e)).length;sa&&(a=r);else t=on(t,n),Fn(e,(function(e,n,r){((i=t(e,n,r))>o||i===-1/0&&a===-1/0)&&(a=e,o=i)}));return a}function Xn(e,t,n){if(null==t||n)return Mn(e)||(e=Ft(e)),e[un(e.length-1)];var r=Mn(e)?Jt(e):Ft(e),i=xt(r);t=Math.max(Math.min(t,i),0);for(var a=i-1,o=0;or||void 0===n)return 1;if(n1&&(r=nn(r,t[1])),t=Ct(e)):(r=or,t=En(t,!1,!1),e=Object(e));for(var i=0,a=t.length;i1&&(n=t[1])):(t=Ln(En(t,!1,!1),String),r=function(e,n){return!Jn(t,n)}),sr(e,r,n)}));function cr(e,t,n){return Ae.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function lr(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:cr(e,e.length-t)}function pr(e,t,n){return Ae.call(e,null==t||n?1:t)}var fr=Le((function(e,t){return t=En(t,!0,!0),Hn(e,(function(e){return!Jn(t,e)}))})),hr=Le((function(e,t){return fr(e,t)}));function dr(e,t,n,r){$e(t)||(r=n,n=t,t=!1),null!=n&&(n=on(n,r));for(var i=[],a=[],o=0,s=xt(e);ot?(r&&(clearTimeout(r),r=null),s=c,o=e.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(u,l)),o};return c.cancel=function(){clearTimeout(r),s=0,r=i=a=null},c},debounce:function(e,t,n){var r,i,a=function(t,n){r=null,n&&(i=e.apply(t,n))},o=Le((function(o){if(r&&clearTimeout(r),n){var s=!r;r=setTimeout(a,t),s&&(i=e.apply(this,o))}else r=On(a,t,this,o);return i}));return o.cancel=function(){clearTimeout(r),r=null},o},wrap:function(e,t){return wn(t,e)},negate:Cn,compose:function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:kn,once:_n,findKey:In,findIndex:Pn,findLastIndex:Dn,sortedIndex:Bn,indexOf:qn,lastIndexOf:zn,find:Rn,detect:Rn,findWhere:function(e,t){return Rn(e,en(t))},each:Fn,forEach:Fn,map:Ln,collect:Ln,reduce:Vn,foldl:Vn,inject:Vn,reduceRight:$n,foldr:$n,filter:Hn,select:Hn,reject:function(e,t,n){return Hn(e,Cn(on(t)),n)},every:Gn,all:Gn,some:Wn,any:Wn,contains:Jn,includes:Jn,include:Jn,invoke:Zn,pluck:Kn,where:function(e,t){return Hn(e,en(t))},max:Yn,min:function(e,t,n){var r,i,a=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=Mn(e)?e:Ft(e)).length;s0)return{result:!1,errors:t};var a=this;return{result:!0,execute:function(){a.incidentsById=Object.assign(a.incidentsById,n),a.incidents=a.incidents.concat(r),a.incidents=Qn(a.incidents,[function(e){return e.millisecond}]);for(var t=0;t3&&void 0!==arguments[3]&&arguments[3];if(r)for(var i=0;ia.millisecond+o.duration?o.onProgress(1,o.duration,n,!0):o.onProgress((t-a.millisecond)/o.duration,t-a.millisecond,n,!0)}else{var s,u=this;s=Hn(this.incidents,t>e?function(n){return n.millisecond+u._incidentById(n.id).duration>=e&&n.millisecond+u._incidentById(n.id).duration<=t||u._incidentById(n.id).duration+n.millisecond>=t&&n.millisecond<=t}:function(n){return n.millisecond+u._incidentById(n.id).duration>=t&&n.millisecond+u._incidentById(n.id).duration<=e||u._incidentById(n.id).duration+n.millisecond>=e&&n.millisecond<=e});for(var c=0;c=1,h=f?1:(t-l.millisecond)/p.duration,d=f?p.duration:t-l.millisecond;p.onProgress(h,d,n,!1)}}}}]),n}(se),Nr=.1,Mr="function"==typeof Float32Array;function Er(e,t){return 1-3*t+3*e}function Sr(e,t){return 3*t-6*e}function Or(e){return 3*e}function Ar(e,t,n){return((Er(t,n)*e+Sr(t,n))*e+Or(t))*e}function Cr(e,t,n){return 3*Er(t,n)*e*e+2*Sr(t,n)*e+Or(t)}function kr(e){return e}var _r=function(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return kr;for(var i=Mr?new Float32Array(11):new Array(11),a=0;a<11;++a)i[a]=Ar(a*Nr,e,n);function o(t){for(var r=0,a=1;10!==a&&i[a]<=t;++a)r+=Nr;--a;var o=r+(t-i[a])/(i[a+1]-i[a])*Nr,s=Cr(o,e,n);return s>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var a=Cr(t,n,r);if(0===a)return t;t-=(Ar(t,n,r)-e)/a}return t}(t,o,e,n):0===s?o:function(e,t,n,r,i){var a,o,s=0;do{(a=Ar(o=t+(n-t)/2,r,i)-e)>0?n=o:t=o}while(Math.abs(a)>1e-7&&++s<10);return o}(t,r,r+Nr,e,n)}return function(e){return 0===e?0:1===e?1:Ar(o(e),t,r)}};function Ir(e){e.descriptor.value=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={};return n[this.mc_plugin_npm_name]=[{millisecond:e,parentMillisecond:t,incident:this,id:this.id}],n}}var Tr=I(null,(function(e){return{F:function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;s(this,t),e(this),this.attrs=n,this.props=r,this.dna=i,this.context=i.context,this.mcid=i.mcid,this.id=r.id||te(),this.modelId=r.modelId,this.gotContext=!1,this.plugin_channel_class=se,this.mc_plugin_npm_name="motor-cortex-js",Object.prototype.hasOwnProperty.call(r,"plugin_channel_class")&&(this.plugin_channel_class=r.plugin_channel_class),Object.prototype.hasOwnProperty.call(r,"mc_plugin_npm_name")&&(this.mc_plugin_npm_name=r.mc_plugin_npm_name),this.hasIncidents=!1,this.initialValues={},this.userDefinedInitialValues=n.initialValues||{},this.pureInitialValues=null,this.autoGenerated=!1,this.onInitialise()},d:[{kind:"get",key:"selector",value:function(){return this.props.selector}},{kind:"get",key:"animAttributes",value:function(){return this.attrs.animatedAttrs}},{kind:"set",key:"animAttributes",value:function(e){this.attrs.animatedAttrs[this.attributeKey]=e}},{kind:"method",key:"getScratchValue",value:function(){return 0}},{kind:"get",key:"element",value:function(){return null===this.contex?[]:this.context.getElementByMCID?this.context.getElementByMCID(this.mcid):this.context.getElements(this.selector)[0]}},{kind:"get",key:"attributeKey",value:function(){return Object.keys(this.attrs.animatedAttrs)[0]}},{kind:"get",key:"targetValue",value:function(){return this.animAttributes[this.attributeKey]}},{kind:"method",key:"getElementAttribute",value:function(e){return this.element.getAttribute(e)}},{kind:"method",decorators:[Ir],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"hasUserDefinedInitialValue",value:function(){return!!Object.prototype.hasOwnProperty.call(this.userDefinedInitialValues,this.attributeKey)}},{kind:"method",key:"setInitialValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t&&(this.pureInitialValues=JSON.parse(JSON.stringify(e))),this.hasUserDefinedInitialValue())if("object"===o(this.targetValue)){for(var n in this.userDefinedInitialValues[this.attributeKey])e[n]=this.userDefinedInitialValues[this.attributeKey][n];this.initialValues[this.attributeKey]=e}else this.initialValues[this.attributeKey]=this.userDefinedInitialValues[this.attributeKey];else this.initialValues[this.attributeKey]=e}},{kind:"get",key:"initialValue",value:function(){return this.initialValues[this.attributeKey]}},{kind:"method",key:"getInitialValue",value:function(){return this.initialValues[this.attributeKey]}},{kind:"method",key:"_onGetContextOnce",value:function(){try{if(!0===this.context.fragment)return;this.gotContext||(this.onGetContext(),this.gotContext=!0)}catch(e){console.log(e),console.log(this.mcid)}}},{kind:"method",key:"onGetContext",value:function(){ae.info('Overwritte the "onGetContext" method with the code you want to get executed',"info")}},{kind:"method",key:"lastWish",value:function(){}},{kind:"method",key:"onInitialise",value:function(){ae.info('Overwritte the "onInialise" method with the code you want to get executed',"info")}},{kind:"method",key:"onProgress",value:function(e,t){}},{kind:"method",decorators:[ge],key:"setBlock",value:function(){}},{kind:"method",decorators:[xe],key:"unblock",value:function(){}}]}})),Pr=function(e){h(n,e);var t=v(n);function n(e,r,i){var a;return s(this,n),(a=t.call(this,e,r,i)).runTimeInfo={currentMillisecond:0},a}return c(n,[{key:"lastWish",value:function(){this.ownClip&&this.ownClip.ownContext.unmount()}},{key:"onGetContext",value:function(){var e=this,t=this.DescriptiveIncident.realClip.exportConstructionArguments(),n=ae.getElementByMCID(this.context,this.mcid),r=f(f({},t.props),{},{selector:void 0,host:n,containerParams:this.DescriptiveIncident.props.containerParams||{},originalDims:this.DescriptiveIncident.constructor.originalDims||{}});this.ownClip=new this.DescriptiveIncident.constructor.Incident(t.attrs,r),this.ownClip.DescriptiveIncident=this.DescriptiveIncident,this.DescriptiveIncident.realClip.addContext({clipId:this.id,context:this.ownClip.ownContext,unblock:function(){return e.unblock()}},!0)}},{key:"onProgress",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!1!==this.DescriptiveIncident.realClip.context.contextLoaded){for(var r in this.DescriptiveIncident.realClip.instantiatedChannels){var i=this.DescriptiveIncident.realClip.instantiatedChannels[r];i.moveTo(this.runTimeInfo.currentMillisecond,t,this.id,n)}this.runTimeInfo.currentMillisecond=t,this.ownClip.onAfterProgress(e,t)}else this.setBlock()}},{key:"duration",get:function(){return this.DescriptiveIncident.realClip.duration},set:function(e){this.DescriptiveIncident.realClip._resize(e/this.realClip.duration)}}]),n}(Tr);function Dr(e){var t=new e.Incident(e.attrs,f(f({},e.props),{},{id:e.id||te()}),{context:e.context,mcid:e.mcid});return t.mc_plugin_npm_name=e.plugin_npm_name,t.plugin_channel_class=e.Channel,t.DescriptiveIncident=e.DescriptiveIncident,t}var Br={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},easeInSine:function(e){return-1*Math.cos(e/1*(Math.PI/2))+1},easeOutSine:function(e){return 1*Math.sin(e/1*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e/1)-1)},easeInExpo:function(e){return 0==e?1:1*Math.pow(2,10*(e/1-1))},easeOutExpo:function(e){return 1==e?1:1*(1-Math.pow(2,-10*e/1))},easeInOutExpo:function(e){return 0==e?0:1==e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return e>=1?e:-1*(Math.sqrt(1-(e/=1)*e)-1)},easeOutCirc:function(e){return 1*Math.sqrt(1-(e=e/1-1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,r=1;return 0==e?0:1==(e/=1)?1:(n||(n=.3),r3&&void 0!==arguments[3]&&arguments[3],i=this.easing(e)||0,a=i*this.duration;!1!==this.originalContext.context.contextLoaded&&this.contexts[n].onProgress(i,a,r)}},{kind:"method",key:"addContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];0===Object.keys(this.contexts).length&&(this.originalContextKey=e.clipId);var n=f(f({},this.constructionIngredients),{},{context:e.context,mcid:this.mcid,Incident:Pr,DescriptiveIncident:this.DescriptiveIncident});this.contexts[e.clipId]=Dr(n),t&&this.contexts[e.clipId]._onGetContextOnce()}},{kind:"method",key:"handleAddContext",value:function(e,t){return this.addContext(t,!0),!0}},{kind:"method",key:"handleContextLoaded",value:function(e,t){this._onGetContextOnce()}},{kind:"method",decorators:[Ir],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"gotContext",value:function(){for(var e in this.contexts)this.contexts[e].gotContext()}},{kind:"method",key:"_onGetContextOnce",value:function(){if(!1!==this.originalContext.contextLoaded)for(var e in this.contexts)this.contexts[e]._onGetContextOnce()}},{kind:"method",key:"lastWish",value:function(){for(var e in this.contexts)this.contexts[e].lastWish()}},{kind:"method",key:"onGetContext",value:function(){if(!1!==this.originalContext.contextLoaded)for(var e in this.contexts)this.contexts[e].onGetContext()}}]}}),fe),qr=I(null,(function(e,t){var n=function(t){h(r,t);var n=v(r);function r(t,i,a,u){var c;return s(this,r),c=n.call(this,f(f({},t.props),{},{id:null!==u?"".concat(t.incidentId,"_").concat(a,"_").concat(u):"".concat(t.incidentId,"_").concat(a)})),e(y(c)),c.contexts={},c.constructionIngredients=t,c.mcid=a,c.attribute=u,c.mc_plugin_npm_name=t.plugin_npm_name,c.plugin_channel_class=t.Channel,c.DescriptiveIncident=t.DescriptiveIncident,c.addContext(i),null!==u&&(c.constructionIngredients.attrs.animatedAttrs[c.attribute]instanceof Array?c.originalAnimatedAttributeValue=c.constructionIngredients.attrs.animatedAttrs[c.attribute].slice():"object"===o(c.constructionIngredients.attrs.animatedAttrs[c.attribute])?c.originalAnimatedAttributeValue=f({},c.constructionIngredients.attrs.animatedAttrs[c.attribute]):c.originalAnimatedAttributeValue=c.constructionIngredients.attrs.animatedAttrs[c.attribute]),c.easing=Br.linear,Object.prototype.hasOwnProperty.call(c.props,"easing")&&(Array.isArray(c.props.easing)?c.easing=_r(c.props.easing[0],c.props.easing[1],c.props.easing[2],c.props.easing[3]):c.easing=Br[c.props.easing]),c}return r}(t);return{F:n,d:[{kind:"get",key:"originalContext",value:function(){return this.contexts[this.originalContextKey]}},{kind:"get",key:"duration",value:function(){return b(d(n.prototype),"duration",this)}},{kind:"set",key:"duration",value:function(e){for(var t in N(d(n.prototype),"duration",e,this,!0),this.contexts)this.contexts[t].duration=e}},{kind:"method",key:"addContext",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!1;0===Object.keys(this.contexts).length&&(this.originalContextKey=e.clipId,this.originalClipContext=e.context,n=!0);var r=f(f({},this.constructionIngredients),{},{context:e.context,mcid:this.mcid}),i=Dr(r);this.contexts[e.clipId]=i,n||null===this.attribute||this.contexts[e.clipId].setInitialValue(this.getInitialValue()),t&&this.contexts[e.clipId].context.contextLoaded&&this.contexts[e.clipId]._onGetContextOnce()}},{kind:"method",key:"handleAddContext",value:function(e,t){return this.addContext(t,!0),!0}},{kind:"method",key:"handleContextLoaded",value:function(e,t){return this._onGetContextOnce(),!0}},{kind:"method",decorators:[Ir],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"onProgress",value:function(e,t,n){var r=t%(this.delay+this.props.duration+this.hiatus);0!==t&&0===r&&(r=this.delay+this.props.duration);var i=r-this.delay;i<0?i=0:i>this.props.duration&&(i=this.props.duration);var a=i/this.props.duration,o=this.easing(a),s=o*this.props.duration;if(void 0!==n)!1!==this.originalContext.context.contextLoaded&&this.contexts[n].onProgress(o,s);else for(var u in this.contexts)this.originalContextKey===u&&!0===this.originalContext.fragment||this.contexts[u].onProgress(o,s)}},{kind:"get",key:"animatedAttributeValue",value:function(){return this.constructionIngredients.attrs.animatedAttrs[this.attribute]}},{kind:"set",key:"animatedAttributeValue",value:function(e){this.constructionIngredients.attrs.animatedAttrs[this.attribute]=e}},{kind:"method",key:"gotContext",value:function(){for(var e in this.contexts)this.contexts[e].gotContext()}},{kind:"method",key:"_onGetContextOnce",value:function(){if(!1!==this.originalContext.context.contextLoaded)for(var e in this.contexts)this.contexts[e]._onGetContextOnce()}},{kind:"method",key:"lastWish",value:function(){for(var e in this.contexts)this.contexts[e].lastWish()}},{kind:"method",key:"onGetContext",value:function(){if(!1!==this.originalContext.contextLoaded)for(var e in this.contexts)this.contexts[e].context.contextLoaded&&this.contexts[e].onGetContext()}},{kind:"method",key:"getInitialValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===e&&(e=this.attribute),this.originalContext.getInitialValue()}},{kind:"get",key:"initialValue",value:function(){return this.getInitialValue()}},{kind:"get",key:"scratchValue",value:function(){return this.originalContext.scratchValue}},{kind:"get",key:"pureInitialValues",value:function(){return this.originalContext.pureInitialValues}},{kind:"method",key:"setInitialValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];for(var n in null===e&&(e=this.getScratchValue()),this.contexts)this.contexts[n].setInitialValue(JSON.parse(JSON.stringify(e)),t)}},{kind:"method",key:"getScratchValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!1===this.originalContext.context.contextLoaded)return 0;if(null===e){var t=Object.keys(this.contexts);if(Object.prototype.hasOwnProperty.call(this.originalClipContext,"nonFragmentedContext")){var n=f(f({},this.constructionIngredients),{},{context:this.originalClipContext.nonFragmentedContext,mcid:this.mcid}),r=Dr(n);return r.getScratchValue()}return 1===t.length?this.originalContext.getScratchValue():this.contexts[t[1]].getScratchValue()}return this.contexts[e].getScratchValue()}},{kind:"method",key:"setCompoAttrKeyValue",value:function(e,t){for(var n in this.contexts)this.contexts[n].attrs.animatedAttrs[this.attribute][e]=t,this.contexts[n].lastWish(),this.contexts[n].onGetContext()}},{kind:"method",key:"play",value:function(e,t,n){return this.contexts[n].play(t)}},{kind:"method",key:"stop",value:function(e){this.contexts[e].stop()}}]}}),fe),zr=function(e){h(n,e);var t=v(n);function n(e,r,i,a){var o,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return s(this,n),(o=t.call(this,{},{id:"".concat(e.id,"_").concat(i)})).mcid=i,o.selector=a,o.dynamicValues=null!==u?u:{attrs:[],props:[]},o.setUp(e,r),o}return c(n,[{key:"setUp",value:function(e,t){var n=e.attrs,r=e.props;if(this.dynamicValues.attrs.length>0){n=JSON.parse(JSON.stringify(e.attrs));for(var i=0;i0){r=JSON.parse(JSON.stringify(e.props));for(var a=0;a0&&(this.descriptiveIncident.dynamicDurationValue=1*this.duration),r}},{key:"lastWish",value:function(){this.descriptiveIncident.propsStaggers.length>0&&(this.descriptiveIncident.dynamicDurationValue=null,this.descriptiveIncident.putMessageOnPipe("setDurationDynamic",{},"Groups",{selfExecute:!1,direction:ce})),b(d(n.prototype),"lastWish",this).call(this)}},{key:"_getElementMCID",value:function(e){var t=this.originalContext.getMCID(e);return t||(t=te(!0),this.originalContext.setMCID(e,t)),t}},{key:"_setElementMCID",value:function(e,t,n){e.getMCID(t)||e.setMCID(t,n)}},{key:"_createElementIncident",value:function(e,t,n,r,i,a){if(Object.prototype.hasOwnProperty.call(t.attrs,"animatedAttrs")){var o=new zr(t,n,a,n.context.getElementSelectorByMCID(a),{attrs:Rr(this.staggerAttrs,r),props:Fr(this.staggerProps,r)});this.addChild(o,0)}else{var s=t.attrs,u=f({},t.props),c={incidentId:t.id,attrs:s,props:u,Incident:t.constructor.Incident,plugin_npm_name:t.constructor.plugin_npm_name,Channel:t.constructor.Channel,DescriptiveIncident:t},l=new qr(c,n,a,null);this.addChild(l,0)}}},{key:"originalContext",get:function(){return this.contexts[this.originalContextKey]}}]),n}(be),Ur=function(e){h(n,e);var t=v(n);function n(e,r){var i;return s(this,n),(i=t.call(this,e,r)).realClip=e.realClip,i}return c(n,[{key:"_createElementIncident",value:function(e,t,n,r,i,a){var o=t.realClip.exportConstructionArguments(),s={incidentId:t.id,attrs:o.attrs,props:f(f({},o.props),{},{selector:n.context.getElementSelectorByMCID(a),runTimeInfo:t.runTimeInfo}),Incident:t.constructor.Incident,plugin_npm_name:t.constructor.plugin_npm_name,Channel:wr,DescriptiveIncident:t},u=new jr(s,n,a,t);this.addChild(u,0)}},{key:"duration",get:function(){return b(d(n.prototype),"duration",this)},set:function(e){this.realClip._resize(e/this.realClip.duration),this._duration=e}}]),n}(Lr),Vr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;Object.prototype.hasOwnProperty.call(i,r)||(i[r]={});for(var a=i[r],o=e.split("."),s=0;s=0?this[s]:n.indexOf(s)>=0?void 0:(r&&null!==a&&(s=a[s]),Object.prototype.hasOwnProperty.call(t,s)?t[s]:e[s])},isArray:function(){return r},_getFromProxy:function(e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},set:function(){return!1},sortBy:function(e){if(a=null,!r)return!1;a=function(e,t){for(var n=[],r=0;r-1&&n.splice(s,1)}else i.setValue(r[r.length-1],a),i.restoreKey(r[r.length-1]);return!0},pushValue:function(t,n){var r=t.split("."),i=this.__createPathProxies(r),a=i.currentObject;if(void 0===i.currentRealObect)return!1;var o=r[r.length-1],s=a[o],u=e[o];if(""===t&&(s=this,u=e),1!==r.length)return a.pushValue(o,n);var c=!1;if(void 0!==s){if(c=!0,!s.isArray())return!1}else if(!Array.isArray(u))return!1;if(!c){var l=$r(u);a[o]=l,s=a[o]}return s.push(n),!0},push:function(e){return!!this.isArray()&&("object"===o(e)?t[i]=$r(e):t[i]=e,i+=1,!0)},removePathKey:function(e){var t=e.split(".");return this.__createPathProxies(t).currentObject.removeKey(t[t.length-1]),!0},removeKey:function(e){n.push(e)},restoreKey:function(e){var t=n.indexOf(e);t>-1&&n.splice(t,1)},hasOwnProperty:function(e){return!(n.indexOf(e)>-1)&&void 0!==this[e]},getKeys:function(){if(r)return[];for(var i=[],a=Object.keys(e),o=Object.keys(t),s=[].concat(E(a),E(o)),u=s.filter((function(e,t){return s.indexOf(e)===t})),c=0;c0}var Gr=function e(t,n,r={}){for(let i in n)if(Hr(n[i]))t[i]=t[i]||{},e(t[i],n[i],r);else{if(!0===r.skipIfExist&&void 0!==t[i])continue;t[i]=n[i]}return t},Wr={required:"The '{field}' field is required.",string:"The '{field}' field must be a string.",stringEmpty:"The '{field}' field must not be empty.",stringMin:"The '{field}' field length must be greater than or equal to {expected} characters long.",stringMax:"The '{field}' field length must be less than or equal to {expected} characters long.",stringLength:"The '{field}' field length must be {expected} characters long.",stringPattern:"The '{field}' field fails to match the required pattern.",stringContains:"The '{field}' field must contain the '{expected}' text.",stringEnum:"The '{field}' field does not match any of the allowed values.",stringNumeric:"The '{field}' field must be a numeric string.",stringAlpha:"The '{field}' field must be an alphabetic string.",stringAlphanum:"The '{field}' field must be an alphanumeric string.",stringAlphadash:"The '{field}' field must be an alphadash string.",stringHex:"The '{field}' field must be a hex string.",stringSingleLine:"The '{field}' field must be a single line string.",number:"The '{field}' field must be a number.",numberMin:"The '{field}' field must be greater than or equal to {expected}.",numberMax:"The '{field}' field must be less than or equal to {expected}.",numberEqual:"The '{field}' field must be equal to {expected}.",numberNotEqual:"The '{field}' field can't be equal to {expected}.",numberInteger:"The '{field}' field must be an integer.",numberPositive:"The '{field}' field must be a positive number.",numberNegative:"The '{field}' field must be a negative number.",array:"The '{field}' field must be an array.",arrayEmpty:"The '{field}' field must not be an empty array.",arrayMin:"The '{field}' field must contain at least {expected} items.",arrayMax:"The '{field}' field must contain less than or equal to {expected} items.",arrayLength:"The '{field}' field must contain {expected} items.",arrayContains:"The '{field}' field must contain the '{expected}' item.",arrayUnique:"The '{actual}' value in '{field}' field does not unique the '{expected}' values.",arrayEnum:"The '{actual}' value in '{field}' field does not match any of the '{expected}' values.",tuple:"The '{field}' field must be an array.",tupleEmpty:"The '{field}' field must not be an empty array.",tupleLength:"The '{field}' field must contain {expected} items.",boolean:"The '{field}' field must be a boolean.",currency:"The '{field}' must be a valid currency format",date:"The '{field}' field must be a Date.",dateMin:"The '{field}' field must be greater than or equal to {expected}.",dateMax:"The '{field}' field must be less than or equal to {expected}.",enumValue:"The '{field}' field value '{expected}' does not match any of the allowed values.",equalValue:"The '{field}' field value must be equal to '{expected}'.",equalField:"The '{field}' field value must be equal to '{expected}' field value.",forbidden:"The '{field}' field is forbidden.",function:"The '{field}' field must be a function.",email:"The '{field}' field must be a valid e-mail.",emailEmpty:"The '{field}' field must not be empty.",luhn:"The '{field}' field must be a valid checksum luhn.",mac:"The '{field}' field must be a valid MAC address.",object:"The '{field}' must be an Object.",objectStrict:"The object '{field}' contains forbidden keys: '{actual}'.",objectMinProps:"The object '{field}' must contain at least {expected} properties.",objectMaxProps:"The object '{field}' must contain {expected} properties at most.",url:"The '{field}' field must be a valid URL.",urlEmpty:"The '{field}' field must not be empty.",uuid:"The '{field}' field must be a valid UUID.",uuidVersion:"The '{field}' field must be a valid UUID version provided.",classInstanceOf:"The '{field}' field must be an instance of the '{expected}' class.",objectID:"The '{field}' field must be an valid ObjectID"},Jr=function(){const e=[];return e.push("\n\t\treturn value;\n\t"),{source:e.join("\n")}},Zr=function({schema:e,messages:t},n,r){const i=[];if(i.push(`\n\t\tif (!Array.isArray(value)) {\n\t\t\t${this.makeError({type:"array",actual:"value",messages:t})}\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t`),!1===e.empty&&i.push(`\n\t\t\tif (len === 0) {\n\t\t\t\t${this.makeError({type:"arrayEmpty",actual:"value",messages:t})}\n\t\t\t}\n\t\t`),null!=e.min&&i.push(`\n\t\t\tif (len < ${e.min}) {\n\t\t\t\t${this.makeError({type:"arrayMin",expected:e.min,actual:"len",messages:t})}\n\t\t\t}\n\t\t`),null!=e.max&&i.push(`\n\t\t\tif (len > ${e.max}) {\n\t\t\t\t${this.makeError({type:"arrayMax",expected:e.max,actual:"len",messages:t})}\n\t\t\t}\n\t\t`),null!=e.length&&i.push(`\n\t\t\tif (len !== ${e.length}) {\n\t\t\t\t${this.makeError({type:"arrayLength",expected:e.length,actual:"len",messages:t})}\n\t\t\t}\n\t\t`),null!=e.contains&&i.push(`\n\t\t\tif (value.indexOf(${JSON.stringify(e.contains)}) === -1) {\n\t\t\t\t${this.makeError({type:"arrayContains",expected:JSON.stringify(e.contains),actual:"value",messages:t})}\n\t\t\t}\n\t\t`),!0===e.unique&&i.push(`\n\t\t\tif(len > (new Set(value)).size) {\n\t\t\t\t${this.makeError({type:"arrayUnique",expected:"Array.from(new Set(value.filter((item, index) => value.indexOf(item) !== index)))",actual:"value",messages:t})}\n\t\t\t}\n\t\t`),null!=e.enum){const n=JSON.stringify(e.enum);i.push(`\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tif (${n}.indexOf(value[i]) === -1) {\n\t\t\t\t\t${this.makeError({type:"arrayEnum",expected:'"'+e.enum.join(", ")+'"',actual:"value[i]",messages:t})}\n\t\t\t\t}\n\t\t\t}\n\t\t`)}if(null!=e.items){i.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t");const t=n+"[]",a=this.getRuleFromSchema(e.items),o='arr[i] = context.fn[%%INDEX%%](arr[i], (parentField ? parentField : "") + "[" + i + "]", parent, errors, context)';i.push(this.compileRule(a,r,t,o,"arr[i]")),i.push("\n\t\t\t}\n\t\t")}return i.push("\n\t\treturn value;\n\t"),{source:i.join("\n")}},Kr=function({schema:e,messages:t},n,r){const i=[];let a=!1;return i.push("\n\t\tvar origValue = value;\n\t"),!0===e.convert&&(a=!0,i.push('\n\t\t\tif (typeof value !== "boolean") {\n\t\t\t\tif (\n\t\t\t\tvalue === 1\n\t\t\t\t|| value === "true"\n\t\t\t\t|| value === "1"\n\t\t\t\t|| value === "on"\n\t\t\t\t) {\n\t\t\t\t\tvalue = true;\n\t\t\t\t} else if (\n\t\t\t\tvalue === 0\n\t\t\t\t|| value === "false"\n\t\t\t\t|| value === "0"\n\t\t\t\t|| value === "off"\n\t\t\t\t) {\n\t\t\t\t\tvalue = false;\n\t\t\t\t}\n\t\t\t}\n\t\t')),i.push(`\n\t\tif (typeof value !== "boolean") {\n\t\t\t${this.makeError({type:"boolean",actual:"origValue",messages:t})}\n\t\t}\n\t\t\n\t\treturn value;\n\t`),{sanitized:a,source:i.join("\n")}},Yr=function({schema:e,messages:t,index:n},r,i){const a=[],o=e.instanceOf.name?e.instanceOf.name:"";return i.customs[n]?i.customs[n].schema=e:i.customs[n]={schema:e},a.push(`\n\t\tif (!(value instanceof context.customs[${n}].schema.instanceOf))\n\t\t\t${this.makeError({type:"classInstanceOf",actual:"value",expected:"'"+o+"'",messages:t})}\n\t`),a.push("\n\t\treturn value;\n\t"),{source:a.join("\n")}},Xr=function({schema:e,messages:t,index:n},r,i){const a=[];return a.push(`\n\t\t${this.makeCustomValidator({fnName:"check",path:r,schema:e,messages:t,context:i,ruleIndex:n})}\n\t\treturn value;\n\t`),{source:a.join("\n")}};const Qr="(?=.*\\d)^(-?~1|~1-?)(([0-9]\\d{0,2}(~2\\d{3})*)|0)?(\\~3\\d{1,2})?$";var ei=function({schema:e,messages:t},n,r){const i=e.currencySymbol||null,a=e.thousandSeparator||",",o=e.decimalSeparator||".",s=e.customRegex;let u=!e.symbolOptional,c=Qr.replace(/~1/g,i?`\\${i}${u?"":"?"}`:"").replace("~2",a).replace("~3",o);return{source:`\n\t\t\tif (!value.match(${s||new RegExp(c)})){\n\t\t\treturn ${this.makeError({type:"currency",actual:"value",messages:t})}\n\t\t\t}\n\t\t\treturn value;\n\t\t`}},ti=function({schema:e,messages:t},n,r){const i=[];let a=!1;return i.push("\n\t\tvar origValue = value;\n\t"),!0===e.convert&&(a=!0,i.push("\n\t\t\tif (!(value instanceof Date)) {\n\t\t\t\tvalue = new Date(value);\n\t\t\t}\n\t\t")),i.push(`\n\t\tif (!(value instanceof Date) || isNaN(value.getTime()))\n\t\t\t${this.makeError({type:"date",actual:"origValue",messages:t})}\n\n\t\treturn value;\n\t`),{sanitized:a,source:i.join("\n")}};const ni=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ri=/^\S+@\S+\.\S+$/;var ii=function({schema:e,messages:t},n,r){const i=[],a="precise"==e.mode?ni:ri;let o=!1;return i.push(`\n\t\tif (typeof value !== "string") {\n\t\t\t${this.makeError({type:"string",actual:"value",messages:t})}\n\t\t\treturn value;\n\t\t}\n\t`),e.empty?i.push("\n\t\t\tif (value.length === 0) return value;\n\t\t"):i.push(`\n\t\t\tif (value.length === 0) {\n\t\t\t\treturn ${this.makeError({type:"emailEmpty",actual:"value",messages:t})}\n\t\t\t}\n\t\t`),e.normalize&&(o=!0,i.push("\n\t\t\tvalue = value.trim().toLowerCase();\n\t\t")),i.push(`\n\t\tif (!${a.toString()}.test(value)) {\n\t\t\t${this.makeError({type:"email",actual:"value",messages:t})}\n\t\t}\n\n\t\treturn value;\n\t`),{sanitized:o,source:i.join("\n")}},ai=function({schema:e,messages:t},n,r){return{source:`\n\t\t\tif (${JSON.stringify(e.values||[])}.indexOf(value) === -1)\n\t\t\t\t${this.makeError({type:"enumValue",expected:'"'+e.values.join(", ")+'"',actual:"value",messages:t})}\n\t\t\t\n\t\t\treturn value;\n\t\t`}},oi=function({schema:e,messages:t},n,r){const i=[];return e.field?(e.strict?i.push(`\n\t\t\t\tif (value !== parent["${e.field}"])\n\t\t\t`):i.push(`\n\t\t\t\tif (value != parent["${e.field}"])\n\t\t\t`),i.push(`\n\t\t\t\t${this.makeError({type:"equalField",actual:"value",expected:JSON.stringify(e.field),messages:t})}\n\t\t`)):(e.strict?i.push(`\n\t\t\t\tif (value !== ${JSON.stringify(e.value)})\n\t\t\t`):i.push(`\n\t\t\t\tif (value != ${JSON.stringify(e.value)})\n\t\t\t`),i.push(`\n\t\t\t\t${this.makeError({type:"equalValue",actual:"value",expected:JSON.stringify(e.value),messages:t})}\n\t\t`)),i.push("\n\t\treturn value;\n\t"),{source:i.join("\n")}},si=function({schema:e,messages:t},n,r){const i=[];return i.push("\n\t\tif (value !== null && value !== undefined) {\n\t"),e.remove?i.push("\n\t\t\treturn undefined;\n\t\t"):i.push(`\n\t\t\t${this.makeError({type:"forbidden",actual:"value",messages:t})}\n\t\t`),i.push("\n\t\t}\n\n\t\treturn value;\n\t"),{source:i.join("\n")}},ui=function({schema:e,messages:t},n,r){return{source:`\n\t\t\tif (typeof value !== "function")\n\t\t\t\t${this.makeError({type:"function",actual:"value",messages:t})}\n\n\t\t\treturn value;\n\t\t`}},ci=function({schema:e,messages:t},n,r){const i=[];i.push("\n\t\tvar prevErrLen = errors.length;\n\t\tvar errBefore;\n\t\tvar hasValid = false;\n\t\tvar newVal = value;\n\t");for(let t=0;t ${e.max}) {\n\t\t\t\t${this.makeError({type:"numberMax",expected:e.max,actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),null!=e.equal&&i.push(`\n\t\t\tif (value !== ${e.equal}) {\n\t\t\t\t${this.makeError({type:"numberEqual",expected:e.equal,actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),null!=e.notEqual&&i.push(`\n\t\t\tif (value === ${e.notEqual}) {\n\t\t\t\t${this.makeError({type:"numberNotEqual",expected:e.notEqual,actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.integer&&i.push(`\n\t\t\tif (value % 1 !== 0) {\n\t\t\t\t${this.makeError({type:"numberInteger",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.positive&&i.push(`\n\t\t\tif (value <= 0) {\n\t\t\t\t${this.makeError({type:"numberPositive",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.negative&&i.push(`\n\t\t\tif (value >= 0) {\n\t\t\t\t${this.makeError({type:"numberNegative",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),i.push("\n\t\treturn value;\n\t"),{sanitized:a,source:i.join("\n")}};const pi=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/,fi=/["'\\\n\r\u2028\u2029]/g;function hi(e){return e.replace(fi,(function(e){switch(e){case'"':case"'":case"\\":return"\\"+e;case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029"}}))}var di=function({schema:e,messages:t},n,r){const i=[];i.push(`\n\t\tif (typeof value !== "object" || value === null || Array.isArray(value)) {\n\t\t\t${this.makeError({type:"object",actual:"value",messages:t})}\n\t\t\treturn value;\n\t\t}\n\t`);const a=e.properties||e.props;if(a){i.push("var parentObj = value;"),i.push("var parentField = field;");const o=Object.keys(a);for(let e=0;e ${e.maxProps}) {\n\t\t\t\t${this.makeError({type:"objectMaxProps",expected:e.maxProps,actual:"props.length",messages:t})}\n\t\t\t}\n\t\t`),a?i.push("\n\t\t\treturn parentObj;\n\t\t"):i.push("\n\t\t\treturn value;\n\t\t"),{source:i.join("\n")}},mi=function({schema:e,messages:t,index:n},r,i){const a=[];return i.customs[n]?i.customs[n].schema=e:i.customs[n]={schema:e},a.push(`\n\t\tconst ObjectID = context.customs[${n}].schema.ObjectID;\n\t\tif (!ObjectID.isValid(value)) {\n\t\t\t${this.makeError({type:"objectID",actual:"value",messages:t})}\n\t\t\treturn;\n\t\t}\n\t`),!0===e.convert?a.push("return new ObjectID(value)"):"hexString"===e.convert?a.push("return value.toString()"):a.push("return value"),{source:a.join("\n")}};const yi=/^-?[0-9]\d*(\.\d+)?$/,gi=/^[a-zA-Z]+$/,vi=/^[a-zA-Z0-9]+$/,xi=/^[a-zA-Z0-9_-]+$/,bi=/^[0-9a-fA-F]+$/;var wi=function({schema:e,messages:t},n,r){const i=[];let a=!1;if(!0===e.convert&&(a=!0,i.push('\n\t\t\tif (typeof value !== "string") {\n\t\t\t\tvalue = String(value);\n\t\t\t}\n\t\t')),i.push(`\n\t\tif (typeof value !== "string") {\n\t\t\t${this.makeError({type:"string",actual:"value",messages:t})}\n\t\t\treturn value;\n\t\t}\n\n\t\tvar origValue = value;\n\t`),e.trim&&(a=!0,i.push("\n\t\t\tvalue = value.trim();\n\t\t")),e.trimLeft&&(a=!0,i.push("\n\t\t\tvalue = value.trimLeft();\n\t\t")),e.trimRight&&(a=!0,i.push("\n\t\t\tvalue = value.trimRight();\n\t\t")),e.padStart){a=!0;const t=null!=e.padChar?e.padChar:" ";i.push(`\n\t\t\tvalue = value.padStart(${e.padStart}, ${JSON.stringify(t)});\n\t\t`)}if(e.padEnd){a=!0;const t=null!=e.padChar?e.padChar:" ";i.push(`\n\t\t\tvalue = value.padEnd(${e.padEnd}, ${JSON.stringify(t)});\n\t\t`)}if(e.lowercase&&(a=!0,i.push("\n\t\t\tvalue = value.toLowerCase();\n\t\t")),e.uppercase&&(a=!0,i.push("\n\t\t\tvalue = value.toUpperCase();\n\t\t")),e.localeLowercase&&(a=!0,i.push("\n\t\t\tvalue = value.toLocaleLowerCase();\n\t\t")),e.localeUppercase&&(a=!0,i.push("\n\t\t\tvalue = value.toLocaleUpperCase();\n\t\t")),i.push("\n\t\t\tvar len = value.length;\n\t"),!1===e.empty&&i.push(`\n\t\t\tif (len === 0) {\n\t\t\t\t${this.makeError({type:"stringEmpty",actual:"value",messages:t})}\n\t\t\t}\n\t\t`),null!=e.min&&i.push(`\n\t\t\tif (len < ${e.min}) {\n\t\t\t\t${this.makeError({type:"stringMin",expected:e.min,actual:"len",messages:t})}\n\t\t\t}\n\t\t`),null!=e.max&&i.push(`\n\t\t\tif (len > ${e.max}) {\n\t\t\t\t${this.makeError({type:"stringMax",expected:e.max,actual:"len",messages:t})}\n\t\t\t}\n\t\t`),null!=e.length&&i.push(`\n\t\t\tif (len !== ${e.length}) {\n\t\t\t\t${this.makeError({type:"stringLength",expected:e.length,actual:"len",messages:t})}\n\t\t\t}\n\t\t`),null!=e.pattern){let n=e.pattern;"string"==typeof e.pattern&&(n=new RegExp(e.pattern,e.patternFlags));const r=`\n\t\t\tif (!${n.toString()}.test(value))\n\t\t\t\t${this.makeError({type:"stringPattern",expected:'"'+n.toString().replace('"','\\"')+'"',actual:"origValue",messages:t})}\n\t\t`;i.push(`\n\t\t\tif (${e.empty} === true && len === 0) {\n\t\t\t\t// Do nothing\n\t\t\t} else {\n\t\t\t\t${r}\n\t\t\t}\n\t\t`)}if(null!=e.contains&&i.push(`\n\t\t\tif (value.indexOf("${e.contains}") === -1) {\n\t\t\t\t${this.makeError({type:"stringContains",expected:'"'+e.contains+'"',actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),null!=e.enum){const n=JSON.stringify(e.enum);i.push(`\n\t\t\tif (${n}.indexOf(value) === -1) {\n\t\t\t\t${this.makeError({type:"stringEnum",expected:'"'+e.enum.join(", ")+'"',actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`)}return!0===e.numeric&&i.push(`\n\t\t\tif (!${yi.toString()}.test(value) ) {\n\t\t\t\t${this.makeError({type:"stringNumeric",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.alpha&&i.push(`\n\t\t\tif(!${gi.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringAlpha",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.alphanum&&i.push(`\n\t\t\tif(!${vi.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringAlphanum",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.alphadash&&i.push(`\n\t\t\tif(!${xi.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringAlphadash",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.hex&&i.push(`\n\t\t\tif(value.length % 2 !== 0 || !${bi.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringHex",actual:"origValue",messages:t})}\n\t\t\t}\n\t\t`),!0===e.singleLine&&i.push(`\n\t\t\tif(value.includes("\\n")) {\n\t\t\t\t${this.makeError({type:"stringSingleLine",messages:t})}\n\t\t\t}\n\t\t`),i.push("\n\t\treturn value;\n\t"),{sanitized:a,source:i.join("\n")}},Ni=function({schema:e,messages:t},n,r){const i=[];if(null!=e.items){if(!Array.isArray(e.items))throw new Error(`Invalid '${e.type}' schema. The 'items' field must be an array.`);if(0===e.items.length)throw new Error(`Invalid '${e.type}' schema. The 'items' field must not be an empty array.`)}if(i.push(`\n\t\tif (!Array.isArray(value)) {\n\t\t\t${this.makeError({type:"tuple",actual:"value",messages:t})}\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t`),!1===e.empty&&i.push(`\n\t\t\tif (len === 0) {\n\t\t\t\t${this.makeError({type:"tupleEmpty",actual:"value",messages:t})}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t`),null!=e.items){i.push(`\n\t\t\tif (${e.empty} !== false && len === 0) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (len !== ${e.items.length}) {\n\t\t\t\t${this.makeError({type:"tupleLength",expected:e.items.length,actual:"len",messages:t})}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t`),i.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t");for(let t=0;t 0)) {\n\t\t\t\t${this.makeError({type:"luhn",actual:"value",messages:t})}\n\t\t\t}\n\n\t\t\treturn value;\n\t\t`}},_i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ii(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ti(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}function Pi(e){var t={exports:{}};return e(t,t.exports),t.exports}function Di(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}let Bi,ji,qi,zi;var Ri=function(e){Bi||(Bi=Di("prettier"),ji={parser:"babel",useTabs:!1,printWidth:120,trailingComma:"none",tabWidth:4,singleQuote:!1,semi:!0,bracketSpacing:!0},qi=Di("cli-highlight"),zi={language:"js",theme:qi.fromJson({keyword:["white","bold"],built_in:"magenta",literal:"cyan",number:"magenta",regexp:"red",string:["yellow","bold"],symbol:"plain",class:"blue",attr:"plain",function:["white","bold"],title:"plain",params:"green",comment:"grey"})});const t=Bi.format(e,ji);return qi.highlight(t,zi)};var Fi=class{constructor(e){if(this.opts={},this.defaults={},this.messages=Object.assign({},Wr),this.rules={any:Jr,array:Zr,boolean:Kr,class:Yr,custom:Xr,currency:ei,date:ti,email:ii,enum:ai,equal:oi,forbidden:si,function:ui,multi:ci,number:li,object:di,objectID:mi,string:wi,tuple:Ni,url:Ei,uuid:Oi,mac:Ci,luhn:ki},this.aliases={},this.cache=new Map,e){if(Gr(this.opts,e),e.defaults&&Gr(this.defaults,e.defaults),e.messages)for(const t in e.messages)this.addMessage(t,e.messages[t]);if(e.aliases)for(const t in e.aliases)this.alias(t,e.aliases[t]);if(e.customRules)for(const t in e.customRules)this.add(t,e.customRules[t]);if(e.plugins){const t=e.plugins;if(!Array.isArray(t))throw new Error("Plugins type must be array");t.forEach(this.plugin.bind(this))}}}validate(e,t){return this.compile(t)(e)}wrapRequiredCheckSourceCode(e,t,n,r){const i=[];let a,o=!0===e.schema.optional||"forbidden"===e.schema.type,s=!0===e.schema.optional||!0===e.schema.nullable||"forbidden"===e.schema.type;if(null!=e.schema.default){let t;o=!1,!0!==e.schema.nullable&&(s=!1),"function"==typeof e.schema.default?(n.customs[e.index]||(n.customs[e.index]={}),n.customs[e.index].defaultFn=e.schema.default,t=`context.customs[${e.index}].defaultFn()`):t=JSON.stringify(e.schema.default),a=`\n\t\t\t\tvalue = ${t};\n\t\t\t\t${r} = value;\n\t\t\t`}else a=this.makeError({type:"required",actual:"value",messages:e.messages});return i.push(`\n\t\t\tif (value === undefined) { ${o?"\n// allow undefined\n":a} }\n\t\t\telse if (value === null) { ${s?"\n// allow null\n":a} }\n\t\t\t${t?`else { ${t} }`:""}\n\t\t`),i.join("\n")}compile(e){if(null===e||"object"!=typeof e)throw new Error("Invalid schema.");const t=this,n={index:0,rules:[],fn:[],customs:{}};if(this.cache.clear(),!0!==e.$$root)if(Array.isArray(e)){e=this.getRuleFromSchema(e).schema}else{const t=Object.assign({},e);e={type:"object",strict:t.$$strict,properties:t},delete t.$$strict}const r=["var errors = [];","var field;","var parent = null;"],i=this.getRuleFromSchema(e);r.push(this.compileRule(i,n,null,"context.fn[%%INDEX%%](value, field, null, errors, context);","value")),r.push("if (errors.length) {"),r.push('\n\t\t\treturn errors.map(err => {\n\t\t\t\tif (err.message)\n\t\t\t\t\terr.message = err.message\n\t\t\t\t\t\t.replace(/\\{field\\}/g, err.field || "")\n\t\t\t\t\t\t.replace(/\\{expected\\}/g, err.expected != null ? err.expected : "")\n\t\t\t\t\t\t.replace(/\\{actual\\}/g, err.actual != null ? err.actual : "");\n\n\t\t\t\treturn err;\n\t\t\t});\n\t\t'),r.push("}"),r.push("return true;");const a=r.join("\n"),o=new Function("value","context",a);if(this.opts.debug){let e=function(e){return e};"undefined"==typeof window&&(e=Ri),n.fn.forEach(((t,n)=>console.log(e(`// Context.fn[${n}]\n`+t.toString())))),console.log(e("// Main check function\n"+o.toString()))}return this.cache.clear(),function(e){return n.data=e,o.call(t,e,n)}}compileRule(e,t,n,r,i){const a=[],o=this.cache.get(e.schema);if(o)(e=o).cycle=!0,e.cycleStack=[],a.push(this.wrapRequiredCheckSourceCode(e,`\n\t\t\t\tvar rule = context.rules[${e.index}];\n\t\t\t\tif (rule.cycleStack.indexOf(value) === -1) {\n\t\t\t\t\trule.cycleStack.push(value);\n\t\t\t\t\t${r.replace(/%%INDEX%%/g,e.index)}\n\t\t\t\t\trule.cycleStack.pop(value);\n\t\t\t\t}\n\t\t\t`,t,i));else{this.cache.set(e.schema,e),e.index=t.index,t.rules[t.index]=e;const o=null!=n?n:"$$root";t.index++;const s=e.ruleFunction.call(this,e,n,t);s.source=s.source.replace(/%%INDEX%%/g,e.index);const u=new Function("value","field","parent","errors","context",s.source);t.fn[e.index]=u,a.push(this.wrapRequiredCheckSourceCode(e,r.replace(/%%INDEX%%/g,e.index),t,i)),a.push(this.makeCustomValidator({vName:i,path:o,schema:e.schema,context:t,messages:e.messages,ruleIndex:e.index}))}return a.join("\n")}getRuleFromSchema(e){if("string"==typeof e)e=this.parseShortHand(e);else if(Array.isArray(e)){if(0==e.length)throw new Error("Invalid schema.");(e={type:"multi",rules:e}).rules.map((e=>this.getRuleFromSchema(e))).every((e=>1==e.schema.optional))&&(e.optional=!0)}if(e.$$type){const t=e.$$type,n=this.getRuleFromSchema(t).schema;delete e.$$type;const r=Object.assign({},e);for(const t in e)delete e[t];Gr(e,n,{skipIfExist:!0}),e.props=r}const t=this.aliases[e.type];t&&(delete e.type,e=Gr(e,t,{skipIfExist:!0}));const n=this.rules[e.type];if(!n)throw new Error("Invalid '"+e.type+"' type in validator schema.");return{messages:Object.assign({},this.messages,e.messages),schema:Gr(e,this.defaults[e.type],{skipIfExist:!0}),ruleFunction:n}}parseShortHand(e){const t=e.split("|").map((e=>e.trim()));let n,r=t[0];return n=r.endsWith("[]")?this.getRuleFromSchema({type:"array",items:r.slice(0,-2)}).schema:{type:t[0]},t.slice(1).map((e=>{const t=e.indexOf(":");if(-1!==t){const r=e.substr(0,t).trim();let i=e.substr(t+1).trim();"true"===i||"false"===i?i="true"===i:Number.isNaN(Number(i))||(i=Number(i)),n[r]=i}else e.startsWith("no-")?n[e.slice(3)]=!1:n[e]=!0})),n}makeError({type:e,field:t,expected:n,actual:r,messages:i}){const a={type:`"${e}"`,message:`"${i[e]}"`};a.field=t?`"${t}"`:"field",null!=n&&(a.expected=n),null!=r&&(a.actual=r);return`errors.push({ ${Object.keys(a).map((e=>`${e}: ${a[e]}`)).join(", ")} });`}makeCustomValidator({vName:e="value",fnName:t="custom",ruleIndex:n,path:r,schema:i,context:a,messages:o}){const s="rule"+n,u="fnCustomErrors"+n;return"function"==typeof i[t]?(a.customs[n]?(a.customs[n].messages=o,a.customs[n].schema=i):a.customs[n]={messages:o,schema:i},this.opts.useNewCustomCheckerFunction?`\n const ${s} = context.customs[${n}];\n\t\t\t\t\tconst ${u} = [];\n\t\t\t\t\t${e} = ${s}.schema.${t}.call(this, ${e}, ${u} , ${s}.schema, "${r}", parent, context);\n\t\t\t\t\tif (Array.isArray(${u} )) {\n ${u} .forEach(err => errors.push(Object.assign({ message: ${s}.messages[err.type], field }, err)));\n\t\t\t\t\t}\n\t\t\t\t`:`\n\t\t\t\tconst ${s} = context.customs[${n}];\n\t\t\t\tconst res = ${s}.schema.${t}.call(this, ${e}, ${s}.schema, "${r}", parent, context);\n\t\t\t\tif (Array.isArray(res)) {\n\t\t\t\t\tres.forEach(err => errors.push(Object.assign({ message: ${s}.messages[err.type], field }, err)));\n\t\t\t\t}\n\t\t`):""}add(e,t){this.rules[e]=t}addMessage(e,t){this.messages[e]=t}alias(e,t){if(this.rules[e])throw new Error("Alias name must not be a rule name");this.aliases[e]=t}plugin(e){if("function"!=typeof e)throw new Error("Plugin fn type must be function");return e(this)}};function Li(e){e=e.replace(/ /g,"");return!!/^@stagger\(([_A-z0-9.%-]+?(,[_A-z0-9.%-]+)?(,[_A-z0-9.%-]+)?(,[_A-z0-9.%-]+)?(,[_A-z0-9.%-]+)?(,[_A-z0-9.%-]+))\)$/.test(e)}var Ui=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e=e.replace(/ /g,""),t&&!Li(e))return!1;var n=/.*\((.*)\).*/,r=n.exec(e)[1],i=r.split(",");return{start:i[0],end:i[1],startFraction:1*i[2]||0,easing:i[3]||"linear",mode:i[4]||"linear",reverse:"true"===i[5]}},Vi=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null===r&&(r="linear");var i=Br[r](n);return i*(t-e)+e},$i=function(){function e(t){s(this,e),this.staggerProps=t}return c(e,[{key:"resize",value:function(e){return this.staggerProps.from*=e,this.staggerProps.to*=e,!0===this.staggerProps.integer&&(this.staggerProps.from=Math.round(this.staggerProps.from),this.staggerProps.to=Math.round(this.staggerProps.to)),"@stagger(".concat(this.staggerProps.from).concat(this.staggerProps.unit,", ").concat(this.staggerProps.to).concat(this.staggerProps.unit,", ").concat(this.staggerProps.fraction||0,", ").concat(this.staggerProps.easing||"linear",", ").concat(this.staggerProps.mode||"linear",", ").concat(this.staggerProps.reverse||!1,")")}},{key:"calculateValues",value:function(e){for(var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[];if("linear"===n)for(var a=0;a3?e.slice(3):"any":e).split("|").map(R).filter(F).filter(z),i=I(t,r),a=r.map((function(e){var t=c(e);return{name:e,typeIndex:l(t),test:t.test,conversion:null,conversionIndex:-1}})),o=i.map((function(e){var n=c(e.from);return{name:e.from,typeIndex:l(n),test:n.test,conversion:e,conversionIndex:t.indexOf(e)}}));return{types:a.concat(o),restParam:n}}function y(e,t,n){var r=[];return""!==e.trim()&&(r=e.split(",").map(R).map((function(e,t,r){var i=m(e,n);if(i.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return i}))),r.some(U)?null:{params:r,fn:t}}function g(e){var t=$(e);return!!t&&t.restParam}function v(e){return e.types.some((function(e){return null!=e.conversion}))}function x(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){var n=c(t.types[0].name).test,r=c(t.types[1].name).test;return function(e){return n(e)||r(e)}}var i=t.types.map((function(e){return c(e.name).test}));return function(e){for(var t=0;t=i+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=x(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=x(e[0]),r=x(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(x),function(e){for(var n=0;n0){var c=p(t[a]);return(r=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+c+", index: "+a+")")).data={category:"wrongType",fn:o,index:a,actual:c,expected:i},r}}else s=u}var l=s.map((function(e){return g(e.params)?1/0:e.params.length}));if(t.lengthf?((r=new TypeError("Too many arguments in function "+o+" (expected: "+f+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:f},r):((r=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+o+".")).data={category:"mismatch",actual:t.map(p)},r)}function A(e){for(var t=999,n=0;n=i:s?i>=a:i===a}function q(e,r){if(0===Object.keys(r).length)throw new SyntaxError("No signatures provided");var i=[];Object.keys(r).map((function(e){return y(e,r[e],u.conversions)})).filter(L).forEach((function(e){var t=J(i,(function(t){return j(t,e)}));if(t)throw new TypeError('Conflicting signatures "'+d(t.params)+'" and "'+d(e.params)+'".');i.push(e)}));var a=K(i,(function(e){return(e?B(e.params,!1):[]).map((function(t){return{params:t,fn:e.fn}}))})).filter(L);a.sort(_);var o=a[0]&&a[0].params.length<=2&&!g(a[0].params),s=a[1]&&a[1].params.length<=2&&!g(a[1].params),c=a[2]&&a[2].params.length<=2&&!g(a[2].params),l=a[3]&&a[3].params.length<=2&&!g(a[3].params),p=a[4]&&a[4].params.length<=2&&!g(a[4].params),f=a[5]&&a[5].params.length<=2&&!g(a[5].params),h=o&&s&&c&&l&&p&&f,m=a.map((function(e){return b(e.params)})),v=o?x(a[0].params[0]):t,w=s?x(a[1].params[0]):t,N=c?x(a[2].params[0]):t,M=l?x(a[3].params[0]):t,E=p?x(a[4].params[0]):t,S=f?x(a[5].params[0]):t,A=o?x(a[0].params[1]):t,C=s?x(a[1].params[1]):t,k=c?x(a[2].params[1]):t,I=l?x(a[3].params[1]):t,P=p?x(a[4].params[1]):t,q=f?x(a[5].params[1]):t,z=a.map((function(e){return T(e.params,e.fn)})),R=o?z[0]:n,F=s?z[1]:n,U=c?z[2]:n,V=l?z[3]:n,$=p?z[4]:n,H=f?z[5]:n,G=o?a[0].params.length:-1,W=s?a[1].params.length:-1,Z=c?a[2].params.length:-1,Y=l?a[3].params.length:-1,X=p?a[4].params.length:-1,Q=f?a[5].params.length:-1,ee=h?6:0,te=a.length,ne=function(){for(var t=ee;t0?1:e<0?-1:0},La=Math.log2||function(e){return Math.log(e)/Math.LN2},Ua=Math.log10||function(e){return Math.log(e)/Math.LN10},Va=Math.log1p||function(e){return Math.log(e+1)},$a=Math.cbrt||function(e){if(0===e)return e;var t,n=e<0;return n&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,n?-t:t},Ha=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function Ga(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,r="auto";switch(t&&(t.notation&&(r=t.notation),Wi(t)?n=t:Wi(t.precision)&&(n=t.precision)),r){case"fixed":return Ja(e,n);case"exponential":return Za(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Ka(Wa(e),t),r=n.exponent,i=n.coefficients,a=r%3==0?r:r<0?r-3-r%3:r-r%3;if(Wi(t))for(;t>i.length||r-a+1>i.length;)i.push(0);else for(var o=Math.abs(r-a)-(i.length-1),s=0;s0;)c++,u--;var l=i.slice(c).join(""),p=Wi(t)&&l.length||l.match(/[1-9]/)?"."+l:"",f=i.slice(0,c).join("")+p+"e"+(r>=0?"+":"")+a.toString();return n.sign+f}(e,n);case"auto":return function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,i=n&&void 0!==n.upperExp?n.upperExp:5,a=Wa(e),o=t?Ka(a,t):a;if(o.exponent=i)return Za(e,t);var s=o.coefficients,u=o.exponent;s.length0?u:0;return c<(s=Ya(-u).concat(s)).length-1&&s.splice(c+1,0,"."),o.sign+s.join("")}(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", or "fixed".')}}function Wa(e){var t=String(e).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),a=r.indexOf(".");i+=-1!==a?a-1:r.length-1;var o=r.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===o.length&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function Ja(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Wa(e),r="number"==typeof t?Ka(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function Ka(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),r[--i]++}return n}function Ya(e){for(var t=[],n=0;n=0?"+":"")+r.toString()}(e,n);case"auto":var i=t&&void 0!==t.lowerExp?t.lowerExp:-3,a=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var o=e.toSignificantDigits(n),s=o.e;return(s>=i&&s'"'+n+'": '+co(e[n],t))).join(", ")+"}":String(e)}function lo(e){for(var t=String(e),n="",r=0;r/g,">")}function fo(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,i=0;it?1:-1}function mo(e,t,n){if(!(this instanceof mo))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function yo(e,t,n){if(!(this instanceof yo))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function go(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function vo(e,t,n){var r,i=e.length;if(i!==t[n])throw new mo(i,t[n]);if(n")}function xo(e,t){if(0===t.length){if(Array.isArray(e))throw new mo(e.length,0)}else vo(e,t,0)}function bo(e,t){if(!Wi(e)||!Ra(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new yo(e,t)}function wo(e,t,n){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach((function(e){if(!Wi(e)||!Ra(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+co(t)+")")})),No(e,t,0,void 0!==n?n:0),e}function No(e,t,n,r){var i,a,o=e.length,s=t[n],u=Math.min(o,s);if(e.length=s,ne*t))}if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new mo(0,i(go(e)),"!=");for(var a=1,o=0;ot.test(e)))}function Po(e,t){return Array.prototype.join.call(e,t)}function Do(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],n=0;t[0]={value:e[0],identifier:0};for(var r=1;r!function(e){return e&&"?"===e[0]}(e))).every((e=>void 0!==n[e]))){var r=t.filter((e=>void 0===n[e]));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(r.map((e=>'"'.concat(e,'"'))).join(", "),"."))}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function zo(e){return e&&"?"===e[0]?e.slice(1):e}mo.prototype=new RangeError,mo.prototype.constructor=RangeError,mo.prototype.name="DimensionError",mo.prototype.isDimensionError=!0,yo.prototype=new RangeError,yo.prototype.constructor=RangeError,yo.prototype.name="IndexError",yo.prototype.isIndexError=!0;var Ro=function(){return Ro=za.create,za},Fo=qo("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,a=Ro();return a.types=[{name:"number",test:Wi},{name:"Complex",test:Zi},{name:"BigNumber",test:Ji},{name:"Fraction",test:Ki},{name:"Unit",test:Yi},{name:"string",test:Xi},{name:"Chain",test:_a},{name:"Array",test:Qi},{name:"Matrix",test:ea},{name:"DenseMatrix",test:na},{name:"SparseMatrix",test:ra},{name:"Range",test:ia},{name:"Index",test:aa},{name:"boolean",test:oa},{name:"ResultSet",test:sa},{name:"Help",test:ua},{name:"function",test:ca},{name:"Date",test:la},{name:"RegExp",test:pa},{name:"null",test:ha},{name:"undefined",test:da},{name:"AccessorNode",test:ma},{name:"ArrayNode",test:ya},{name:"AssignmentNode",test:ga},{name:"BlockNode",test:va},{name:"ConditionalNode",test:xa},{name:"ConstantNode",test:ba},{name:"FunctionNode",test:Na},{name:"FunctionAssignmentNode",test:wa},{name:"IndexNode",test:Ma},{name:"Node",test:Ea},{name:"ObjectNode",test:Sa},{name:"OperatorNode",test:Oa},{name:"ParenthesisNode",test:Aa},{name:"RangeNode",test:Ca},{name:"SymbolNode",test:ka},{name:"Object",test:fa}],a.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||Lo(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||Uo(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||Uo(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||Uo(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||Vo(e);var t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||Lo(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||Vo(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||Uo(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||Lo(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||Vo(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],a}));function Lo(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Uo(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Vo(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var $o,Ho,Go=qo("ResultSet",[],(()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0}),Wo=9e15,Jo=1e9,Zo="0123456789abcdef",Ko="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Yo="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Xo={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Wo,maxE:Wo,crypto:!1},Qo=!0,es="[DecimalError] ",ts=es+"Invalid argument: ",ns=es+"Precision limit exceeded",rs=es+"crypto unavailable",is=Math.floor,as=Math.pow,os=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ss=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,us=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,cs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ls=1e7,ps=Ko.length-1,fs=Yo.length-1,hs={name:"[object Decimal]"};function ds(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;tn)throw Error(ts+e)}function ys(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),a=as(10,7-t),s=e[i]%a|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),o=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==as(10,t-2)-1||(s==a/2||0==s)&&0==(e[i+1]/a/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),o=(r||n<4)&&9999==s||!r&&n>3&&4999==s):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==as(10,t-3)-1,o}function gs(e,t,n){for(var r,i,a=[0],o=0,s=e.length;on-1&&(void 0===a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}hs.absoluteValue=hs.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),xs(e)},hs.ceil=function(){return xs(new this.constructor(this),this.e+1,2)},hs.comparedTo=hs.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,u=a.s,c=e.s;if(!o||!s)return u&&c?u!==c?u:o===s?0:!o^u<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?u:s[0]?-c:0;if(u!==c)return u;if(a.e!==e.e)return a.e>e.e^u<0?1:-1;for(t=0,n=(r=o.length)<(i=s.length)?r:i;ts[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},hs.cosine=hs.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i=t.d.length;i<32?r=(1/Bs(4,n=Math.ceil(i/3))).toString():(n=16,r="2.3283064365386962890625e-10");e.precision+=n,t=Ds(e,1,t.times(r),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}(r,js(r,n)),r.precision=e,r.rounding=t,xs(2==Ho||3==Ho?n.neg():n,e,t,!0)):new r(1):new r(NaN)},hs.cubeRoot=hs.cbrt=function(){var e,t,n,r,i,a,o,s,u,c,l=this,p=l.constructor;if(!l.isFinite()||l.isZero())return new p(l);for(Qo=!1,(a=l.s*as(l.s*l,1/3))&&Math.abs(a)!=1/0?r=new p(a.toString()):(n=ds(l.d),(a=((e=l.e)-n.length+1)%3)&&(n+=1==a||-2==a?"0":"00"),a=as(n,1/3),e=is((e+1)/3)-(e%3==(e<0?-1:2)),(r=new p(n=a==1/0?"5e"+e:(n=a.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=l.s),o=(e=p.precision)+3;;)if(c=(u=(s=r).times(s).times(s)).plus(l),r=vs(c.plus(l).times(s),c.plus(u),o+2,1),ds(s.d).slice(0,o)===(n=ds(r.d)).slice(0,o)){if("9999"!=(n=n.slice(o-3,o+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(xs(r,e+1,1),t=!r.times(r).times(r).eq(l));break}if(!i&&(xs(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}o+=4,i=1}return Qo=!0,xs(r,e,p.rounding,t)},hs.decimalPlaces=hs.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-is(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},hs.dividedBy=hs.div=function(e){return vs(this,new this.constructor(e))},hs.dividedToIntegerBy=hs.divToInt=function(e){var t=this.constructor;return xs(vs(this,new t(e),0,1,1),t.precision,t.rounding)},hs.equals=hs.eq=function(e){return 0===this.cmp(e)},hs.floor=function(){return xs(new this.constructor(this),this.e+1,3)},hs.greaterThan=hs.gt=function(e){return this.cmp(e)>0},hs.greaterThanOrEqualTo=hs.gte=function(e){var t=this.cmp(e);return 1==t||0===t},hs.hyperbolicCosine=hs.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/Bs(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=Ds(o,1,a.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=a.times(a),a=s.minus(u.times(l.minus(u.times(l))));return xs(a,o.precision=n,o.rounding=r,!0)},hs.hyperbolicSine=hs.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(r=i.d.length)<3)i=Ds(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=Ds(a,2,i=i.times(1/Bs(5,e)),i,!0);for(var o,s=new a(5),u=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(u.times(o).plus(c))))}return a.precision=t,a.rounding=n,xs(i,t,n,!0)},hs.hyperbolicTangent=hs.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,vs(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},hs.inverseCosine=hs.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,a=n.rounding;return-1!==r?0===r?t.isNeg()?Ms(n,i,a):new n(0):new n(NaN):t.isZero()?Ms(n,i+4,a).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=Ms(n,i+4,a).times(.5),n.precision=i,n.rounding=a,e.minus(t))},hs.inverseHyperbolicCosine=hs.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Qo=!1,n=n.times(n).minus(1).sqrt().plus(n),Qo=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},hs.inverseHyperbolicSine=hs.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Qo=!1,n=n.times(n).plus(1).sqrt().plus(n),Qo=!0,r.precision=e,r.rounding=t,n.ln())},hs.inverseHyperbolicTangent=hs.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?xs(new a(i),e,t,!0):(a.precision=n=r-i.e,i=vs(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},hs.inverseSine=hs.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,-1!==t?0===t?((e=Ms(a,n+4,r).times(.5)).s=i.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)))},hs.inverseTangent=hs.atan=function(){var e,t,n,r,i,a,o,s,u,c=this,l=c.constructor,p=l.precision,f=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&p+4<=fs)return(o=Ms(l,p+4,f).times(.25)).s=c.s,o}else{if(!c.s)return new l(NaN);if(p+4<=fs)return(o=Ms(l,p+4,f).times(.5)).s=c.s,o}for(l.precision=s=p+10,l.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(Qo=!1,t=Math.ceil(s/7),r=1,u=c.times(c),o=new l(c),i=c;-1!==e;)if(i=i.times(u),a=o.minus(i.div(r+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(r+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<this.d.length-2},hs.isNaN=function(){return!this.s},hs.isNegative=hs.isNeg=function(){return this.s<0},hs.isPositive=hs.isPos=function(){return this.s>0},hs.isZero=function(){return!!this.d&&0===this.d[0]},hs.lessThan=hs.lt=function(e){return this.cmp(e)<0},hs.lessThanOrEqualTo=hs.lte=function(e){return this.cmp(e)<1},hs.logarithm=hs.log=function(e){var t,n,r,i,a,o,s,u,c=this,l=c.constructor,p=l.precision,f=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10==0;)i/=10;a=1!==i}if(Qo=!1,o=_s(c,s=p+5),r=t?Ns(l,s+10):_s(e,s),ys((u=vs(o,r,s,1)).d,i=p,f))do{if(o=_s(c,s+=10),r=t?Ns(l,s+10):_s(e,s),u=vs(o,r,s,1),!a){+ds(u.d).slice(i+1,i+15)+1==1e14&&(u=xs(u,p+1,0));break}}while(ys(u.d,i+=10,f));return Qo=!0,xs(u,p,f)},hs.minus=hs.sub=function(e){var t,n,r,i,a,o,s,u,c,l,p,f,h=this,d=h.constructor;if(e=new d(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new d(e.d||h.s!==e.s?h:NaN):e=new d(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.d,f=e.d,s=d.precision,u=d.rounding,!c[0]||!f[0]){if(f[0])e.s=-e.s;else{if(!c[0])return new d(3===u?-0:0);e=new d(h)}return Qo?xs(e,s,u):e}if(n=is(e.e/7),l=is(h.e/7),c=c.slice(),a=l-n){for((p=a<0)?(t=c,a=-a,o=f.length):(t=f,n=l,o=c.length),a>(r=Math.max(Math.ceil(s/7),o)+2)&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for((p=(r=c.length)<(o=f.length))&&(o=r),r=0;r0;--r)c[o++]=0;for(r=f.length;r>a;){if(c[--r](o=(a=Math.ceil(s/7))>o?a+1:o+1)&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((o=c.length)-(i=l.length)<0&&(i=o,n=l,l=c,c=n),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/ls|0,c[i]%=ls;for(t&&(c.unshift(t),++r),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=ws(c,r),Qo?xs(e,s,u):e},hs.precision=hs.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ts+e);return n.d?(t=Es(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},hs.round=function(){var e=this,t=e.constructor;return xs(new t(e),e.e+1,t.rounding)},hs.sine=hs.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return Ds(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/Bs(5,n)),t=Ds(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(r,js(r,n)),r.precision=e,r.rounding=t,xs(Ho>2?n.neg():n,e,t,!0)):new r(NaN)},hs.squareRoot=hs.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,u=o.e,c=o.s,l=o.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);for(Qo=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=ds(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=is((u+1)/2)-(u<0||u%2),r=new l(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new l(c.toString()),n=(u=l.precision)+3;;)if(r=(a=r).plus(vs(o,a,n+2,1)).times(.5),ds(a.d).slice(0,n)===(t=ds(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(xs(r,u+1,1),e=!r.times(r).eq(o));break}if(!i&&(xs(a,u+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}return Qo=!0,xs(r,u,l.rounding,e)},hs.tangent=hs.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=vs(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,xs(2==Ho||4==Ho?n.neg():n,e,t,!0)):new r(NaN)},hs.times=hs.mul=function(e){var t,n,r,i,a,o,s,u,c,l=this,p=l.constructor,f=l.d,h=(e=new p(e)).d;if(e.s*=l.s,!(f&&f[0]&&h&&h[0]))return new p(!e.s||f&&!f[0]&&!h||h&&!h[0]&&!f?NaN:f&&h?0*e.s:e.s/0);for(n=is(l.e/7)+is(e.e/7),(u=f.length)<(c=h.length)&&(a=f,f=h,h=a,o=u,u=c,c=o),a=[],r=o=u+c;r--;)a.push(0);for(r=c;--r>=0;){for(t=0,i=u+r;i>r;)s=a[i]+h[r]*f[i-r-1]+t,a[i--]=s%ls|0,t=s/ls|0;a[i]=(a[i]+t)%ls|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=ws(a,n),Qo?xs(e,p.precision,p.rounding):e},hs.toBinary=function(e,t){return qs(this,2,e,t)},hs.toDecimalPlaces=hs.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(ms(e,0,Jo),void 0===t?t=r.rounding:ms(t,0,8),xs(n,e+n.e+1,t))},hs.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=bs(r,!0):(ms(e,0,Jo),void 0===t?t=i.rounding:ms(t,0,8),n=bs(r=xs(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},hs.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return void 0===e?n=bs(i):(ms(e,0,Jo),void 0===t?t=a.rounding:ms(t,0,8),n=bs(r=xs(new a(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},hs.toFraction=function(e){var t,n,r,i,a,o,s,u,c,l,p,f,h=this,d=h.d,m=h.constructor;if(!d)return new m(h);if(c=n=new m(1),r=u=new m(0),o=(a=(t=new m(r)).e=Es(d)-h.e-1)%7,t.d[0]=as(10,o<0?7+o:o),null==e)e=a>0?t:c;else{if(!(s=new m(e)).isInt()||s.lt(c))throw Error(ts+s);e=s.gt(t)?a>0?t:c:s}for(Qo=!1,s=new m(ds(d)),l=m.precision,m.precision=a=7*d.length*2;p=vs(s,t,0,1,1),1!=(i=n.plus(p.times(r))).cmp(e);)n=r,r=i,i=c,c=u.plus(p.times(i)),u=i,i=t,t=s.minus(p.times(i)),s=i;return i=vs(e.minus(n),r,0,1,1),u=u.plus(i.times(c)),n=n.plus(i.times(r)),u.s=c.s=h.s,f=vs(c,r,a,1).minus(h).abs().cmp(vs(u,n,a,1).minus(h).abs())<1?[c,r]:[u,n],m.precision=l,Qo=!0,f},hs.toHexadecimal=hs.toHex=function(e,t){return qs(this,16,e,t)},hs.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:ms(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(Qo=!1,n=vs(n,e,0,t,1).times(e),Qo=!0,xs(n)):(e.s=n.s,n=e),n},hs.toNumber=function(){return+this},hs.toOctal=function(e,t){return qs(this,8,e,t)},hs.toPower=hs.pow=function(e){var t,n,r,i,a,o,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(as(+s,c));if((s=new u(s)).eq(1))return s;if(r=u.precision,a=u.rounding,e.eq(1))return xs(s,r,a);if((t=is(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=Os(u,s,n,r),e.s<0?new u(1).div(i):xs(i,r,a);if((o=s.s)<0){if(tu.maxE+1||t0?o/0:0):(Qo=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=ks(e.times(_s(s,r+n)),r)).d&&ys((i=xs(i,r+5,1)).d,r,a)&&(t=r+10,+ds((i=xs(ks(e.times(_s(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=xs(i,r+1,0))),i.s=o,Qo=!0,u.rounding=a,xs(i,r,a))},hs.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=bs(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(ms(e,1,Jo),void 0===t?t=i.rounding:ms(t,0,8),n=bs(r=xs(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},hs.toSignificantDigits=hs.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(ms(e,1,Jo),void 0===t?t=n.rounding:ms(t,0,8)),xs(new n(this),e,t)},hs.toString=function(){var e=this,t=e.constructor,n=bs(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},hs.truncated=hs.trunc=function(){return xs(new this.constructor(this),this.e+1,1)},hs.valueOf=hs.toJSON=function(){var e=this,t=e.constructor,n=bs(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var vs=function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]1;)e.shift()}return function(r,i,a,o,s,u){var c,l,p,f,h,d,m,y,g,v,x,b,w,N,M,E,S,O,A,C,k=r.constructor,_=r.s==i.s?1:-1,I=r.d,T=i.d;if(!(I&&I[0]&&T&&T[0]))return new k(r.s&&i.s&&(I?!T||I[0]!=T[0]:T)?I&&0==I[0]||!T?0*_:_/0:NaN);for(u?(h=1,l=r.e-i.e):(u=ls,h=7,l=is(r.e/h)-is(i.e/h)),A=T.length,S=I.length,v=(g=new k(_)).d=[],p=0;T[p]==(I[p]||0);p++);if(T[p]>(I[p]||0)&&l--,null==a?(N=a=k.precision,o=k.rounding):N=s?a+(r.e-i.e)+1:a,N<0)v.push(1),d=!0;else{if(N=N/h+2|0,p=0,1==A){for(f=0,T=T[0],N++;(p1&&(T=e(T,f,u),I=e(I,f,u),A=T.length,S=I.length),E=A,b=(x=I.slice(0,A)).length;b=u/2&&++O;do{f=0,(c=t(T,x,A,b))<0?(w=x[0],A!=b&&(w=w*u+(x[1]||0)),(f=w/O|0)>1?(f>=u&&(f=u-1),1==(c=t(m=e(T,f,u),x,y=m.length,b=x.length))&&(f--,n(m,A=10;f/=10)p++;g.e=p+l*h-1,xs(g,s?a+g.e+1:a,o,d)}return g}}();function xs(e,t,n,r){var i,a,o,s,u,c,l,p,f,h=e.constructor;e:if(null!=t){if(!(p=e.d))return e;for(i=1,s=p[0];s>=10;s/=10)i++;if((a=t-i)<0)a+=7,o=t,u=(l=p[f=0])/as(10,i-o-1)%10|0;else if((f=Math.ceil((a+1)/7))>=(s=p.length)){if(!r)break e;for(;s++<=f;)p.push(0);l=u=0,i=1,o=(a%=7)-7+1}else{for(l=s=p[f],i=1;s>=10;s/=10)i++;u=(o=(a%=7)-7+i)<0?0:l/as(10,i-o-1)%10|0}if(r=r||t<0||void 0!==p[f+1]||(o<0?l:l%as(10,i-o-1)),c=n<4?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(a>0?o>0?l/as(10,i-o):0:p[f-1])%10&1||n==(e.s<0?8:7)),t<1||!p[0])return p.length=0,c?(t-=e.e+1,p[0]=as(10,(7-t%7)%7),e.e=-t||0):p[0]=e.e=0,e;if(0==a?(p.length=f,s=1,f--):(p.length=f+1,s=as(10,7-a),p[f]=o>0?(l/as(10,i-o)%as(10,o)|0)*s:0),c)for(;;){if(0==f){for(a=1,o=p[0];o>=10;o/=10)a++;for(o=p[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,p[0]==ls&&(p[0]=1));break}if(p[f]+=s,p[f]!=ls)break;p[f--]=0,s=1}for(a=p.length;0===p[--a];)p.pop()}return Qo&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+Ss(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Ss(-i-1)+a,n&&(r=n-o)>0&&(a+=Ss(r))):i>=o?(a+=Ss(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ss(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Ss(r))),a}function ws(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function Ns(e,t,n){if(t>ps)throw Qo=!0,n&&(e.precision=n),Error(ns);return xs(new e(Ko),t,1,!0)}function Ms(e,t,n){if(t>fs)throw Error(ns);return xs(new e(Yo),t,n,!0)}function Es(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Ss(e){for(var t="";e--;)t+="0";return t}function Os(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/7+4);for(Qo=!1;;){if(n%2&&zs((a=a.times(t)).d,o)&&(i=!0),0===(n=is(n/2))){n=a.d.length-1,i&&0===a.d[n]&&++a.d[n];break}zs((t=t.times(t)).d,o)}return Qo=!0,a}function As(e){return 1&e.d[e.d.length-1]}function Cs(e,t,n){for(var r,i=new e(t[0]),a=0;++a17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(Qo=!1,u=d):u=t,s=new f(.03125);e.e>-2;)e=e.times(s),p+=5;for(u+=r=Math.log(as(2,p))/Math.LN10*2+5|0,n=a=o=new f(1),f.precision=u;;){if(a=xs(a.times(e),u,1),n=n.times(++l),ds((s=o.plus(vs(a,n,u,1))).d).slice(0,u)===ds(o.d).slice(0,u)){for(i=p;i--;)o=xs(o.times(o),u,1);if(null!=t)return f.precision=d,o;if(!(c<3&&ys(o.d,u-r,h,c)))return xs(o,f.precision=d,h,Qo=!0);f.precision=u+=10,n=a=s=new f(1),l=0,c++}o=s}}function _s(e,t){var n,r,i,a,o,s,u,c,l,p,f,h=1,d=e,m=d.d,y=d.constructor,g=y.rounding,v=y.precision;if(d.s<0||!m||!m[0]||!d.e&&1==m[0]&&1==m.length)return new y(m&&!m[0]?-1/0:1!=d.s?NaN:m?0:d);if(null==t?(Qo=!1,l=v):l=t,y.precision=l+=10,r=(n=ds(m)).charAt(0),!(Math.abs(a=d.e)<15e14))return c=Ns(y,l+2,v).times(a+""),d=_s(new y(r+"."+n.slice(1)),l-10).plus(c),y.precision=v,null==t?xs(d,v,g,Qo=!0):d;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=ds((d=d.times(e)).d)).charAt(0),h++;for(a=d.e,r>1?(d=new y("0."+n),a++):d=new y(r+"."+n.slice(1)),p=d,u=o=d=vs(d.minus(1),d.plus(1),l,1),f=xs(d.times(d),l,1),i=3;;){if(o=xs(o.times(f),l,1),ds((c=u.plus(vs(o,new y(i),l,1))).d).slice(0,l)===ds(u.d).slice(0,l)){if(u=u.times(2),0!==a&&(u=u.plus(Ns(y,l+2,v).times(a+""))),u=vs(u,new y(h),l,1),null!=t)return y.precision=v,u;if(!ys(u.d,l-10,g,s))return xs(u,y.precision=v,g,Qo=!0);y.precision=l+=10,c=o=d=vs(p.minus(1),p.plus(1),l,1),f=xs(d.times(d),l,1),i=s=1}u=c,i+=2}}function Is(e){return String(e.s*e.s/0)}function Ts(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),re.constructor.maxE?(e.d=null,e.e=NaN):e.e0?(u=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),o=(a=t.indexOf("."))>=0,r=e.constructor,o&&(a=(s=(t=t.replace(".","")).length)-a,i=Os(r,new r(n),a,2*a)),a=l=(c=gs(t,n,ls)).length-1;0===c[a];--a)c.pop();return a<0?new r(0*e.s):(e.e=ws(c,l),e.d=c,Qo=!1,o&&(e=vs(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?as(2,u):Mu.pow(2,u))),Qo=!0,e)}function Ds(e,t,n,r,i){var a,o,s,u,c=e.precision,l=Math.ceil(c/7);for(Qo=!1,u=n.times(n),s=new e(r);;){if(o=vs(s.times(u),new e(t++*t++),c,1),s=i?r.plus(o):r.minus(o),r=vs(o.times(u),new e(t++*t++),c,1),void 0!==(o=s.plus(r)).d[l]){for(a=l;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=r,r=o,o=a}return Qo=!0,o.d.length=l+1,o}function Bs(e,t){for(var n=e;--t;)n*=e;return n}function js(e,t){var n,r=t.s<0,i=Ms(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return Ho=r?4:1,t;if((n=t.divToInt(i)).isZero())Ho=r?3:2;else{if((t=t.minus(n.times(i))).lte(a))return Ho=As(n)?r?2:3:r?4:1,t;Ho=As(n)?r?1:4:r?3:2}return t.minus(i).abs()}function qs(e,t,n,r){var i,a,o,s,u,c,l,p,f,h=e.constructor,d=void 0!==n;if(d?(ms(n,1,Jo),void 0===r?r=h.rounding:ms(r,0,8)):(n=h.precision,r=h.rounding),e.isFinite()){for(d?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(o=(l=bs(e)).indexOf("."))>=0&&(l=l.replace(".",""),(f=new h(1)).e=l.length-o,f.d=gs(bs(f),10,i),f.e=f.d.length),a=u=(p=gs(l,10,i)).length;0==p[--u];)p.pop();if(p[0]){if(o<0?a--:((e=new h(e)).d=p,e.e=a,p=(e=vs(e,f,n,r,0,i)).d,a=e.e,c=$o),o=p[n],s=i/2,c=c||void 0!==p[n+1],c=r<4?(void 0!==o||c)&&(0===r||r===(e.s<0?3:2)):o>s||o===s&&(4===r||c||6===r&&1&p[n-1]||r===(e.s<0?8:7)),p.length=n,c)for(;++p[--n]>i-1;)p[n]=0,n||(++a,p.unshift(1));for(u=p.length;!p[u-1];--u);for(o=0,l="";o1)if(16==t||8==t){for(o=16==t?4:3,--u;u%o;u++)l+="0";for(u=(p=gs(l,i,t)).length;!p[u-1];--u);for(o=1,l="1.";ou)for(a-=u;a--;)l+="0";else at)return e.length=t,!0}function Rs(e){return new this(e).abs()}function Fs(e){return new this(e).acos()}function Ls(e){return new this(e).acosh()}function Us(e,t){return new this(e).plus(t)}function Vs(e){return new this(e).asin()}function $s(e){return new this(e).asinh()}function Hs(e){return new this(e).atan()}function Gs(e){return new this(e).atanh()}function Ws(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?Ms(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=Ms(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,n=this.atan(vs(e,t,a,1)),t=Ms(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(vs(e,t,a,1)):(n=Ms(this,a,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Js(e){return new this(e).cbrt()}function Zs(e){return xs(e=new this(e),e.e+1,2)}function Ks(e){if(!e||"object"!=typeof e)throw Error(es+"Object expected");var t,n,r,i=!0===e.defaults,a=["precision",1,Jo,"rounding",0,8,"toExpNeg",-Wo,0,"toExpPos",0,Wo,"maxE",0,Wo,"minE",-Wo,0,"modulo",0,9];for(t=0;t=a[t+1]&&r<=a[t+2]))throw Error(ts+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=Xo[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(ts+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(rs);this[n]=!0}else this[n]=!1}return this}function Ys(e){return new this(e).cos()}function Xs(e){return new this(e).cosh()}function Qs(e,t){return new this(e).div(t)}function eu(e){return new this(e).exp()}function tu(e){return xs(e=new this(e),e.e+1,3)}function nu(){var e,t,n=new this(0);for(Qo=!1,e=0;e=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error(rs);for(t=crypto.randomBytes(r*=4);a=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else for(;a=10;i/=10)r++;r<7&&(n-=7-r)}return o.e=n,o.d=s,o}function du(e){return xs(e=new this(e),e.e+1,this.rounding)}function mu(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function yu(e){return new this(e).sin()}function gu(e){return new this(e).sinh()}function vu(e){return new this(e).sqrt()}function xu(e,t){return new this(e).sub(t)}function bu(e){return new this(e).tan()}function wu(e){return new this(e).tanh()}function Nu(e){return xs(e=new this(e),e.e+1,1)}hs[Symbol.for("nodejs.util.inspect.custom")]=hs.toString,hs[Symbol.toStringTag]="Decimal";var Mu=function e(t){var n,r,i;function a(e){var t,n,r,i=this;if(!(i instanceof a))return new a(e);if(i.constructor=a,e instanceof a)return i.s=e.s,void(Qo?!e.d||e.e>a.maxE?(i.e=NaN,i.d=null):e.e=10;n/=10)t++;return void(Qo?t>a.maxE?(i.e=NaN,i.d=null):t{var{on:t,config:n}=e,r=Mu.clone({precision:n.precision,modulo:9});return r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})})),r}),{isClass:!0}),Su=Ii(Pi((function(e,t){!function(n){var r=function(e){return.5*(Math.exp(e)+Math.exp(-e))},i=function(e){return.5*(Math.exp(e)-Math.exp(-e))},a=function(){throw SyntaxError("Invalid Param")};function o(e,t){var n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):Math.log(e/Math.cos(Math.atan2(t,e)))}function s(e,t){if(!(this instanceof s))return new s(e,t);var n=function(e,t){var n={re:0,im:0};if(null==e)n.re=n.im=0;else if(void 0!==t)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return s.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return s.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else 2===e.length?(n.re=e[0],n.im=e[1]):a();break;case"string":n.im=n.re=0;var r=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,o=0;null===r&&a();for(var u=0;u0&&a();break;case"number":n.im=0,n.re=e;break;default:a()}return n}(e,t);this.re=n.re,this.im=n.im}s.prototype={re:0,im:0,sign:function(){var e=this.abs();return new s(this.re/e,this.im/e)},add:function(e,t){var n=new s(e,t);return this.isInfinite()&&n.isInfinite()?s.NAN:this.isInfinite()||n.isInfinite()?s.INFINITY:new s(this.re+n.re,this.im+n.im)},sub:function(e,t){var n=new s(e,t);return this.isInfinite()&&n.isInfinite()?s.NAN:this.isInfinite()||n.isInfinite()?s.INFINITY:new s(this.re-n.re,this.im-n.im)},mul:function(e,t){var n=new s(e,t);return this.isInfinite()&&n.isZero()||this.isZero()&&n.isInfinite()?s.NAN:this.isInfinite()||n.isInfinite()?s.INFINITY:0===n.im&&0===this.im?new s(this.re*n.re,0):new s(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){var n=new s(e,t);if(this.isZero()&&n.isZero()||this.isInfinite()&&n.isInfinite())return s.NAN;if(this.isInfinite()||n.isZero())return s.INFINITY;if(this.isZero()||n.isInfinite())return s.ZERO;e=this.re,t=this.im;var r,i,a=n.re,o=n.im;return 0===o?new s(e/a,t/a):Math.abs(a)=0)return new s(Math.pow(e,n.re),0);if(0===e)switch((n.re%4+4)%4){case 0:return new s(Math.pow(t,n.re),0);case 1:return new s(0,Math.pow(t,n.re));case 2:return new s(-Math.pow(t,n.re),0);case 3:return new s(0,-Math.pow(t,n.re))}}if(0===e&&0===t&&n.re>0&&n.im>=0)return s.ZERO;var r=Math.atan2(t,e),i=o(e,t);return e=Math.exp(n.re*i-n.im*r),t=n.im*i+n.re*r,new s(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,n=this.re,r=this.im,i=this.abs();if(n>=0){if(0===r)return new s(Math.sqrt(n),0);e=.5*Math.sqrt(2*(i+n))}else e=Math.abs(r)/Math.sqrt(2*(i-n));return t=n<=0?.5*Math.sqrt(2*(i-n)):Math.abs(r)/Math.sqrt(2*(i+n)),new s(e,r<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new s(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new s(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(e<-t||e>t)return Math.cos(e)-1;var n=e*e;return n*(n*(1/24+n*(-1/720+n*(1/40320+n*(-1/3628800+n*(1/4790014600+n*(-1/87178291200+n*(1/20922789888e3)))))))-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new s(o(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,n=Math.abs(e),r=Math.abs(t),n<3e3&&r<3e3?Math.sqrt(n*n+r*r):(n1&&0===t,r=1-e,i=1+e,a=r*r+t*t,u=0!==a?new s((i*r-t*t)/a,(t*r+i*t)/a):new s(-1!==e?e/0:0,0!==t?t/0:0),c=u.re;return u.re=o(u.re,u.im)/2,u.im=Math.atan2(u.im,c)/2,n&&(u.im=-u.im),u},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(0,Math.PI/2);var n=e*e+t*t;return 0!==n?new s(e/n,-t/n).atanh():new s(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new s(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var n=e*e+t*t;return 0!==n?new s(e/n,-t/n).asinh():new s(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return s.INFINITY;var n=e*e+t*t;return 0!==n?new s(e/n,-t/n).acosh():new s(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var e=this.re,t=this.im,n=e*e+t*t;return new s(e/n,-t/n)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new s(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new s(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new s(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var n=new s(e,t);return Math.abs(n.re-this.re)<=s.EPSILON&&Math.abs(n.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isZero()?"0":this.isInfinite()?"Infinity":(0!==e&&(n+=e),0!==t&&(0!==e?n+=t<0?" - ":" + ":t<0&&(n+="-"),1!==(t=Math.abs(t))&&(n+=t),n+="i"),n||"0")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return!(0!==this.re&&-0!==this.re||0!==this.im&&-0!==this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-16,Object.defineProperty(t,"__esModule",{value:!0}),s.default=s,s.Complex=s,e.exports=s}()}))),Ou=qo("Complex",[],(()=>(Su.prototype.type="Complex",Su.prototype.isComplex=!0,Su.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Su.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Su.prototype.format=function(e){var t=this.im,n=this.re,r=Ga(this.re,e),i=Ga(this.im,e),a=Wi(e)?e:e?e.precision:null;if(null!==a){var o=Math.pow(10,-a);Math.abs(n/t)t.re?1:e.ret.im?1:e.im0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));y<=x&&v<=x;){if(e===(r=(m+g)/(y+v))){y+v<=x?(a=m+g,u=y+v):v>y?(a=g,u=v):(a=m,u=y);break}e>r?(m+=g,y+=v):(g+=m,v+=y),y>x?(a=g,u=v):(a=m,u=y)}a*=d}else(isNaN(e)||isNaN(t))&&(u=a=NaN);break;case"string":if(null===(y=e.match(/\d+|./g))&&s(),"-"===y[m]?(c=-1,m++):"+"===y[m]&&m++,y.length===m+1?p=o(y[m++],c):"."===y[m+1]||"."===y[m]?("."!==y[m]&&(l=o(y[m++],c)),(++m+1===y.length||"("===y[m+1]&&")"===y[m+3]||"'"===y[m+1]&&"'"===y[m+3])&&(p=o(y[m],c),h=Math.pow(10,y[m].length),m++),("("===y[m]&&")"===y[m+2]||"'"===y[m]&&"'"===y[m+2])&&(f=o(y[m+1],c),d=Math.pow(10,y[m+1].length)-1,m+=3)):"/"===y[m+1]||":"===y[m+1]?(p=o(y[m],c),h=o(y[m+2],1),m+=3):"/"===y[m+3]&&" "===y[m+1]&&(l=o(y[m],c),p=o(y[m+2],c),h=o(y[m+4],1),m+=5),y.length<=m){c=a=f+(u=h*d)*l+d*p;break}default:s()}if(0===u)throw new i;n.s=c<0?-1:1,n.n=Math.abs(a),n.d=Math.abs(u)};function c(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function l(e,t){if(!(this instanceof l))return new l(e,t);u(e,t),e=l.REDUCE?c(n.d,n.n):1,this.s=n.s,this.n=n.n/e,this.d=n.d/e}l.REDUCE=1,l.prototype={s:1,n:0,d:1,abs:function(){return new l(this.n,this.d)},neg:function(){return new l(-this.s*this.n,this.d)},add:function(e,t){return u(e,t),new l(this.s*this.n*n.d+n.s*this.d*n.n,this.d*n.d)},sub:function(e,t){return u(e,t),new l(this.s*this.n*n.d-n.s*this.d*n.n,this.d*n.d)},mul:function(e,t){return u(e,t),new l(this.s*n.s*this.n*n.n,this.d*n.d)},div:function(e,t){return u(e,t),new l(this.s*n.s*this.n*n.d,this.d*n.n)},clone:function(){return new l(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new l(NaN):void 0===e?new l(this.s*this.n%this.d,1):(u(e,t),0===n.n&&0===this.d&&l(0,0),new l(this.s*(n.d*this.n)%(n.n*this.d),n.d*this.d))},gcd:function(e,t){return u(e,t),new l(c(n.n,this.n)*c(n.d,this.d),n.d*this.d)},lcm:function(e,t){return u(e,t),0===n.n&&0===this.n?new l:new l(n.n*this.n,c(n.n,this.n)*c(n.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):new l(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):new l(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):new l(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new l(this.s*this.d,this.n)},pow:function(e){return e<0?new l(Math.pow(this.s*this.d,-e),Math.pow(this.n,-e)):new l(Math.pow(this.s*this.n,e),Math.pow(this.d,e))},equals:function(e,t){return u(e,t),this.s*this.n*n.d==n.s*n.n*this.d},compare:function(e,t){u(e,t);var r=this.s*this.n*n.d-n.s*n.n*this.d;return(00&&(n+=t,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(t)||isNaN(n))return r;do{r.push(Math.floor(t/n)),e=t%n,t=n,n=e}while(1!==t);return r},toString:function(e){var t,n=this.n,r=this.d;if(isNaN(n)||isNaN(r))return"NaN";l.REDUCE||(n/=t=c(n,r),r/=t),e=e||15;var i=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var n=10%t,r=1;1!==n;r++)if(n=10*n%t,r>2e3)return 0;return r}(0,r),a=function(e,t,n){for(var r=1,i=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,n,t),a=0;a<300;a++){if(r===i)return a;r=10*r%t,i=10*i%t}return 0}(0,r,i),o=-1===this.s?"-":"";if(o+=n/r|0,n%=r,(n*=10)&&(o+="."),i){for(var s=a;s--;)o+=n/r|0,n%=r,n*=10;o+="(";for(s=i;s--;)o+=n/r|0,n%=r,n*=10;o+=")"}else for(s=e;n&&s--;)o+=n/r|0,n%=r,n*=10;return o}},Object.defineProperty(l,"__esModule",{value:!0}),l.default=l,l.Fraction=l,e.exports=l}()}))),Cu=qo("Fraction",[],(()=>(Au.prototype.type="Fraction",Au.prototype.isFraction=!0,Au.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Au.fromJSON=function(e){return new Au(e)},Au)),{isClass:!0}),ku=qo("Range",[],(()=>{function e(t,n,r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=null!=t,a=null!=n,o=null!=r;if(i)if(Ji(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(a)if(Ji(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter end must be a number");if(o)if(Ji(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(t):0,this.end=a?parseFloat(n):0,this.step=o?parseFloat(r):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var n=t.split(":").map((function(e){return parseFloat(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var e=0,t=this.start,n=this.step,r=this.end-t;return Fa(n)===Fa(r)?e=Math.ceil(r/n):0===r&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var t=this.start,n=this.step,r=this.end,i=0;if(n>0)for(;tr;)e(t,[i],this),t+=n,i++},e.prototype.map=function(e){var t=[];return this.forEach((function(n,r,i){t[r[0]]=e(n,r,i)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,n){e[n[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=Ga(this.start,e);return 1!==this.step&&(t+=":"+Ga(this.step,e)),t+=":"+Ga(this.end,e)},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e}),{isClass:!0}),_u=qo("Matrix",[],(()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0}),Iu=qo("DenseMatrix",["Matrix"],(e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!Xi(t))throw new Error("Invalid datatype: "+t);if(ea(e))"DenseMatrix"===e.type?(this._data=Ta(e._data),this._size=Ta(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&Qi(e.data)&&Qi(e.size))this._data=e.data,this._size=e.size,xo(this._data,this._size),this._datatype=t||e.datatype;else if(Qi(e))this._data=c(e),this._size=go(this._data),xo(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+Ia(e)+")");this._data=[],this._size=[0],this._datatype=t}}function r(e,t){if(!aa(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r=t.size();if(r.length!==e._size.length)throw new mo(r.length,e._size.length);for(var a=t.min(),o=t.max(),s=0,u=e._size.length;s");u(e,t.max().map((function(e){return e+1})),r);var p=a.length;o(e._data,t,n,p,0)}return e}function o(e,t,n,r,i){var a=i===r-1,s=t.dimension(i);a?s.forEach((function(t,r){bo(t),e[t]=n[r[0]]})):s.forEach((function(a,s){bo(a),o(e[a],t,n[s[0]],r,i+1)}))}function s(e,t,n){if(0===t.length){for(var r=e._data;Qi(r);)r=r[0];return r}return e._size=t.slice(0),e._data=wo(e._data,e._size,n),e}function u(e,t,n){for(var r=e._size.slice(0),i=!1;r.lengthr[a]&&(r[a]=t[a],i=!0);i&&s(e,r,n)}function c(e){for(var t=0,n=e.length;tArray.isArray(e)&&1===e.length?e[0]:e));return s(n?this.clone():this,r,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;return n._data=Mo(n._data,e),n._size=e.slice(0),n},n.prototype.clone=function(){return new n({data:Ta(this._data),size:Ta(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function n(r,i){return Qi(r)?r.map((function(e,t){return n(e,i.concat(t))})):e(r,i,t)}(this._data,[]);return new n(r,void 0!==this._datatype?jo(r,Ia):void 0)},n.prototype.forEach=function(e){var t=this;!function n(r,i){Qi(r)?r.forEach((function(e,t){n(e,i.concat(t))})):e(r,i,t)}(this._data,[])},n.prototype.toArray=function(){return Ta(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return co(this._data,e)},n.prototype.toString=function(){return co(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(Ji(e)&&(e=e.toNumber()),!Wi(e)||!Ra(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=this._size[0],a=this._size[1],o=Math.min(i-r,a-t),s=[],u=0;u0?r:0,s=r<0?-r:0,u=e[0],c=e[1],l=Math.min(u-s,c-o);if(Qi(t)){if(t.length!==l)throw new Error("Invalid value array length");a=function(e){return t[e]}}else if(ea(t)){var p=t.size();if(1!==p.length||p[0]!==l)throw new Error("Invalid matrix length");a=function(e){return t.get([e])}}else a=function(){return t};i||(i=Ji(a(0))?a(0).mul(0):0);var f=[];if(e.length>0){f=wo(f,e,i);for(var h=0;h{var{typed:t}=e;return t(Tu,{any:Ta})}));function Du(e){for(var t=0;t=r.length)throw new yo(t,r.length);return ea(e)?e.create(zu(e.valueOf(),t,n)):zu(e,t,n)}function zu(e,t,n){var r,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=function(e){var t,n,r=e.length,i=e[0].length,a=[];for(n=0;n{var{typed:t}=e;return t(Fu,{number:Ra,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":function(e){return ju(e,this)}})})),Uu="number",Vu="number, number";function $u(e){return Math.abs(e)}function Hu(e,t){return e+t}function Gu(e,t){return e*t}function Wu(e){return-e}function Ju(e){return e}function Zu(e){return $a(e)}function Ku(e){return Math.ceil(e)}function Yu(e){return e*e*e}function Xu(e){return Math.exp(e)}function Qu(e){return Ha(e)}function ec(e,t){if(!Ra(e)||!Ra(t))throw new Error("Parameters in function gcd must be integer numbers");for(var n;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}function tc(e,t){if(!Ra(e)||!Ra(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var n,r=e*t;0!==t;)t=e%(n=t),e=n;return Math.abs(r/e)}function nc(e){return Math.log(e)}function rc(e){return Ua(e)}function ic(e){return La(e)}function ac(e,t){if(t>0)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function oc(e,t){var n=t<0;if(n&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return n?1/0:0;if(!isFinite(e))return n?0:e;var r=Math.pow(Math.abs(e),1/t);return r=e<0?-r:r,n?1/r:r}function sc(e){return Fa(e)}function uc(e){return e*e}function cc(e,t){var n,r,i,a=0,o=1,s=1,u=0;if(!Ra(e)||!Ra(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=e-(r=Math.floor(e/t))*t,n=a,a=o-r*a,o=n,n=s,s=u-r*s,u=n,e=t,t=i;return e<0?[-e,-o,-u]:[e,e?o:0,u]}function lc(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function pc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat(Ja(e,t))}$u.signature=Uu,Hu.signature=Vu,Gu.signature=Vu,Wu.signature=Uu,Ju.signature=Uu,Zu.signature=Uu,Ku.signature=Uu,Yu.signature=Uu,Xu.signature=Uu,Qu.signature=Uu,ec.signature=Vu,tc.signature=Vu,nc.signature=Uu,rc.signature=Uu,ic.signature=Uu,ac.signature=Vu,oc.signature=Vu,sc.signature=Uu,uc.signature=Uu,cc.signature=Vu,lc.signature=Vu,pc.signature=Vu;var fc="number, number";function hc(e,t){if(!Ra(e)||!Ra(t))throw new Error("Integers expected in function bitAnd");return e&t}function dc(e){if(!Ra(e))throw new Error("Integer expected in function bitNot");return~e}function mc(e,t){if(!Ra(e)||!Ra(t))throw new Error("Integers expected in function bitOr");return e|t}function yc(e,t){if(!Ra(e)||!Ra(t))throw new Error("Integers expected in function bitXor");return e^t}function gc(e,t){if(!Ra(e)||!Ra(t))throw new Error("Integers expected in function leftShift");return e<>t}function xc(e,t){if(!Ra(e)||!Ra(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}function bc(e,t){if(t>1;return bc(e,n)*bc(n+1,t)}function wc(e,t){if(!Ra(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Ra(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");var n=e-t;return t171?1/0:bc(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*_c(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,i=r*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=Tc[0];for(var o=1;o0}function Qc(e){return 0===e}function el(e){return Number.isNaN(e)}Yc.signature=Kc,Xc.signature=Kc,Qc.signature=Kc,el.signature=Kc;var tl="isNegative",nl=qo(tl,["typed"],(e=>{var{typed:t}=e;return t(tl,{number:Yc,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),rl="isNumeric",il=qo(rl,["typed"],(e=>{var{typed:t}=e;return t(rl,{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(e){return ju(e,this)}})})),al="hasNumericValue",ol=qo(al,["typed","isNumeric"],(e=>{var{typed:t,isNumeric:n}=e;return t(al,{string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})})),sl="isPositive",ul=qo(sl,["typed"],(e=>{var{typed:t}=e;return t(sl,{number:Xc,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),cl="isZero",ll=qo(cl,["typed"],(e=>{var{typed:t}=e;return t(cl,{number:Qc,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),pl="isNaN",fl=qo(pl,["typed"],(e=>{var{typed:t}=e;return t(pl,{number:el,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return ju(e,Number.isNaN)}})})),hl="typeOf",dl=qo(hl,["typed"],(e=>{var{typed:t}=e;return t(hl,{any:Ia})}));function ml(e,t,n){if(null==n)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var r=e.minus(t).abs();if(r.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return r.lte(i.times(n))}return!1}var yl="equalScalar",gl=qo(yl,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(yl,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return Qa(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||ml(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,n){return Qa(e.re,t.re,n)&&Qa(e.im,t.im,n)}(e,t,n.epsilon)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)}})})),vl=(qo(yl,["typed","config"],(e=>{var{typed:t,config:n}=e;return t(yl,{"number, number":function(e,t){return Qa(e,t,n.epsilon)}})})),qo("SparseMatrix",["typed","equalScalar","Matrix"],(e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!Xi(t))throw new Error("Invalid datatype: "+t);if(ea(e))!function(e,t,n){"SparseMatrix"===t.type?(e._values=t._values?Ta(t._values):void 0,e._index=Ta(t._index),e._ptr=Ta(t._ptr),e._size=Ta(t._size),e._datatype=n||t._datatype):a(e,t.valueOf(),n||t._datatype)}(this,e,t);else if(e&&Qi(e.index)&&Qi(e.ptr)&&Qi(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(Qi(e))a(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+Ia(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function a(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=r.length,o=0,s=n,u=0;if(Xi(i)&&(s=t.find(n,[i,i])||n,u=t.convert(0,i)),a>0){var c=0;do{e._ptr.push(e._index.length);for(var l=0;l");for(var c=t.min()[0],l=t.min()[1],p=i[0],f=i[1],h=0;hd){for(l=d;lh){if(f){var m=0;for(l=0;lr-1&&(e._values.splice(p,1),e._index.splice(p,1),g++)}e._ptr[l]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function p(e,t,n,r,i){var a,o,s=r[0],u=r[1],c=[];for(a=0;as-1||o>p-1)&&(l(this,Math.max(a+1,s),Math.max(o+1,p),i),s=this._size[0],p=this._size[1]),bo(a,s),bo(o,p);var d=u(a,this._ptr[o],this._ptr[o+1],this._index);return dArray.isArray(e)&&1===e.length?e[0]:e));if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(e){if(!Wi(e)||!Ra(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+co(r)+")")})),l(n?this.clone():this,r[0],r[1],t)},i.prototype.reshape=function(e,t){if(!Qi(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(e.forEach((function(t){if(!Wi(t)||!Ra(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+co(e)+")")})),this._size[0]*this._size[1]!=e[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;for(var r=[],i=0;i=r&&b<=a&&m(e._values[x],b-r,y-o)}else{for(var w={},N=g;N "+(this._values?co(this._values[u],e):"X")}return i},i.prototype.toString=function(){return co(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(Ji(e)&&(e=e.toNumber()),!Wi(e)||!Ra(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],a=this._size[1],o=Math.min(r-n,a-t),s=[],u=[],c=[];c[0]=0;for(var l=t;l0?a:0,f=a<0?-a:0,h=e[0],d=e[1],m=Math.min(h-f,d-p);if(Qi(r)){if(r.length!==m)throw new Error("Invalid value array length");l=function(e){return r[e]}}else if(ea(r)){var y=r.size();if(1!==y.length||y[0]!==m)throw new Error("Invalid matrix length");l=function(e){return r.get([e])}}else l=function(){return r};for(var g=[],v=[],x=[],b=0;b=0&&w=c||i[p]!==t)){var h=r?r[l]:void 0;i.splice(p,0,t),r&&r.splice(p,0,h),i.splice(p<=l?l+1:l,1),r&&r.splice(p<=l?l+1:l,1)}else if(p=c||i[l]!==e)){var d=r?r[p]:void 0;i.splice(l,0,e),r&&r.splice(l,0,d),i.splice(l<=p?p+1:p,1),r&&r.splice(l<=p?p+1:p,1)}}},i}),{isClass:!0})),xl=qo("number",["typed"],(e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=Number(e);if(isNaN(t))throw new SyntaxError('String "'+e+'" is no valid number');if(["0b","0o","0x"].includes(e.substring(0,2))){if(t>2**32-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));2147483648&t&&(t=-1*~(t-1))}return t},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return ju(e,this)}});return n.fromJSON=function(e){return parseFloat(e.value)},n})),bl="string",wl=qo(bl,["typed"],(e=>{var{typed:t}=e;return t(bl,{"":function(){return""},number:Ga,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return ju(e,this)},any:function(e){return String(e)}})})),Nl="boolean",Ml=qo(Nl,["typed"],(e=>{var{typed:t}=e;return t(Nl,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;var n=Number(e);if(""!==e&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":function(e){return ju(e,this)}})})),El=qo("bignumber",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(e){return new n(e+"")},string:function(e){return new n(e)},BigNumber:function(e){return e},Fraction:function(e){return new n(e.n).div(e.d).times(e.s)},null:function(e){return new n(0)},"Array | Matrix":function(e){return ju(e,this)}})})),Sl=qo("complex",["typed","Complex"],(e=>{var{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(e){return new n(e,0)},"number, number":function(e,t){return new n(e,t)},"BigNumber, BigNumber":function(e,t){return new n(e.toNumber(),t.toNumber())},Fraction:function(e){return new n(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return n(e)},null:function(e){return n(0)},Object:function(e){if("re"in e&&"im"in e)return new n(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new n(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return ju(e,this)}})})),Ol=qo("fraction",["typed","Fraction"],(e=>{var{typed:t,Fraction:n}=e;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new n(e)},string:function(e){return new n(e)},"number, number":function(e,t){return new n(e,t)},null:function(e){return new n(0)},BigNumber:function(e){return new n(e.toString())},Fraction:function(e){return e},Object:function(e){return new n(e)},"Array | Matrix":function(e){return ju(e,this)}})})),Al="matrix",Cl=qo(Al,["typed","Matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Al,{"":function(){return a([])},string:function(e){return a([],e)},"string, string":function(e,t){return a([],e,t)},Array:function(e){return a(e)},Matrix:function(e){return a(e,e.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(e,t,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new i(e,n);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),kl="splitUnit",_l=qo(kl,["typed"],(e=>{var{typed:t}=e;return t(kl,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),Il="unaryMinus",Tl=qo(Il,["typed"],(e=>{var{typed:t}=e;return t(Il,{number:Wu,Complex:function(e){return e.neg()},BigNumber:function(e){return e.neg()},Fraction:function(e){return e.neg()},Unit:function(e){var t=e.clone();return t.value=this(e.value),t},"Array | Matrix":function(e){return ju(e,this)}})})),Pl="unaryPlus",Dl=qo(Pl,["typed","config","BigNumber"],(e=>{var{typed:t,config:n,BigNumber:r}=e;return t(Pl,{number:Ju,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return ju(e,this)},"boolean | string":function(e){return"BigNumber"===n.number?new r(+e):+e}})})),Bl=qo("abs",["typed"],(e=>{var{typed:t}=e;return t("abs",{number:$u,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},Fraction:function(e){return e.abs()},"Array | Matrix":function(e){return ju(e,this)},Unit:function(e){return e.abs()}})})),jl="apply",ql=qo(jl,["typed","isInteger"],(e=>{var{typed:t,isInteger:n}=e;return t(jl,{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw new TypeError("Integer number expected for dimension");var i=Array.isArray(e)?go(e):e.size();if(t<0||t>=i.length)throw new yo(t,i.length);return ea(e)?e.create(zl(e.valueOf(),t,r)):zl(e,t,r)}})}));function zl(e,t,n){var r,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,n,r=e.length,i=e[0].length,a=[];for(n=0;n{var{typed:t}=e;return t(Rl,{"number, number":Hu,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":function(e,t){if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value||void 0===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var n=e.clone();return n.value=this(n.value,t.value),n.fixPrefix=!1,n}})})),Ll="cbrt",Ul=qo(Ll,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(e=>{var{config:t,typed:n,isNegative:r,unaryMinus:i,matrix:a,Complex:o,BigNumber:s,Fraction:u}=e;return n(Ll,{number:Zu,Complex:c,"Complex, boolean":c,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&Zi(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=c(e.value),t}var n,a=r(e.value);a&&(e.value=i(e.value)),n=Ji(e.value)?new s(1).div(3):Ki(e.value)?new u(1,3):1/3;var o=e.pow(n);return a&&(o.value=i(o.value)),o},"Array | Matrix":function(e){return ju(e,this)}});function c(e,n){var r=e.arg()/3,i=e.abs(),s=new o(Zu(i),0).mul(new o(0,r).exp());if(n){var u=[s,new o(Zu(i),0).mul(new o(0,r+2*Math.PI/3).exp()),new o(Zu(i),0).mul(new o(0,r-2*Math.PI/3).exp())];return"Array"===t.matrix?u:a(u)}return s}})),Vl=qo("algorithm11",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p,f=c[0],h=c[1],d=n,m=0,y=i;"string"==typeof l&&(p=l,d=t.find(n,[p,p]),m=t.convert(0,p),r=t.convert(r,p),y=t.find(i,[p,p]));for(var g=[],v=[],x=[],b=0;b{var{typed:t}=e;return function(e,r,i,a){var o,s=e._data,u=e._size,c=e._datatype,l=i;"string"==typeof c&&(o=c,r=t.convert(r,o),l=t.find(i,[o,o]));var p=u.length>0?n(l,0,u,u[0],s,r,a):[];return e.createDenseMatrix({data:p,size:Ta(u),datatype:o})};function n(e,t,r,i,a,o,s){var u=[];if(t===r.length-1)for(var c=0;c{var{typed:t,config:n,round:r,matrix:i,equalScalar:a}=e,o=Vl({typed:t,equalScalar:a}),s=$l({typed:t});return t("ceil",{number:function(e){return Qa(e,r(e),n.epsilon)?r(e):Ku(e)},"number, number":function(e,t){if(Qa(e,r(e,t),n.epsilon))return r(e,t);var[i,a]="".concat(e,"e").split("e"),o=Math.ceil(Number("".concat(i,"e").concat(Number(a)+t)));return[i,a]="".concat(o,"e").split("e"),Number("".concat(i,"e").concat(Number(a)-t))},Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},BigNumber:function(e){return ml(e,r(e),n.epsilon)?r(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return ml(e,r(e,t),n.epsilon)?r(e,t):e.toDecimalPlaces(t.toNumber(),Mu.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Array | Matrix":function(e){return ju(e,this)},"Array | Matrix, number":function(e,t){return ju(e,(e=>this(e,t)))},"SparseMatrix, number | BigNumber":function(e,t){return o(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"number | Complex | BigNumber, Array":function(e,t){return s(i(t),e,this,!0).valueOf()}})})),Gl="cube",Wl=qo(Gl,["typed"],(e=>{var{typed:t}=e;return t(Gl,{number:Yu,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},Fraction:function(e){return e.pow(3)},"Array | Matrix":function(e){return ju(e,this)},Unit:function(e){return e.pow(3)}})})),Jl=qo("exp",["typed"],(e=>{var{typed:t}=e;return t("exp",{number:Xu,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(e){return ju(e,this)}})})),Zl="expm1",Kl=qo(Zl,["typed","Complex"],(e=>{var{typed:t,Complex:n}=e;return t(Zl,{number:Qu,Complex:function(e){var t=Math.exp(e.re);return new n(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(e){return ju(e,this)}})})),Yl=qo("fix",["typed","Complex","matrix","ceil","floor"],(e=>{var{typed:t,Complex:n,matrix:r,ceil:i,floor:a}=e,o=$l({typed:t});return t("fix",{number:function(e){return e>0?a(e):i(e)},"number, number | BigNumber":function(e,t){return e>0?a(e,t):i(e,t)},Complex:function(e){return new n(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number | BigNumber":function(e,t){return new n(e.re>0?a(e.re,t):i(e.re,t),e.im>0?a(e.im,t):i(e.im,t))},BigNumber:function(e){return e.isNegative()?i(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):a(e,t)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?e.ceil(t):e.floor(t)},"Array | Matrix":function(e){return ju(e,this)},"Array | Matrix, number | BigNumber":function(e,t){return ju(e,(e=>this(e,t)))},"number | Complex | BigNumber, Array":function(e,t){return o(r(t),e,this,!0).valueOf()}})})),Xl=qo("floor",["typed","config","round","matrix","equalScalar"],(e=>{var{typed:t,config:n,round:r,matrix:i,equalScalar:a}=e,o=Vl({typed:t,equalScalar:a}),s=$l({typed:t});return t("floor",{number:function(e){return Qa(e,r(e),n.epsilon)?r(e):Math.floor(e)},"number, number":function(e,t){if(Qa(e,r(e,t),n.epsilon))return r(e,t);var[i,a]="".concat(e,"e").split("e"),o=Math.floor(Number("".concat(i,"e").concat(Number(a)+t)));return[i,a]="".concat(o,"e").split("e"),Number("".concat(i,"e").concat(Number(a)-t))},Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},BigNumber:function(e){return ml(e,r(e),n.epsilon)?r(e):e.floor()},"BigNumber, BigNumber":function(e,t){return ml(e,r(e,t),n.epsilon)?r(e,t):e.toDecimalPlaces(t.toNumber(),Mu.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Array | Matrix":function(e){return ju(e,this)},"Array | Matrix, number":function(e,t){return ju(e,(e=>this(e,t)))},"SparseMatrix, number | BigNumber":function(e,t){return o(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"number | Complex | BigNumber, Array":function(e,t){return s(i(t),e,this,!0).valueOf()}})})),Ql=qo("algorithm01",["typed"],(e=>{var{typed:t}=e;return function(e,n,r,i){var a=e._data,o=e._size,s=e._datatype,u=n._values,c=n._index,l=n._ptr,p=n._size,f=n._datatype;if(o.length!==p.length)throw new mo(o.length,p.length);if(o[0]!==p[0]||o[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,d,m=o[0],y=o[1],g="string"==typeof s&&s===f?s:void 0,v=g?t.find(r,[g,g]):r,x=[];for(h=0;h{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=r._values,p=r._index,f=r._ptr,h=r._size,d=r._datatype;if(u.length!==h.length)throw new mo(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");var m,y=u[0],g=u[1],v=n,x=0,b=i;"string"==typeof c&&c===d&&(m=c,v=t.find(n,[m,m]),x=t.convert(0,m),b=t.find(i,[m,m]));var w,N,M,E,S,O=a&&l?[]:void 0,A=[],C=[],k=a&&l?[]:void 0,_=a&&l?[]:void 0,I=[],T=[];for(N=0;N{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p,f=c[0],h=c[1],d=i;"string"==typeof l&&(p=l,r=t.convert(r,p),d=t.find(i,[p,p]));for(var m=[],y=[],g=[],v=0;v{var{typed:t}=e;return function(e,r,i){var a,o=e._data,s=e._size,u=e._datatype,c=r._data,l=r._size,p=r._datatype,f=[];if(s.length!==l.length)throw new mo(s.length,l.length);for(var h=0;h0?n(d,0,f,f[0],o,c):[];return e.createDenseMatrix({data:m,size:f,datatype:a})};function n(e,t,r,i,a,o){var s=[];if(t===r.length-1)for(var u=0;u{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:a}=e,o=Ql({typed:t}),s=ep({typed:t,equalScalar:r}),u=tp({typed:t,DenseMatrix:a}),c=np({typed:t}),l=$l({typed:t});return t("gcd",{"number, number":ec,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var n=new i(0);for(;!t.isZero();){var r=e.mod(t);e=t,t=r}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return u(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return l(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return l(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var r=this(e,t),i=0;i{var{typed:t,equalScalar:n}=e;return function(e,r,i,a){var o=e._data,s=e._size,u=e._datatype,c=r._values,l=r._index,p=r._ptr,f=r._size,h=r._datatype;if(s.length!==f.length)throw new mo(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,m=s[0],y=s[1],g=n,v=0,x=i;"string"==typeof u&&u===h&&(d=u,g=t.find(n,[d,d]),v=t.convert(0,d),x=t.find(i,[d,d]));for(var b=[],w=[],N=[],M=0;M{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._size,s=e._datatype,u=r._values,c=r._size,l=r._datatype;if(o.length!==c.length)throw new mo(o.length,c.length);if(o[0]!==c[0]||o[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+c+")");var p,f=o[0],h=o[1],d=n,m=0,y=i;"string"==typeof s&&s===l&&(p=s,d=t.find(n,[p,p]),m=t.convert(0,p),y=t.find(i,[p,p]));for(var g=a&&u?[]:void 0,v=[],x=[],b=g?[]:void 0,w=[],N=[],M=0;M{var{typed:t,matrix:n,equalScalar:r}=e,i=ip({typed:t,equalScalar:r}),a=ap({typed:t,equalScalar:r}),o=Vl({typed:t,equalScalar:r}),s=np({typed:t}),u=$l({typed:t});return t("lcm",{"number, number":tc,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;var n=e.times(t);for(;!t.isZero();){var r=t;t=e.mod(r),e=r}return n.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return o(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return o(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return u(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return u(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var r=this(e,t),i=0;i{var{typed:t,config:n,Complex:r}=e;return t(sp,{number:function(e){return e>=0||n.predictable?rc(e):new r(e,0).log().div(Math.LN10)},Complex:function(e){return new r(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||n.predictable?e.log():new r(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return ju(e,this)}})})),cp="log2",lp=qo(cp,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(cp,{number:function(e){return e>=0||n.predictable?ic(e):i(new r(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log(2):i(new r(e.toNumber(),0))},"Array | Matrix":function(e){return ju(e,this)}});function i(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),pp=qo("algorithm03",["typed"],(e=>{var{typed:t}=e;return function(e,n,r,i){var a=e._data,o=e._size,s=e._datatype,u=n._values,c=n._index,l=n._ptr,p=n._size,f=n._datatype;if(o.length!==p.length)throw new mo(o.length,p.length);if(o[0]!==p[0]||o[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,d=o[0],m=o[1],y=0,g=r;"string"==typeof s&&s===f&&(h=s,y=t.convert(0,h),g=t.find(r,[h,h]));for(var v=[],x=0;x{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=r._values,p=r._index,f=r._ptr,h=r._size,d=r._datatype;if(u.length!==h.length)throw new mo(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");var m,y=u[0],g=u[1],v=n,x=0,b=i;"string"==typeof c&&c===d&&(m=c,v=t.find(n,[m,m]),x=t.convert(0,m),b=t.find(i,[m,m]));var w,N,M,E,S=a&&l?[]:void 0,O=[],A=[],C=S?[]:void 0,k=S?[]:void 0,_=[],I=[];for(N=0;N{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p,f=c[0],h=c[1],d=i;"string"==typeof l&&(p=l,r=t.convert(r,p),d=t.find(i,[p,p]));for(var m=[],y=[],g=[],v=0;v{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i}=e,a=ip({typed:t,equalScalar:r}),o=pp({typed:t}),s=fp({typed:t,equalScalar:r}),u=Vl({typed:t,equalScalar:r}),c=hp({typed:t,DenseMatrix:i}),l=np({typed:t}),p=$l({typed:t});return t("mod",{"number, number":ac,"BigNumber, BigNumber":function(e,t){if(t.isNeg())throw new Error("Cannot calculate mod for a negative divisor");return t.isZero()?e:e.mod(t)},"Fraction, Fraction":function(e,t){if(t.compare(0)<0)throw new Error("Cannot calculate mod for a negative divisor");return e.compare(0)>=0?e.mod(t):e.mod(t).add(t).mod(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return p(e,t,this,!1)},"any, SparseMatrix":function(e,t){return c(t,e,this,!0)},"any, DenseMatrix":function(e,t){return p(t,e,this,!0)},"Array, any":function(e,t){return p(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return p(n(t),e,this,!0).valueOf()}})})),mp=qo("multiplyScalar",["typed"],(e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Gu,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":function(e,t){var n=t.clone();return n.value=null===n.value?n._normalize(e):this(n.value,e),n},"Unit, number | Fraction | BigNumber | Complex":function(e,t){var n=e.clone();return n.value=null===n.value?n._normalize(t):this(n.value,t),n},"Unit, Unit":function(e,t){return e.multiply(t)}})})),yp="multiply",gp=qo(yp,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:a,dot:o}=e,s=Vl({typed:t,equalScalar:a}),u=$l({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}function l(e,n){if("dense"!==n.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,n){var a,o=e._data,s=e._size,u=e._datatype,c=n._data,l=n._size,p=n._datatype,f=s[0],h=l[1],d=r,m=i;u&&p&&u===p&&"string"==typeof u&&(a=u,d=t.find(r,[a,a]),m=t.find(i,[a,a]));for(var y=[],g=0;gO)for(var C=0,k=0;k{var{typed:t,matrix:n,equalScalar:r,BigNumber:i}=e,a=Ql({typed:t}),o=ip({typed:t,equalScalar:r}),s=ap({typed:t,equalScalar:r}),u=Vl({typed:t,equalScalar:r}),c=np({typed:t}),l=$l({typed:t}),p="Complex number not supported in function nthRoot. Use nthRoots instead.";return t(vp,{number:function(e){return oc(e,2)},"number, number":oc,BigNumber:function(e){return f(e,new i(2))},Complex:function(e){throw new Error(p)},"Complex, number":function(e,t){throw new Error(p)},"BigNumber, BigNumber":f,"Array | Matrix":function(e){return this(e,2)},"SparseMatrix, SparseMatrix":function(e,t){if(1===t.density())return s(e,t,this);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){if(1===t.density())return a(e,t,this,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){if(1===t.density())return u(t,e,this,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}});function f(e,t){var n=i.precision,r=i.clone({precision:n+2}),a=new i(0),o=new r(1),s=t.isNegative();if(s&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return s?new r(1/0):0;if(!e.isFinite())return s?a:e;var u=e.abs().pow(o.div(t));return u=e.isNeg()?u.neg():u,new i((s?o.div(u):u).toPrecision(n))}})),bp="sign",wp=qo(bp,["typed","BigNumber","Fraction","complex"],(e=>{var{typed:t,BigNumber:n,complex:r,Fraction:i}=e;return t(bp,{number:sc,Complex:function(e){return 0===e.im?r(sc(e.re)):e.sign()},BigNumber:function(e){return new n(e.cmp(0))},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":function(e){return ju(e,this)},Unit:function(e){return this(e.value)}})})),Np=qo("sqrt",["config","typed","Complex"],(e=>{var{config:t,typed:n,Complex:r}=e;return n("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},"Array | Matrix":function(e){return ju(e,this)},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new r(e,0).sqrt()}})),Mp="square",Ep=qo(Mp,["typed"],(e=>{var{typed:t}=e;return t(Mp,{number:uc,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return ju(e,this)},Unit:function(e){return e.pow(2)}})})),Sp="subtract",Op=qo(Sp,["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,addScalar:i,unaryMinus:a,DenseMatrix:o}=e,s=Ql({typed:t}),u=pp({typed:t}),c=fp({typed:t,equalScalar:r}),l=tp({typed:t,DenseMatrix:o}),p=np({typed:t}),f=$l({typed:t});return t(Sp,{"number, number":function(e,t){return e-t},"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":function(e,t){if(null===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var n=e.clone();return n.value=this(n.value,t.value),n.fixPrefix=!1,n},"SparseMatrix, SparseMatrix":function(e,t){return Ap(e,t),c(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return Ap(e,t),u(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return Ap(e,t),s(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return Ap(e,t),p(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return l(e,a(t),i)},"DenseMatrix, any":function(e,t){return f(e,t,this)},"any, SparseMatrix":function(e,t){return l(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, any":function(e,t){return f(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return f(n(t),e,this,!0).valueOf()}})}));function Ap(e,t){var n=e.size(),r=t.size();if(n.length!==r.length)throw new mo(n.length,r.length)}var Cp="xgcd",kp=qo(Cp,["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(Cp,{"number, number":function(e,t){var i=cc(e,t);return"Array"===n.matrix?i:r(i)},"BigNumber, BigNumber":function(e,t){var a,o,s,u,c=new i(0),l=new i(1),p=c,f=l,h=l,d=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=e.div(t).floor(),s=e.mod(t),a=p,p=f.minus(o.times(p)),f=a,a=h,h=d.minus(o.times(h)),d=a,e=t,t=s;u=e.lt(c)?[e.neg(),f.neg(),d.neg()]:[e,e.isZero()?0:f,d];return"Array"===n.matrix?u:r(u)}})})),_p=qo("algorithm09",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=r._values,p=r._index,f=r._ptr,h=r._size,d=r._datatype;if(u.length!==h.length)throw new mo(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");var m,y=u[0],g=u[1],v=n,x=0,b=i;"string"==typeof c&&c===d&&(m=c,v=t.find(n,[m,m]),x=t.convert(0,m),b=t.find(i,[m,m]));var w,N,M,E,S,O=a&&l?[]:void 0,A=[],C=[],k=O?[]:void 0,_=[];for(N=0;N{var{typed:t,matrix:n,equalScalar:r,multiplyScalar:i}=e,a=ip({typed:t,equalScalar:r}),o=_p({typed:t,equalScalar:r}),s=Vl({typed:t,equalScalar:r}),u=np({typed:t}),c=$l({typed:t});return t(Ip,{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,i)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return c(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return c(t,e,i,!0)},"Array, any":function(e,t){return c(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,i,!0).valueOf()}})}));function Pp(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return jp(e,t,(function(e,t){return e&t}))}function Dp(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,n=t.precision;t.config({precision:1e9});var r=e.plus(new t(1));return r.s=-r.s||null,t.config({precision:n}),r}function Bp(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);var r=new n(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:e.isFinite()&&t.isFinite()?jp(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function jp(e,t,n){var r,i,a,o,s,u=e.constructor,c=+(e.s<0),l=+(t.s<0);if(c){r=qp(Dp(e));for(var p=0;p0;)n(a[--h],o[--d])===m&&(y=y.plus(g)),g=g.times(v);for(;d>0;)n(s,o[--d])===m&&(y=y.plus(g)),g=g.times(v);return u.config({precision:x}),0===m&&(y.s=-y.s),y}function qp(e){for(var t=e.d,n=t[0]+"",r=1;r0)if(++s>c)for(s-=c;s--;)u+="0";else s1&&(null!==l[h+1]&&void 0!==l[h+1]||(l[h+1]=0),l[h+1]+=l[h]>>1,l[h]&=1)}return l.reverse()}function zp(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new n(0);var r=new n(-1);return e.eq(r)?Dp(t):t.eq(r)?Dp(e):e.isFinite()&&t.isFinite()?jp(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new n(e.isNegative()===t.isNegative()?1/0:-1/0):r}function Rp(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new n(2).pow(t)):new n(NaN)}function Fp(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new n(2).pow(t)).floor():e.isNegative()?new n(-1):e.isFinite()?new n(0):new n(NaN)}var Lp="bitAnd",Up=qo(Lp,["typed","matrix","equalScalar"],(e=>{var{typed:t,matrix:n,equalScalar:r}=e,i=ip({typed:t,equalScalar:r}),a=ap({typed:t,equalScalar:r}),o=Vl({typed:t,equalScalar:r}),s=np({typed:t}),u=$l({typed:t});return t(Lp,{"number, number":hc,"BigNumber, BigNumber":Pp,"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})})),Vp="bitNot",$p=qo(Vp,["typed"],(e=>{var{typed:t}=e;return t(Vp,{number:dc,BigNumber:Dp,"Array | Matrix":function(e){return ju(e,this)}})})),Hp="bitOr",Gp=qo(Hp,["typed","matrix","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i}=e,a=Ql({typed:t}),o=ep({typed:t,equalScalar:r}),s=tp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t(Hp,{"number, number":mc,"BigNumber, BigNumber":Bp,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return c(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, any":function(e,t){return c(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,this,!0).valueOf()}})})),Wp=qo("algorithm07",["typed","DenseMatrix"],(e=>{var{typed:t,DenseMatrix:n}=e;return function(e,i,a){var o=e._size,s=e._datatype,u=i._size,c=i._datatype;if(o.length!==u.length)throw new mo(o.length,u.length);if(o[0]!==u[0]||o[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+u+")");var l,p,f,h=o[0],d=o[1],m=0,y=a;"string"==typeof s&&s===c&&(l=s,m=t.convert(0,l),y=t.find(a,[l,l]));var g=[];for(p=0;p{var{typed:t,matrix:n,DenseMatrix:r}=e,i=pp({typed:t}),a=Wp({typed:t,DenseMatrix:r}),o=hp({typed:t,DenseMatrix:r}),s=np({typed:t}),u=$l({typed:t});return t(Jp,{"number, number":yc,"BigNumber, BigNumber":zp,"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})})),Kp=qo("arg",["typed"],(e=>{var{typed:t}=e;return t("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":function(e){return ju(e,this)}})})),Yp="conj",Xp=qo(Yp,["typed"],(e=>{var{typed:t}=e;return t(Yp,{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.conjugate()},"Array | Matrix":function(e){return ju(e,this)}})})),Qp=qo("im",["typed"],(e=>{var{typed:t}=e;return t("im",{number:function(e){return 0},BigNumber:function(e){return e.mul(0)},Complex:function(e){return e.im},"Array | Matrix":function(e){return ju(e,this)}})})),ef=qo("re",["typed"],(e=>{var{typed:t}=e;return t("re",{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.re},"Array | Matrix":function(e){return ju(e,this)}})})),tf=qo("not",["typed"],(e=>{var{typed:t}=e;return t("not",{number:Oc,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:function(e){return null===e.value||this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),nf=qo("or",["typed","matrix","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i}=e,a=pp({typed:t}),o=fp({typed:t,equalScalar:r}),s=hp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t("or",{"number, number":Ac,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return c(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, any":function(e,t){return c(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,this,!0).valueOf()}})})),rf=qo("xor",["typed","matrix","DenseMatrix"],(e=>{var{typed:t,matrix:n,DenseMatrix:r}=e,i=pp({typed:t}),a=Wp({typed:t,DenseMatrix:r}),o=hp({typed:t,DenseMatrix:r}),s=np({typed:t}),u=$l({typed:t});return t("xor",{"number, number":Cc,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})})),af="concat",of=qo(af,["typed","matrix","isInteger"],(e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(af,{"...Array | Matrix | number | BigNumber":function(e){var t,i,a=e.length,o=-1,s=!1,u=[];for(t=0;t0&&o>i)throw new yo(o,i+1)}else{var l=Ta(c).valueOf(),p=go(l);if(u[t]=l,i=o,o=p.length-1,t>0&&o!==i)throw new mo(i+1,o+1)}}if(0===u.length)throw new SyntaxError("At least one matrix expected");for(var f=u.shift();u.length;)f=sf(f,u.shift(),o,0);return s?n(f):f},"...string":function(e){return e.join("")}})}));function sf(e,t,n,r){if(r{var{typed:t,Index:n,matrix:r,range:i}=e;return t(uf,{"Matrix, number":a,"Array, number":function(e,t){return a(r(Ta(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");bo(t,e.size()[1]);var r=i(0,e.size()[0]),a=new n(r,t);return e.subset(a)}})),lf="cross",pf=qo(lf,["typed","matrix","subtract","multiply"],(e=>{var{typed:t,matrix:n,subtract:r,multiply:i}=e;return t(lf,{"Matrix, Matrix":function(e,t){return n(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(a(e.toArray(),t))},"Array, Matrix":function(e,t){return n(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var n=Math.max(go(e).length,go(t).length);e=Eo(e),t=Eo(t);var a=go(e),o=go(t);if(1!==a.length||1!==o.length||3!==a[0]||3!==o[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+o.join(", ")+"])");var s=[r(i(e[1],t[2]),i(e[2],t[1])),r(i(e[2],t[0]),i(e[0],t[2])),r(i(e[0],t[1]),i(e[1],t[0]))];return n>1?[s]:s}})),ff="diag",hf=qo(ff,["typed","matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(ff,{Array:function(e){return a(e,0,go(e),null)},"Array, number":function(e,t){return a(e,t,go(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),go(e),null)},"Array, string":function(e,t){return a(e,0,go(e),t)},"Array, number, string":function(e,t,n){return a(e,t,go(e),n)},"Array, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),go(e),n)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return a(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return a(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return a(e,0,e.size(),t)},"Matrix, number, string":function(e,t,n){return a(e,t,e.size(),n)},"Matrix, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),e.size(),n)}});function a(e,t,a,o){if(!Ra(t))throw new TypeError("Second parameter in function diag must be an integer");var s=t>0?t:0,u=t<0?-t:0;switch(a.length){case 1:return function(e,t,n,a,o,s){var u=[a+o,a+s];if(n&&"sparse"!==n&&"dense"!==n)throw new TypeError("Unknown matrix type ".concat(n,'"'));var c="sparse"===n?i.diagonal(u,e,t):r.diagonal(u,e,t);return null!==n?c:c.valueOf()}(e,t,o,a[0],u,s);case 2:return function(e,t,r,i,a,o){if(ea(e)){var s=e.diagonal(t);return null!==r?r!==s.storage()?n(s,r):s:s.valueOf()}for(var u=Math.min(i[0]-a,i[1]-o),c=[],l=0;l{var{typed:t}=e;return t("filter",{"Array, function":gf,"Matrix, function":function(e,t){return e.create(gf(e.toArray(),t))},"Array, RegExp":To,"Matrix, RegExp":function(e,t){return e.create(To(e.toArray(),t))}})}));function gf(e,t){var n=mf(t);return Io(e,(function(e,r,i){return 1===n?t(e):2===n?t(e,[r]):t(e,[r],i)}))}var vf="flatten",xf=qo(vf,["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return t(vf,{Array:function(e){return Co(Ta(e))},Matrix:function(e){var t=Co(Ta(e.toArray()));return n(t)}})})),bf="forEach",wf=qo(bf,["typed"],(e=>{var{typed:t}=e;return t(bf,{"Array, function":Nf,"Matrix, function":function(e,t){return e.forEach(t)}})}));function Nf(e,t){var n=mf(t);!function r(i,a){Array.isArray(i)?_o(i,(function(e,t){r(e,a.concat(t))})):1===n?t(i):2===n?t(i,a):t(i,a,e)}(e,[])}var Mf="getMatrixDataType",Ef=qo(Mf,["typed"],(e=>{var{typed:t}=e;return t(Mf,{Array:function(e){return jo(e,Ia)},Matrix:function(e){return e.getDataType()}})})),Sf="identity",Of=qo(Sf,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(Sf,{"":function(){return"Matrix"===n.matrix?r([]):[]},string:function(e){return r(e)},"number | BigNumber":function(e){return u(e,e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return u(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return u(e,t,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,n){return u(e,t,n)},Array:function(e){return s(e)},"Array, string":function(e,t){return s(e,t)},Matrix:function(e){return s(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return s(e.valueOf(),t)}});function s(e,t){switch(e.length){case 0:return t?r(t):[];case 1:return u(e[0],e[0],t);case 2:return u(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function u(e,t,n){var r=Ji(e)||Ji(t)?i:null;if(Ji(e)&&(e=e.toNumber()),Ji(t)&&(t=t.toNumber()),!Ra(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!Ra(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var s=r?new i(1):1,u=r?new r(0):0,c=[e,t];if(n){if("sparse"===n)return o.diagonal(c,s,0,u);if("dense"===n)return a.diagonal(c,s,0,u);throw new TypeError('Unknown matrix type "'.concat(n,'"'))}for(var l=wo([],c,u),p=e{var{typed:t,matrix:n,multiplyScalar:r}=e;return t(Af,{"Matrix, Matrix":function(e,t){return n(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(i(e.toArray(),t))},"Array, Matrix":function(e,t){return n(i(e,t.toArray()))},"Array, Array":i});function i(e,t){if(1===go(e).length&&(e=[e]),1===go(t).length&&(t=[t]),go(e).length>2||go(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var n=[],i=[];return e.map((function(e){return t.map((function(t){return i=[],n.push(i),e.map((function(e){return t.map((function(t){return i.push(r(e,t))}))}))}))}))&&n}})),kf=qo("map",["typed"],(e=>{var{typed:t}=e;return t("map",{"Array, function":_f,"Matrix, function":function(e,t){return e.map(t)}})}));function _f(e,t){var n=mf(t);return function r(i,a){return Array.isArray(i)?i.map((function(e,t){return r(e,a.concat(t))})):1===n?t(i):2===n?t(i,a):t(i,a,e)}(e,[])}var If="diff",Tf=qo(If,["typed","matrix","subtract","number"],(e=>{var{typed:t,matrix:n,subtract:r,number:i}=e;return t(If,{"Array | Matrix":function(e){return ea(e)?n(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(!Ra(t))throw new RangeError("Dimension must be a whole number");return ea(e)?n(a(e.toArray(),t)):a(e,t)},"Array | Matrix, BigNumber":function(e,t){return this(e,i(t))}});function a(e,t){if(ea(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var n=[];return e.forEach((e=>{n.push(a(e,t-1))})),n}if(0===t)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){var t=[],n=e.length;if(n<2)return e;for(var r=1;r{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t("ones",{"":function(){return"Array"===n.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===n.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var n=function(e){var t=!1;return e.forEach((function(e,n,r){Ji(e)&&(t=!0,r[n]=e.toNumber())})),t}(e)?new i(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!Ra(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var a=r(t);return e.length>0?a.resize(e,n):a}var o=[];return e.length>0?wo(o,e,n):o}}));function Df(){throw new Error('No "bignumber" implementation available')}function Bf(){throw new Error('No "fraction" implementation available')}function jf(){throw new Error('No "matrix" implementation available')}var qf="range",zf=qo(qf,["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],(e=>{var{typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u}=e;return t(qf,{string:l,"string, boolean":l,"number, number":function(e,t){return c(p(e,t,1))},"number, number, number":function(e,t,n){return c(p(e,t,n))},"number, number, boolean":function(e,t,n){return c(n?f(e,t,1):p(e,t,1))},"number, number, number, boolean":function(e,t,n,r){return c(r?f(e,t,n):p(e,t,n))},"BigNumber, BigNumber":function(e,t){return c(h(e,t,new(0,e.constructor)(1)))},"BigNumber, BigNumber, BigNumber":function(e,t,n){return c(h(e,t,n))},"BigNumber, BigNumber, boolean":function(e,t,n){var r=e.constructor;return c(n?d(e,t,new r(1)):h(e,t,new r(1)))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,n,r){return c(r?d(e,t,n):h(e,t,n))}});function c(e){return"Matrix"===n.matrix?r?r(e):jf():e}function l(e,t){var r=function(e){var t=e.split(":").map((function(e){return Number(e)}));if(t.some((function(e){return isNaN(e)})))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(e);if(!r)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===n.number?(void 0===i&&Df(),c((t?d:h)(i(r.start),i(r.end),i(r.step)))):c((t?f:p)(r.start,r.end,r.step))}function p(e,t,n){var r=[],i=e;if(n>0)for(;a(i,t);)r.push(i),i+=n;else if(n<0)for(;s(i,t);)r.push(i),i+=n;return r}function f(e,t,n){var r=[],i=e;if(n>0)for(;o(i,t);)r.push(i),i+=n;else if(n<0)for(;u(i,t);)r.push(i),i+=n;return r}function h(e,t,n){var r=i(0),o=[],u=e;if(n.gt(r))for(;a(u,t);)o.push(u),u=u.plus(n);else if(n.lt(r))for(;s(u,t);)o.push(u),u=u.plus(n);return o}function d(e,t,n){var r=i(0),a=[],s=e;if(n.gt(r))for(;o(s,t);)a.push(s),s=s.plus(n);else if(n.lt(r))for(;u(s,t);)a.push(s),s=s.plus(n);return a}})),Rf="reshape",Ff=qo(Rf,["typed","isInteger","matrix"],(e=>{var{typed:t,isInteger:n,matrix:r}=e;return t(Rf,{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):r(Mo(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach((function(e){if(!n(e))throw new TypeError("Invalid size for dimension: "+e)})),Mo(e,t)}})}));function Lf(e,t,n,r){if(!(this instanceof Lf))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}Lf.prototype=new Error,Lf.prototype.constructor=Error,Lf.prototype.name="ArgumentsError",Lf.prototype.isArgumentsError=!0;var Uf=qo("resize",["config","matrix"],(e=>{var{config:t,matrix:n}=e;return function(e,i,a){if(2!==arguments.length&&3!==arguments.length)throw new Lf("resize",arguments.length,2,3);if(ea(i)&&(i=i.valueOf()),Ji(i[0])&&(i=i.map((function(e){return Ji(e)?e.toNumber():e}))),ea(e))return e.resize(i,a,!0);if("string"==typeof e)return r(e,i,a);var o=!Array.isArray(e)&&"Array"!==t.matrix;if(0===i.length){for(;Array.isArray(e);)e=e[0];return Ta(e)}Array.isArray(e)||(e=[e]);var s=wo(e=Ta(e),i,a);return o?n(s):s};function r(e,t,n){if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";if(1!==t.length)throw new mo(t.length,1);var r=t[0];if("number"!=typeof r||!Ra(r))throw new TypeError("Invalid size, must contain positive integers (size: "+co(t)+")");if(e.length>r)return e.substring(0,r);if(e.length{var{typed:t,multiply:n,rotationMatrix:r}=e;return t(Vf,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),n(r(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),n(r(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),n(r(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),n(r(t,a),e)}});function i(e,t){var n=Array.isArray(e)?go(e):e.size();if(n.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===n.length&&1!==n[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(n[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}})),Hf="rotationMatrix",Gf=qo(Hf,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],(e=>{var{typed:t,config:n,multiplyScalar:r,addScalar:i,unaryMinus:a,norm:o,BigNumber:s,matrix:u,DenseMatrix:c,SparseMatrix:l,cos:p,sin:f}=e;return t(Hf,{"":function(){return"Matrix"===n.matrix?u([]):[]},string:function(e){return u(e)},"number | BigNumber | Complex | Unit":function(e){return h(e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return h(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var n=u(t);return d(n),g(e,n,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){d(t);var r=t.storage()||("Matrix"===n.matrix?"dense":void 0);return g(e,t,r)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,n){var r=u(t);return d(r),g(e,r,n)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,n){return d(t),g(e,t,n)}});function h(e,t){var n=Ji(e)?new s(-1):-1,i=p(e),a=f(e);return y([[i,r(n,a)],[a,i]],t)}function d(e){var t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function m(e){return e.reduce(((e,t)=>r(e,t)))}function y(e,t){if(t){if("sparse"===t)return new l(e);if("dense"===t)return new c(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function g(e,t,n){var r=o(t);if(0===r)throw new RangeError("Rotation around zero vector");var u=Ji(e)?s:null,c=u?new u(1):1,l=u?new u(-1):-1,h=u?new u(t.get([0])/r):t.get([0])/r,d=u?new u(t.get([1])/r):t.get([1])/r,g=u?new u(t.get([2])/r):t.get([2])/r,v=p(e),x=i(c,a(v)),b=f(e);return y([[i(v,m([h,h,x])),i(m([h,d,x]),m([l,g,b])),i(m([h,g,x]),m([d,b]))],[i(m([h,d,x]),m([g,b])),i(v,m([d,d,x])),i(m([d,g,x]),m([l,h,b]))],[i(m([h,g,x]),m([l,d,b])),i(m([d,g,x]),m([h,b])),i(v,m([g,g,x]))]],n)}})),Wf=qo("row",["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:i}=e;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(r(Ta(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");bo(t,e.size()[0]);var r=i(0,e.size()[1]),a=new n(t,r);return e.subset(a)}})),Jf="size",Zf=qo(Jf,["typed","config","?matrix"],(e=>{var{typed:t,config:n,matrix:r}=e;return t(Jf,{Matrix:function(e){return e.create(e.size())},Array:go,string:function(e){return"Array"===n.matrix?[e.length]:r([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===n.matrix?[]:r?r([]):jf()}})})),Kf="squeeze",Yf=qo(Kf,["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return t(Kf,{Array:function(e){return Eo(Ta(e))},Matrix:function(e){var t=Eo(e.toArray());return Array.isArray(t)?n(t):t},any:function(e){return Ta(e)}})}));function Xf(e,t){if(nh(e)&&eh(e,t))return e[t];if("function"==typeof e[t]&&th(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function Qf(e,t,n){if(nh(e)&&eh(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function eh(e,t){return!(!e||"object"!=typeof e)&&(!!Ba(rh,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function th(e,t){return null!=e&&"function"==typeof e[t]&&(!(Ba(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!Ba(ih,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}function nh(e){return"object"==typeof e&&e&&e.constructor===Object}var rh={length:!0,name:!0},ih={toString:!0,valueOf:!0,toLocaleString:!0},ah="subset",oh=qo(ah,["typed","matrix"],(e=>{var{typed:t,matrix:n}=e;return t(ah,{"Array, Index":function(e,t){var r=n(e).subset(t);return t.isScalar()?r:r.valueOf()},"Matrix, Index":function(e,t){return e.subset(t)},"Object, Index":ch,"string, Index":sh,"Array, Index, any":function(e,t,r){return n(Ta(e)).subset(t,r,void 0).valueOf()},"Array, Index, any, any":function(e,t,r,i){return n(Ta(e)).subset(t,r,i).valueOf()},"Matrix, Index, any":function(e,t,n){return e.clone().subset(t,n)},"Matrix, Index, any, any":function(e,t,n,r){return e.clone().subset(t,n,r)},"string, Index, string":uh,"string, Index, string, string":uh,"Object, Index, any":lh})}));function sh(e,t){if(!aa(t))throw new TypeError("Index expected");if(1!==t.size().length)throw new mo(t.size().length,1);var n=e.length;bo(t.min()[0],n),bo(t.max()[0],n);var r=t.dimension(0),i="";return r.forEach((function(t){i+=e.charAt(t)})),i}function uh(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(1!==t.size().length)throw new mo(t.size().length,1);if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";var i=t.dimension(0);if(i.size()[0]!==n.length)throw new mo(i.size()[0],n.length);var a=e.length;bo(t.min()[0]),bo(t.max()[0]);for(var o=[],s=0;sa)for(var u=a-1,c=o.length;u{var{typed:t,matrix:n}=e;return t("transpose",{Array:function(e){return this(n(e)).valueOf()},Matrix:function(e){var t,n=e.size();switch(n.length){case 1:t=e.clone();break;case 2:var r=n[0],i=n[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+co(n)+")");switch(e.storage()){case"dense":t=function(e,t,n){for(var r,i=e._data,a=[],o=0;o{var{typed:t,transpose:n,conj:r}=e;return t(fh,{any:function(e){return r(n(e))}})})),dh="zeros",mh=qo(dh,["typed","config","matrix","BigNumber"],(e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(dh,{"":function(){return"Array"===n.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===n.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var n=function(e){var t=!1;return e.forEach((function(e,n,r){Ji(e)&&(t=!0,r[n]=e.toNumber())})),t}(e)?new i(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!Ra(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var a=r(t);return e.length>0?a.resize(e,n):a}var o=[];return e.length>0?wo(o,e,n):o}})),yh=qo("erf",["typed"],(e=>{var{typed:t}=e;return t("name",{number:function(e){var t=Math.abs(e);return t>=wh?Fa(e):t<=gh?Fa(e)*function(e){var t,n=e*e,r=xh[0][4]*n,i=n;for(t=0;t<3;t+=1)r=(r+xh[0][t])*n,i=(i+bh[0][t])*n;return e*(r+xh[0][3])/(i+bh[0][3])}(t):t<=4?Fa(e)*(1-function(e){var t,n=xh[1][8]*e,r=e;for(t=0;t<7;t+=1)n=(n+xh[1][t])*e,r=(r+bh[1][t])*e;var i=(n+xh[1][7])/(r+bh[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):Fa(e)*(1-function(e){var t,n=1/(e*e),r=xh[2][5]*n,i=n;for(t=0;t<4;t+=1)r=(r+xh[2][t])*n,i=(i+bh[2][t])*n;var a=n*(r+xh[2][4])/(i+bh[2][4]);a=(vh-a)/e,n=parseInt(16*e)/16;var o=(e-n)*(e+n);return Math.exp(-n*n)*Math.exp(-o)*a}(t))},"Array | Matrix":function(e){return ju(e,this)}})})),gh=.46875,vh=.5641895835477563,xh=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],bh=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],wh=Math.pow(2,53),Nh="mode",Mh=qo(Nh,["typed","isNaN","isNumeric"],(e=>{var{typed:t,isNaN:n,isNumeric:r}=e;return t(Nh,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=Co(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},i=[],a=0,o=0;oa&&(a=t[s],i=[s])}return i}}));function Eh(e,t,n){var r;return-1!==String(e).indexOf("Unexpected type")?(r=arguments.length>2?" (type: "+Ia(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):-1!==String(e).indexOf("complex numbers")?(r=arguments.length>2?" (type: "+Ia(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var Sh="prod",Oh=qo(Sh,["typed","config","multiplyScalar","numeric"],(e=>{var{typed:t,config:n,multiplyScalar:r,numeric:i}=e;return t(Sh,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var t;if(Bu(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(t){throw Eh(t,"prod",e)}})),"string"==typeof t&&(t=i(t,n.number)),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),Ah="format",Ch=qo(Ah,["typed"],(e=>{var{typed:t}=e;return t(Ah,{any:co,"any, Object | function | number":co})}));function kh(e){var t={2:"0b",8:"0o",16:"0x"}[e];return function(n){if(n>2**31-1||n<-(2**31))throw new Error("Value must be in range [-2^31, 2^31-1]");if(!Ra(n))throw new Error("Value must be an integer");return n<0&&(n+=2**32),"".concat(t).concat(n.toString(e))}}var _h=["typed"];function Ih(e,t){return qo(e,_h,(n=>{var{typed:r}=n;return r(e,{number:kh(t)})}))}var Th=Ih("bin",2),Ph=Ih("oct",8),Dh=Ih("hex",16),Bh="print",jh=qo(Bh,["typed"],(e=>{var{typed:t}=e;return t(Bh,{"string, Object | Array":qh,"string, Object | Array, number | Object":qh})}));function qh(e,t,n){return e.replace(/\$([\w.]+)/g,(function(e,r){for(var i=r.split("."),a=t[i.shift()];i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}return void 0!==a?Xi(a)?a:co(a,n):e}))}var zh=qo("to",["typed","matrix"],(e=>{var{typed:t,matrix:n}=e,r=np({typed:t}),i=$l({typed:t});return t("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return r(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"Matrix, any":function(e,t){return i(e,t,this,!1)},"any, Matrix":function(e,t){return i(t,e,this,!0)},"Array, any":function(e,t){return i(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return i(n(t),e,this,!0).valueOf()}})})),Rh="isPrime",Fh=qo(Rh,["typed"],(e=>{var{typed:t}=e;return t(Rh,{number:function(e){if(0*e!=0)return!1;if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},BigNumber:function(e){if(0*e.toNumber()!=0)return!1;if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;for(var t=5;e.gte(t*t);t+=6)if(e.mod(t).eq(0)||e.mod(t+2).eq(0))return!1;return!0},"Array | Matrix":function(e){return ju(e,this)}})})),Lh=qo("numeric",["number","?bignumber","?fraction"],(e=>{var{number:t,bignumber:n,fraction:r}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:n?e=>n(e):Df,Fraction:r?e=>r(e):Bf};return function(e,t){var n=Ia(e);if(!(n in i))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===n?e:a[t](e)}})),Uh="divideScalar",Vh=qo(Uh,["typed","numeric"],(e=>{var{typed:t,numeric:n}=e;return t(Uh,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Fraction | BigNumber":function(e,t){var r=e.clone(),i=n(1,Ia(t));return r.value=this(null===r.value?r._normalize(i):r.value,t),r},"number | Fraction | BigNumber, Unit":function(e,t){var r=t.clone();r=r.pow(-1);var i=n(1,Ia(e));return r.value=this(e,null===t.value?t._normalize(i):t.value),r},"Unit, Unit":function(e,t){return e.divide(t)}})})),$h=qo("pow",["typed","config","identity","multiply","matrix","fraction","number","Complex"],(e=>{var{typed:t,config:n,identity:r,multiply:i,matrix:a,number:o,fraction:s,Complex:u}=e;return t("pow",{"number, number":c,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||n.predictable?e.pow(t):new u(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){if(1!==t.d){if(n.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return c(e.valueOf(),t.valueOf())}return e.pow(t)},"Array, number":l,"Array, BigNumber":function(e,t){return l(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function c(e,t){if(n.predictable&&!Ra(t)&&e<0)try{var r=s(t),i=o(r);if((t===i||Math.abs((t-i)/t)<1e-14)&&r.d%2==1)return(r.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:Ra(t)||e>=0||n.predictable?lc(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new u(e,0).pow(t,0)}function l(e,t){if(!Ra(t)||t<0)throw new TypeError("For A^b, b must be a positive integer (value is "+t+")");var n=go(e);if(2!==n.length)throw new Error("For A^b, A must be 2 dimensional (A has "+n.length+" dimensions)");if(n[0]!==n[1])throw new Error("For A^b, A must be square (size is "+n[0]+"x"+n[1]+")");for(var a=r(n[0]).valueOf(),o=e;t>=1;)1==(1&t)&&(a=i(o,a)),t>>=1,o=i(o,o);return a}function p(e,t){return a(l(e.valueOf(),t))}}));function Hh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gh(e){for(var t=1;t{var{typed:t,matrix:n,equalScalar:r,zeros:i,BigNumber:a,DenseMatrix:o}=e,s=Vl({typed:t,equalScalar:r}),u=hp({typed:t,DenseMatrix:o}),c=$l({typed:t});return t(Zh,Gh(Gh({},Yh),{},{Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(Jh);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Jh);var n=t.toNumber();return e.round(n)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Jh);return new a(e).toDecimalPlaces(t.toNumber())},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Jh);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(Jh);return e.round(t)},"Array | Matrix":function(e){return ju(e,this)},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | Complex | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,this,!1).valueOf()},"number | Complex | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()}}))})),Yh={number:pc,"number, number":function(e,t){if(!Ra(t))throw new TypeError(Jh);if(t<0||t>15)throw new Error("Number of decimals in function round must be in te range of 0-15");return pc(e,t)}},Xh=qo("log",["config","typed","divideScalar","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,Complex:i}=e;return t("log",{number:function(e){return e>=0||n.predictable?nc(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||n.predictable?e.ln():new i(e.toNumber(),0).log()},"Array | Matrix":function(e){return ju(e,this)},"any, any":function(e,t){return r(this(e),this(t))}})})),Qh="log1p",ed=qo(Qh,["typed","config","divideScalar","log","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,log:i,Complex:a}=e;return t(Qh,{number:function(e){return e>=-1||n.predictable?Va(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":function(e){return ju(e,this)},"any, any":function(e,t){return r(this(e),i(t))}});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}})),td="nthRoots",nd=qo(td,["config","typed","divideScalar","Complex"],(e=>{var{typed:t,config:n,divideScalar:r,Complex:i}=e,a=[function(e){return new i(e,0)},function(e){return new i(0,e)},function(e){return new i(-e,0)},function(e){return new i(0,-e)}];function o(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new i(0,0)];var n,r="number"==typeof e;(r||0===e.re||0===e.im)&&(n=r?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var o=e.arg(),s=e.abs(),u=[],c=Math.pow(s,1/t),l=0;l{var{typed:t,equalScalar:n,matrix:r,pow:i,DenseMatrix:a}=e,o=pp({typed:t}),s=Wp({typed:t,DenseMatrix:a}),u=Vl({typed:t,equalScalar:n}),c=hp({typed:t,DenseMatrix:a}),l=np({typed:t}),p=$l({typed:t});return t(rd,{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,i)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return p(e,t,this,!1)},"any, SparseMatrix":function(e,t){return c(t,e,this,!0)},"any, DenseMatrix":function(e,t){return p(t,e,this,!0)},"Array, any":function(e,t){return p(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return p(r(t),e,this,!0).valueOf()}})})),ad="dotDivide",od=qo(ad,["typed","matrix","equalScalar","divideScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,divideScalar:i,DenseMatrix:a}=e,o=ip({typed:t,equalScalar:r}),s=pp({typed:t}),u=Wp({typed:t,DenseMatrix:a}),c=Vl({typed:t,equalScalar:r}),l=hp({typed:t,DenseMatrix:a}),p=np({typed:t}),f=$l({typed:t});return t(ad,{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return p(e,t,i)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return c(e,t,i,!1)},"DenseMatrix, any":function(e,t){return f(e,t,i,!1)},"any, SparseMatrix":function(e,t){return l(t,e,i,!0)},"any, DenseMatrix":function(e,t){return f(t,e,i,!0)},"Array, any":function(e,t){return f(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return f(n(t),e,i,!0).valueOf()}})}));function sd(e){var{DenseMatrix:t}=e;return function(e,n,r){var i=e.size();if(2!==i.length)throw new RangeError("Matrix must be two dimensional (size: "+co(i)+")");var a=i[0];if(a!==i[1])throw new RangeError("Matrix must be square (size: "+co(i)+")");var o=[];if(ea(n)){var s=n.size(),u=n._data;if(1===s.length){if(s[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=sd({DenseMatrix:s});return t(ud,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],p=e._values,f=e._index,h=e._ptr,d=[],m=0;mm&&(v.push(p[N]),x.push(M))}if(o(g,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var E=r(y,g),S=0,O=x.length;S{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=sd({DenseMatrix:s});return t(ld,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=(t=u(e,t,!0))._data,c=e._size[0],l=e._size[1],p=e._values,f=e._index,h=e._ptr,d=[],m=l-1;m>=0;m--){var y=n[m][0]||0;if(o(y,0))d[m]=[0];else{for(var g=0,v=[],x=[],b=h[m],w=h[m+1]-1;w>=b;w--){var N=f[w];N===m?g=p[w]:N=0;h--){var d=n[h][0]||0,m=void 0;if(o(d,0))m=0;else{var y=f[h][h];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");m=r(d,y);for(var g=h-1;g>=0;g--)n[g]=[a(n[g][0]||0,i(m,f[g][h]))]}p[h]=[m]}return new s({data:p,size:[c,1]})}})),fd="lsolveAll",hd=qo(fd,["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=sd({DenseMatrix:s});return t(fd,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=[u(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],l=e._size[1],p=e._values,f=e._index,h=e._ptr,d=0;dd&&(v.push(p[M]),x.push(E))}if(o(N,0))if(o(g[d],0)){if(0===y){var S=[...g];S[d]=1;for(var O=0,A=x.length;Onew s({data:e.map((e=>[e])),size:[c,1]})))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(n(e),t).map((e=>e.valueOf()))}});function c(e,t){for(var n=[u(e,t,!0)._data.map((e=>e[0]))],c=e._data,l=e._size[0],p=e._size[1],f=0;fnew s({data:e.map((e=>[e])),size:[l,1]})))}})),dd="usolveAll",md=qo(dd,["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=sd({DenseMatrix:s});return t(dd,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n=[u(e,t,!0)._data.map((e=>e[0]))],c=e._size[0],l=e._size[1],p=e._values,f=e._index,h=e._ptr,d=l-1;d>=0;d--)for(var m=n.length,y=0;y=b;N--){var M=f[N];M===d?w=p[N]:Mnew s({data:e.map((e=>[e])),size:[c,1]})))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(n(e),t).map((e=>e.valueOf()))}});function c(e,t){for(var n=[u(e,t,!0)._data.map((e=>e[0]))],c=e._data,l=e._size[0],p=e._size[1]-1;p>=0;p--)for(var f=n.length,h=0;h=0;y--)m[y]=a(m[y],c[y][p]);n.push(m)}}else{if(0===h)return[];n.splice(h,1),h-=1,f-=1}else{d[p]=r(d[p],c[p][p]);for(var g=p-1;g>=0;g--)d[g]=a(d[g],i(d[p],c[g][p]))}}return n.map((e=>new s({data:e.map((e=>[e])),size:[l,1]})))}})),yd=qo("algorithm08",["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=r._values,p=r._index,f=r._ptr,h=r._size,d=r._datatype;if(u.length!==h.length)throw new mo(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");if(!a||!l)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var m,y=u[0],g=u[1],v=n,x=0,b=i;"string"==typeof c&&c===d&&(m=c,v=t.find(n,[m,m]),x=t.convert(0,m),b=t.find(i,[m,m]));for(var w,N,M,E,S=[],O=[],A=[],C=[],k=[],_=0;_{var{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:a}=e,o=Ql({typed:t}),s=ip({typed:t,equalScalar:r}),u=yd({typed:t,equalScalar:r}),c=tp({typed:t,DenseMatrix:a}),l=Vl({typed:t,equalScalar:r}),p=np({typed:t}),f=$l({typed:t});return t(gd,{"number, number":gc,"BigNumber, BigNumber":Rp,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return p(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():f(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):c(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):f(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}})})),xd="rightArithShift",bd=qo(xd,["typed","matrix","equalScalar","zeros","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:a}=e,o=Ql({typed:t}),s=ip({typed:t,equalScalar:r}),u=yd({typed:t,equalScalar:r}),c=tp({typed:t,DenseMatrix:a}),l=Vl({typed:t,equalScalar:r}),p=np({typed:t}),f=$l({typed:t});return t(xd,{"number, number":vc,"BigNumber, BigNumber":Fp,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return p(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():f(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):c(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):f(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}})})),wd="rightLogShift",Nd=qo(wd,["typed","matrix","equalScalar","zeros","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:a}=e,o=Ql({typed:t}),s=ip({typed:t,equalScalar:r}),u=yd({typed:t,equalScalar:r}),c=tp({typed:t,DenseMatrix:a}),l=Vl({typed:t,equalScalar:r}),p=np({typed:t}),f=$l({typed:t});return t(wd,{"number, number":xc,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return p(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():f(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):c(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):f(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}})})),Md=qo("and",["typed","matrix","equalScalar","zeros","not"],(e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,not:a}=e,o=ip({typed:t,equalScalar:r}),s=ap({typed:t,equalScalar:r}),u=Vl({typed:t,equalScalar:r}),c=np({typed:t}),l=$l({typed:t});return t("and",{"number, number":kc,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return a(t)?i(e.size(),e.storage()):u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return a(t)?i(e.size(),e.storage()):l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return a(e)?i(e.size(),e.storage()):u(t,e,this,!0)},"any, DenseMatrix":function(e,t){return a(e)?i(e.size(),e.storage()):l(t,e,this,!0)},"Array, any":function(e,t){return this(n(e),t).valueOf()},"any, Array":function(e,t){return this(e,n(t)).valueOf()}})})),Ed="compare",Sd=qo(Ed,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix"],(e=>{var{typed:t,config:n,equalScalar:r,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:s}=e,u=pp({typed:t}),c=fp({typed:t,equalScalar:r}),l=hp({typed:t,DenseMatrix:s}),p=np({typed:t}),f=$l({typed:t});return t(Ed,{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"number, number":function(e,t){return Qa(e,t,n.epsilon)?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return ml(e,t,n.epsilon)?new a(0):new a(e.cmp(t))},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return c(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return p(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return l(e,t,this,!1)},"DenseMatrix, any":function(e,t){return f(e,t,this,!1)},"any, SparseMatrix":function(e,t){return l(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, any":function(e,t){return f(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return f(i(t),e,this,!0).valueOf()}})})),Od=function e(t,n){var r,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},p=l(t).replace(o,"")||"",f=l(n).replace(o,"")||"",h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=f.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(p.match(u),16)||1!==h.length&&p.match(s)&&Date.parse(p),y=parseInt(f.match(u),16)||m&&f.match(s)&&Date.parse(f)||null;if(y){if(my)return 1}for(var g=0,v=Math.max(h.length,d.length);gi)return 1}return 0},Ad="compareNatural",Cd=qo(Ad,["typed","compare"],(e=>{var{typed:t,compare:n}=e,r=n.signatures["boolean,boolean"];return t(Ad,{"any, any":function(e,t){var o,s=Ia(e),u=Ia(t);if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==u&&"BigNumber"!==u&&"Fraction"!==u))return"0"!==(o=n(e,t)).toString()?o>0?1:-1:Od(s,u);if("Array"===s||"Matrix"===s||"Array"===u||"Matrix"===u)return 0!==(o=i(this,e,t))?o:Od(s,u);if(s!==u)return Od(s,u);if("Complex"===s)return function(e,t){if(e.re>t.re)return 1;if(e.ret.im)return 1;if(e.imn.length?1:t.length{var{typed:t,matrix:n}=e,r=np({typed:t}),i=$l({typed:t});return t(kd,{"any, any":ho,"DenseMatrix, DenseMatrix":function(e,t){return r(e,t,ho)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"DenseMatrix, any":function(e,t){return i(e,t,ho,!1)},"any, DenseMatrix":function(e,t){return i(t,e,ho,!0)},"Array, any":function(e,t){return i(n(e),t,ho,!1).valueOf()},"any, Array":function(e,t){return i(n(t),e,ho,!0).valueOf()}})})),Id="equal",Td=qo(Id,["typed","matrix","equalScalar","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i}=e,a=pp({typed:t}),o=Wp({typed:t,DenseMatrix:i}),s=hp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t(Id,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,r)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,r,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,r,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,r)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,r,!1)},"DenseMatrix, any":function(e,t){return c(e,t,r,!1)},"any, SparseMatrix":function(e,t){return s(t,e,r,!0)},"any, DenseMatrix":function(e,t){return c(t,e,r,!0)},"Array, any":function(e,t){return c(n(e),t,r,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,r,!0).valueOf()}})})),Pd=(qo(Id,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(Id,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:n(e,t)}})})),"equalText"),Dd=qo(Pd,["typed","compareText","isZero"],(e=>{var{typed:t,compareText:n,isZero:r}=e;return t(Pd,{"any, any":function(e,t){return r(n(e,t))}})})),Bd="smaller",jd=qo(Bd,["typed","config","matrix","DenseMatrix"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i}=e,a=pp({typed:t}),o=Wp({typed:t,DenseMatrix:i}),s=hp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t(Bd,{"boolean, boolean":function(e,t){return e{var{typed:t,config:n,matrix:r,DenseMatrix:i}=e,a=pp({typed:t}),o=Wp({typed:t,DenseMatrix:i}),s=hp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t(qd,{"boolean, boolean":function(e,t){return e<=t},"number, number":function(e,t){return e<=t||Qa(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lte(t)||ml(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return 1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return c(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, any":function(e,t){return c(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return c(r(t),e,this,!0).valueOf()}})})),Rd="larger",Fd=qo(Rd,["typed","config","matrix","DenseMatrix"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i}=e,a=pp({typed:t}),o=Wp({typed:t,DenseMatrix:i}),s=hp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t(Rd,{"boolean, boolean":function(e,t){return e>t},"number, number":function(e,t){return e>t&&!Qa(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!ml(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return 1===e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return c(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, any":function(e,t){return c(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return c(r(t),e,this,!0).valueOf()}})})),Ld="largerEq",Ud=qo(Ld,["typed","config","matrix","DenseMatrix"],(e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i}=e,a=pp({typed:t}),o=Wp({typed:t,DenseMatrix:i}),s=hp({typed:t,DenseMatrix:i}),u=np({typed:t}),c=$l({typed:t});return t(Ld,{"boolean, boolean":function(e,t){return e>=t},"number, number":function(e,t){return e>=t||Qa(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gte(t)||ml(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return-1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return c(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, any":function(e,t){return c(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return c(r(t),e,this,!0).valueOf()}})})),Vd="deepEqual",$d=qo(Vd,["typed","equal"],(e=>{var{typed:t,equal:n}=e;return t(Vd,{"any, any":function(e,t){return r(e.valueOf(),t.valueOf())}});function r(e,t){if(Array.isArray(e)){if(Array.isArray(t)){var i=e.length;if(i!==t.length)return!1;for(var a=0;a{var{typed:t,config:n,equalScalar:r,matrix:i,DenseMatrix:a}=e,o=pp({typed:t}),s=Wp({typed:t,DenseMatrix:a}),u=hp({typed:t,DenseMatrix:a}),c=np({typed:t}),l=$l({typed:t});return t("unequal",{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:p(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,p)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,p,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,p,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,p)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return u(e,t,p,!1)},"DenseMatrix, any":function(e,t){return l(e,t,p,!1)},"any, SparseMatrix":function(e,t){return u(t,e,p,!0)},"any, DenseMatrix":function(e,t){return l(t,e,p,!0)},"Array, any":function(e,t){return l(i(e),t,p,!1).valueOf()},"any, Array":function(e,t){return l(i(t),e,p,!0).valueOf()}});function p(e,t){return!r(e,t)}})),Wd=(qo(Hd,["typed","equalScalar"],(e=>{var{typed:t,equalScalar:n}=e;return t(Hd,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!n(e,t)}})})),"partitionSelect"),Jd=qo(Wd,["typed","isNumeric","isNaN","compare"],(e=>{var{typed:t,isNumeric:n,isNaN:r,compare:i}=e,a=i,o=(e,t)=>-i(e,t);return t(Wd,{"Array | Matrix, number":function(e,t){return s(e,t,a)},"Array | Matrix, number, string":function(e,t,n){if("asc"===n)return s(e,t,a);if("desc"===n)return s(e,t,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(e,t,n){if(!Ra(t)||t<0)throw new Error("k must be a non-negative integer");if(ea(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return u(e.valueOf(),t,n)}if(Array.isArray(e))return u(e,t,n)}function u(e,t,i){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a=0){var p=e[c];e[c]=e[u],e[u]=p,--c}else++u;i(e[u],l)>0&&--u,t<=u?s=u:o=u+1}return e[t]}})),Zd="sort",Kd=qo(Zd,["typed","matrix","compare","compareNatural"],(e=>{var{typed:t,matrix:n,compare:r,compareNatural:i}=e,a=r,o=(e,t)=>-r(e,t);return t(Zd,{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return c(e),n(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),n(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(s(t))},"Matrix, string":function(e,t){return c(e),n(e.toArray().sort(s(t)),e.storage())}});function s(e){if("asc"===e)return a;if("desc"===e)return o;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==go(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),Yd=qo("max",["typed","config","numeric","larger"],(e=>{var{typed:t,config:n,numeric:r,larger:i}=e;return t("max",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return qu(e,t.valueOf(),a)},"...":function(e){if(Du(e))throw new TypeError("Scalar values expected in function max");return o(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw Eh(e,"max",t)}}function o(e){var t;if(Bu(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw Eh(t,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=r(t,n.number)),t}})),Xd=qo("min",["typed","config","numeric","smaller"],(e=>{var{typed:t,config:n,numeric:r,smaller:i}=e;return t("min",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return qu(e,t.valueOf(),a)},"...":function(e){if(Du(e))throw new TypeError("Scalar values expected in function min");return o(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw Eh(e,"min",t)}}function o(e){var t;if(Bu(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw Eh(t,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=r(t,n.number)),t}})),Qd=qo("ImmutableDenseMatrix",["smaller","DenseMatrix"],(e=>{var{smaller:t,DenseMatrix:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!Xi(t))throw new Error("Invalid datatype: "+t);if(ea(e)||Qi(e)){var i=new n(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&Qi(e.data)&&Qi(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+Ia(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return ea(t)?new r({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:Ta(this._data),size:Ta(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(n){(null===e||t(n,e))&&(e=n)})),this._min=null!==e?e:void 0}return this._min},r.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(n){(null===e||t(e,n))&&(e=n)})),this._max=null!==e?e:void 0}return this._max},r}),{isClass:!0}),em=qo("Index",["ImmutableDenseMatrix"],(e=>{var{ImmutableDenseMatrix:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var t=0,i=arguments.length;t{var{smaller:t,larger:n}=e,r=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,t,n){t.left.right=t.right,t.right.left=t.left,n.degree--,n.child===t&&(n.child=t.right),0===n.degree&&(n.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function o(e,t){var n=t.parent;n&&(t.mark?(a(e,t,n),o(n)):t.mark=!0)}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,n){var r={key:e,value:n,degree:0};if(this._minimum){var i=this._minimum;r.left=i,r.right=i.right,i.right=r,r.right.left=r,t(e,i.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var i=this._minimum,a=e.degree,o=e.child;a>0;){var u=o.right;o.left.right=o.right,o.right.left=o.left,o.left=i,o.right=i.right,i.right=o,o.right.left=o,o.parent=null,o=u,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,o=Math.floor(Math.log(i)*r)+1,u=new Array(o),c=0,l=e;if(l)for(c++,l=l.right;l!==e;)c++,l=l.right;for(;c>0;){for(var p=l.degree,f=l.right;a=u[p];){if(n(l.key,a.key)){var h=a;a=l,l=h}s(a,l),u[p]=null,p++}u[p]=l,l=f,c--}e=null;for(var d=0;d{var{addScalar:t,equalScalar:n,FibonacciHeap:r}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new r}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var n=this._heap.insert(e,t);this._values[e]=n}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,n){var r=this._values[e];r?r.value=t(r.value,n):(r=this._heap.insert(e,n),this._values[e]=r)},i.prototype.forEach=function(e,t,r){var i=this._heap,a=this._values,o=[],s=i.extractMinimum();for(s&&o.push(s);s&&s.key<=t;)s.key>=e&&(n(s.value,0)||r(s.key,s.value,this)),(s=i.extractMinimum())&&o.push(s);for(var u=0;u{var t,n,r,{on:i,config:a,addScalar:o,subtract:s,multiplyScalar:u,divideScalar:c,pow:l,abs:p,fix:f,round:h,equal:d,isNumeric:m,format:y,number:g,Complex:v,BigNumber:x,Fraction:b}=e,w=g;function N(e,t){if(!(this instanceof N))throw new Error("Constructor must be called with the new operator");if(null!=e&&!m(e)&&!Zi(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==t&&("string"!=typeof t||""===t))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==t){var n=N.parse(t);this.units=n.units,this.dimensions=n.dimensions}else{this.units=[{unit:j,prefix:T.NONE,power:0}],this.dimensions=[];for(var r=0;r="0"&&e<="9"}function S(){n++,r=t.charAt(n)}function O(e){n=e,r=t.charAt(n)}function A(){var e="",t=n;if("+"===r?S():"-"===r&&(e+=r,S()),!function(e){return e>="0"&&e<="9"||"."===e}(r))return O(t),null;if("."===r){if(e+=r,S(),!E(r))return O(t),null}else{for(;E(r);)e+=r,S();"."===r&&(e+=r,S())}for(;E(r);)e+=r,S();if("E"===r||"e"===r){var i="",a=n;if(i+=r,S(),"+"!==r&&"-"!==r||(i+=r,S()),!E(r))return O(a),e;for(e+=i;E(r);)e+=r,S()}return e}function C(){for(var e="";E(r)||N.isValidAlpha(r);)e+=r,S();var t=e.charAt(0);return N.isValidAlpha(t)?e:null}function k(e){return r===e?(S(),e):null}function _(e){if(Ba(q,e)){var t=q[e];return{unit:t,prefix:t.prefixes[""]}}for(var n in q)if(Ba(q,n)&&uo(e,n)){var r=q[n],i=e.length-n.length,a=e.substring(0,i),o=Ba(r.prefixes,a)?r.prefixes[a]:void 0;if(void 0!==o)return{unit:r,prefix:o}}return null}function I(e){return e.equalBase(D.NONE)&&null!==e.value&&!a.predictable?e.value:e}N.prototype.type="Unit",N.prototype.isUnit=!0,N.parse=function(e,i){if(i=i||{},n=-1,r="","string"!=typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var o=new N;o.units=[];var s=1,u=!1;S(),M();var c=A(),l=null;if(c){if("BigNumber"===a.number)l=new x(c);else if("Fraction"===a.number)try{l=new b(c)}catch(e){l=parseFloat(c)}else l=parseFloat(c);M(),k("*")?(s=1,u=!0):k("/")&&(s=-1,u=!0)}for(var p=[],f=1;;){for(M();"("===r;)p.push(s),f*=s,s=1,S(),M();var h=void 0;if(!r)break;var d=r;if(null===(h=C()))throw new SyntaxError('Unexpected "'+d+'" in "'+t+'" at index '+n.toString());var m=_(h);if(null===m)throw new SyntaxError('Unit "'+h+'" not found.');var y=s*f;if(M(),k("^")){M();var g=A();if(null===g)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');y*=g}o.units.push({unit:m.unit,prefix:m.prefix,power:y});for(var v=0;v1||Math.abs(this.units[0].power-1)>1e-15)},N.prototype._normalize=function(e){var t,n,r,i,a;if(null==e||0===this.units.length)return e;if(this._isDerived()){var s=e;a=N._getNumberConverter(Ia(e));for(var c=0;c1e-12)return!1;return!0},N.prototype.equalBase=function(e){for(var t=0;t1e-12)return!1;return!0},N.prototype.equals=function(e){return this.equalBase(e)&&d(this.value,e.value)},N.prototype.multiply=function(e){for(var t=this.clone(),n=0;n1e-12&&(Ba(L,s)?r.push({unit:L[s].unit,prefix:L[s].prefix,power:n.dimensions[o]||0}):a=!0)}r.length1e-12){if(!Ba(F.si,r))throw new Error("Cannot express custom unit "+r+" in SI units");t.push({unit:F.si[r].unit,prefix:F.si[r].prefix,power:e.dimensions[n]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},N.prototype.formatUnits=function(){for(var e="",t="",n=0,r=0,i=0;i0?(n++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&r++;if(r>0)for(var a=0;a0?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+="^"+-this.units[a].power)):(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,t+="^"+this.units[a].power));e=e.substr(1),t=t.substr(1),n>1&&r>0&&(e="("+e+")"),r>1&&n>0&&(t="("+t+")");var o=e;return n>0&&r>0&&(o+=" / "),o+=t},N.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),n=!1;for(var r in void 0!==t.value&&null!==t.value&&Zi(t.value)&&(n=Math.abs(t.value.re)<1e-14),t.units)Ba(t.units,r)&&t.units[r].unit&&("VA"===t.units[r].unit.name&&n?t.units[r].unit=q.VAR:"VAR"!==t.units[r].unit.name||n||(t.units[r].unit=q.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var i=t._denormalize(t.value),a=null!==t.value?y(i,e||{}):"",o=t.formatUnits();return t.value&&Zi(t.value)&&(a="("+a+")"),o.length>0&&a.length>0&&(a+=" "),a+=o},N.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?p(this.value):0,t=p(this.units[0].unit.value),n=this.units[0].prefix;if(0===e)return n;var r=this.units[0].power,i=Math.log(e/Math.pow(n.value*t,r))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return n;i=Math.abs(i);var a=this.units[0].unit.prefixes;for(var o in a)if(Ba(a,o)){var s=a[o];if(s.scientific){var u=Math.abs(Math.log(e/Math.pow(s.value*t,r))/Math.LN10-1.2);(u0))},q={meter:{name:"meter",base:D.LENGTH,prefixes:T.LONG,value:1,offset:0},inch:{name:"inch",base:D.LENGTH,prefixes:T.NONE,value:.0254,offset:0},foot:{name:"foot",base:D.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yard:{name:"yard",base:D.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mile:{name:"mile",base:D.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},link:{name:"link",base:D.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rod:{name:"rod",base:D.LENGTH,prefixes:T.NONE,value:5.0292,offset:0},chain:{name:"chain",base:D.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:D.LENGTH,prefixes:T.NONE,value:1e-10,offset:0},m:{name:"m",base:D.LENGTH,prefixes:T.SHORT,value:1,offset:0},in:{name:"in",base:D.LENGTH,prefixes:T.NONE,value:.0254,offset:0},ft:{name:"ft",base:D.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yd:{name:"yd",base:D.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mi:{name:"mi",base:D.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},li:{name:"li",base:D.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rd:{name:"rd",base:D.LENGTH,prefixes:T.NONE,value:5.02921,offset:0},ch:{name:"ch",base:D.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},mil:{name:"mil",base:D.LENGTH,prefixes:T.NONE,value:254e-7,offset:0},m2:{name:"m2",base:D.SURFACE,prefixes:T.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:D.SURFACE,prefixes:T.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:D.SURFACE,prefixes:T.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:D.SURFACE,prefixes:T.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:D.SURFACE,prefixes:T.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:D.SURFACE,prefixes:T.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:D.SURFACE,prefixes:T.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:D.SURFACE,prefixes:T.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:D.SURFACE,prefixes:T.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:D.SURFACE,prefixes:T.NONE,value:1e4,offset:0},m3:{name:"m3",base:D.VOLUME,prefixes:T.CUBIC,value:1,offset:0},L:{name:"L",base:D.VOLUME,prefixes:T.SHORT,value:.001,offset:0},l:{name:"l",base:D.VOLUME,prefixes:T.SHORT,value:.001,offset:0},litre:{name:"litre",base:D.VOLUME,prefixes:T.LONG,value:.001,offset:0},cuin:{name:"cuin",base:D.VOLUME,prefixes:T.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:D.VOLUME,prefixes:T.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:D.VOLUME,prefixes:T.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:D.VOLUME,prefixes:T.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:D.VOLUME,prefixes:T.NONE,value:15e-6,offset:0},drop:{name:"drop",base:D.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:D.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},minim:{name:"minim",base:D.VOLUME,prefixes:T.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:D.VOLUME,prefixes:T.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:D.VOLUME,prefixes:T.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:D.VOLUME,prefixes:T.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:D.VOLUME,prefixes:T.NONE,value:1e-6,offset:0},cup:{name:"cup",base:D.VOLUME,prefixes:T.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:D.VOLUME,prefixes:T.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:D.VOLUME,prefixes:T.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:D.VOLUME,prefixes:T.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:D.VOLUME,prefixes:T.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:D.VOLUME,prefixes:T.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:D.VOLUME,prefixes:T.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:D.VOLUME,prefixes:T.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:D.VOLUME,prefixes:T.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:D.VOLUME,prefixes:T.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:D.VOLUME,prefixes:T.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:D.VOLUME,prefixes:T.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:D.VOLUME,prefixes:T.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:D.VOLUME,prefixes:T.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:D.VOLUME,prefixes:T.NONE,value:.1173478,offset:0},obl:{name:"obl",base:D.VOLUME,prefixes:T.NONE,value:.1589873,offset:0},g:{name:"g",base:D.MASS,prefixes:T.SHORT,value:.001,offset:0},gram:{name:"gram",base:D.MASS,prefixes:T.LONG,value:.001,offset:0},ton:{name:"ton",base:D.MASS,prefixes:T.SHORT,value:907.18474,offset:0},t:{name:"t",base:D.MASS,prefixes:T.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:D.MASS,prefixes:T.LONG,value:1e3,offset:0},grain:{name:"grain",base:D.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:D.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:D.MASS,prefixes:T.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:D.MASS,prefixes:T.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:D.MASS,prefixes:T.NONE,value:45.359237,offset:0},stick:{name:"stick",base:D.MASS,prefixes:T.NONE,value:.115,offset:0},stone:{name:"stone",base:D.MASS,prefixes:T.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:D.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:D.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:D.MASS,prefixes:T.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:D.MASS,prefixes:T.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:D.MASS,prefixes:T.NONE,value:45.359237,offset:0},s:{name:"s",base:D.TIME,prefixes:T.SHORT,value:1,offset:0},min:{name:"min",base:D.TIME,prefixes:T.NONE,value:60,offset:0},h:{name:"h",base:D.TIME,prefixes:T.NONE,value:3600,offset:0},second:{name:"second",base:D.TIME,prefixes:T.LONG,value:1,offset:0},sec:{name:"sec",base:D.TIME,prefixes:T.LONG,value:1,offset:0},minute:{name:"minute",base:D.TIME,prefixes:T.NONE,value:60,offset:0},hour:{name:"hour",base:D.TIME,prefixes:T.NONE,value:3600,offset:0},day:{name:"day",base:D.TIME,prefixes:T.NONE,value:86400,offset:0},week:{name:"week",base:D.TIME,prefixes:T.NONE,value:604800,offset:0},month:{name:"month",base:D.TIME,prefixes:T.NONE,value:2629800,offset:0},year:{name:"year",base:D.TIME,prefixes:T.NONE,value:31557600,offset:0},decade:{name:"decade",base:D.TIME,prefixes:T.NONE,value:315576e3,offset:0},century:{name:"century",base:D.TIME,prefixes:T.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:D.TIME,prefixes:T.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:D.FREQUENCY,prefixes:T.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:D.FREQUENCY,prefixes:T.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:D.ANGLE,prefixes:T.SHORT,value:1,offset:0},radian:{name:"radian",base:D.ANGLE,prefixes:T.LONG,value:1,offset:0},deg:{name:"deg",base:D.ANGLE,prefixes:T.SHORT,value:null,offset:0},degree:{name:"degree",base:D.ANGLE,prefixes:T.LONG,value:null,offset:0},grad:{name:"grad",base:D.ANGLE,prefixes:T.SHORT,value:null,offset:0},gradian:{name:"gradian",base:D.ANGLE,prefixes:T.LONG,value:null,offset:0},cycle:{name:"cycle",base:D.ANGLE,prefixes:T.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:D.ANGLE,prefixes:T.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:D.ANGLE,prefixes:T.NONE,value:null,offset:0},A:{name:"A",base:D.CURRENT,prefixes:T.SHORT,value:1,offset:0},ampere:{name:"ampere",base:D.CURRENT,prefixes:T.LONG,value:1,offset:0},K:{name:"K",base:D.TEMPERATURE,prefixes:T.NONE,value:1,offset:0},degC:{name:"degC",base:D.TEMPERATURE,prefixes:T.NONE,value:1,offset:273.15},degF:{name:"degF",base:D.TEMPERATURE,prefixes:T.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:D.TEMPERATURE,prefixes:T.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:D.TEMPERATURE,prefixes:T.NONE,value:1,offset:0},celsius:{name:"celsius",base:D.TEMPERATURE,prefixes:T.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:D.TEMPERATURE,prefixes:T.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:D.TEMPERATURE,prefixes:T.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:D.AMOUNT_OF_SUBSTANCE,prefixes:T.SHORT,value:1,offset:0},mole:{name:"mole",base:D.AMOUNT_OF_SUBSTANCE,prefixes:T.LONG,value:1,offset:0},cd:{name:"cd",base:D.LUMINOUS_INTENSITY,prefixes:T.SHORT,value:1,offset:0},candela:{name:"candela",base:D.LUMINOUS_INTENSITY,prefixes:T.LONG,value:1,offset:0},N:{name:"N",base:D.FORCE,prefixes:T.SHORT,value:1,offset:0},newton:{name:"newton",base:D.FORCE,prefixes:T.LONG,value:1,offset:0},dyn:{name:"dyn",base:D.FORCE,prefixes:T.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:D.FORCE,prefixes:T.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:D.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:D.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:D.FORCE,prefixes:T.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:D.FORCE,prefixes:T.NONE,value:9.80665,offset:0},J:{name:"J",base:D.ENERGY,prefixes:T.SHORT,value:1,offset:0},joule:{name:"joule",base:D.ENERGY,prefixes:T.SHORT,value:1,offset:0},erg:{name:"erg",base:D.ENERGY,prefixes:T.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:D.ENERGY,prefixes:T.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:D.ENERGY,prefixes:T.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:D.ENERGY,prefixes:T.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:D.ENERGY,prefixes:T.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:D.POWER,prefixes:T.SHORT,value:1,offset:0},watt:{name:"watt",base:D.POWER,prefixes:T.LONG,value:1,offset:0},hp:{name:"hp",base:D.POWER,prefixes:T.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:D.POWER,prefixes:T.SHORT,value:v.I,offset:0},VA:{name:"VA",base:D.POWER,prefixes:T.SHORT,value:1,offset:0},Pa:{name:"Pa",base:D.PRESSURE,prefixes:T.SHORT,value:1,offset:0},psi:{name:"psi",base:D.PRESSURE,prefixes:T.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:D.PRESSURE,prefixes:T.NONE,value:101325,offset:0},bar:{name:"bar",base:D.PRESSURE,prefixes:T.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:D.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:D.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:D.PRESSURE,prefixes:T.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:D.PRESSURE,prefixes:T.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:D.ELECTRIC_CHARGE,prefixes:T.LONG,value:1,offset:0},C:{name:"C",base:D.ELECTRIC_CHARGE,prefixes:T.SHORT,value:1,offset:0},farad:{name:"farad",base:D.ELECTRIC_CAPACITANCE,prefixes:T.LONG,value:1,offset:0},F:{name:"F",base:D.ELECTRIC_CAPACITANCE,prefixes:T.SHORT,value:1,offset:0},volt:{name:"volt",base:D.ELECTRIC_POTENTIAL,prefixes:T.LONG,value:1,offset:0},V:{name:"V",base:D.ELECTRIC_POTENTIAL,prefixes:T.SHORT,value:1,offset:0},ohm:{name:"ohm",base:D.ELECTRIC_RESISTANCE,prefixes:T.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:D.ELECTRIC_INDUCTANCE,prefixes:T.LONG,value:1,offset:0},H:{name:"H",base:D.ELECTRIC_INDUCTANCE,prefixes:T.SHORT,value:1,offset:0},siemens:{name:"siemens",base:D.ELECTRIC_CONDUCTANCE,prefixes:T.LONG,value:1,offset:0},S:{name:"S",base:D.ELECTRIC_CONDUCTANCE,prefixes:T.SHORT,value:1,offset:0},weber:{name:"weber",base:D.MAGNETIC_FLUX,prefixes:T.LONG,value:1,offset:0},Wb:{name:"Wb",base:D.MAGNETIC_FLUX,prefixes:T.SHORT,value:1,offset:0},tesla:{name:"tesla",base:D.MAGNETIC_FLUX_DENSITY,prefixes:T.LONG,value:1,offset:0},T:{name:"T",base:D.MAGNETIC_FLUX_DENSITY,prefixes:T.SHORT,value:1,offset:0},b:{name:"b",base:D.BIT,prefixes:T.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:D.BIT,prefixes:T.BINARY_LONG,value:1,offset:0},B:{name:"B",base:D.BIT,prefixes:T.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:D.BIT,prefixes:T.BINARY_LONG,value:8,offset:0}},z={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function R(e){if("BigNumber"===e.number){var t=am(x);q.rad.value=new x(1),q.deg.value=t.div(180),q.grad.value=t.div(200),q.cycle.value=t.times(2),q.arcsec.value=t.div(648e3),q.arcmin.value=t.div(10800)}else q.rad.value=1,q.deg.value=Math.PI/180,q.grad.value=Math.PI/200,q.cycle.value=2*Math.PI,q.arcsec.value=Math.PI/648e3,q.arcmin.value=Math.PI/10800;q.radian.value=q.rad.value,q.degree.value=q.deg.value,q.gradian.value=q.grad.value}R(a),i&&i("config",(function(e,t){e.number!==t.number&&R(e)}));var F={si:{NONE:{unit:j,prefix:T.NONE[""]},LENGTH:{unit:q.m,prefix:T.SHORT[""]},MASS:{unit:q.g,prefix:T.SHORT.k},TIME:{unit:q.s,prefix:T.SHORT[""]},CURRENT:{unit:q.A,prefix:T.SHORT[""]},TEMPERATURE:{unit:q.K,prefix:T.SHORT[""]},LUMINOUS_INTENSITY:{unit:q.cd,prefix:T.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:q.mol,prefix:T.SHORT[""]},ANGLE:{unit:q.rad,prefix:T.SHORT[""]},BIT:{unit:q.bits,prefix:T.SHORT[""]},FORCE:{unit:q.N,prefix:T.SHORT[""]},ENERGY:{unit:q.J,prefix:T.SHORT[""]},POWER:{unit:q.W,prefix:T.SHORT[""]},PRESSURE:{unit:q.Pa,prefix:T.SHORT[""]},ELECTRIC_CHARGE:{unit:q.C,prefix:T.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:q.F,prefix:T.SHORT[""]},ELECTRIC_POTENTIAL:{unit:q.V,prefix:T.SHORT[""]},ELECTRIC_RESISTANCE:{unit:q.ohm,prefix:T.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:q.H,prefix:T.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:q.S,prefix:T.SHORT[""]},MAGNETIC_FLUX:{unit:q.Wb,prefix:T.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:q.T,prefix:T.SHORT[""]},FREQUENCY:{unit:q.Hz,prefix:T.SHORT[""]}}};F.cgs=JSON.parse(JSON.stringify(F.si)),F.cgs.LENGTH={unit:q.m,prefix:T.SHORT.c},F.cgs.MASS={unit:q.g,prefix:T.SHORT[""]},F.cgs.FORCE={unit:q.dyn,prefix:T.SHORT[""]},F.cgs.ENERGY={unit:q.erg,prefix:T.NONE[""]},F.us=JSON.parse(JSON.stringify(F.si)),F.us.LENGTH={unit:q.ft,prefix:T.NONE[""]},F.us.MASS={unit:q.lbm,prefix:T.NONE[""]},F.us.TEMPERATURE={unit:q.degF,prefix:T.NONE[""]},F.us.FORCE={unit:q.lbf,prefix:T.NONE[""]},F.us.ENERGY={unit:q.BTU,prefix:T.BTU[""]},F.us.POWER={unit:q.hp,prefix:T.NONE[""]},F.us.PRESSURE={unit:q.psi,prefix:T.NONE[""]},F.auto=JSON.parse(JSON.stringify(F.si));var L=F.auto;for(var U in N.setUnitSystem=function(e){if(!Ba(F,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(F).join(", "));L=F[e]},N.getUnitSystem=function(){for(var e in F)if(Ba(F,e)&&F[e]===L)return e},N.typeConverters={BigNumber:function(e){return new x(e+"")},Fraction:function(e){return new b(e)},Complex:function(e){return e},number:function(e){return e}},N._getNumberConverter=function(e){if(!N.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return N.typeConverters[e]},q)if(Ba(q,U)){var V=q[U];V.dimensions=V.base.dimensions}for(var $ in z)if(Ba(z,$)){var H=q[z[$]],G={};for(var W in H)Ba(H,W)&&(G[W]=H[W]);G.name=$,q[$]=G}return N.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},N.createUnit=function(e,t){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var n in e)if(Ba(e,n)&&N.deleteUnit(n),e[n].aliases)for(var r=0;r0&&!N.isValidAlpha(r)&&!E(r))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var i,a,o,s=null,u=[],c=0;if(t&&"Unit"===t.type)s=t.clone();else if("string"==typeof t)""!==t&&(i=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');i=t.definition,a=t.prefixes,c=t.offset,o=t.baseName,t.aliases&&(u=t.aliases.valueOf())}if(u)for(var l=0;l1e-12){d=!1;break}if(d){f=!0,p.base=D[h];break}}if(!f){o=o||e+"_STUFF";var y={dimensions:s.dimensions.slice(0)};y.key=o,D[o]=y,L[o]={unit:p,prefix:T.NONE[""]},p.base=D[o]}}else{if(o=o||e+"_STUFF",P.indexOf(o)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var g in P.push(o),D)Ba(D,g)&&(D[g].dimensions[P.length-1]=0);for(var v={dimensions:[]},x=0;x{var{typed:t,Unit:n}=e;return t(hm,{Unit:function(e){return e.clone()},string:function(e){return n.isValuelessUnit(e)?new n(null,e):n.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(e,t){return new n(e,t)},"Array | Matrix":function(e){return ju(e,this)}})})),mm="sparse",ym=qo(mm,["typed","SparseMatrix"],(e=>{var{typed:t,SparseMatrix:n}=e;return t(mm,{"":function(){return new n([])},string:function(e){return new n([],e)},"Array | Matrix":function(e){return new n(e)},"Array | Matrix, string":function(e,t){return new n(e,t)}})})),gm="createUnit",vm=qo(gm,["typed","Unit"],(e=>{var{typed:t,Unit:n}=e;return t(gm,{"Object, Object":function(e,t){return n.createUnit(e,t)},Object:function(e){return n.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var i={};return i[e]=t,n.createUnit(i,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,n.createUnit(r,{})},string:function(e){var t={};return t[e]={},n.createUnit(t,{})}})})),xm="acos",bm=qo(xm,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(xm,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.acos(e):new r(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return ju(e,this)}})})),wm="acosh",Nm=qo(wm,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(wm,{number:function(e){return e>=1||n.predictable?Dc(e):e<=-1?new r(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return ju(e,this)}})})),Mm="acot",Em=qo(Mm,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Mm,{number:Bc,Complex:function(e){return e.acot()},BigNumber:function(e){return new n(1).div(e).atan()},"Array | Matrix":function(e){return ju(e,this)}})})),Sm="acoth",Om=qo(Sm,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Sm,{number:function(e){return e>=1||e<=-1||n.predictable?jc(e):new r(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()},"Array | Matrix":function(e){return ju(e,this)}})})),Am="acsc",Cm=qo(Am,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Am,{number:function(e){return e<=-1||e>=1||n.predictable?qc(e):new r(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()},"Array | Matrix":function(e){return ju(e,this)}})})),km="acsch",_m=qo(km,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(km,{number:zc,Complex:function(e){return e.acsch()},BigNumber:function(e){return new n(1).div(e).asinh()},"Array | Matrix":function(e){return ju(e,this)}})})),Im="asec",Tm=qo(Im,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Im,{number:function(e){return e<=-1||e>=1||n.predictable?Rc(e):new r(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()},"Array | Matrix":function(e){return ju(e,this)}})})),Pm="asech",Dm=qo(Pm,["typed","config","Complex","BigNumber"],(e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Pm,{number:function(e){if(e<=1&&e>=-1||n.predictable){var t=1/e;if(t>0||n.predictable)return Fc(e);var i=Math.sqrt(t*t-1);return new r(Math.log(i-t),Math.PI)}return new r(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()},"Array | Matrix":function(e){return ju(e,this)}})})),Bm="asin",jm=qo(Bm,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(Bm,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.asin(e):new r(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return ju(e,this)}})})),qm=qo("asinh",["typed"],(e=>{var{typed:t}=e;return t("asinh",{number:Lc,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return ju(e,this)}})})),zm=qo("atan",["typed"],(e=>{var{typed:t}=e;return t("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()},"Array | Matrix":function(e){return ju(e,this)}})})),Rm="atan2",Fm=qo(Rm,["typed","matrix","equalScalar","BigNumber","DenseMatrix"],(e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:a}=e,o=ip({typed:t,equalScalar:r}),s=pp({typed:t}),u=_p({typed:t,equalScalar:r}),c=Vl({typed:t,equalScalar:r}),l=hp({typed:t,DenseMatrix:a}),p=np({typed:t}),f=$l({typed:t});return t(Rm,{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return i.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return p(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return f(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return f(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return f(n(t),e,this,!0).valueOf()}})})),Lm="atanh",Um=qo(Lm,["typed","config","Complex"],(e=>{var{typed:t,config:n,Complex:r}=e;return t(Lm,{number:function(e){return e<=1&&e>=-1||n.predictable?Uc(e):new r(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return ju(e,this)}})})),Vm=qo("cos",["typed"],(e=>{var{typed:t}=e;return t("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),$m="cosh",Hm=qo($m,["typed"],(e=>{var{typed:t}=e;return t($m,{number:ro,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),Gm=qo("cot",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("cot",{number:Vc,Complex:function(e){return e.cot()},BigNumber:function(e){return new n(1).div(e.tan())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),Wm="coth",Jm=qo(Wm,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Wm,{number:$c,Complex:function(e){return e.coth()},BigNumber:function(e){return new n(1).div(e.tanh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),Zm=qo("csc",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("csc",{number:Hc,Complex:function(e){return e.csc()},BigNumber:function(e){return new n(1).div(e.sin())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),Km="csch",Ym=qo(Km,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Km,{number:Gc,Complex:function(e){return e.csch()},BigNumber:function(e){return new n(1).div(e.sinh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),Xm=qo("sec",["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t("sec",{number:Wc,Complex:function(e){return e.sec()},BigNumber:function(e){return new n(1).div(e.cos())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),Qm="sech",ey=qo(Qm,["typed","BigNumber"],(e=>{var{typed:t,BigNumber:n}=e;return t(Qm,{number:Jc,Complex:function(e){return e.sech()},BigNumber:function(e){return new n(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),ty=qo("sin",["typed"],(e=>{var{typed:t}=e;return t("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),ny="sinh",ry=qo(ny,["typed"],(e=>{var{typed:t}=e;return t(ny,{number:Zc,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),iy=qo("tan",["typed"],(e=>{var{typed:t}=e;return t("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),ay=qo("tanh",["typed"],(e=>{var{typed:t}=e;return t("tanh",{number:ao,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return this(e.value)},"Array | Matrix":function(e){return ju(e,this)}})})),oy="setCartesian",sy=qo(oy,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(oy,{"Array | Matrix, Array | Matrix":function(e,t){var s=[];if(0!==r(n(e),new a(0))&&0!==r(n(t),new a(0))){var u=Co(Array.isArray(e)?e:e.toArray()).sort(i),c=Co(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(var l=0;l{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(uy,{"Array | Matrix, Array | Matrix":function(e,t){var s;if(0===r(n(e),new a(0)))s=[];else{if(0===r(n(t),new a(0)))return Co(e.toArray());var u,c=Do(Co(Array.isArray(e)?e:e.toArray()).sort(i)),l=Do(Co(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var p=0;p{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(ly,{"Array | Matrix":function(e){var t;if(0===r(n(e),new a(0)))t=[];else{var s=Co(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(s[0]);for(var u=1;u{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(fy,{"Array | Matrix, Array | Matrix":function(e,t){var s;if(0===r(n(e),new a(0))||0===r(n(t),new a(0)))s=[];else{var u=Do(Co(Array.isArray(e)?e:e.toArray()).sort(i)),c=Do(Co(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var l=0;l{var{typed:t,size:n,subset:r,compareNatural:i,Index:a}=e;return t(dy,{"Array | Matrix, Array | Matrix":function(e,t){if(0===r(n(e),new a(0)))return!0;if(0===r(n(t),new a(0)))return!1;for(var o,s=Do(Co(Array.isArray(e)?e:e.toArray()).sort(i)),u=Do(Co(Array.isArray(t)?t:t.toArray()).sort(i)),c=0;c{var{typed:t,size:n,subset:r,compareNatural:i,Index:a}=e;return t(yy,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===r(n(t),new a(0)))return 0;for(var o=Co(Array.isArray(t)?t:t.toArray()),s=0,u=0;u{var{typed:t,size:n,subset:r,compareNatural:i,Index:a}=e;return t(vy,{"Array | Matrix":function(e){if(0===r(n(e),new a(0)))return[];for(var t=Co(Array.isArray(e)?e:e.toArray()).sort(i),s=[],u=0;u.toString(2).length<=t.length;)s.push(o(t,u.toString(2).split("").reverse())),u++;return function(e){for(var t=[],n=e.length-1;n>0;n--)for(var r=0;re[r+1].length&&(t=e[r],e[r]=e[r+1],e[r+1]=t);return e}(s)}});function o(e,t){for(var n=[],r=0;r{var{typed:t,compareNatural:n}=e;return t(by,{"Array | Matrix":function(e){return Array.isArray(e)?Co(e).length:Co(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?Co(e).length:Co(e.toArray()).length;for(var r=Co(Array.isArray(e)?e:e.toArray()).sort(n),i=1,a=1;a{var{typed:t,size:n,concat:r,subset:i,setDifference:a,Index:o}=e;return t(Ny,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(n(e),new o(0)))return Co(t);if(0===i(n(t),new o(0)))return Co(e);var s=Co(e),u=Co(t);return r(a(s,u),a(u,s))}})})),Ey="setUnion",Sy=qo(Ey,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(e=>{var{typed:t,size:n,concat:r,subset:i,setIntersect:a,setSymDifference:o,Index:s}=e;return t(Ey,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(n(e),new s(0)))return Co(t);if(0===i(n(t),new s(0)))return Co(e);var u=Co(e),c=Co(t);return r(o(u,c),a(u,c))}})})),Oy=qo("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix"],(e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:a,SparseMatrix:o}=e,s=Ql({typed:t}),u=ep({typed:t,equalScalar:i}),c=tp({typed:t,DenseMatrix:a}),l=np({typed:t}),p=$l({typed:t});return t("add",Pa({"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,r)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,r,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,r,!0)},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,r)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"DenseMatrix, any":function(e,t){return p(e,t,r,!1)},"SparseMatrix, any":function(e,t){return c(e,t,r,!1)},"any, DenseMatrix":function(e,t){return p(t,e,r,!0)},"any, SparseMatrix":function(e,t){return c(t,e,r,!0)},"Array, any":function(e,t){return p(n(e),t,r,!1).valueOf()},"any, Array":function(e,t){return p(n(t),e,r,!0).valueOf()},"any, any":r,"any, any, ...any":function(e,t,n){for(var r=this(e,t),i=0;i{var{typed:t,abs:n,addScalar:r,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:s,isPositive:u}=e;return t(Ay,{"... number | BigNumber":function(e){for(var t=0,c=0,l=0;l{var{typed:t,abs:n,add:r,pow:i,conj:a,sqrt:o,multiply:s,equalScalar:u,larger:c,smaller:l,matrix:p,ctranspose:f,eigs:h}=e;return t(ky,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return y(p(e),2)},Matrix:function(e){return y(e,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(e){return this(e)},"Array, number | BigNumber | string":function(e,t){return y(p(e),t)},"Matrix, number | BigNumber | string":function(e,t){return y(e,t)}});function d(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var r=n(e);c(r,t)&&(t=r)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var r=n(e);t&&!l(r,t)||(t=r)}),!0),t||0}(e);if("fro"===t)return y(e,2);if("number"==typeof t&&!isNaN(t)){if(!u(t,0)){var a=0;return e.forEach((function(e){a=r(i(n(e),t),a)}),!0),i(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function m(e,t){if(1===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[1],s=r(t[o]||0,n(e));c(s,i)&&(i=s),t[o]=s}),!0),i}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[0],s=r(t[o]||0,n(e));c(s,i)&&(i=s),t[o]=s}),!0),i}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,n){t=r(t,s(e,a(e)))})),n(o(t))}(e);if(2===t)return function(e){var t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");var r=f(e),i=s(r,e),a=h(i).values,u=a.get([a.size()[0]-1]);return n(o(u))}(e);throw new Error("Unsupported parameter value "+t)}function y(e,t){var n=e.size();if(1===n.length)return d(e,t);if(2===n.length){if(n[0]&&n[1])return m(e,t);throw new RangeError("Invalid matrix dimensions")}}})),Iy=qo("dot",["typed","addScalar","multiplyScalar","conj","size"],(e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:i,size:a}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var u=o(e,a),c=ea(e)?e._data:e,l=ea(e)?e._datatype:void 0,p=ea(a)?a._data:a,f=ea(a)?a._datatype:void 0,h=2===s(e).length,d=2===s(a).length,m=n,y=r;if(l&&f&&l===f&&"string"==typeof l){var g=l;m=t.find(n,[g,g]),y=t.find(r,[g,g])}if(!h&&!d){for(var v=y(i(c[0]),p[0]),x=1;xm?h++:d===m&&(c=l(c,p(a[f],u[h])),f++,h++)}return c}});function o(e,t){var n,r,i=s(e),a=s(t);if(1===i.length)n=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");n=i[0]}if(1===a.length)r=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");r=a[0]}if(n!==r)throw new RangeError("Vectors must have equal length ("+n+" != "+r+")");if(0===n)throw new RangeError("Cannot calculate the dot product of empty vectors");return n}function s(e){return ea(e)?e.size():a(e)}})),Ty=qo("trace",["typed","matrix","add"],(e=>{var{typed:t,matrix:n,add:r}=e;return t("trace",{Array:function(e){return i(n(e))},SparseMatrix:function(e){var t=e._values,n=e._index,i=e._ptr,a=e._size,o=a[0],s=a[1];if(o===s){var u=0;if(t.length>0)for(var c=0;cc)break}return u}throw new RangeError("Matrix must be square (size: "+co(a)+")")},DenseMatrix:i,any:Ta});function i(e){var t=e._size,n=e._data;switch(t.length){case 1:if(1===t[0])return Ta(n[0]);throw new RangeError("Matrix must be square (size: "+co(t)+")");case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o{var{typed:t,Index:n}=e;return t(Py,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return Ji(e)?e.toNumber():Array.isArray(e)||ea(e)?e.map((function(e){return Ji(e)?e.toNumber():e})):e})),r=new n;return n.apply(r,t),r}})})),By={end:!0},jy=qo("Node",["mathWithTransform"],(e=>{var{mathWithTransform:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator")}return n.prototype.evaluate=function(e){return this.compile().evaluate(e)},n.prototype.type="Node",n.prototype.isNode=!0,n.prototype.comment="",n.prototype.compile=function(){var e=this._compile(t,{}),n={};return{evaluate:function(t){var r=t||{};return function(e){for(var t in e)if(Ba(e,t)&&t in By)throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(r),e(r,n,null)}}},n.prototype._compile=function(e,t){throw new Error("Method _compile should be implemented by type "+this.type)},n.prototype.forEach=function(e){throw new Error("Cannot run forEach on a Node interface")},n.prototype.map=function(e){throw new Error("Cannot run map on a Node interface")},n.prototype._ifNode=function(e){if(!Ea(e))throw new TypeError("Callback function must return a Node");return e},n.prototype.traverse=function(e){e(this,null,null),function e(t,n){t.forEach((function(t,r,i){n(t,r,i),e(t,n)}))}(this,e)},n.prototype.transform=function(e){return function t(n,r,i){var a=e(n,r,i);return a!==n?a:n.map(t)}(this,null,null)},n.prototype.filter=function(e){var t=[];return this.traverse((function(n,r,i){e(n,r,i)&&t.push(n)})),t},n.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},n.prototype.cloneDeep=function(){return this.map((function(e){return e.cloneDeep()}))},n.prototype.equals=function(e){return!!e&&Da(this,e)},n.prototype.toString=function(e){var t;if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":break;case"function":t=e.handler(this,e);break;default:throw new TypeError("Object or function expected as callback")}return void 0!==t?t:this._toString(e)},n.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},n.prototype.toHTML=function(e){var t;if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":break;case"function":t=e.handler(this,e);break;default:throw new TypeError("Object or function expected as callback")}return void 0!==t?t:this.toHTML(e)},n.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},n.prototype.toTex=function(e){var t;if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":break;case"function":t=e.handler(this,e);break;default:throw new TypeError("Object or function expected as callback")}return void 0!==t?t:this._toTex(e)},n.prototype._toTex=function(e){throw new Error("_toTex not implemented for "+this.type)},n.prototype.getIdentifier=function(){return this.type},n.prototype.getContent=function(){return this},n}),{isClass:!0,isNode:!0});function qy(e){return e&&e.isIndexError?new yo(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function zy(e){var{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"==typeof e.subset)return e.subset(n);if("string"==typeof e)return t(e,n);if("object"==typeof e){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return Xf(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw qy(e)}}}var Ry=qo("AccessorNode",["subset","Node"],(e=>{var{subset:t,Node:n}=e,r=zy({subset:t});function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!Ea(e))throw new TypeError('Node expected for parameter "object"');if(!Ma(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e||null,this.index=t,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function a(e){return!(ma(e)||ya(e)||ba(e)||Na(e)||Sa(e)||Aa(e)||ka(e))}return i.prototype=new n,i.prototype.type="AccessorNode",i.prototype.isAccessorNode=!0,i.prototype._compile=function(e,t){var n=this.object._compile(e,t),i=this.index._compile(e,t);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,t,r){return Xf(n(e,t,r),a)}}return function(e,t,a){var o=n(e,t,a),s=i(e,t,o);return r(o,s)}},i.prototype.forEach=function(e){e(this.object,"object",this),e(this.index,"index",this)},i.prototype.map=function(e){return new i(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))},i.prototype.clone=function(){return new i(this.object,this.index)},i.prototype._toString=function(e){var t=this.object.toString(e);return a(this.object)&&(t="("+t+")"),t+this.index.toString(e)},i.prototype.toHTML=function(e){var t=this.object.toHTML(e);return a(this.object)&&(t='('+t+')'),t+this.index.toHTML(e)},i.prototype._toTex=function(e){var t=this.object.toTex(e);return a(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)},i.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},i.fromJSON=function(e){return new i(e.object,e.index)},i}),{isClass:!0,isNode:!0}),Fy=qo("ArrayNode",["Node"],(e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(Ea))throw new TypeError("Array containing Nodes expected")}return n.prototype=new t,n.prototype.type="ArrayNode",n.prototype.isArrayNode=!0,n.prototype._compile=function(e,t){var n=ko(this.items,(function(n){return n._compile(e,t)}));if("Array"!==e.config.matrix){var r=e.matrix;return function(e,t,i){return r(ko(n,(function(n){return n(e,t,i)})))}}return function(e,t,r){return ko(n,(function(n){return n(e,t,r)}))}},n.prototype.forEach=function(e){for(var t=0;t['+this.items.map((function(t){return t.toHTML(e)})).join(',')+']'},n.prototype._toTex=function(e){var t="\\begin{bmatrix}";return this.items.forEach((function(n){n.items?t+=n.items.map((function(t){return t.toTex(e)})).join("&"):t+=n.toTex(e),t+="\\\\"})),t+="\\end{bmatrix}"},n}),{isClass:!0,isNode:!0});var Ly=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function Uy(e,t){var n=e;"keep"!==t&&(n=e.getContent());for(var r=n.getIdentifier(),i=0;i{var{subset:t,matrix:n,Node:r}=e,i=zy({subset:t}),a=function(e){var{subset:t,matrix:n}=e;return function(e,r,i){try{if(Array.isArray(e))return n(e).subset(r,i).valueOf();if(e&&"function"==typeof e.subset)return e.subset(r,i);if("string"==typeof e)return t(e,r,i);if("object"==typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Qf(e,r.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw qy(e)}}}({subset:t,matrix:n});function o(e,t,n){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=n?t:null,this.value=n||t,!ka(e)&&!ma(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(ka(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!Ma(this.index))throw new TypeError('IndexNode expected as "index"');if(!Ea(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function s(e,t){t||(t="keep");var n=Uy(e,t),r=Uy(e.value,t);return"all"===t||null!==r&&r<=n}return o.prototype=new r,o.prototype.type="AssignmentNode",o.prototype.isAssignmentNode=!0,o.prototype._compile=function(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,o=this.value._compile(e,t),s=this.object.name;if(this.index){if(this.index.isObjectProperty()){var u=this.index.getObjectProperty();return function(e,t,r){var i=n(e,t,r),a=o(e,t,r);return Qf(i,u,a)}}if(ka(this.object))return function(e,t,i){var u=n(e,t,i),c=o(e,t,i),l=r(e,t,u);return Qf(e,s,a(u,l,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var l=this.object.index.getObjectProperty();return function(e,t,n){var i=c(e,t,n),s=Xf(i,l),u=r(e,t,s),p=o(e,t,n);return Qf(i,l,a(s,u,p)),p}}var p=this.object.index._compile(e,t);return function(e,t,n){var s=c(e,t,n),u=p(e,t,s),l=i(s,u),f=r(e,t,l),h=o(e,t,n);return a(s,u,a(l,f,h)),h}}if(!ka(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){return Qf(e,s,o(e,t,n))}},o.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},o.prototype.map=function(e){return new o(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))},o.prototype.clone=function(){return new o(this.object,this.index,this.value)},o.prototype._toString=function(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):"",r=this.value.toString(e);return s(this,e&&e.parenthesis)&&(r="("+r+")"),t+n+" = "+r},o.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},o.fromJSON=function(e){return new o(e.object,e.index,e.value)},o.prototype.toHTML=function(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"",r=this.value.toHTML(e);return s(this,e&&e.parenthesis)&&(r='('+r+')'),t+n+'='+r},o.prototype._toTex=function(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):"",r=this.value.toTex(e);return s(this,e&&e.parenthesis)&&(r="\\left(".concat(r,"\\right)")),t+n+":="+r},o}),{isClass:!0,isNode:!0}),Gy=qo("BlockNode",["ResultSet","Node"],(e=>{var{ResultSet:t,Node:n}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!Ea(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}return r.prototype=new n,r.prototype.type="BlockNode",r.prototype.isBlockNode=!0,r.prototype._compile=function(e,n){var r=ko(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,i){var a=[];return _o(r,(function(t){var r=t.evaluate(e,n,i);t.visible&&a.push(r)})),new t(a)}},r.prototype.forEach=function(e){for(var t=0;t;')})).join('
')},r.prototype._toTex=function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")},r}),{isClass:!0,isNode:!0}),Wy=qo("ConditionalNode",["Node"],(e=>{var{Node:t}=e;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Ea(e))throw new TypeError("Parameter condition must be a Node");if(!Ea(t))throw new TypeError("Parameter trueExpr must be a Node");if(!Ea(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}return n.prototype=new t,n.prototype.type="ConditionalNode",n.prototype.isConditionalNode=!0,n.prototype._compile=function(e,t){var n=this.condition._compile(e,t),r=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(Ji(e))return!e.isZero();if(Zi(e))return!(!e.re&&!e.im);if(Yi(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+Ia(e)+'"')}(n(e,t,a))?r(e,t,a):i(e,t,a)}},n.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},n.prototype.clone=function(){return new n(this.condition,this.trueExpr,this.falseExpr)},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Uy(this,t),r=this.condition.toString(e),i=Uy(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=n)&&(r="("+r+")");var a=this.trueExpr.toString(e),o=Uy(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=n)&&(a="("+a+")");var s=this.falseExpr.toString(e),u=Uy(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=n)&&(s="("+s+")"),r+" ? "+a+" : "+s},n.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},n.fromJSON=function(e){return new n(e.condition,e.trueExpr,e.falseExpr)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Uy(this,t),r=this.condition.toHTML(e),i=Uy(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=n)&&(r='('+r+')');var a=this.trueExpr.toHTML(e),o=Uy(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=n)&&(a='('+a+')');var s=this.falseExpr.toHTML(e),u=Uy(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=n)&&(s='('+s+')'),r+'?'+a+':'+s},n.prototype._toTex=function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},n}),{isClass:!0,isNode:!0}),Jy=Object.assign||function(e){for(var t=1;t>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},eg={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Qy.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Qy.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Qy.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Qy.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Qy.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Qy.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Qy.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Qy.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Qy.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Qy.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Qy.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Qy.bitAnd,"${args[1]}\\right)")},bitNot:{1:Qy.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Qy.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Qy.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Qy.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Qy.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Qy.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Qy.and,"${args[1]}\\right)")},not:{1:Qy.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Qy.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Qy.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Qy.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},sqrtm:{1:"{${args[0]}}".concat(Qy.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Qy.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Qy.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Qy.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Qy.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Qy.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Qy.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Qy.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Qy.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Qy.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Xy.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},tg={deg:"^\\circ"};function ng(e){return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preserveFormatting,r=void 0!==n&&n,i=t.escapeMapFn,a=void 0===i?Yy:i,o=String(e),s="",u=a(Jy({},Zy),r?Jy({},Ky):{}),c=Object.keys(u),l=function(){var e=!1;c.forEach((function(t,n){e||o.length>=t.length&&o.slice(0,t.length)===t&&(s+=u[c[n]],o=o.slice(t.length,o.length),e=!0)})),e||(s+=o.slice(0,1),o=o.slice(1,o.length))};o;)l();return s}(e,{preserveFormatting:!0})}function rg(e,t){return(t=void 0!==t&&t)?Ba(tg,e)?tg[e]:"\\mathrm{"+ng(e)+"}":Ba(Xy,e)?Xy[e]:ng(e)}var ig=qo("ConstantNode",["Node"],(e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.value=e}return n.prototype=new t,n.prototype.type="ConstantNode",n.prototype.isConstantNode=!0,n.prototype._compile=function(e,t){var n=this.value;return function(){return n}},n.prototype.forEach=function(e){},n.prototype.map=function(e){return this.clone()},n.prototype.clone=function(){return new n(this.value)},n.prototype._toString=function(e){return co(this.value,e)},n.prototype.toHTML=function(e){var t=this._toString(e);switch(Ia(this.value)){case"number":case"BigNumber":case"Fraction":return''+t+"";case"string":return''+t+"";case"boolean":return''+t+"";case"null":return''+t+"";case"undefined":return''+t+"";default:return''+t+""}},n.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},n.fromJSON=function(e){return new n(e.value)},n.prototype._toTex=function(e){var t=this._toString(e);switch(Ia(this.value)){case"string":return"\\mathtt{"+ng(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");return-1!==n?t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},n}),{isClass:!0,isNode:!0}),ag=qo("FunctionAssignmentNode",["typed","Node"],(e=>{var{typed:t,Node:n}=e;function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Ea(n))throw new TypeError('Node expected for parameter "expr"');if(e in By)throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=n}function i(e,t){var n=Uy(e,t),r=Uy(e.expr,t);return"all"===t||null!==r&&r<=n}return r.prototype=new n,r.prototype.type="FunctionAssignmentNode",r.prototype.isFunctionAssignmentNode=!0,r.prototype._compile=function(e,n){var r=Object.create(n);_o(this.params,(function(e){r[e]=!0}));var i=this.expr._compile(e,r),a=this.name,o=this.params,s=Po(this.types,","),u=a+"("+Po(this.params,", ")+")";return function(e,n,r){var c={};c[s]=function(){for(var t=Object.create(n),a=0;a'+po(this.params[r])+"");var a=this.expr.toHTML(e);return i(this,t)&&(a='('+a+')'),''+po(this.name)+'('+n.join(',')+')='+a},r.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toTex(e);return i(this,t)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(rg).join(",")+"\\right):="+n},r}),{isClass:!0,isNode:!0}),og=qo("IndexNode",["Range","Node","size"],(e=>{var{Range:t,Node:n,size:r}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(Ea))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}function a(e,n,r){return new t(Ji(e)?e.toNumber():e,Ji(n)?n.toNumber():n,Ji(r)?r.toNumber():r)}return i.prototype=new n,i.prototype.type="IndexNode",i.prototype.isIndexNode=!0,i.prototype._compile=function(e,t){var n=ko(this.dimensions,(function(n,i){if(Ca(n)){if(n.needsEnd()){var o=Object.create(t);o.end=!0;var s=n.start._compile(e,o),u=n.end._compile(e,o),c=n.step?n.step._compile(e,o):function(){return 1};return function(e,t,n){var o=r(n).valueOf(),l=Object.create(t);return l.end=o[i],a(s(e,l,n),u(e,l,n),c(e,l,n))}}var l=n.start._compile(e,t),p=n.end._compile(e,t),f=n.step?n.step._compile(e,t):function(){return 1};return function(e,t,n){return a(l(e,t,n),p(e,t,n),f(e,t,n))}}if(ka(n)&&"end"===n.name){var h=Object.create(t);h.end=!0;var d=n._compile(e,h);return function(e,t,n){var a=r(n).valueOf(),o=Object.create(t);return o.end=a[i],d(e,o,n)}}var m=n._compile(e,t);return function(e,t,n){return m(e,t,n)}})),i=Xf(e,"index");return function(e,t,r){var a=ko(n,(function(n){return n(e,t,r)}));return i(...a)}},i.prototype.forEach=function(e){for(var t=0;t.'+po(this.getObjectProperty())+"":'['+t.join(',')+']'},i.prototype._toTex=function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"},i}),{isClass:!0,isNode:!0}),sg=qo("ObjectNode",["Node"],(e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every((function(t){return Ea(e[t])}))))throw new TypeError("Object containing Nodes expected")}return n.prototype=new t,n.prototype.type="ObjectNode",n.prototype.isObjectNode=!0,n.prototype._compile=function(e,t){var n={};for(var r in this.properties)if(Ba(this.properties,r)){var i=lo(r),a=JSON.parse(i);if(!eh(this.properties,a))throw new Error('No access to property "'+a+'"');n[a]=this.properties[r]._compile(e,t)}return function(e,t,r){var i={};for(var a in n)Ba(n,a)&&(i[a]=n[a](e,t,r));return i}},n.prototype.forEach=function(e){for(var t in this.properties)Ba(this.properties,t)&&e(this.properties[t],"properties["+lo(t)+"]",this)},n.prototype.map=function(e){var t={};for(var r in this.properties)Ba(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+lo(r)+"]",this)));return new n(t)},n.prototype.clone=function(){var e={};for(var t in this.properties)Ba(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)},n.prototype._toString=function(e){var t=[];for(var n in this.properties)Ba(this.properties,n)&&t.push(lo(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"},n.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},n.fromJSON=function(e){return new n(e.properties)},n.prototype.toHTML=function(e){var t=[];for(var n in this.properties)Ba(this.properties,n)&&t.push(''+po(n)+':'+this.properties[n].toHTML(e));return'{'+t.join(',')+'}'},n.prototype._toTex=function(e){var t=[];for(var n in this.properties)Ba(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},n}),{isClass:!0,isNode:!0}),ug=qo("OperatorNode",["Node"],(e=>{var{Node:t}=e;function n(e,t,r,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(Ea))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===i,this.op=e,this.fn=t,this.args=r||[]}function r(e,t,n,r,i){var a,o=Uy(e,t),s=Vy(e,t);if("all"===t||r.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return r.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(r.length){case 0:a=[];break;case 1:var u=Uy(r[0],t);if(i&&null!==u){var c,l;if("keep"===t?(c=r[0].getIdentifier(),l=e.getIdentifier()):(c=r[0].getContent().getIdentifier(),l=e.getContent().getIdentifier()),!1===Ly[o][l].latexLeftParens){a=[!1];break}if(!1===Ly[u][c].latexParens){a=[!1];break}}if(null===u){a=[!1];break}if(u<=o){a=[!0];break}a=[!1];break;case 2:var p,f,h=Uy(r[0],t),d=$y(e,r[0],t);p=null!==h&&(h===o&&"right"===s&&!d||h=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"auto"===t&&"hide"===n&&(a=r.map((function(e,t){var n="ParenthesisNode"===e.getIdentifier();return!(!a[t]&&!n)}))),a}return n.prototype=new t,n.prototype.type="OperatorNode",n.prototype.isOperatorNode=!0,n.prototype._compile=function(e,t){if("string"!=typeof this.fn||!th(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var n=Xf(e,this.fn),r=ko(this.args,(function(n){return n._compile(e,t)}));if(1===r.length){var i=r[0];return function(e,t,r){return n(i(e,t,r))}}if(2===r.length){var a=r[0],o=r[1];return function(e,t,r){return n(a(e,t,r),o(e,t,r))}}return function(e,t,i){return n.apply(null,ko(r,(function(n){return n(e,t,i)})))}},n.prototype.forEach=function(e){for(var t=0;t2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var p=i.map((function(t,n){return t=t.toString(e),a[n]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?p.join(" "):p.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},n.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit}},n.fromJSON=function(e){return new n(e.op,e.fn,e.args,e.implicit)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!1);if(1===i.length){var o=Vy(this,t),s=i[0].toHTML(e);return a[0]&&(s='('+s+')'),"right"===o?''+po(this.op)+""+s:s+''+po(this.op)+""}if(2===i.length){var u=i[0].toHTML(e),c=i[1].toHTML(e);return a[0]&&(u='('+u+')'),a[1]&&(c='('+c+')'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?u+''+c:u+''+po(this.op)+""+c}var l=i.map((function(t,n){return t=t.toHTML(e),a[n]&&(t='('+t+')'),t}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l.join(''):l.join(''+po(this.op)+""):''+po(this.fn)+'('+l.join(',')+')'},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,a=r(this,t,n,i,!0),o=Qy[this.fn];if(o=void 0===o?this.op:o,1===i.length){var s=Vy(this,t),u=i[0].toTex(e);return a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===s?o+u:u+o}if(2===i.length){var c=i[0],l=c.toTex(e);a[0]&&(l="\\left(".concat(l,"\\right)"));var p,f=i[1].toTex(e);switch(a[1]&&(f="\\left(".concat(f,"\\right)")),p="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+l+"}{"+f+"}";case"OperatorNode:pow":switch(l="{"+l+"}",f="{"+f+"}",p){case"ConditionalNode":case"OperatorNode:divide":l="\\left(".concat(l,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return l+"~"+f}return l+o+f}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var h=i.map((function(t,n){return t=t.toTex(e),a[n]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?h.join("~"):h.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(t){return t.toTex(e)})).join(",")+"\\right)"},n.prototype.getIdentifier=function(){return this.type+":"+this.fn},n}),{isClass:!0,isNode:!0}),cg=qo("ParenthesisNode",["Node"],(e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Ea(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return n.prototype=new t,n.prototype.type="ParenthesisNode",n.prototype.isParenthesisNode=!0,n.prototype._compile=function(e,t){return this.content._compile(e,t)},n.prototype.getContent=function(){return this.content.getContent()},n.prototype.forEach=function(e){e(this.content,"content",this)},n.prototype.map=function(e){return new n(e(this.content,"content",this))},n.prototype.clone=function(){return new n(this.content)},n.prototype._toString=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},n.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},n.fromJSON=function(e){return new n(e.content)},n.prototype.toHTML=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'('+this.content.toHTML(e)+')':this.content.toHTML(e)},n.prototype._toTex=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},n}),{isClass:!0,isNode:!0}),lg=qo("RangeNode",["Node"],(e=>{var{Node:t}=e;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Ea(e))throw new TypeError("Node expected");if(!Ea(t))throw new TypeError("Node expected");if(r&&!Ea(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}function r(e,t){var n=Uy(e,t),r={},i=Uy(e.start,t);if(r.start=null!==i&&i<=n||"all"===t,e.step){var a=Uy(e.step,t);r.step=null!==a&&a<=n||"all"===t}var o=Uy(e.end,t);return r.end=null!==o&&o<=n||"all"===t,r}return n.prototype=new t,n.prototype.type="RangeNode",n.prototype.isRangeNode=!0,n.prototype.needsEnd=function(){return this.filter((function(e){return ka(e)&&"end"===e.name})).length>0},n.prototype._compile=function(e,t){var n=e.range,r=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,o){return n(r(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return n(r(e,t,a),i(e,t,a))}},n.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},n.prototype.clone=function(){return new n(this.start,this.end,this.step&&this.step)},n.prototype._toString=function(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep"),i=this.start.toString(e);if(n.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),t+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),t+=":"+o},n.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},n.fromJSON=function(e){return new n(e.start,e.end,e.step)},n.prototype.toHTML=function(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep"),i=this.start.toHTML(e);if(n.start&&(i='('+i+')'),t=i,this.step){var a=this.step.toHTML(e);n.step&&(a='('+a+')'),t+=':'+a}var o=this.end.toHTML(e);return n.end&&(o='('+o+')'),t+=':'+o},n.prototype._toTex=function(e){var t=r(this,e&&e.parenthesis?e.parenthesis:"keep"),n=this.start.toTex(e);if(t.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);t.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),n+=":"+a},n}),{isClass:!0,isNode:!0}),pg=qo("RelationalNode",["Node"],(e=>{var{Node:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}return n.prototype=new t,n.prototype.type="RelationalNode",n.prototype.isRelationalNode=!0,n.prototype._compile=function(e,t){var n=this,r=this.params.map((n=>n._compile(e,t)));return function(t,i,a){for(var o,s=r[0](t,i,a),u=0;ue(t,"params["+n+"]",this)),this)},n.prototype.map=function(e){return new n(this.conditionals.slice(),this.params.map(((t,n)=>this._ifNode(e(t,"params["+n+"]",this))),this))},n.prototype.clone=function(){return new n(this.conditionals,this.params)},n.prototype._toString=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Uy(this,t),r=this.params.map((function(r,i){var a=Uy(r,t);return"all"===t||null!==a&&a<=n?"("+r.toString(e)+")":r.toString(e)})),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},a=r[0],o=0;o('+r.toHTML(e)+')':r.toHTML(e)})),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},a=r[0],o=0;o'+po(i[this.conditionals[o]])+""+r[o+1];return a},n.prototype._toTex=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Uy(this,t),r=this.params.map((function(r,i){var a=Uy(r,t);return"all"===t||null!==a&&a<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)})),i=r[0],a=0;a{var{math:t,Unit:n,Node:r}=e;function i(e){return!!n&&n.isValuelessUnit(e)}function a(e){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}return a.prototype=new r,a.prototype.type="SymbolNode",a.prototype.isSymbolNode=!0,a.prototype._compile=function(e,t){var r=this.name;if(!0===t[r])return function(e,t,n){return t[r]};if(r in e)return function(t,n,i){return Xf(r in t?t:e,r)};var a=i(r);return function(e,t,i){return r in e?Xf(e,r):a?new n(null,r):function(e){throw new Error("Undefined symbol "+e)}(r)}},a.prototype.forEach=function(e){},a.prototype.map=function(e){return this.clone()},a.prototype.clone=function(){return new a(this.name)},a.prototype._toString=function(e){return this.name},a.prototype.toHTML=function(e){var t=po(this.name);return"true"===t||"false"===t?''+t+"":"i"===t?''+t+"":"Infinity"===t?''+t+"":"NaN"===t?''+t+"":"null"===t?''+t+"":"undefined"===t?''+t+"":''+t+""},a.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},a.fromJSON=function(e){return new a(e.name)},a.prototype._toTex=function(e){var n=!1;void 0===t[this.name]&&i(this.name)&&(n=!0);var r=rg(this.name,n);return"\\"===r[0]?r:" "+r},a}),{isClass:!0,isNode:!0});function hg(){return(hg=Object.assign||function(e){for(var t=1;t{var{math:t,Node:n,SymbolNode:r}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if("string"==typeof e&&(e=new r(e)),!Ea(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(Ea))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}i.prototype=new n,i.prototype.type="FunctionNode",i.prototype.isFunctionNode=!0,i.prototype._compile=function(e,t){if(!(this instanceof i))throw new TypeError("No valid FunctionNode");var n=ko(this.args,(function(n){return n._compile(e,t)}));if(ka(this.fn)){var r=this.fn.name,a=r in e?Xf(e,r):void 0;if("function"==typeof a&&!0===a.rawArgs){var o=this.args;return function(t,n,i){return(r in t?Xf(t,r):a)(o,e,hg({},t,n))}}if(1===n.length){var s=n[0];return function(e,t,n){return(r in e?Xf(e,r):a)(s(e,t,n))}}if(2===n.length){var u=n[0],c=n[1];return function(e,t,n){return(r in e?Xf(e,r):a)(u(e,t,n),c(e,t,n))}}return function(e,t,i){return(r in e?Xf(e,r):a).apply(null,ko(n,(function(n){return n(e,t,i)})))}}if(ma(this.fn)&&Ma(this.fn.index)&&this.fn.index.isObjectProperty()){var l=this.fn.object._compile(e,t),p=this.fn.index.getObjectProperty(),f=this.args;return function(t,r,i){var a=l(t,r,i);return function(e,t){if(!th(e,t))throw new Error('No access to method "'+t+'"')}(a,p),a[p]&&a[p].rawArgs?a[p](f,e,hg({},t,r)):a[p].apply(a,ko(n,(function(e){return e(t,r,i)})))}}var h=this.fn._compile(e,t),d=this.args;return function(t,r,i){var a=h(t,r,i);return a&&a.rawArgs?a(d,e,hg({},t,r)):a.apply(a,ko(n,(function(e){return e(t,r,i)})))}},i.prototype.forEach=function(e){e(this.fn,"fn",this);for(var t=0;t'+po(this.fn)+'('+t.join(',')+')'};var s=i.prototype.toTex;return i.prototype.toTex=function(e){var t;return e&&"object"==typeof e.handler&&Ba(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:s.call(this,e)},i.prototype._toTex=function(e){var n,r,i=this.args.map((function(t){return t.toTex(e)}));switch(eg[this.name]&&(n=eg[this.name]),!t[this.name]||"function"!=typeof t[this.name].toTex&&"object"!=typeof t[this.name].toTex&&"string"!=typeof t[this.name].toTex||(n=t[this.name].toTex),typeof n){case"function":r=n(this,e);break;case"string":r=o(n,this,e);break;case"object":switch(typeof n[i.length]){case"function":r=n[i.length](this,e);break;case"string":r=o(n[i.length],this,e)}}return void 0!==r?r:o("\\mathrm{${name}}\\left(${args}\\right)",this,e)},i.prototype.getIdentifier=function(){return this.type+":"+this.name},i}),{isClass:!0,isNode:!0});function mg(){return(mg=Object.assign||function(e){for(var t=1;t{var{typed:t,numeric:n,config:r,AccessorNode:i,ArrayNode:a,AssignmentNode:o,BlockNode:s,ConditionalNode:u,ConstantNode:c,FunctionAssignmentNode:l,FunctionNode:p,IndexNode:f,ObjectNode:h,OperatorNode:d,ParenthesisNode:m,RangeNode:y,RelationalNode:g,SymbolNode:v}=e,x=t(yg,{string:function(e){return R(e,{})},"Array | Matrix":function(e){return b(e,{})},"string, Object":function(e,t){return R(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":b});function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0!==t.nodes?t.nodes:{};return ju(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return R(e,n)}))}var w=0,N=1,M=2,E=3,S=4,O={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},A={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},C={true:!0,false:!1,null:null,undefined:void 0},k=["NaN","Infinity"];function _(e,t){return e.expression.substr(e.index,t)}function I(e){return _(e,1)}function T(e){e.index++}function P(e){return e.expression.charAt(e.index-1)}function D(e){return e.expression.charAt(e.index+1)}function B(e){for(e.tokenType=w,e.token="",e.comment="";x.isWhitespace(I(e),e.nestingLevel);)T(e);if("#"===I(e))for(;"\n"!==I(e)&&""!==I(e);)e.comment+=I(e),T(e);if(""!==I(e)){if("\n"===I(e)&&!e.nestingLevel)return e.tokenType=N,e.token=I(e),void T(e);var t=I(e),n=_(e,2),r=_(e,3);if(3===r.length&&O[r])return e.tokenType=N,e.token=r,T(e),T(e),void T(e);if(2===n.length&&O[n])return e.tokenType=N,e.token=n,T(e),void T(e);if(O[t])return e.tokenType=N,e.token=t,void T(e);if(x.isDigitDot(t)){e.tokenType=M;var i=_(e,2);if("0b"===i||"0o"===i||"0x"===i){for(e.token+=I(e),T(e),e.token+=I(e),T(e);x.isHexDigit(I(e));)e.token+=I(e),T(e);return}if("."===I(e))e.token+=I(e),T(e),x.isDigit(I(e))||(e.tokenType=N);else{for(;x.isDigit(I(e));)e.token+=I(e),T(e);x.isDecimalMark(I(e),D(e))&&(e.token+=I(e),T(e))}for(;x.isDigit(I(e));)e.token+=I(e),T(e);if("E"===I(e)||"e"===I(e))if(x.isDigit(D(e))||"-"===D(e)||"+"===D(e)){if(e.token+=I(e),T(e),"+"!==I(e)&&"-"!==I(e)||(e.token+=I(e),T(e)),!x.isDigit(I(e)))throw oe(e,'Digit expected, got "'+I(e)+'"');for(;x.isDigit(I(e));)e.token+=I(e),T(e);if(x.isDecimalMark(I(e),D(e)))throw oe(e,'Digit expected, got "'+I(e)+'"')}else if("."===D(e))throw T(e),oe(e,'Digit expected, got "'+I(e)+'"')}else{if(!x.isAlpha(I(e),P(e),D(e))){for(e.tokenType=S;""!==I(e);)e.token+=I(e),T(e);throw oe(e,'Syntax error in part "'+e.token+'"')}for(;x.isAlpha(I(e),P(e),D(e))||x.isDigit(I(e));)e.token+=I(e),T(e);Ba(A,e.token)?e.tokenType=N:e.tokenType=E}}else e.tokenType=N}function j(e){do{B(e)}while("\n"===e.token)}function q(e){e.nestingLevel++}function z(e){e.nestingLevel--}function R(e,t){var n={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w,nestingLevel:0,conditionalLevel:null};mg(n,{expression:e,extraNodes:t}),B(n);var r=function(e){var t,n,r=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&((t=F(e)).comment=e.comment);for(;"\n"===e.token||";"===e.token;)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),B(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((t=F(e)).comment=e.comment,n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new s(r):(t||((t=new c(void 0)).comment=e.comment),t)}(n);if(""!==n.token)throw n.tokenType===N?se(n,"Unexpected operator "+n.token):oe(n,'Unexpected part "'+n.token+'"');return r}function F(e){var t,n,r,i,a=function(e){var t=function(e){var t=L(e);for(;"or"===e.token;)j(e),t=new d("or","or",[t,L(e)]);return t}(e);for(;"?"===e.token;){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,j(e);var r=t,i=F(e);if(":"!==e.token)throw oe(e,"False part of conditional expression expected");e.conditionalLevel=null,j(e);var a=F(e);t=new u(r,i,a),e.conditionalLevel=n}return t}(e);if("="===e.token){if(ka(a))return t=a.name,j(e),r=F(e),new o(new v(t),r);if(ma(a))return j(e),r=F(e),new o(a.object,a.index,r);if(Na(a)&&ka(a.fn)&&(i=!0,n=[],t=a.name,a.args.forEach((function(e,t){ka(e)?n[t]=e.name:i=!1})),i))return j(e),r=F(e),new l(t,n,r);throw oe(e,"Invalid left hand side of assignment operator =")}return a}function L(e){for(var t=U(e);"xor"===e.token;)j(e),t=new d("xor","xor",[t,U(e)]);return t}function U(e){for(var t=V(e);"and"===e.token;)j(e),t=new d("and","and",[t,V(e)]);return t}function V(e){for(var t=$(e);"|"===e.token;)j(e),t=new d("|","bitOr",[t,$(e)]);return t}function $(e){for(var t=H(e);"^|"===e.token;)j(e),t=new d("^|","bitXor",[t,H(e)]);return t}function H(e){for(var t=G(e);"&"===e.token;)j(e),t=new d("&","bitAnd",[t,G(e)]);return t}function G(e){for(var t=[W(e)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Ba(r,e.token);){var i={name:e.token,fn:r[e.token]};n.push(i),j(e),t.push(W(e))}return 1===t.length?t[0]:2===t.length?new d(n[0].name,n[0].fn,t):new g(n.map((e=>e.fn)),t)}function W(e){var t,n,r,i;t=J(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Ba(a,e.token);)r=a[n=e.token],j(e),i=[t,J(e)],t=new d(n,r,i);return t}function J(e){var t,n,r,i;t=Z(e);for(var a={to:"to",in:"to"};Ba(a,e.token);)r=a[n=e.token],j(e),"in"===n&&""===e.token?t=new d("*","multiply",[t,new v("in")],!0):(i=[t,Z(e)],t=new d(n,r,i));return t}function Z(e){var t,n=[];if(t=":"===e.token?new c(1):K(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(n.push(t);":"===e.token&&n.length<3;)j(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new v("end")):n.push(K(e));t=3===n.length?new y(n[0],n[2],n[1]):new y(n[0],n[1])}return t}function K(e){var t,n,r,i;t=Y(e);for(var a={"+":"add","-":"subtract"};Ba(a,e.token);)r=a[n=e.token],j(e),i=[t,Y(e)],t=new d(n,r,i);return t}function Y(e){var t,n,r,i;n=t=X(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};Ba(a,e.token);)i=a[r=e.token],j(e),n=X(e),t=new d(r,i,[t,n]);return t}function X(e){var t,n;for(n=t=Q(e);e.tokenType===E||"in"===e.token&&ba(t)||!(e.tokenType!==M||ba(n)||Oa(n)&&"!"!==n.op)||"("===e.token;)n=Q(e),t=new d("*","multiply",[t,n],!0);return t}function Q(e){for(var t=ee(e),n=t,r=[];"/"===e.token&&ba(n);){if(r.push(mg({},e)),j(e),e.tokenType!==M){mg(e,r.pop());break}if(r.push(mg({},e)),j(e),e.tokenType!==E&&"("!==e.token){r.pop(),mg(e,r.pop());break}mg(e,r.pop()),r.pop(),n=ee(e),t=new d("/","divide",[t,n])}return t}function ee(e){var t,i,o,s={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Ba(s,e.token)?(o=s[e.token],t=e.token,j(e),i=[ee(e)],new d(t,o,i)):function(e){var t,i,o,s;t=function(e){var t,i,o;t=function(e){var t=[];if(e.tokenType===E&&Ba(e.extraNodes,e.token)){var i=e.extraNodes[e.token];if(B(e),"("===e.token){if(t=[],q(e),B(e),")"!==e.token)for(t.push(F(e));","===e.token;)B(e),t.push(F(e));if(")"!==e.token)throw oe(e,"Parenthesis ) expected");z(e),B(e)}return new i(t)}return function(e){var t;if(e.tokenType===E||e.tokenType===N&&e.token in A)return t=e.token,B(e),te(e,Ba(C,t)?new c(C[t]):-1!==k.indexOf(t)?new c(n(t,"number")):new v(t));return function(e){var t;if('"'===e.token)return t=ne(e),te(e,new c(t));return function(e){var t;if("'"===e.token)return t=re(e),te(e,new c(t));return function(e){var t,i,o,s;if("["===e.token){if(q(e),B(e),"]"!==e.token){var u=ie(e);if(";"===e.token){for(o=1,i=[u];";"===e.token;)B(e),i[o]=ie(e),o++;if("]"!==e.token)throw oe(e,"End of matrix ] expected");z(e),B(e),s=i[0].items.length;for(var l=1;l0},x.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},x.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},x.isDigit=function(e){return e>="0"&&e<="9"},x.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},x})),vg="compile",xg=qo(vg,["typed","parse"],(e=>{var{typed:t,parse:n}=e;return t(vg,{string:function(e){return n(e).compile()},"Array | Matrix":function(e){return ju(e,(function(e){return n(e).compile()}))}})})),bg="evaluate",wg=qo(bg,["typed","parse"],(e=>{var{typed:t,parse:n}=e;return t(bg,{string:function(e){return n(e).compile().evaluate({})},"string, Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t={};return ju(e,(function(e){return n(e).compile().evaluate(t)}))},"Array | Matrix, Object":function(e,t){return ju(e,(function(e){return n(e).compile().evaluate(t)}))}})})),Ng=qo("Parser",["parse"],(e=>{var{parse:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.scope={}}return n.prototype.type="Parser",n.prototype.isParser=!0,n.prototype.evaluate=function(e){return t(e).compile().evaluate(this.scope)},n.prototype.get=function(e){return e in this.scope?Xf(this.scope,e):void 0},n.prototype.getAll=function(){return Pa({},this.scope)},n.prototype.set=function(e,t){return Qf(this.scope,e,t)},n.prototype.remove=function(e){delete this.scope[e]},n.prototype.clear=function(){for(var e in this.scope)Ba(this.scope,e)&&delete this.scope[e]},n}),{isClass:!0}),Mg="parser",Eg=qo(Mg,["typed","Parser"],(e=>{var{typed:t,Parser:n}=e;return t(Mg,{"":function(){return new n}})})),Sg=qo("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtract","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(e=>{var{typed:t,matrix:n,abs:r,addScalar:i,divideScalar:a,multiplyScalar:o,subtract:s,larger:u,equalScalar:c,unaryMinus:l,DenseMatrix:p,SparseMatrix:f,Spa:h}=e;return t("lup",{DenseMatrix:function(e){return d(e)},SparseMatrix:function(e){return m(e)},Array:function(e){var t=d(n(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function d(e){var t,n,l,f=e._size[0],h=e._size[1],d=Math.min(f,h),m=Ta(e._data),y=[],g=[f,d],v=[],x=[d,h],b=[];for(t=0;t0)for(t=0;t0&&e.forEach(0,n-1,(function(t,n){f._forEachRow(t,v,x,b,(function(r,i){r>t&&e.accumulate(r,l(o(i,n)))}))}));var C,k,_,I,T=n,P=e.get(n),D=r(P);e.forEach(n+1,s-1,(function(e,t){var n=r(t);u(n,D)&&(T=e,D=n,P=t)})),n!==T&&(f._swapRows(n,T,w[1],v,x,b),f._swapRows(n,T,S[1],N,M,E),e.swap(n,T),k=T,_=A[C=n],I=A[k],O[_]=k,O[I]=C,A[C]=I,A[k]=_),e.forEach(0,s-1,(function(e,t){e<=n?(N.push(t),M.push(e)):(t=a(t,P),c(t,0)||(v.push(t),x.push(e)))}))};for(n=0;n{var{typed:t,matrix:n,zeros:r,identity:i,isZero:a,equal:o,sign:s,sqrt:u,conj:c,unaryMinus:l,addScalar:p,divideScalar:f,multiplyScalar:h,subtract:d,complex:m}=e;return Og(t("qr",{DenseMatrix:function(e){return g(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=g(n(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:y});function y(e){var t,n,m,y=e._size[0],g=e._size[1],v=i([y],"dense"),x=v._data,b=e.clone(),w=b._data,N=r([y],"");for(m=0;m0)for(var r="Complex"===n[0][0].type?m(0):0,i=0;i=0;){var u=n[o+s],c=n[r+u];-1===c?(s--,a[t++]=u):(n[r+u]=n[i+c],n[o+ ++s]=c)}return t}function kg(e){return-e-2}var _g=qo("csAmd",["add","multiply","transpose"],(e=>{var{add:t,multiply:n,transpose:r}=e;return function(e,o){if(!o||e<=0||e>3)return null;var s=o._size,u=s[0],c=s[1],l=0,p=Math.max(16,10*Math.sqrt(c)),f=function(e,i,a,o,s){var u=r(i);if(1===e&&o===a)return t(i,u);if(2===e){for(var c=u._index,l=u._ptr,p=0,f=0;fs))for(var d=l[f+1];ho)n[s+f]=0,n[i+f]=-1,p++,t[f]=kg(e),n[s+e]++;else{var d=n[u+h];-1!==d&&(c[d]=f),n[l+f]=n[u+h],n[u+h]=f}}return p}(c,_,P,z,q,R,p,D,j,L,B),$=0;VH?(v=m,x=J,b=P[0+m]-H):(x=_[v=k[J++]],b=P[0+v]),g=1;g<=b;g++)(w=P[D+(h=k[x++])])<=0||(W+=w,P[D+h]=-w,k[K++]=h,-1!==P[B+h]&&(L[P[B+h]]=L[h]),-1!==L[h]?P[B+L[h]]=P[B+h]:P[j+P[z+h]]=P[B+h]);v!==m&&(_[v]=kg(m),P[R+v]=0)}for(0!==H&&(I=K),P[z+m]=W,_[m]=Z,P[0+m]=K-Z,P[q+m]=-2,U=i(U,l,P,R,c),N=Z;N=U?P[R+v]-=w:0!==P[R+v]&&(P[R+v]=P[z+v]+Y)}for(N=Z;N0?(C+=X,k[O++]=v,A+=v):(_[v]=kg(m),P[R+v]=0)}P[q+h]=O-E+1;var Q=O,ee=E+P[0+h];for(J=S+1;J=0))for(h=P[F+(A=L[h])],P[F+A]=-1;-1!==h&&-1!==P[B+h];h=P[B+h],U++){for(b=P[0+h],M=P[q+h],J=_[h]+1;J<=_[h]+b-1;J++)P[R+k[J]]=U;var ne=h;for(d=P[B+h];-1!==d;){var re=P[0+d]===b&&P[q+d]===M;for(J=_[d]+1;re&&J<=_[d]+b-1;J++)P[R+k[J]]!==U&&(re=0);re?(_[d]=kg(h),P[D+h]+=P[D+d],P[D+d]=0,P[q+d]=-1,d=P[B+d],P[B+ne]=d):(ne=d,d=P[B+d])}}for(J=Z,N=Z;N=0;d--)P[D+d]>0||(P[B+d]=P[j+_[d]],P[j+_[d]]=d);for(v=c;v>=0;v--)P[D+v]<=0||-1!==_[v]&&(P[B+v]=P[j+_[v]],P[j+_[v]]=v);for(m=0,h=0;h<=c;h++)-1===_[h]&&(m=Cg(h,m,P,j,B,T,R));return T.splice(T.length-1,1),T};function i(e,t,n,r,i){if(e<2||e+t<0){for(var a=0;a{var{transpose:t}=e;return function(e,n,r,i){if(!e||!n||!r)return null;var a,o,s,u,c,l,p,f=e._size,h=f[0],d=f[1],m=4*d+(i?d+h+1:0),y=[],g=d,v=2*d,x=3*d,b=4*d,w=5*d+1;for(s=0;s=1&&N[o]++,2===O.jleaf&&N[O.q]--}-1!==n[o]&&(y[0+o]=n[o])}for(o=0;o{var{add:t,multiply:n,transpose:r}=e,i=_g({add:t,multiply:n,transpose:r}),a=Tg({transpose:r});return function(e,t,n){var r,o=t._ptr,s=t._size[1],u={};if(u.q=i(e,t),e&&!u.q)return null;if(n){var c=e?function(e,t,n,r){for(var i=e._values,a=e._index,o=e._ptr,s=e._size,u=e._datatype,c=s[0],l=s[1],p=r&&e._values?[]:null,f=[],h=[],d=0,m=0;m=0;n--)-1!==e[n]&&(a[o+n]=a[0+e[n]],a[0+e[n]]=n);for(n=0;n=0;u--)for(l=n[u],p=n[u+1],c=l;c=0;s--)h[s]=-1,-1!==(u=d[s])&&(0==m[x+u]++&&(m[v+u]=s),m[y+s]=m[g+u],m[g+u]=s);for(t.lnz=0,t.m2=a,u=0;u=0;){e=r[p];var f=i?i[e]:e;Dg(c,e)||(Bg(c,e),r[l+p]=f<0?0:jg(c[f]));var h=1;for(o=r[l+p],s=f<0?0:jg(c[f+1]);o{var{divideScalar:t,multiply:n,subtract:r}=e;return function(e,i,a,o,s,u,c){var l,p,f,h,d=e._values,m=e._index,y=e._ptr,g=e._size[1],v=i._values,x=i._index,b=i._ptr,w=function(e,t,n,r,i){var a,o,s,u=e._ptr,c=e._size,l=t._index,p=t._ptr,f=c[1],h=f;for(o=p[n],s=p[n+1],a=o;a{var{abs:t,divideScalar:n,multiply:r,subtract:i,larger:a,largerEq:o,SparseMatrix:s}=e,u=zg({divideScalar:n,multiply:r,subtract:i});return function(e,i,c){if(!e)return null;var l,p=e._size[1],f=100,h=100;i&&(l=i.q,f=i.lnz||f,h=i.unz||h);var d,m,y=[],g=[],v=[],x=new s({values:y,index:g,ptr:v,size:[p,p]}),b=[],w=[],N=[],M=new s({values:b,index:w,ptr:N,size:[p,p]}),E=[],S=[],O=[];for(d=0;d{var{typed:t,abs:n,add:r,multiply:i,transpose:a,divideScalar:o,subtract:s,larger:u,largerEq:c,SparseMatrix:l}=e,p=Pg({add:r,multiply:i,transpose:a}),f=Rg({abs:n,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:c,SparseMatrix:l});return t("slu",{"SparseMatrix, number, number":function(e,t,n){if(!Ra(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var r=p(t,e,!1),i=f(e,r,n);return{L:i.L,U:i.U,p:i.pinv,q:r.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));function Lg(e,t){var n,r=t.length,i=[];if(e)for(n=0;n{var{typed:t,matrix:n,lup:r,slu:i,usolve:a,lsolve:o,DenseMatrix:s}=e,u=sd({DenseMatrix:s});return t(Ug,{"Array, Array | Matrix":function(e,t){e=n(e);var i=r(e);return l(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var n=r(e);return l(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var n=r(e);return l(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,n,r){var a=i(e,n,r);return l(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return l(e.L,e.U,e.p,e.q,t)}});function c(e){if(ea(e))return e;if(Qi(e))return n(e);throw new TypeError("Invalid Matrix LU decomposition")}function l(e,t,n,r,i){e=c(e),t=c(t),n&&((i=u(e,i,!0))._data=Lg(n,i._data));var s=o(e,i),l=a(t,s);return r&&(l._data=Lg(r,l._data)),l}})),Hg=["parse"],Gg=qo("Help",Hg,(e=>{var{parse:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){var e=this.doc||{},n="\n";if(e.name&&(n+="Name: "+e.name+"\n\n"),e.category&&(n+="Category: "+e.category+"\n\n"),e.description&&(n+="Description:\n "+e.description+"\n\n"),e.syntax&&(n+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){n+="Examples:\n";for(var r={},i=0;i"mathjs"!==e)).forEach((n=>{t[n]=e[n]})),new n(t)},n.prototype.valueOf=n.prototype.toString,n}),{isClass:!0}),Wg=["?on","math"],Jg=qo("Chain",Wg,(e=>{var{on:t,math:n}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");_a(e)?this.value=e.value:this.value=e}function i(e,t){!function(e,t,n){var r,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(r=n(),i=!1),r},set:function(e){r=e,i=!1},configurable:!0,enumerable:!0})}(r.prototype,e,(function(){var e=t();if("function"==typeof e)return a(e)}))}function a(e){return function(){for(var t=[this.value],n=0;ne[t]))};for(var s in e)n(s)}};var o={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return r.createProxy(n),t&&t("import",(function(e,t,n){n||i(e,t)})),r}),{isClass:!0}),Zg={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},Kg={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},Yg={bignumber:{name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},boolean:{name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},complex:{name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},createUnit:{name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},fraction:{name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},index:{name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["[]","[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},matrix:{name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},number:{name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},sparse:{name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},splitUnit:{name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},string:{name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},unit:{name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},e:Kg,E:Kg,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},Infinity:{name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},LOG10E:{name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:Zg,PI:Zg,phi:{name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},SQRT1_2:{name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},SQRT2:{name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tau:{name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},true:{name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},version:{name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:{name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},lsolve:{name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},lsolveAll:{name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},lup:{name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},lusolve:{name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},simplify:{name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["derivative","parse","evaluate"]},rationalize:{name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},slu:{name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},usolve:{name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},usolveAll:{name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},qr:{name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},abs:{name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},add:{name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},cbrt:{name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},ceil:{name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},cube:{name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},divide:{name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},dotDivide:{name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},dotMultiply:{name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},dotPow:{name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},exp:{name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},expm:{name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},expm1:{name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},fix:{name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},gcd:{name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},hypot:{name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},lcm:{name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},log:{name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},log2:{name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},log1p:{name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},log10:{name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},mod:{name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},multiply:{name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},norm:{name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},nthRoot:{name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},nthRoots:{name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},pow:{name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)"],seealso:["ceil","floor","fix"]},sign:{name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},sqrt:{name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},sqrtm:{name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]},square:{name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},subtract:{name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},unaryMinus:{name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},bitAnd:{name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitNot:{name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitOr:{name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},bitXor:{name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},leftShift:{name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},rightArithShift:{name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},rightLogShift:{name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},bellNumbers:{name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},catalan:{name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},composition:{name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},stirlingS2:{name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},config:{name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},import:{name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},typed:{name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]},arg:{name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},conj:{name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},re:{name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},im:{name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},evaluate:{name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(" + 4 + ")")'],seealso:[]},help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},distance:{name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},intersect:{name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},and:{name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},not:{name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},or:{name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},xor:{name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},concat:{name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},cross:{name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},column:{name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row"]},ctranspose:{name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},det:{name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diag:{name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diff:{name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["diff([1, 2, 4, 7, 0])","diff([1, 2, 4, 7, 0], 0)","diff(matrix([1, 2, 4, 7, 0]))","diff([[1, 2], [3, 4]])","diff([[1, 2], [3, 4]], 0)","diff([[1, 2], [3, 4]], 1)","diff([[1, 2], [3, 4]], bignumber(1))","diff(matrix([[1, 2], [3, 4]]), 1)","diff([[1, 2], matrix([3, 4])], 1)"],seealso:["subtract","partitionSelect"]},dot:{name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},getMatrixDataType:{name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},identity:{name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},filter:{name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},flatten:{name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},forEach:{name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]},inv:{name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and eigenvectors of a real symmetric matrix",examples:["eigs([[5, 2.3], [2.3, 1]])"],seealso:["inv"]},kron:{name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},map:{name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},ones:{name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},partitionSelect:{name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1)'],seealso:["sort"]},range:{name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},resize:{name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},reshape:{name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])"],seealso:["size","squeeze","resize"]},rotate:{name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], math.pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},rotationMatrix:{name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},row:{name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column"]},size:{name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},sort:{name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},squeeze:{name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},subset:{name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},trace:{name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},transpose:{name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},zeros:{name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},combinations:{name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},combinationsWithRep:{name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},factorial:{name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},gamma:{name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},kldivergence:{name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},multinomial:{name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},permutations:{name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},pickRandom:{name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},random:{name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},randomInt:{name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},compare:{name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},compareNatural:{name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},compareText:{name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},deepEqual:{name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},equal:{name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},equalText:{name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},larger:{name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},largerEq:{name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},smaller:{name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},smallerEq:{name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},unequal:{name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},setCartesian:{name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},setDifference:{name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},setDistinct:{name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},setIntersect:{name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},setIsSubset:{name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},setMultiplicity:{name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},setPowerset:{name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},setSize:{name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},setSymDifference:{name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},setUnion:{name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},erf:{name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},mad:{name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},max:{name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},mean:{name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},median:{name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},min:{name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},mode:{name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},prod:{name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},quantileSeq:{name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},std:{name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},sum:{name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},variance:{name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},acos:{name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},acosh:{name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},acot:{name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},acoth:{name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},acsc:{name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},acsch:{name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},asec:{name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},asinh:{name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},atan:{name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},atanh:{name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},atan2:{name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},cos:{name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},coth:{name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},csc:{name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},csch:{name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},sec:{name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},sech:{name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},sin:{name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},tanh:{name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},to:{name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},clone:{name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},format:{name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},bin:{name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},oct:{name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},hex:{name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},isNaN:{name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isInteger:{name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isNegative:{name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},isNumeric:{name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},hasNumericValue:{name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},isPositive:{name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isPrime:{name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isZero:{name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},typeOf:{name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},numeric:{name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction)','numeric(4, "Fraction")','numeric(fraction(2, 5), "number)'],seealso:["number","fraction","bignumber","string","format"]}},Xg="help",Qg=qo(Xg,["typed","mathWithTransform","Help"],(e=>{var{typed:t,mathWithTransform:n,Help:r}=e;return t(Xg,{any:function(e){var t,i=e;if("string"!=typeof e)for(t in n)if(Ba(n,t)&&e===n[t]){i=t;break}var a=Xf(Yg,i);if(!a){var o="function"==typeof i?i.name:i;throw new Error('No documentation found on "'+o+'"')}return new r(a)}})})),ev="chain",tv=qo(ev,["typed","Chain"],(e=>{var{typed:t,Chain:n}=e;return t(ev,{"":function(){return new n},any:function(e){return new n(e)}})})),nv=qo("det",["typed","matrix","subtract","multiply","unaryMinus","lup"],(e=>{var{typed:t,matrix:n,subtract:r,multiply:i,unaryMinus:a,lup:o}=e;return t("det",{any:function(e){return Ta(e)},"Array | Matrix":function(e){var t;switch((t=ea(e)?e.size():Array.isArray(e)?(e=n(e)).size():[]).length){case 0:return Ta(e);case 1:if(1===t[0])return Ta(e.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+co(t)+")");case 2:var s=t[0];if(s===t[1])return function(e,t,n){if(1===t)return Ta(e[0][0]);if(2===t)return r(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var s=o(e),u=s.U[0][0],c=1;c=t)break;for(var h=p,d=0;!f[s.p[h]];)f[s.p[h]]=!0,h=s.p[h],d++;d%2==0&&l++}return l%2==0?u:a(u)}(e.clone().valueOf(),s);throw new RangeError("Matrix must be square (size: "+co(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+co(t)+")")}}})})),rv=qo("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],(e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:i,multiply:a,unaryMinus:o,det:s,identity:u,abs:c}=e;return t("inv",{"Array | Matrix":function(e){var t=ea(e)?e.size():go(e);switch(t.length){case 1:if(1===t[0])return ea(e)?n([r(1,e.valueOf()[0])]):[r(1,e[0])];throw new RangeError("Matrix must be square (size: "+co(t)+")");case 2:var i=t[0],a=t[1];if(i===a)return ea(e)?n(l(e.valueOf(),i,a),e.storage()):l(e,i,a);throw new RangeError("Matrix must be square (size: "+co(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+co(t)+")")}},any:function(e){return r(1,e)}});function l(e,t,n){var l,p,f,h,d;if(1===t){if(0===(h=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,h)]]}if(2===t){var m=s(e);if(0===m)throw Error("Cannot calculate inverse, determinant is zero");return[[r(e[1][1],m),r(o(e[0][1]),m)],[r(o(e[1][0]),m),r(e[0][0],m)]]}var y=e.concat();for(l=0;lx&&(x=c(y[l][v]),b=l),l++;if(0===x)throw Error("Cannot calculate inverse, determinant is zero");(l=b)!==v&&(d=y[v],y[v]=y[l],y[l]=d,d=g[v],g[v]=g[l],g[l]=d);var w=y[v],N=g[v];for(l=0;l{var{config:t,typed:n,matrix:r,addScalar:i,subtract:a,equal:o,abs:s,atan:u,cos:c,sin:l,multiplyScalar:p,inv:f,bignumber:h,multiply:d,add:m}=e;return n("eigs",{Array:function(e){var t=r(e),n=t.size();if(2!==n.length||n[0]!==n[1])throw new RangeError("Matrix must be square (size: "+co(n)+")");var i=y(t,n[0]);return{values:i[0],vectors:i[1]}},Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+co(t)+")");var n=y(e,t[0]);return{values:r(n[0]),vectors:r(n[1])}}});function y(e,n){var r=e.datatype();if(void 0===r&&(r=e.getDataType()),"number"!==r&&"BigNumber"!==r&&"Fraction"!==r)throw"mixed"===r?new TypeError("Mixed matrix element type is not supported"):new TypeError("Matrix element type not supported ("+r+")");if(function(e,t){for(var n=0;n=s(i);){var c=u[0][0],l=u[0][1];e=N(e,n=x(e[c][c],e[l][l],e[c][l]),c,l),a=w(a,n,c,l),u=S(e)}for(var p=A(r,0),f=0;f=Math.abs(i);){var u=s[0][0],c=s[0][1];e=M(e,n=v(e[u][u],e[c][c],e[u][c]),u,c),a=b(a,n,u,c),s=E(e)}for(var l=A(r,0),p=0;p{var{typed:t,abs:n,add:r,identity:i,inv:a,multiply:o}=e;return t(av,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+co(t)+")");for(var u=t[0],c=function(e,t){for(var n=30,r=0;r1&&(y=o(y,f),g=-g),h=r(h,o(m=m*(l-v+1)/((2*l-v+1)*v),y)),d=r(d,o(m*g,y));for(var x=o(a(d),h),b=0;b{var{typed:t,abs:n,add:r,multiply:i,sqrt:a,subtract:o,inv:s,size:u,max:c,identity:l}=e,p=1e-6;function f(e){var t,a=0,f=e,h=l(u(e));do{var d=f;if(f=i(.5,r(d,s(h))),h=i(.5,r(h,s(d))),(t=c(n(o(f,d))))>p&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>p);return f}return t(sv,{"Array | Matrix":function(e){var t=ea(e)?e.size():go(e);switch(t.length){case 1:if(1===t[0])return a(e);throw new RangeError("Matrix must be square (size: "+co(t)+")");case 2:if(t[0]===t[1])return f(e);throw new RangeError("Matrix must be square (size: "+co(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+co(t)+")")}}})})),cv=qo("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(e=>{var{typed:t,matrix:n,multiply:r,equalScalar:i,divideScalar:a,inv:o}=e,s=Vl({typed:t,equalScalar:i}),u=$l({typed:t});return t("divide",Pa({"Array | Matrix, Array | Matrix":function(e,t){return r(e,o(t))},"DenseMatrix, any":function(e,t){return u(e,t,a,!1)},"SparseMatrix, any":function(e,t){return s(e,t,a,!1)},"Array, any":function(e,t){return u(n(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return r(e,o(t))}},a.signatures))})),lv="distance",pv=qo(lv,["typed","addScalar","subtract","divideScalar","multiplyScalar","unaryMinus","sqrt","abs"],(e=>{var{typed:t,addScalar:n,subtract:r,multiplyScalar:i,divideScalar:a,unaryMinus:o,sqrt:s,abs:u}=e;return t(lv,{"Array, Array, Array":function(e,t,n){if(2===e.length&&2===t.length&&2===n.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var s=a(r(n[1],n[0]),r(t[1],t[0])),u=i(i(s,s),t[0]),c=o(i(s,t[0])),p=e[1];return m(e[0],e[1],u,c,p)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,n){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(n).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(n))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in n&&"lineTwoPtY"in n){var s=a(r(n.lineTwoPtY,n.lineTwoPtX),r(t.lineOnePtY,t.lineOnePtX)),u=i(i(s,s),t.lineOnePtX),c=o(i(s,t.lineOnePtX)),p=e.pointX;return m(e.pointX,e.pointY,u,c,p)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return m(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!p(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!f(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!f(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return g(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return m(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return y(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return g([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return g([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&c(e[0][0])&&c(e[0][1])){if(e.some((e=>2!==e.length||!c(e[0])||!c(e[1]))))return!1}else{if(!(3===e[0].length&&c(e[0][0])&&c(e[0][1])&&c(e[0][2])))return!1;if(e.some((e=>3!==e.length||!c(e[0])||!c(e[1])||!c(e[2]))))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],n=[],r=[],i=0;i{var{typed:t,config:n,abs:r,add:i,addScalar:a,matrix:o,multiply:s,multiplyScalar:u,divideScalar:c,subtract:l,smaller:p,equalScalar:f}=e;return t("intersect",{"Array, Array, Array":function(e,t,n){if(!m(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&h(e[0])&&h(e[1])&&h(e[2])&&h(e[3])}(n))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,n,r,i,o,s,p,f,h){var d=u(e,s),m=u(r,s),y=u(t,p),g=u(i,p),v=u(n,f),x=u(o,f),b=c(l(l(l(h,d),y),v),l(l(l(a(a(m,g),x),d),y),v)),w=a(e,u(b,l(r,e))),N=a(t,u(b,l(i,t))),M=a(n,u(b,l(o,n)));return[w,N,M]}(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3])},"Array, Array, Array, Array":function(e,t,o,h){if(2===e.length){if(!d(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!d(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!d(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!d(h))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,o,f){var h=e,d=o,m=l(h,t),y=l(d,f),g=l(u(m[0],y[1]),u(y[0],m[1]));if(p(r(g),n.epsilon))return null;var v=u(y[0],h[1]),x=u(y[1],h[0]),b=u(y[0],d[1]),w=u(y[1],d[0]),N=c(a(l(l(v,x),b),w),g);return i(s(m,N),h)}(e,t,o,h)}if(3===e.length){if(!m(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!m(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!m(h))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return g=e[0],v=e[1],x=e[2],b=t[0],w=t[1],N=t[2],M=o[0],E=o[1],S=o[2],O=h[0],A=h[1],C=h[2],k=y(g,M,O,M,v,E,A,E,x,S,C,S),_=y(O,M,b,g,A,E,w,v,C,S,N,x),I=y(g,M,b,g,v,E,w,v,x,S,N,x),T=y(O,M,O,M,A,E,A,E,C,S,C,S),P=y(b,g,b,g,w,v,w,v,N,x,N,x),D=c(l(u(k,_),u(I,T)),l(u(P,T),u(_,_))),B=c(a(k,u(D,_)),T),j=a(g,u(D,l(b,g))),q=a(v,u(D,l(w,v))),z=a(x,u(D,l(N,x))),R=a(M,u(B,l(O,M))),F=a(E,u(B,l(A,E))),L=a(S,u(B,l(C,S))),f(j,R)&&f(q,F)&&f(z,L)?[j,q,z]:null}throw new TypeError("Arrays with two or thee dimensional points expected");var g,v,x,b,w,N,M,E,S,O,A,C,k,_,I,T,P,D,B,j,q,z,R,F,L},"Matrix, Matrix, Matrix":function(e,t,n){return o(this(e.valueOf(),t.valueOf(),n.valueOf()))},"Matrix, Matrix, Matrix, Matrix":function(e,t,n,r){return o(this(e.valueOf(),t.valueOf(),n.valueOf(),r.valueOf()))}});function h(e){return"number"==typeof e||Ji(e)}function d(e){return 2===e.length&&h(e[0])&&h(e[1])}function m(e){return 3===e.length&&h(e[0])&&h(e[1])&&h(e[2])}function y(e,t,n,r,i,o,s,c,p,f,h,d){var m=u(l(e,t),l(n,r)),y=u(l(i,o),l(s,c)),g=u(l(p,f),l(h,d));return a(a(m,y),g)}})),hv=qo("sum",["typed","config","add","numeric"],(e=>{var{typed:t,config:n,add:r,numeric:i}=e;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return qu(e,t,r)}catch(e){throw Eh(e,"sum")}},"...":function(e){if(Du(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return Bu(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(t){throw Eh(t,"sum",e)}})),void 0===t&&(t=i(0,n.number)),"string"==typeof t&&(t=i(t,n.number)),t}})),dv="mean",mv=qo(dv,["typed","add","divide"],(e=>{var{typed:t,add:n,divide:r}=e;return t(dv,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{var i=qu(e,t,n),a=Array.isArray(e)?go(e):e.size();return r(i,a[t])}catch(e){throw Eh(e,"mean")}},"...":function(e){if(Du(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){var t,i=0;if(Bu(e,(function(e){try{t=void 0===t?e:n(t,e),i++}catch(t){throw Eh(t,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return r(t,i)}})),yv="median",gv=qo(yv,["typed","add","divide","compare","partitionSelect"],(e=>{var{typed:t,add:n,divide:r,compare:i,partitionSelect:a}=e;function o(e){try{var t=(e=Co(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var n=t/2-1,r=a(e,n+1),o=e[n],c=0;c0&&(o=e[c]);return u(o,r)}var l=a(e,(t-1)/2);return s(l)}catch(e){throw Eh(e,"median")}}var s=t({"number | BigNumber | Complex | Unit":function(e){return e}}),u=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return r(n(e,t),2)}});return t(yv,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(Du(e))throw new TypeError("Scalar values expected in function median");return o(e)}})})),vv=qo("mad",["typed","abs","map","median","subtract"],(e=>{var{typed:t,abs:n,map:r,median:i,subtract:a}=e;return t("mad",{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=Co(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(r(e,(function(e){return n(a(e,t))})))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):Eh(e,"mad")}}})),xv="unbiased",bv="variance",wv=qo(bv,["typed","add","subtract","multiply","divide","apply","isNaN"],(e=>{var{typed:t,add:n,subtract:r,multiply:i,divide:a,apply:o,isNaN:s}=e;return t(bv,{"Array | Matrix":function(e){return u(e,xv)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,xv)},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return u(e,xv)}});function u(e,t){var o,u=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Bu(e,(function(e){try{o=void 0===o?e:n(o,e),u++}catch(t){throw Eh(t,"variance",e)}})),0===u)throw new Error("Cannot calculate variance of an empty array");var c=a(o,u);if(o=void 0,Bu(e,(function(e){var t=r(e,c);o=void 0===o?i(t,t):n(o,i(t,t))})),s(o))return o;switch(t){case"uncorrected":return a(o,u);case"biased":return a(o,u+1);case"unbiased":var l=Ji(o)?o.mul(0):0;return 1===u?l:a(o,u-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,n){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(e,t,(e=>u(e,n)))}catch(e){throw Eh(e,"variance")}}})),Nv=qo("quantileSeq",["typed","add","multiply","partitionSelect","compare"],(e=>{var{typed:t,add:n,multiply:r,partitionSelect:i,compare:a}=e;function o(e,t,o){var u=Co(e),c=u.length;if(0===c)throw new Error("Cannot calculate quantile of an empty sequence");if(Wi(t)){var l=t*(c-1),p=l%1;if(0===p){var f=o?u[l]:i(u,l);return s(f),f}var h,d,m=Math.floor(l);if(o)h=u[m],d=u[m+1];else{d=i(u,m+1),h=u[m];for(var y=0;y0&&(h=u[y])}return s(h),s(d),n(r(h,1-p),r(d,p))}var g=t.times(c-1);if(g.isInteger()){g=g.toNumber();var v=o?u[g]:i(u,g);return s(v),v}var x,b,w=g.floor(),N=g.minus(w),M=w.toNumber();if(o)x=u[M],b=u[M+1];else{b=i(u,M+1),x=u[M];for(var E=0;E0&&(x=u[E])}s(x),s(b);var S=new N.constructor(1);return n(r(x,S.minus(N)),r(b,N))}var s=t({"number | BigNumber | Unit":function(e){return e}});return function(e,t,n){var r,i,a;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(ta(e)){if("boolean"==typeof(n=n||!1)){if(i=e.valueOf(),Wi(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return o(i,t,n);if(t>1){if(!Ra(t))throw new Error("N must be a positive integer");var s=t+1;r=new Array(t);for(var u=0;u4294967295)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var p=new c(l+1);r=new Array(l);for(var f=0;f1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!Ji(d))throw new TypeError("Unexpected type of argument in function quantileSeq");if(a=new d.constructor(1),d.isNegative()||d.gt(a))throw new Error("Probability must be between 0 and 1, inclusive")}r[h]=o(i,d,n)}return r}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}})),Mv=qo("std",["typed","sqrt","variance"],(e=>{var{typed:t,sqrt:n,variance:r}=e;return t("std",{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(e){return i(e)}});function i(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return n(r.apply(null,arguments))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}})),Ev="combinations",Sv=qo(Ev,["typed"],(e=>{var{typed:t}=e;return t(Ev,{"number, number":wc,"BigNumber, BigNumber":function(e,t){var n,r,i=e.constructor,a=e.minus(t),o=new i(1);if(!Ov(e)||!Ov(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(n=o,t.lt(a))for(r=o;r.lte(a);r=r.plus(o))n=n.times(t.plus(r)).dividedBy(r);else for(r=o;r.lte(t);r=r.plus(o))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function Ov(e){return e.isInteger()&&e.gte(0)}var Av="combinationsWithRep",Cv=qo(Av,["typed"],(e=>{var{typed:t}=e;return t(Av,{"number, number":function(e,t){if(!Ra(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ra(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t{var{typed:t,config:n,multiplyScalar:r,pow:i,BigNumber:a,Complex:o}=e;return t(_v,{number:_c,Complex:function(e){if(0===e.im)return this(e.re);e=new o(e.re-1,e.im);for(var t=new o(Tc[0],0),n=1;n2;)u+=i-=2,o=o.times(u);return new a(o.toPrecision(a.precision))}})),Tv="factorial",Pv=qo(Tv,["typed","gamma"],(e=>{var{typed:t,gamma:n}=e;return t(Tv,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return n(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return n(e.plus(1))},"Array | Matrix":function(e){return ju(e,this)}})})),Dv="kldivergence",Bv=qo(Dv,["typed","matrix","divide","sum","multiply","dotDivide","log","isNumeric"],(e=>{var{typed:t,matrix:n,divide:r,sum:i,multiply:a,dotDivide:o,log:s,isNumeric:u}=e;return t(Dv,{"Array, Array":function(e,t){return c(n(e),n(t))},"Matrix, Array":function(e,t){return c(e,n(t))},"Array, Matrix":function(e,t){return c(n(e),t)},"Matrix, Matrix":function(e,t){return c(e,t)}});function c(e,t){var n=t.size().length,c=e.size().length;if(n>1)throw new Error("first object must be one dimensional");if(c>1)throw new Error("second object must be one dimensional");if(n!==c)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(t))throw new Error("Sum of elements in second object must be non zero");var l=r(e,i(e)),p=r(t,i(t)),f=i(a(l,s(o(l,p))));return u(f)?f:Number.NaN}})),jv="multinomial",qv=qo(jv,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(e=>{var{typed:t,add:n,divide:r,multiply:i,factorial:a,isInteger:o,isPositive:s}=e;return t(jv,{"Array | Matrix":function(e){var t=0,u=1;return Bu(e,(function(e){if(!o(e)||!s(e))throw new TypeError("Positive integer value expected in function multinomial");t=n(t,e),u=i(u,a(e))})),r(a(t),u)}})})),zv="permutations",Rv=qo(zv,["typed","factorial"],(e=>{var{typed:t,factorial:n}=e;return t(zv,{"number | BigNumber":n,"number, number":function(e,t){if(!Ra(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ra(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return bc(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var n,r;if(!Fv(e)||!Fv(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(n=e.mul(0).add(1),r=e.minus(t).plus(1);r.lte(e);r=r.plus(1))n=n.times(r);return n}})}));function Fv(e){return e.isInteger()&&e.gte(0)}var Lv=Pi((function(e){!function(e,t,n){function r(e){var t,n=this,r=(t=4022871197,function(e){e=String(e);for(var n=0;n>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function a(e,t){var n=new r(e),a=t&&t.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n((function(){return a})):this.alea=a}(0,e,!1)})),Uv=Pi((function(e){!function(e,t,n){function r(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 r=0;r>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n((function(){return a})):this.xor128=a}(0,e,!1)})),Vv=Pi((function(e){!function(e,t,n){function r(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 r=0;r>>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 a(e,t){var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n((function(){return a})):this.xorwow=a}(0,e,!1)})),$v=Pi((function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&(a.x&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n((function(){return a})):this.xorshift7=a}(0,e,!1)})),Hv=Pi((function(e){!function(e,t,n){function r(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,a=t.i;return t.w=r=r+1640531527|0,n=i[a+34&127],e=i[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[a]=n^e,t.i=a,n+(r^r>>>16)|0},function(e,t){var n,r,i,a,o,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),i=0,a=-32;a>>15,r^=r<<4,r^=r>>>13,a>=0&&(o=o+1640531527|0,i=0==(n=s[127&a]^=r+o)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,a=512;a>0;--a)r=s[i+34&127],n=s[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[i]=r^n;e.w=o,e.X=s,e.i=i}(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){null==e&&(e=+new Date);var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&(a.X&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n((function(){return a})):this.xor4096=a}(0,e,!1)})),Gv=Pi((function(e){!function(e,t,n){function r(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,i=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^i,t.a=i-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 r=0;r>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n((function(){return a})):this.tychei=a}(0,e,!1)})),Wv=Ti(Object.freeze({__proto__:null,default:{}})),Jv=Pi((function(e){!function(t,n,r){var i,a=256,o=r.pow(a,6),s=r.pow(2,52),u=2*s,c=255;function l(e,c,l){var y=[],g=d(h((c=1==c?{entropy:!0}:c||{}).entropy?[e,m(n)]:null==e?function(){try{var e;return i&&(e=i.randomBytes)?e=e(a):(e=new Uint8Array(a),(t.crypto||t.msCrypto).getRandomValues(e)),m(e)}catch(e){var r=t.navigator,o=r&&r.plugins;return[+new Date,t,o,t.screen,m(n)]}}():e,3),y),v=new p(y),x=function(){for(var e=v.g(6),t=o,n=0;e=u;)e/=2,t/=2,n>>>=1;return(e+n)/t};return x.int32=function(){return 0|v.g(4)},x.quick=function(){return v.g(4)/4294967296},x.double=x,d(m(v.S),n),(c.pass||l||function(e,t,n,i){return i&&(i.S&&f(i,v),e.state=function(){return f(v,{})}),n?(r.random=e,t):e})(x,g,"global"in c?c.global:this==r,c.state)}function p(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);i{var{typed:t,config:n,on:r}=e,i=Yv(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Yv(e.randomSeed))})),t({"Array | Matrix":function(e){return a(e,{})},"Array | Matrix, Object":function(e,t){return a(e,t)},"Array | Matrix, number":function(e,t){return a(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return a(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,n){return a(e,{number:n,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,n){return a(e,{number:t,weights:n})}});function a(e,t){var{number:n,weights:r,elementWise:a=!0}=t,o=void 0===n;o&&(n=1);var s=ea(e)?e.create:ea(r)?r.create:null;e=e.valueOf(),r&&(r=r.valueOf()),!0===a&&(e=Co(e),r=Co(r));var u=0;if(void 0!==r){if(r.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var c=0,l=r.length;c1)for(var r=0,i=e.shift();r{var{typed:t,config:n,on:r}=e,i=Yv(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Yv(e.randomSeed))})),t(ex,{"":()=>o(0,1),number:e=>o(0,e),"number, number":(e,t)=>o(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=Qv(e.valueOf(),(()=>o(t,n)));return ea(e)?e.create(r):r}function o(e,t){return e+i()*(t-e)}})),nx="randomInt",rx=qo(nx,["typed","config","?on"],(e=>{var{typed:t,config:n,on:r}=e,i=Yv(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=Yv(e.randomSeed))})),t(nx,{"":()=>o(0,1),number:e=>o(0,e),"number, number":(e,t)=>o(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=Qv(e.valueOf(),(()=>o(t,n)));return ea(e)?e.create(r):r}function o(e,t){return Math.floor(e+i()*(t-e))}})),ix="stirlingS2",ax=qo(ix,["typed","addScalar","subtract","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","larger"],(e=>{var{typed:t,addScalar:n,subtract:r,multiplyScalar:i,divideScalar:a,pow:o,factorial:s,combinations:u,isNegative:c,isInteger:l,larger:p}=e;return t(ix,{"number | BigNumber, number | BigNumber":function(e,t){if(!l(e)||c(e)||!l(t)||c(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");for(var f=s(t),h=0,d=0;d<=t;d++){var m=o(-1,r(t,d)),y=u(t,d),g=o(d,e);h=n(h,i(i(y,g),m))}return a(h,f)}})})),ox="bellNumbers",sx=qo(ox,["typed","addScalar","isNegative","isInteger","stirlingS2"],(e=>{var{typed:t,addScalar:n,isNegative:r,isInteger:i,stirlingS2:a}=e;return t(ox,{"number | BigNumber":function(e){if(!i(e)||r(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,o=0;o<=e;o++)t=n(t,a(e,o));return t}})})),ux="catalan",cx=qo(ux,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(e=>{var{typed:t,addScalar:n,divideScalar:r,multiplyScalar:i,combinations:a,isNegative:o,isInteger:s}=e;return t(ux,{"number | BigNumber":function(e){if(!s(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return r(a(i(e,2),e),n(e,1))}})})),lx="composition",px=qo(lx,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(e=>{var{typed:t,addScalar:n,combinations:r,isPositive:i,isNegative:a,isInteger:o,larger:s}=e;return t(lx,{"number | BigNumber, number | BigNumber":function(e,t){if(!(o(e)&&i(e)&&o(t)&&i(t)))throw new TypeError("Positive integer value expected in function composition");if(s(t,e))throw new TypeError("k must be less than or equal to n in function composition");return r(n(e,-1),n(t,-1))}})})),fx=qo("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(e=>{var{FunctionNode:t,OperatorNode:n,SymbolNode:r}=e,i={add:!0,multiply:!0},a={add:!0,multiply:!0};function o(e,t){if(!Oa(e))return!1;var n=e.fn.toString();return t&&Ba(t,n)&&Ba(t[n],"associative")?t[n].associative:a[n]||!1}function s(e){var t,n=[];return o(e)?(t=e.op,function e(r){for(var i=0;i2&&o(t)){for(var a=t.args.pop();t.args.length>0;)a=n([t.args.pop(),a]);t.args=a.args}}},unflattenl:function e(t){if(t.args&&0!==t.args.length){for(var n=u(t),r=t.args.length,i=0;i2&&o(t)){for(var a=t.args.shift();t.args.length>0;)a=n([a,t.args.shift()]);t.args=a.args}}}}})),hx=qo("simplifyCore",["equal","isZero","add","subtract","multiply","divide","pow","ConstantNode","OperatorNode","FunctionNode","ParenthesisNode"],(e=>{var{equal:t,isZero:n,add:r,subtract:i,multiply:a,divide:o,pow:s,ConstantNode:u,OperatorNode:c,FunctionNode:l,ParenthesisNode:p}=e,f=new u(0),h=new u(1);return function e(d){if(Oa(d)&&d.isUnary()){var m=e(d.args[0]);if("+"===d.op)return m;if("-"===d.op){if(Oa(m)){if(m.isUnary()&&"-"===m.op)return m.args[0];if(m.isBinary()&&"subtract"===m.fn)return new c("-","subtract",[m.args[1],m.args[0]])}return new c(d.op,d.fn,[m])}}else if(Oa(d)&&d.isBinary()){var y=e(d.args[0]),g=e(d.args[1]);if("+"===d.op){if(ba(y)){if(n(y.value))return g;if(ba(g))return new u(r(y.value,g.value))}return ba(g)&&n(g.value)?y:Oa(g)&&g.isUnary()&&"-"===g.op?new c("-","subtract",[y,g.args[0]]):new c(d.op,d.fn,g?[y,g]:[y])}if("-"===d.op){if(ba(y)&&g){if(ba(g))return new u(i(y.value,g.value));if(n(y.value))return new c("-","unaryMinus",[g])}if("subtract"===d.fn)return ba(g)&&n(g.value)?y:Oa(g)&&g.isUnary()&&"-"===g.op?e(new c("+","add",[y,g.args[0]])):new c(d.op,d.fn,[y,g])}else{if("*"===d.op){if(ba(y)){if(n(y.value))return f;if(t(y.value,1))return g;if(ba(g))return new u(a(y.value,g.value))}if(ba(g)){if(n(g.value))return f;if(t(g.value,1))return y;if(Oa(y)&&y.isBinary()&&y.op===d.op){var v=y.args[0];if(ba(v)){var x=new u(a(v.value,g.value));return new c(d.op,d.fn,[x,y.args[1]],d.implicit)}}return new c(d.op,d.fn,[g,y],d.implicit)}return new c(d.op,d.fn,[y,g],d.implicit)}if("/"===d.op){if(ba(y)){if(n(y.value))return f;if(ba(g)&&(t(g.value,1)||t(g.value,2)||t(g.value,4)))return new u(o(y.value,g.value))}return new c(d.op,d.fn,[y,g])}if("^"===d.op){if(ba(g)){if(n(g.value))return h;if(t(g.value,1))return y;if(ba(y))return new u(s(y.value,g.value));if(Oa(y)&&y.isBinary()&&"^"===y.op){var b=y.args[1];if(ba(b))return new c(d.op,d.fn,[y.args[0],new u(a(b.value,g.value))])}}return new c(d.op,d.fn,[y,g])}}}else{if(Aa(d)){var w=e(d.content);return Aa(w)||ka(w)||ba(w)?w:new p(w)}if(Na(d)){var N=d.args.map(e).map((function(e){return Aa(e)?e.content:e}));return new l(e(d.fn),N)}}return d}})),dx=qo("simplifyConstant",["typed","config","mathWithTransform","?fraction","?bignumber","ConstantNode","OperatorNode","FunctionNode","SymbolNode"],(e=>{var{typed:t,config:n,mathWithTransform:r,fraction:i,bignumber:a,ConstantNode:o,OperatorNode:s,FunctionNode:u,SymbolNode:c}=e,{isCommutative:l,isAssociative:p,allChildren:f,createMakeNodeFunction:h}=fx({FunctionNode:u,OperatorNode:s,SymbolNode:c});function d(e,t,n){try{return g(r[e].apply(null,t),n)}catch(i){return t=t.map((function(e){return Ki(e)?e.valueOf():e})),g(r[e].apply(null,t),n)}}var m=t({Fraction:function(e){var t,n=e.s*e.n;t=n<0?new s("-","unaryMinus",[new o(-n)]):new o(n);if(1===e.d)return t;return new s("/","divide",[t,new o(e.d)])},number:function(e){return e<0?v(new o(-e)):new o(e)},BigNumber:function(e){return e<0?v(new o(-e)):new o(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")}});function y(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&i){var n=i(e),r=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(n.valueOf()===e&&n.nb(e,t)));if(!n.some(Ea))try{return d(e.name,n,t)}catch(e){}return n=n.map((function(e){return Ea(e)?e:m(e)})),new u(e.name,n)}case"OperatorNode":var i,a,o=e.fn.toString(),s=h(e);if(Oa(e)&&e.isUnary())a=Ea((i=[b(e.args[0],t)])[0])?s(i):d(o,i,t);else if(p(e))if(i=(i=f(e)).map((e=>b(e,t))),l(o)){for(var c=[],y=[],v=0;v1?(a=x(o,c,s,t),y.unshift(a),a=x(o,y,s,t)):a=x(o,i,s,t)}else a=x(o,i,s,t);else a=x(o,i=e.args.map((e=>b(e,t))),s,t);return a;case"ParenthesisNode":return b(e.content,t);case"AccessorNode":case"ArrayNode":case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"IndexNode":case"ObjectNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return function(e,t){var n=b(e,t);return Ea(n)?n:m(n)}})),mx=qo("resolve",["parse","FunctionNode","OperatorNode","ParenthesisNode"],(e=>{var{parse:t,FunctionNode:n,OperatorNode:r,ParenthesisNode:i}=e;return function e(a,o){if(!o)return a;if(ka(a)){var s=o[a.name];if(Ea(s))return e(s,o);if("number"==typeof s)return t(String(s))}else{if(Oa(a)){var u=a.args.map((function(t){return e(t,o)}));return new r(a.op,a.fn,u,a.implicit)}if(Aa(a))return new i(e(a.content,o));if(Na(a)){var c=a.args.map((function(t){return e(t,o)}));return new n(a.name,c)}}return a}})),yx=qo("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","?fraction","?bignumber","mathWithTransform","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{config:t,typed:n,parse:r,add:i,subtract:a,multiply:o,divide:s,pow:u,isZero:c,equal:l,fraction:p,bignumber:f,mathWithTransform:h,ConstantNode:d,FunctionNode:m,OperatorNode:y,ParenthesisNode:g,SymbolNode:v}=e,x=dx({typed:n,config:t,mathWithTransform:h,fraction:p,bignumber:f,ConstantNode:d,OperatorNode:y,FunctionNode:m,SymbolNode:v}),b=hx({equal:l,isZero:c,add:i,subtract:a,multiply:o,divide:s,pow:u,ConstantNode:d,OperatorNode:y,FunctionNode:m,ParenthesisNode:g}),w=mx({parse:r,FunctionNode:m,OperatorNode:y,ParenthesisNode:g}),{isCommutative:N,isAssociative:M,flatten:E,unflattenr:S,unflattenl:O,createMakeNodeFunction:A}=fx({FunctionNode:m,OperatorNode:y,SymbolNode:v}),C=n("simplify",{string:function(e){return this(r(e),this.rules,{},{})},"string, Object":function(e,t){return this(r(e),this.rules,t,{})},"string, Object, Object":function(e,t,n){return this(r(e),this.rules,t,n)},"string, Array":function(e,t){return this(r(e),t,{},{})},"string, Array, Object":function(e,t,n){return this(r(e),t,n,{})},"string, Array, Object, Object":function(e,t,n,i){return this(r(e),t,n,i)},"Node, Object":function(e,t){return this(e,this.rules,t,{})},"Node, Object, Object":function(e,t,n){return this(e,this.rules,t,n)},Node:function(e){return this(e,this.rules,{},{})},"Node, Array":function(e,t){return this(e,t,{},{})},"Node, Array, Object":function(e,t,n){return this(e,t,n,{})},"Node, Array, Object, Object":function(e,t,n,i){t=function(e){for(var t=[],n=0;n");if(2!==s.length)throw SyntaxError("Could not parse rule: "+i);i={l:s[0],r:s[1]};case"object":if(a={l:k(r(i.l)),r:k(r(i.r))},i.context&&(a.evaluate=i.context),i.evaluate&&(a.evaluate=r(i.evaluate)),M(a.l)){var u=A(a.l),c=T();a.expanded={},a.expanded.l=u([a.l.clone(),c]),E(a.expanded.l),S(a.expanded.l),a.expanded.r=u([a.r,c])}break;case"function":a=i;break;default:throw TypeError("Unsupported type of rule: "+o)}t.push(a)}return t}(t);for(var a=w(e,n),o={},s=(a=k(a)).toString({parenthesis:"all"});!o[s];){o[s]=!0,I=0;for(var u=0;u=2&&2===e.args.length){for(var i=function(e,t){var n,r,i=[],a=A(e);if(N(e,t))for(var o=0;o2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var u=[],c=0;c{var{typed:t,config:n,parse:r,simplify:i,equal:a,isZero:o,numeric:s,ConstantNode:u,FunctionNode:c,OperatorNode:l,ParenthesisNode:p,SymbolNode:f}=e,h=t("derivative",{"Node, SymbolNode, Object":function(e,t,n){var r={};m(r,e,t.name);var a=y(e,r);return n.simplify?i(a):a},"Node, SymbolNode":function(e,t){return this(e,t,{simplify:!0})},"string, SymbolNode":function(e,t){return this(r(e),t)},"string, SymbolNode, Object":function(e,t,n){return this(r(e),t,n)},"string, string":function(e,t){return this(r(e),r(t))},"string, string, Object":function(e,t,n){return this(r(e),r(t),n)},"Node, string":function(e,t){return this(e,r(t))},"Node, string, Object":function(e,t,n){return this(e,r(t),n)}});h._simplify=!0,h.toTex=function(e){return d.apply(null,e.args)};var d=t("_derivTex",{"Node, SymbolNode":function(e,t){return ba(e)&&"string"===Ia(e.value)?d(r(e.value).toString(),t.toString(),1):d(e.toString(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===Ia(t.value))return d(e,r(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,n){return d(e.toString(),t.name,n.value)},"string, string, number":function(e,t,n){return(1===n?"{d\\over d"+t+"}":"{d^{"+n+"}\\over d"+t+"^{"+n+"}}")+"\\left[".concat(e,"\\right]")}}),m=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,n){return t.name!==n&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,n){return m(e,t.content,n)},"Object, FunctionAssignmentNode, string":function(e,t,n){return-1===t.params.indexOf(n)?(e[t]=!0,!0):m(e,t.expr,n)},"Object, FunctionNode | OperatorNode, string":function(e,t,n){if(t.args.length>0){for(var r=m(e,t.args[0],n),i=1;i0){var r=e.args.filter((function(e){return void 0===t[e]})),i=1===r.length?r[0]:new l("*","multiply",r),s=n.concat(y(i,t));return new l("*","multiply",s)}return new l("+","add",e.args.map((function(n){return new l("*","multiply",e.args.map((function(e){return e===n?y(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var u=e.args[0],p=e.args[1];return void 0!==t[p]?new l("/","divide",[y(u,t),p]):void 0!==t[u]?new l("*","multiply",[new l("-","unaryMinus",[u]),new l("/","divide",[y(p,t),new l("^","pow",[p.clone(),g(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[y(u,t),p.clone()]),new l("*","multiply",[u.clone(),y(p,t)])]),new l("^","pow",[p.clone(),g(2)])])}if("^"===e.op&&e.isBinary()){var f=e.args[0],h=e.args[1];if(void 0!==t[f])return ba(f)&&(o(f.value)||a(f.value,1))?g(0):new l("*","multiply",[e,new l("*","multiply",[new c("log",[f.clone()]),y(h.clone(),t)])]);if(void 0!==t[h]){if(ba(h)){if(o(h.value))return g(0);if(a(h.value,1))return y(f,t)}var d=new l("^","pow",[f.clone(),new l("-","subtract",[h,g(1)])]);return new l("*","multiply",[h.clone(),new l("*","multiply",[y(f,t),d])])}return new l("*","multiply",[new l("^","pow",[f.clone(),h.clone()]),new l("+","add",[new l("*","multiply",[y(f,t),new l("/","divide",[h.clone(),f.clone()])]),new l("*","multiply",[y(h,t),new c("log",[f.clone()])])])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function g(e,t){return new u(s(e,t||n.number))}return h})),vx="rationalize",xx=qo(vx,["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplify","?bignumber","?fraction","mathWithTransform","ConstantNode","OperatorNode","FunctionNode","SymbolNode","ParenthesisNode"],(e=>{var{config:t,typed:n,equal:r,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,parse:l,simplify:p,fraction:f,bignumber:h,mathWithTransform:d,ConstantNode:m,OperatorNode:y,FunctionNode:g,SymbolNode:v,ParenthesisNode:x}=e,b=dx({typed:n,config:t,mathWithTransform:d,fraction:f,bignumber:h,ConstantNode:m,OperatorNode:y,FunctionNode:g,SymbolNode:v}),w=hx({equal:r,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,ConstantNode:m,OperatorNode:y,FunctionNode:g,ParenthesisNode:x});return n(vx,{string:function(e){return this(l(e),{},!1)},"string, boolean":function(e,t){return this(l(e),{},t)},"string, Object":function(e,t){return this(l(e),t,!1)},"string, Object, boolean":function(e,t,n){return this(l(e),t,n)},Node:function(e){return this(e,{},!1)},"Node, boolean":function(e,t){return this(e,{},t)},"Node, Object":function(e,t){return this(e,t,!1)},"Node, Object, boolean":function(e,t,n){var r=function(){var e=[w,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},b,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],n=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],i={};return i.firstRules=e.concat(t,r),i.distrDivRules=n,i.sucDivRules=r,i.firstRulesAgain=e.concat(t),i.finalRules=[w,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},b,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],i}(),i=function(e,t,n,r){var i=[],a=p(e,r,t,{exactFractions:!1}),o="+-*"+((n=!!n)?"/":"");u(a);var s={};return s.expression=a,s.variables=i,s;function u(e){var t=e.type;if("FunctionNode"===t)throw new Error("There is an unsolved function call");if("OperatorNode"===t)if("^"===e.op){if("ConstantNode"!==e.args[1].type||!Ra(parseFloat(e.args[1].value)))throw new Error("There is a non-integer exponent");u(e.args[0])}else{if(-1===o.indexOf(e.op))throw new Error("Operator "+e.op+" invalid in polynomial expression");for(var n=0;n=1){var o,s;e=N(e);var u,c=!0,l=!1;for(e=p(e,r.firstRules,{},{exactFractions:!1});s=c?r.distrDivRules:r.sucDivRules,c=!c,(u=(e=p(e,s)).toString())!==o;)l=!0,o=u;l&&(e=p(e,r.firstRulesAgain,{},{exactFractions:!1})),e=p(e,r.finalRules,{},{exactFractions:!1})}var f=[],h={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===a&&(e.args[0]=M(e.args[0],f),e.args[1]=M(e.args[1])),n&&(h.numerator=e.args[0],h.denominator=e.args[1])):(1===a&&(e=M(e,f)),n&&(h.numerator=e,h.denominator=null)),n?(h.coefficients=f,h.variables=i.variables,h.expression=e,h):e}});function N(e,t,n){var r=e.type,i=arguments.length>1;if("OperatorNode"===r&&e.isBinary()){var a,o=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(o=(a=parseFloat(e.args[1].value))>=2&&Ra(a))),o){if(a>2){var s=e.args[0],u=new y("^","pow",[e.args[0].cloneDeep(),new m(a-1)]);e=new y("*","multiply",[s,u])}else e=new y("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===n?t.content=e:t.args[n]=e)}}if("ParenthesisNode"===r)N(e.content,e,"content");else if("ConstantNode"!==r&&"SymbolNode"!==r)for(var c=0;cr&&(t[c]=0),t[c]+=o.cte*("+"===o.oper?1:-1),void(r=Math.max(c,r))}o.cte=c,""===o.fire&&(t[0]+=o.cte*("+"===o.oper?1:-1))}}(e,null,n);for(var a,o=!0,s=r=t.length-1;s>=0;s--)if(0!==t[s]){var u=new m(o?t[s]:Math.abs(t[s])),c=t[s]<0?"-":"+";if(s>0){var l=new v(i);if(s>1){var p=new m(s);l=new y("^","pow",[l,p])}u=-1===t[s]&&o?new y("-","unaryMinus",[l]):1===Math.abs(t[s])?l:new y("*","multiply",[u,l])}a=o?u:"+"===c?new y("+","add",[a,u]):new y("-","subtract",[a,u]),o=!1}return o?new m(0):a}})),bx=qo("reviver",["classes"],(e=>{var{classes:t}=e;return function(e,n){var r=t[n&&n.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(n):n}})),wx=qo("replacer",[],(()=>function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?t:{mathjs:"number",value:String(t)}})),Nx=qo("true",[],(()=>!0)),Mx=qo("false",[],(()=>!1)),Ex=qo("null",[],(()=>null)),Sx=Rx("Infinity",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1/0):1/0})),Ox=Rx("NaN",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(NaN):NaN})),Ax=Rx("pi",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?am(n):Nc})),Cx=Rx("tau",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?om(n):Mc})),kx=Rx("e",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?rm(n):Ec})),_x=Rx("phi",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?im(n):1.618033988749895})),Ix=Rx("LN2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).ln():Math.LN2})),Tx=Rx("LN10",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(10).ln():Math.LN10})),Px=Rx("LOG2E",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(2).ln()):Math.LOG2E})),Dx=Rx("LOG10E",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(10).ln()):Math.LOG10E})),Bx=Rx("SQRT1_2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n("0.5").sqrt():Math.SQRT1_2})),jx=Rx("SQRT2",["config","?BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).sqrt():Math.SQRT2})),qx=Rx("i",["Complex"],(e=>{var{Complex:t}=e;return t.I})),zx=qo("version",[],(()=>"8.1.0"));function Rx(e,t,n){return qo(e,t,n,{recreateOnConfigChange:!0})}var Fx=jb("speedOfLight","299792458","m s^-1"),Lx=jb("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Ux=jb("planckConstant","6.62607015e-34","J s"),Vx=jb("reducedPlanckConstant","1.0545718176461565e-34","J s"),$x=jb("magneticConstant","1.25663706212e-6","N A^-2"),Hx=jb("electricConstant","8.8541878128e-12","F m^-1"),Gx=jb("vacuumImpedance","376.730313667","ohm"),Wx=jb("coulomb","8.987551792261171e9","N m^2 C^-2"),Jx=jb("elementaryCharge","1.602176634e-19","C"),Zx=jb("bohrMagneton","9.2740100783e-24","J T^-1"),Kx=jb("conductanceQuantum","7.748091729863649e-5","S"),Yx=jb("inverseConductanceQuantum","12906.403729652257","ohm"),Xx=jb("magneticFluxQuantum","2.0678338484619295e-15","Wb"),Qx=jb("nuclearMagneton","5.0507837461e-27","J T^-1"),eb=jb("klitzing","25812.807459304513","ohm"),tb=jb("bohrRadius","5.29177210903e-11","m"),nb=jb("classicalElectronRadius","2.8179403262e-15","m"),rb=jb("electronMass","9.1093837015e-31","kg"),ib=jb("fermiCoupling","1.1663787e-5","GeV^-2"),ab=qb("fineStructure",.0072973525693),ob=jb("hartreeEnergy","4.3597447222071e-18","J"),sb=jb("protonMass","1.67262192369e-27","kg"),ub=jb("deuteronMass","3.3435830926e-27","kg"),cb=jb("neutronMass","1.6749271613e-27","kg"),lb=jb("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),pb=jb("rydberg","10973731.568160","m^-1"),fb=jb("thomsonCrossSection","6.6524587321e-29","m^2"),hb=qb("weakMixingAngle",.2229),db=qb("efimovFactor",22.7),mb=jb("atomicMass","1.66053906660e-27","kg"),yb=jb("avogadro","6.02214076e23","mol^-1"),gb=jb("boltzmann","1.380649e-23","J K^-1"),vb=jb("faraday","96485.33212331001","C mol^-1"),xb=jb("firstRadiation","3.7417718521927573e-16","W m^2"),bb=jb("loschmidt","2.686780111798444e25","m^-3"),wb=jb("gasConstant","8.31446261815324","J K^-1 mol^-1"),Nb=jb("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Mb=jb("molarVolume","0.022413969545014137","m^3 mol^-1"),Eb=qb("sackurTetrode",-1.16487052358),Sb=jb("secondRadiation","0.014387768775039337","m K"),Ob=jb("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Ab=jb("wienDisplacement","2.897771955e-3","m K"),Cb=jb("molarMass","0.99999999965e-3","kg mol^-1"),kb=jb("molarMassC12","11.9999999958e-3","kg mol^-1"),_b=jb("gravity","9.80665","m s^-2"),Ib=jb("planckLength","1.616255e-35","m"),Tb=jb("planckMass","2.176435e-8","kg"),Pb=jb("planckTime","5.391245e-44","s"),Db=jb("planckCharge","1.87554603778e-18","C"),Bb=jb("planckTemperature","1.416785e+32","K");function jb(e,t,n){return qo(e,["config","Unit","BigNumber"],(e=>{var{config:r,Unit:i,BigNumber:a}=e,o=new i("BigNumber"===r.number?new a(t):parseFloat(t),n);return o.fixPrefix=!0,o}))}function qb(e,t){return qo(e,["config","BigNumber"],(e=>{var{config:n,BigNumber:r}=e;return"BigNumber"===n.number?new r(t):t}))}var zb=qo("apply",["typed","isInteger"],(e=>{var{typed:t,isInteger:n}=e,r=ql({typed:t,isInteger:n});return t("apply",{"...any":function(e){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),Rb=qo("column",["typed","Index","matrix","range"],(e=>{var{typed:t,Index:n,matrix:r,range:i}=e,a=cf({typed:t,Index:n,matrix:r,range:i});return t("column",{"...any":function(e){var t=e.length-1,n=e[t];Wi(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0});function Fb(e,t,n){var r=e.filter((function(e){return ka(e)&&!(e.name in t)&&!(e.name in n)}))[0];if(!r)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=r.name,a=Object.create(n),o=e.compile();return function(e){return a[i]=e,o.evaluate(a)}}var Lb=qo("filter",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var i,a;return e[0]&&(i=e[0].compile().evaluate(n)),e[1]&&(a=ka(e[1])||wa(e[1])?e[1].compile().evaluate(n):Fb(e[1],t,n)),r(i,a)}n.rawArgs=!0;var r=t("filter",{"Array, function":Ub,"Matrix, function":function(e,t){return e.create(Ub(e.toArray(),t))},"Array, RegExp":To,"Matrix, RegExp":function(e,t){return e.create(To(e.toArray(),t))}});return n}),{isTransformFunction:!0});function Ub(e,t){var n=mf(t);return Io(e,(function(e,r,i){return 1===n?t(e):2===n?t(e,[r+1]):t(e,[r+1],i)}))}var Vb=qo("forEach",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var i,a;return e[0]&&(i=e[0].compile().evaluate(n)),e[1]&&(a=ka(e[1])||wa(e[1])?e[1].compile().evaluate(n):Fb(e[1],t,n)),r(i,a)}n.rawArgs=!0;var r=t("forEach",{"Array | Matrix, function":function(e,t){var n=mf(t);!function r(i,a){Array.isArray(i)?_o(i,(function(e,t){r(e,a.concat(t+1))})):1===n?t(i):2===n?t(i,a):t(i,a,e)}(e.valueOf(),[])}});return n}),{isTransformFunction:!0}),$b=qo("index",["Index"],(e=>{var{Index:t}=e;return function(){for(var e=[],n=0,r=arguments.length;n0?0:2;else if(i&&!0===i.isSet)i=i.map((function(e){return e-1}));else if(Qi(i)||ea(i))i=i.map((function(e){return e-1}));else if(Wi(i))i--;else if(Ji(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[n]=i}var a=new t;return t.apply(a,e),a}}),{isTransformFunction:!0}),Hb=qo("map",["typed"],(e=>{var{typed:t}=e;function n(e,t,n){var i,a;return e[0]&&(i=e[0].compile().evaluate(n)),e[1]&&(a=ka(e[1])||wa(e[1])?e[1].compile().evaluate(n):Fb(e[1],t,n)),r(i,a)}n.rawArgs=!0;var r=t("map",{"Array, function":function(e,t){return Gb(e,t,e)},"Matrix, function":function(e,t){return e.create(Gb(e.valueOf(),t,e))}});return n}),{isTransformFunction:!0});function Gb(e,t,n){var r=mf(t);return function e(i,a){return Array.isArray(i)?ko(i,(function(t,n){return e(t,a.concat(n+1))})):1===r?t(i):2===r?t(i,a):t(i,a,n)}(e,[])}var Wb=["typed","config","numeric","larger"],Jb=qo("max",Wb,(e=>{var{typed:t,config:n,numeric:r,larger:i}=e,a=Yd({typed:t,config:n,numeric:r,larger:i});return t("max",{"...any":function(e){if(2===e.length&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return a.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),Zb=["typed","add","divide"],Kb=qo("mean",Zb,(e=>{var{typed:t,add:n,divide:r}=e,i=mv({typed:t,add:n,divide:r});return t("mean",{"...any":function(e){if(2===e.length&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),Yb=["typed","config","numeric","smaller"],Xb=qo("min",Yb,(e=>{var{typed:t,config:n,numeric:r,smaller:i}=e,a=Xd({typed:t,config:n,numeric:r,smaller:i});return t("min",{"...any":function(e){if(2===e.length&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return a.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),Qb=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],ew=qo("range",Qb,(e=>{var{typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u}=e,c=zf({typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),c.apply(null,e)}})}),{isTransformFunction:!0}),tw=["typed","Index","matrix","range"],nw=qo("row",tw,(e=>{var{typed:t,Index:n,matrix:r,range:i}=e,a=Wf({typed:t,Index:n,matrix:r,range:i});return t("row",{"...any":function(e){var t=e.length-1,n=e[t];Wi(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),rw=["typed","matrix"],iw=qo("subset",rw,(e=>{var{typed:t,matrix:n}=e,r=oh({typed:t,matrix:n});return t("subset",{"...any":function(e){try{return r.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),aw=["typed","matrix","isInteger"],ow=qo("concat",aw,(e=>{var{typed:t,matrix:n,isInteger:r}=e,i=of({typed:t,matrix:n,isInteger:r});return t("concat",{"...any":function(e){var t=e.length-1,n=e[t];Wi(n)?e[t]=n-1:Ji(n)&&(e[t]=n.minus(1));try{return i.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),sw="diff",uw=["typed","matrix","subtract","number","bignumber"],cw=qo(sw,uw,(e=>{var{typed:t,matrix:n,subtract:r,number:i,bignumber:a}=e,o=Tf({typed:t,matrix:n,subtract:r,number:i,bignumber:a});return t(sw,{"...any":function(e){if(2===e.length&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return o.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),lw=["typed","sqrt","variance"],pw=qo("std",lw,(e=>{var{typed:t,sqrt:n,variance:r}=e,i=Mv({typed:t,sqrt:n,variance:r});return t("std",{"...any":function(e){if(e.length>=2&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),fw=["typed","config","add","numeric"],hw=qo("sum",fw,(e=>{var{typed:t,config:n,add:r,numeric:i}=e,a=hv({typed:t,config:n,add:r,numeric:i});return t("sum",{"...any":function(e){if(2===e.length&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return a.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),dw="variance",mw=["typed","add","subtract","multiply","divide","apply","isNaN"],yw=qo(dw,mw,(e=>{var{typed:t,add:n,subtract:r,multiply:i,divide:a,apply:o,isNaN:s}=e,u=wv({typed:t,add:n,subtract:r,multiply:i,divide:a,apply:o,isNaN:s});return t(dw,{"...any":function(e){if(e.length>=2&&ta(e[0])){var t=e[1];Wi(t)?e[1]=t-1:Ji(t)&&(e[1]=t.minus(1))}try{return u.apply(null,e)}catch(e){throw qy(e)}}})}),{isTransformFunction:!0}),gw=Go({}),vw=Ou({}),xw=ku({}),bw=Mx({}),ww=Ex({}),Nw=Nx({}),Mw=Eu({config:qa}),Ew=_u({}),Sw=wx({}),Ow=qx({Complex:vw}),Aw=Tx({BigNumber:Mw,config:qa}),Cw=Dx({BigNumber:Mw,config:qa}),kw=Ox({BigNumber:Mw,config:qa}),_w=Ax({BigNumber:Mw,config:qa}),Iw=Bx({BigNumber:Mw,config:qa}),Tw=Cx({BigNumber:Mw,config:qa}),Pw=db({BigNumber:Mw,config:qa}),Dw=ab({BigNumber:Mw,config:qa}),Bw=Eb({BigNumber:Mw,config:qa}),jw=hb({BigNumber:Mw,config:qa}),qw=Cu({}),zw=kx({BigNumber:Mw,config:qa}),Rw=Sx({BigNumber:Mw,config:qa}),Fw=Px({BigNumber:Mw,config:qa}),Lw=zx({}),Uw=Iu({Matrix:Ew}),Vw=_x({BigNumber:Mw,config:qa}),$w=Fo({BigNumber:Mw,Complex:vw,DenseMatrix:Uw,Fraction:qw}),Hw=Lu({typed:$w}),Gw=il({typed:$w}),Ww=ul({typed:$w}),Jw=fl({typed:$w}),Zw=gl({config:qa,typed:$w}),Kw=xl({typed:$w}),Yw=Ml({typed:$w}),Xw=Sl({Complex:vw,typed:$w}),Qw=_l({typed:$w}),eN=Dl({BigNumber:Mw,config:qa,typed:$w}),tN=ql({isInteger:Hw,typed:$w}),nN=Wl({typed:$w}),rN=Kl({Complex:vw,typed:$w}),iN=up({Complex:vw,config:qa,typed:$w}),aN=mp({typed:$w}),oN=wp({BigNumber:Mw,Fraction:qw,complex:Xw,typed:$w}),sN=Ep({typed:$w}),uN=$p({typed:$w}),cN=Kp({typed:$w}),lN=Qp({typed:$w}),pN=tf({typed:$w}),fN=yf({typed:$w}),hN=wf({typed:$w}),dN=kf({typed:$w}),mN=yh({typed:$w}),yN=Ch({typed:$w}),gN=Ph({typed:$w}),vN=jh({typed:$w}),xN=Fh({typed:$w}),bN=bm({Complex:vw,config:qa,typed:$w}),wN=Em({BigNumber:Mw,typed:$w}),NN=Cm({BigNumber:Mw,Complex:vw,config:qa,typed:$w}),MN=Tm({BigNumber:Mw,Complex:vw,config:qa,typed:$w}),EN=jm({Complex:vw,config:qa,typed:$w}),SN=zm({typed:$w}),ON=Um({Complex:vw,config:qa,typed:$w}),AN=Hm({typed:$w}),CN=Jm({BigNumber:Mw,typed:$w}),kN=Ym({BigNumber:Mw,typed:$w}),_N=ey({BigNumber:Mw,typed:$w}),IN=ry({typed:$w}),TN=ay({typed:$w}),PN=Sv({typed:$w}),DN=Xv({config:qa,typed:$w}),BN=rx({config:qa,typed:$w}),jN=Ix({BigNumber:Mw,config:qa}),qN=Pu({typed:$w}),zN=ol({isNumeric:Gw,typed:$w}),RN=dl({typed:$w}),FN=wl({typed:$w}),LN=Ol({Fraction:qw,typed:$w}),UN=Tl({typed:$w}),VN=Fl({typed:$w}),$N=Jl({typed:$w}),HN=lp({Complex:vw,config:qa,typed:$w}),GN=Np({Complex:vw,config:qa,typed:$w}),WN=Xp({typed:$w}),JN=Ef({typed:$w}),ZN=Mh({isNaN:Jw,isNumeric:Gw,typed:$w}),KN=Th({typed:$w}),YN=Nm({Complex:vw,config:qa,typed:$w}),XN=_m({BigNumber:Mw,typed:$w}),QN=qm({typed:$w}),eM=Vm({typed:$w}),tM=Zm({BigNumber:Mw,typed:$w}),nM=ty({typed:$w}),rM=Cv({typed:$w}),iM=tx({config:qa,typed:$w}),aM=jx({BigNumber:Mw,config:qa}),oM=nl({typed:$w}),sM=vl({Matrix:Ew,equalScalar:Zw,typed:$w}),uM=Cl({DenseMatrix:Uw,Matrix:Ew,SparseMatrix:sM,typed:$w}),cM=Ul({BigNumber:Mw,Complex:vw,Fraction:qw,config:qa,isNegative:oM,matrix:uM,typed:$w,unaryMinus:UN}),lM=rp({BigNumber:Mw,DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w}),pM=dp({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w}),fM=xp({BigNumber:Mw,equalScalar:Zw,matrix:uM,typed:$w}),hM=kp({BigNumber:Mw,config:qa,matrix:uM,typed:$w}),dM=Up({equalScalar:Zw,matrix:uM,typed:$w}),mM=Zp({DenseMatrix:Uw,matrix:uM,typed:$w}),yM=nf({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w}),gM=of({isInteger:Hw,matrix:uM,typed:$w}),vM=hf({DenseMatrix:Uw,SparseMatrix:sM,matrix:uM,typed:$w}),xM=Of({BigNumber:Mw,DenseMatrix:Uw,SparseMatrix:sM,config:qa,matrix:uM,typed:$w}),bM=Pf({BigNumber:Mw,config:qa,matrix:uM,typed:$w}),wM=Ff({isInteger:Hw,matrix:uM,typed:$w}),NM=Zf({matrix:uM,config:qa,typed:$w}),MM=oh({matrix:uM,typed:$w}),EM=mh({BigNumber:Mw,config:qa,matrix:uM,typed:$w}),SM=Dh({typed:$w}),OM=Kh({BigNumber:Mw,DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w,zeros:EM}),AM=vd({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w,zeros:EM}),CM=Nd({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w,zeros:EM}),kM=Sd({BigNumber:Mw,DenseMatrix:Uw,Fraction:qw,config:qa,equalScalar:Zw,matrix:uM,typed:$w}),_M=_d({matrix:uM,typed:$w}),IM=jd({DenseMatrix:Uw,config:qa,matrix:uM,typed:$w}),TM=Fd({DenseMatrix:Uw,config:qa,matrix:uM,typed:$w}),PM=Gd({DenseMatrix:Uw,config:qa,equalScalar:Zw,matrix:uM,typed:$w}),DM=Qd({DenseMatrix:Uw,smaller:IM}),BM=tm({larger:TM,smaller:IM}),jM=ym({SparseMatrix:sM,typed:$w}),qM=Om({BigNumber:Mw,Complex:vw,config:qa,typed:$w}),zM=Fm({BigNumber:Mw,DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w}),RM=Xm({BigNumber:Mw,typed:$w}),FM=Oy({DenseMatrix:Uw,SparseMatrix:sM,addScalar:VN,equalScalar:Zw,matrix:uM,typed:$w}),LM=Iy({addScalar:VN,conj:WN,multiplyScalar:aN,size:NM,typed:$w}),UM=px({addScalar:VN,combinations:PN,isInteger:Hw,isNegative:oM,isPositive:Ww,larger:TM,typed:$w}),VM=ll({typed:$w}),$M=Bl({typed:$w}),HM=Xl({config:qa,equalScalar:Zw,matrix:uM,round:OM,typed:$w}),GM=gp({addScalar:VN,dot:LM,equalScalar:Zw,matrix:uM,multiplyScalar:aN,typed:$w}),WM=Tp({equalScalar:Zw,matrix:uM,multiplyScalar:aN,typed:$w}),JM=ef({typed:$w}),ZM=xf({matrix:uM,typed:$w}),KM=Uf({config:qa,matrix:uM}),YM=Yf({matrix:uM,typed:$w}),XM=zh({matrix:uM,typed:$w}),QM=$h({Complex:vw,config:qa,fraction:LN,identity:xM,matrix:uM,multiply:GM,number:Kw,typed:$w}),eE=id({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,pow:QM,typed:$w}),tE=bd({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w,zeros:EM}),nE=Cd({compare:kM,typed:$w}),rE=Dd({compareText:_M,isZero:VM,typed:$w}),iE=Ud({DenseMatrix:Uw,config:qa,matrix:uM,typed:$w}),aE=Jd({compare:kM,isNaN:Jw,isNumeric:Gw,typed:$w}),oE=em({ImmutableDenseMatrix:DM}),sE=Dm({BigNumber:Mw,Complex:vw,config:qa,typed:$w}),uE=iy({typed:$w}),cE=cy({DenseMatrix:Uw,Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),lE=hy({DenseMatrix:Uw,Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),pE=gy({Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),fE=wy({compareNatural:nE,typed:$w}),hE=Ty({add:FM,matrix:uM,typed:$w}),dE=Nv({add:FM,compare:kM,multiply:GM,partitionSelect:aE,typed:$w}),mE=Iv({BigNumber:Mw,Complex:vw,config:qa,multiplyScalar:aN,pow:QM,typed:$w}),yE=El({BigNumber:Mw,typed:$w}),gE=op({equalScalar:Zw,matrix:uM,typed:$w}),vE=Gp({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w}),xE=Cf({matrix:uM,multiplyScalar:aN,typed:$w}),bE=ph({matrix:uM,typed:$w}),wE=Lh({bignumber:yE,fraction:LN,number:Kw}),NE=Md({equalScalar:Zw,matrix:uM,not:pN,typed:$w,zeros:EM}),ME=zd({DenseMatrix:Uw,config:qa,matrix:uM,typed:$w}),EE=Kd({compare:kM,compareNatural:nE,matrix:uM,typed:$w}),SE=Xd({config:qa,numeric:wE,smaller:IM,typed:$w}),OE=Gm({BigNumber:Mw,typed:$w}),AE=py({DenseMatrix:Uw,Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),CE=xy({Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),kE=Dy({Index:oE,typed:$w}),_E=hv({add:FM,config:qa,numeric:wE,typed:$w}),IE=Pv({gamma:mE,typed:$w}),TE=Rv({factorial:IE,typed:$w}),PE=Hl({config:qa,equalScalar:Zw,matrix:uM,round:OM,typed:$w}),DE=Op({DenseMatrix:Uw,addScalar:VN,equalScalar:Zw,matrix:uM,typed:$w,unaryMinus:UN}),BE=pf({matrix:uM,multiply:GM,subtract:DE,typed:$w}),jE=zf({bignumber:yE,matrix:uM,config:qa,larger:TM,largerEq:iE,smaller:IM,smallerEq:ME,typed:$w}),qE=Wf({Index:oE,matrix:uM,range:jE,typed:$w}),zE=Oh({config:qa,multiplyScalar:aN,numeric:wE,typed:$w}),RE=Td({DenseMatrix:Uw,equalScalar:Zw,matrix:uM,typed:$w}),FE=Yd({config:qa,larger:TM,numeric:wE,typed:$w}),LE=sy({DenseMatrix:Uw,Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),UE=My({Index:oE,concat:gM,setDifference:cE,size:NM,subset:MM,typed:$w}),VE=Yl({Complex:vw,ceil:PE,floor:HM,matrix:uM,typed:$w}),$E=cf({Index:oE,matrix:uM,range:jE,typed:$w}),HE=hh({conj:WN,transpose:bE,typed:$w}),GE=$d({equal:RE,typed:$w}),WE=my({Index:oE,compareNatural:nE,size:NM,subset:MM,typed:$w}),JE=rf({DenseMatrix:Uw,matrix:uM,typed:$w}),ZE=Vh({numeric:wE,typed:$w}),KE=nd({Complex:vw,config:qa,divideScalar:ZE,typed:$w}),YE=cd({DenseMatrix:Uw,divideScalar:ZE,equalScalar:Zw,matrix:uM,multiplyScalar:aN,subtract:DE,typed:$w}),XE=hd({DenseMatrix:Uw,divideScalar:ZE,equalScalar:Zw,matrix:uM,multiplyScalar:aN,subtract:DE,typed:$w}),QE=nm({FibonacciHeap:BM,addScalar:VN,equalScalar:Zw}),eS=Sy({Index:oE,concat:gM,setIntersect:lE,setSymDifference:UE,size:NM,subset:MM,typed:$w}),tS=Sg({DenseMatrix:Uw,Spa:QE,SparseMatrix:sM,abs:$M,addScalar:VN,divideScalar:ZE,equalScalar:Zw,larger:TM,matrix:uM,multiplyScalar:aN,subtract:DE,typed:$w,unaryMinus:UN}),nS=Fg({SparseMatrix:sM,abs:$M,add:FM,divideScalar:ZE,larger:TM,largerEq:iE,multiply:GM,subtract:DE,transpose:bE,typed:$w}),rS=nv({lup:tS,matrix:uM,multiply:GM,subtract:DE,typed:$w,unaryMinus:UN}),iS=pv({abs:$M,addScalar:VN,divideScalar:ZE,multiplyScalar:aN,sqrt:GN,subtract:DE,typed:$w,unaryMinus:UN}),aS=ax({addScalar:VN,combinations:PN,divideScalar:ZE,factorial:IE,isInteger:Hw,isNegative:oM,larger:TM,multiplyScalar:aN,pow:QM,subtract:DE,typed:$w}),oS=cx({addScalar:VN,combinations:PN,divideScalar:ZE,isInteger:Hw,isNegative:oM,multiplyScalar:aN,typed:$w}),sS=Tf({matrix:uM,number:Kw,subtract:DE,typed:$w}),uS=Xh({Complex:vw,config:qa,divideScalar:ZE,typed:$w}),cS=od({DenseMatrix:Uw,divideScalar:ZE,equalScalar:Zw,matrix:uM,typed:$w}),lS=md({DenseMatrix:Uw,divideScalar:ZE,equalScalar:Zw,matrix:uM,multiplyScalar:aN,subtract:DE,typed:$w}),pS=Cy({abs:$M,addScalar:VN,divideScalar:ZE,isPositive:Ww,multiplyScalar:aN,smaller:IM,sqrt:GN,typed:$w}),fS=Ag({addScalar:VN,complex:Xw,conj:WN,divideScalar:ZE,equal:RE,identity:xM,isZero:VM,matrix:uM,multiplyScalar:aN,sign:oN,sqrt:GN,subtract:DE,typed:$w,unaryMinus:UN,zeros:EM}),hS=rv({abs:$M,addScalar:VN,det:rS,divideScalar:ZE,identity:xM,matrix:uM,multiply:GM,typed:$w,unaryMinus:UN}),dS=ov({abs:$M,add:FM,identity:xM,inv:hS,multiply:GM,typed:$w}),mS=cv({divideScalar:ZE,equalScalar:Zw,inv:hS,matrix:uM,multiply:GM,typed:$w}),yS=mv({add:FM,divide:mS,typed:$w}),gS=wv({add:FM,apply:tN,divide:mS,isNaN:Jw,multiply:GM,subtract:DE,typed:$w}),vS=Bv({divide:mS,dotDivide:cS,isNumeric:Gw,log:uS,matrix:uM,multiply:GM,sum:_E,typed:$w}),xS=sx({addScalar:VN,isInteger:Hw,isNegative:oM,stirlingS2:aS,typed:$w}),bS=ed({Complex:vw,config:qa,divideScalar:ZE,log:uS,typed:$w}),wS=fm({BigNumber:Mw,Complex:vw,Fraction:qw,abs:$M,addScalar:VN,config:qa,divideScalar:ZE,equal:RE,fix:VE,format:yN,isNumeric:Gw,multiplyScalar:aN,number:Kw,pow:QM,round:OM,subtract:DE}),NS=vm({Unit:wS,typed:$w}),MS=iv({abs:$M,add:FM,addScalar:VN,atan:SN,bignumber:yE,config:qa,cos:eM,equal:RE,inv:hS,matrix:uM,multiply:GM,multiplyScalar:aN,sin:nM,subtract:DE,typed:$w}),ES=fv({abs:$M,add:FM,addScalar:VN,config:qa,divideScalar:ZE,equalScalar:Zw,matrix:uM,multiply:GM,multiplyScalar:aN,smaller:IM,subtract:DE,typed:$w}),SS=Mv({sqrt:GN,typed:$w,variance:gS}),OS=mb({BigNumber:Mw,Unit:wS,config:qa}),AS=Zx({BigNumber:Mw,Unit:wS,config:qa}),CS=gb({BigNumber:Mw,Unit:wS,config:qa}),kS=Kx({BigNumber:Mw,Unit:wS,config:qa}),_S=ub({BigNumber:Mw,Unit:wS,config:qa}),IS=rb({BigNumber:Mw,Unit:wS,config:qa}),TS=vb({BigNumber:Mw,Unit:wS,config:qa}),PS=xb({BigNumber:Mw,Unit:wS,config:qa}),DS=Lx({BigNumber:Mw,Unit:wS,config:qa}),BS=ob({BigNumber:Mw,Unit:wS,config:qa}),jS=eb({BigNumber:Mw,Unit:wS,config:qa}),qS=$x({BigNumber:Mw,Unit:wS,config:qa}),zS=Cb({BigNumber:Mw,Unit:wS,config:qa}),RS=Nb({BigNumber:Mw,Unit:wS,config:qa}),FS=cb({BigNumber:Mw,Unit:wS,config:qa}),LS=Db({BigNumber:Mw,Unit:wS,config:qa}),US=Ib({BigNumber:Mw,Unit:wS,config:qa}),VS=Bb({BigNumber:Mw,Unit:wS,config:qa}),$S=sb({BigNumber:Mw,Unit:wS,config:qa}),HS=Vx({BigNumber:Mw,Unit:wS,config:qa}),GS=Sb({BigNumber:Mw,Unit:wS,config:qa}),WS=Ob({BigNumber:Mw,Unit:wS,config:qa}),JS=Gx({BigNumber:Mw,Unit:wS,config:qa}),ZS=pd({DenseMatrix:Uw,divideScalar:ZE,equalScalar:Zw,matrix:uM,multiplyScalar:aN,subtract:DE,typed:$w}),KS=_y({abs:$M,add:FM,conj:WN,ctranspose:HE,eigs:MS,equalScalar:Zw,larger:TM,matrix:uM,multiply:GM,pow:QM,smaller:IM,sqrt:GN,typed:$w}),YS=$g({DenseMatrix:Uw,lsolve:YE,lup:tS,matrix:uM,slu:nS,typed:$w,usolve:ZS}),XS=uv({abs:$M,add:FM,identity:xM,inv:hS,max:FE,multiply:GM,size:NM,sqrt:GN,subtract:DE,typed:$w}),QS=qv({add:FM,divide:mS,factorial:IE,isInteger:Hw,isPositive:Ww,multiply:GM,typed:$w}),eO=yb({BigNumber:Mw,Unit:wS,config:qa}),tO=nb({BigNumber:Mw,Unit:wS,config:qa}),nO=Hx({BigNumber:Mw,Unit:wS,config:qa}),rO=ib({BigNumber:Mw,Unit:wS,config:qa}),iO=_b({BigNumber:Mw,Unit:wS,config:qa}),aO=bb({BigNumber:Mw,Unit:wS,config:qa}),oO=kb({BigNumber:Mw,Unit:wS,config:qa}),sO=Qx({BigNumber:Mw,Unit:wS,config:qa}),uO=Tb({BigNumber:Mw,Unit:wS,config:qa}),cO=lb({BigNumber:Mw,Unit:wS,config:qa}),lO=Fx({BigNumber:Mw,Unit:wS,config:qa}),pO=Ab({BigNumber:Mw,Unit:wS,config:qa}),fO=Gf({BigNumber:Mw,DenseMatrix:Uw,SparseMatrix:sM,addScalar:VN,config:qa,cos:eM,matrix:uM,multiplyScalar:aN,norm:KS,sin:nM,typed:$w,unaryMinus:UN}),hO=gv({add:FM,compare:kM,divide:mS,partitionSelect:aE,typed:$w}),dO=tb({BigNumber:Mw,Unit:wS,config:qa}),mO=Jx({BigNumber:Mw,Unit:wS,config:qa}),yO=Yx({BigNumber:Mw,Unit:wS,config:qa}),gO=Mb({BigNumber:Mw,Unit:wS,config:qa}),vO=Pb({BigNumber:Mw,Unit:wS,config:qa}),xO=fb({BigNumber:Mw,Unit:wS,config:qa}),bO=$f({multiply:GM,rotationMatrix:fO,typed:$w}),wO=vv({abs:$M,map:dN,median:hO,subtract:DE,typed:$w}),NO=Wx({BigNumber:Mw,Unit:wS,config:qa}),MO=Xx({BigNumber:Mw,Unit:wS,config:qa}),EO=pb({BigNumber:Mw,Unit:wS,config:qa}),SO=dm({Unit:wS,typed:$w}),OO=wb({BigNumber:Mw,Unit:wS,config:qa}),AO=Ux({BigNumber:Mw,Unit:wS,config:qa});function CO(){return(CO=Object.assign||function(e){for(var t=1;t analysis.start){\n ").concat(this.makeError({type:"amount",actual:"analysis.start",messages:{amount:"The provided start "+V.staggerPreface+" value is smaller than the minimum accepted value ("+r.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"max"),"){\n if(").concat(r.max," < analysis.start){\n ").concat(this.makeError({type:"amount",actual:"analysis.start",messages:{amount:"The provided start "+V.staggerPreface+" value is bigger than the maximum accepted value ("+r.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"integer"),"){\n if(!analysis.start.match(").concat(uA,")){\n ").concat(this.makeError({type:"amount",actual:"analysis.start",messages:{amount:"The provided start "+V.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(!isNumeric(analysis.end)){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+V.staggerPreface+" value is invalid"}}),";\n return;\n } else {\n endNumberPart = analysis.end*1;\n if(").concat(Object.prototype.hasOwnProperty.call(r,"min"),"){\n if(").concat(r.min," > analysis.end){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+V.staggerPreface+" value is smaller than the minimum accepted value ("+r.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"max"),"){\n if(").concat(r.max," < analysis.end){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+V.staggerPreface+" value is bigger than the maximum accepted value ("+r.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"integer"),"){\n if(!analysis.end.match(").concat(uA,")){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+V.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(analysis.startFraction < 0 || analysis.startFraction > 1){\n ").concat(this.makeError({type:"amount",actual:"analysis.startFraction",messages:{amount:"The "+V.staggerPreface+" fraction must be a number >=0 and <=1"}}),";\n return;\n }\n\n if(easingKeys.indexOf(analysis.easing) < 0){\n ").concat(this.makeError({type:"amount",actual:"analysis.startFraction",messages:{amount:"The provided "+V.staggerPreface+" easing is not recognised by the system"}}),";\n return;\n }\n\n if(analysis.mode !== 'linear' && analysis.mode !== 'omni'){\n ").concat(this.makeError({type:"amount",actual:"analysis.mode",messages:{amount:V.staggerPreface+" mode can only be either linear or omni"}}),";\n return;\n }\n\n if(analysis.reverse !== true && analysis.reverse !== false){\n ").concat(this.makeError({type:"amount",actual:"analysis.reverse",messages:{amount:V.staggerPreface+" reverse needs to be either true or false"}}),";\n return;\n }\n\n return value;\n }\n } else if(value.trim().startsWith('").concat(V.attibuteValue,"')){\n if(!attributeRegexp.test(value)){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+V.attibuteValue+" expression is invalid"}}),";\n return;\n }\n\n return value;\n } else if(value.trim().startsWith('").concat(V.mathExpPreface,"')){\n const validity = validateExpression(value);\n if(validity.result === false){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+V.expressionPreface+" expression is invalid"}}),';\n return;\n } else {\n if(validity.unit !== ""){\n ').concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+V.expressionPreface+" expression includes units"}}),";\n return;\n }\n\n return value;\n }\n }\n }\n\n\n if(typeof value !== 'number'){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"Type measurement accepts only numbers"}}),";\n return;\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"max"),"){\n if(").concat(r.max," < value){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided amount is bigger than the maximum accepted value"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"min"),"){\n if(").concat(r.min," > value){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided amount is lower than the minimum accepted value"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"integer"),"){\n if(value !== parseInt(value, 10)){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided amount is not an integer"}}),";\n return;\n }\n }\n return value;\n\n ")}})),cA.add("measurement",(function(e,t,n){var r=e.schema,i=e.messages,a=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)("+r.units.join("|")+")$","gi"),o=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)","gi");return{source:"\n let startUnits, endUnits, startNumberPart, endNumberPart;\n const staggerValidation = ".concat(Hi,";\n const staggerAnalyser = ").concat(Ui,';\n const easingKeys = "').concat(Object.keys(Br).join(","),"\".split(',');\n const validateExpression = ").concat(aA,";\n const validUnits = ['").concat(r.units.join("','"),"'];\n const attributeRegexp = /^").concat(V.attibuteValue,"\\([_A-z0-9-]*\\)$/;\n\n if(typeof value !== 'string' && !(value instanceof String)){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:i}),"\n return ;\n }\n\n if(value.trim().startsWith('").concat(V.attibuteValue,"')){\n if(!attributeRegexp.test(value)){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+V.attibuteValue+" expression is invalid"}}),";\n return;\n }\n\n return value;\n } else if(value.trim().startsWith('").concat(V.staggerPreface,"')){\n const staggerValid = staggerValidation(value);\n if(staggerValid === false){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:{measurement:"The "+V.staggerPreface+" expression is invalid"}}),";\n return;\n } else {\n const analysis = staggerAnalyser(value, false);\n if(!analysis.start.match(").concat(a,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+V.staggerPreface+" value is invalid"}}),";\n return;\n } else {\n var numberPart = analysis.start.match(").concat(o,")[0];\n startNumberPart = numberPart;\n startUnits = analysis.start.toString().substring(numberPart.length);\n if(").concat(Object.prototype.hasOwnProperty.call(r,"min"),"){\n if(").concat(r.min," > numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+V.staggerPreface+" value is smaller than the minimum accepted value ("+r.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"max"),"){\n if(").concat(r.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+V.staggerPreface+" value is bigger than the maximum accepted value ("+r.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"integer"),"){\n if(!numberPart.match(").concat(uA,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+V.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(!analysis.end.match(").concat(a,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+V.staggerPreface+" value is invalid"}}),";\n return;\n } else {\n var numberPart = analysis.end.match(").concat(o,")[0];\n endNumberPart = numberPart;\n endUnits = analysis.end.toString().substring(numberPart.length);\n if(").concat(Object.prototype.hasOwnProperty.call(r,"min"),"){\n if(").concat(r.min," > numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+V.staggerPreface+" value is smaller than the minimum accepted value ("+r.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"max"),"){\n if(").concat(r.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+V.staggerPreface+" value is bigger than the maximum accepted value ("+r.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"integer"),"){\n if(!numberPart.match(").concat(uA,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+V.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(startUnits !== endUnits){\n ").concat(this.makeError({type:"measurement",actual:"analysis.startFraction",messages:{measurement:"The "+V.staggerPreface+" start and end must always have the same units"}}),";\n return;\n }\n\n if(analysis.startFraction < 0 || analysis.startFraction > 1){\n ").concat(this.makeError({type:"measurement",actual:"analysis.startFraction",messages:{measurement:"The "+V.staggerPreface+" fraction must be a number >=0 and <=1"}}),";\n return;\n }\n\n if(easingKeys.indexOf(analysis.easing) < 0){\n ").concat(this.makeError({type:"measurement",actual:"analysis.startFraction",messages:{measurement:"The provided "+V.staggerPreface+" easing is not recognised by the system"}}),";\n return;\n }\n\n if(analysis.mode !== 'linear' && analysis.mode !== 'omni'){\n ").concat(this.makeError({type:"measurement",actual:"analysis.mode",messages:{measurement:V.staggerPreface+" mode can only be either linear or omni"}}),";\n return;\n }\n\n if(analysis.reverse !== true && analysis.reverse !== false){\n ").concat(this.makeError({type:"measurement",actual:"analysis.reverse",messages:{measurement:V.staggerPreface+" reverse needs to be either true or false"}}),";\n return;\n }\n\n return value;\n }\n } else if(value.trim().startsWith('").concat(V.mathExpPreface,"')){\n const validity = validateExpression(value);\n if(validity.result === false){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:{measurement:"The "+V.expressionPreface+" expression is invalid"}}),";\n return;\n } else {\n if(validUnits.indexOf(validity.unit) < 0){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:{measurement:"The "+V.expressionPreface+" expression has non-supported units"}}),";\n return;\n }\n\n return value;\n }\n }\n\n\n if(!value.match(").concat(a,")){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:i}),"\n } else {\n var numberPart = value.match(").concat(o,")[0];\n if(").concat(Object.prototype.hasOwnProperty.call(r,"min"),"){\n if(").concat(r.min," > numberPart){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:i}),"\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"max"),"){\n if(").concat(r.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:i}),"\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(r,"integer"),"){\n if(!numberPart.match(").concat(uA,")){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:i}),"\n }\n }\n }\n return value;\n ")}})),cA.add("html",(function(e,t,n){e.schema;var r=e.messages;return{source:"\n if(value === null){\n ".concat(this.makeError({type:"html",actual:"value",messages:r}),"\n } else {\n return value;\n }\n ")}})),cA.add("css",(function(e,t,n){e.schema;var r=e.messages;return{source:"\n if(value === null){\n ".concat(this.makeError({type:"css",actual:"value",messages:r}),"\n } else {\n return value;\n }\n ")}})),cA.add("color",(function(e,t,n){e.schema;var r=e.messages;return{source:"\n if(typeof value !== 'string' && !(value instanceof String)){\n ".concat(this.makeError({type:"measurement",actual:"value",messages:r}),"\n return ;\n }\n if(!value.match(").concat(sA,') && [\n "aliceblue",\n "antiquewhite",\n "aqua",\n "aquamarine",\n "azure",\n "beige",\n "bisque",\n "black",\n "blanchedalmond",\n "blue",\n "blueviolet",\n "brown",\n "burlywood",\n "cadetblue",\n "chartreuse",\n "chocolate",\n "coral",\n "cornflowerblue",\n "cornsilk",\n "crimson",\n "cyan",\n "darkblue",\n "darkcyan",\n "darkgoldenrod",\n "darkgray",\n "darkgrey",\n "darkgreen",\n "darkkhaki",\n "darkmagenta",\n "darkolivegreen",\n "darkorange",\n "darkorchid",\n "darkred",\n "darksalmon",\n "darkseagreen",\n "darkslateblue",\n "darkslategray",\n "darkslategrey",\n "darkturquoise",\n "darkviolet",\n "deeppink",\n "deepskyblue",\n "dimgray",\n "dimgrey",\n "dodgerblue",\n "firebrick",\n "floralwhite",\n "forestgreen",\n "fuchsia",\n "gainsboro",\n "ghostwhite",\n "gold",\n "goldenrod",\n "gray",\n "grey",\n "green",\n "greenyellow",\n "honeydew",\n "hotpink",\n "indianred",\n "indigo",\n "ivory",\n "khaki",\n "lavender",\n "lavenderblush",\n "lawngreen",\n "lemonchiffon",\n "lightblue",\n "lightcoral",\n "lightcyan",\n "lightgoldenrodyellow",\n "lightgray",\n "lightgrey",\n "lightgreen",\n "lightpink",\n "lightsalmon",\n "lightseagreen",\n "lightskyblue",\n "lightslategray",\n "lightslategrey",\n "lightsteelblue",\n "lightyellow",\n "lime",\n "limegreen",\n "linen",\n "magenta",\n "maroon",\n "mediumaquamarine",\n "mediumblue",\n "mediumorchid",\n "mediumpurple",\n "mediumseagreen",\n "mediumslateblue",\n "mediumspringgreen",\n "mediumturquoise",\n "mediumvioletred",\n "midnightblue",\n "mintcream",\n "mistyrose",\n "moccasin",\n "navajowhite",\n "navy",\n "oldlace",\n "olive",\n "olivedrab",\n "orange",\n "orangered",\n "orchid",\n "palegoldenrod",\n "palegreen",\n "paleturquoise",\n "palevioletred",\n "papayawhip",\n "peachpuff",\n "peru",\n "pink",\n "plum",\n "powderblue",\n "purple",\n "rebeccapurple",\n "red",\n "rosybrown",\n "royalblue",\n "saddlebrown",\n "salmon",\n "sandybrown",\n "seagreen",\n "seashell",\n "sienna",\n "silver",\n "skyblue",\n "slateblue",\n "slategray",\n "slategrey",\n "snow",\n "springgreen",\n "steelblue",\n "tan",\n "teal",\n "thistle",\n "tomato",\n "turquoise",\n "violet",\n "wheat",\n "white",\n "whitesmoke",\n "yellow",\n "yellowgreen",\n ].indexOf(value.toLowerCase()) < 0){\n ').concat(this.makeError({type:"color",actual:"value",messages:r}),"\n }\n return value;\n ")}}));var lA=["cm","mm","in","px","pt","pc","em","ex","ch","rem","vw","vh","vmin","vmax","%"],pA=[{type:"string",optional:!0,default:"linear",enum:["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce"]},{type:"array",optional:!0,length:4,items:{type:"number"}}],fA={type:"string",empty:!1,trim:!0,optional:!0},hA={type:"string",empty:!1,trim:!0,optional:!0},dA={type:"string",empty:!1,optional:!1},mA={type:"amount",optional:!1,integer:!0,min:0},yA={type:"html",optional:!0},gA={type:"css",optional:!0},vA={type:"array",optional:!0,items:{type:"object",props:{type:"string",src:"string"}}},xA={type:"array",items:{type:"object",strict:!0,props:{src:"string",id:"string",mcid:{type:"string",optional:!0},classes:{type:"array",optional:!0,items:"string"},base64:{type:"boolean",optional:!0},startValues:{optional:!0,type:"object",props:{gain:{optional:!0,type:"number"},pan:{optional:!0,type:"number"}}}}},optional:!0},bA=cA.compile({id:fA,name:hA,selector:f(f({},dA),{},{optional:!0}),easing:pA,duration:mA,startFrom:{type:"amount",integer:!0,min:0,optional:!0},repeats:{type:"amount",integer:!0,min:1,optional:!0},hiatus:{type:"amount",integer:!0,min:0,optional:!0},delay:{type:"amount",integer:!0,min:0,optional:!0}}),wA={type:"object",optional:!0,props:{width:{type:"measurement",units:lA,optional:!0},height:{type:"measurement",units:lA,optional:!0}}},NA={type:"string",enum:["on","off"],optional:!0},MA=cA.compile({props:[{type:"object",strict:!0,props:{id:fA,name:hA,selector:f(f({},dA),{},{optional:!0}),easing:pA,html:yA,css:gA,audioSources:xA,audio:NA,containerParams:wA,fonts:vA,initParams:{type:"object",optional:!0}}},{type:"object",strict:!0,props:{id:fA,name:hA,host:{type:"any",optional:!1},html:yA,css:gA,audioSources:xA,audio:NA,containerParams:wA,fonts:vA,initParams:{type:"object",optional:!0}}},{type:"object",strict:!0,props:{root:{type:"boolean",optional:!0},name:hA,id:fA,audioSources:xA,audio:f(f({},NA),{},{enum:["on"]})}}]}),EA=cA.compile({selector:f(f({},dA),{},{optional:!0,strict:!0}),name:hA}),SA=cA.compile({selector:f(f({},dA),{},{strict:!0,optional:!0}),name:hA,repeats:{type:"amount",integer:!0,min:1,optional:!0},hiatus:{type:"amount",integer:!0,min:0,optional:!0},delay:{type:"amount",integer:!0,min:0,optional:!0}}),OA=(cA.compile({selector:dA,duration:mA}),"mc.descriptive.decisionAuthority");function AA(e){e.descriptor.value=function(e){if(null!==this.constructor.attrsValidationRules){var t=this.constructor.attrsValidationMethod(e);if(t.length>0)return{result:!1,errors:t}}return!0===this.putMessageOnPipe("checkForClip",{},OA,{selfExecute:!0,direction:ce}).response?this.manageEditAttrProps(e,"attrs"):(this.attrs=e,{result:!0})}}function CA(e){e.descriptor.value=function(e){var t=ae.validateProps(e,this.constructor.propsValidationRules,this.constructor);return t.result?!0===this.putMessageOnPipe("checkForClip",{},OA,{selfExecute:!0,direction:ce}).response?this.manageEditAttrProps(e,"props"):(this.props=e,{result:!0}):t}}function kA(e){e.descriptor.value=function(){return null!==this.props.host&&void 0!==this.props.host?[this.props.host]:this.hasParent&&this.putMessageOnPipe("checkForClip",{},OA,{selfExecute:!0,direction:ce}).response?this.putMessageOnPipe("getElements",{selector:this.selector()},OA,{selfExecute:!1,direction:ce}).response:[]}}function _A(e){e.descriptor.value=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{check:!0};if("dynamic"===this.duration)return{result:!1,reason:"Incidents with dynamic duration can't be resized. Once the Incident enters a Clip it'll become resizable"};if(e===this.duration)return{result:!0,meta:{unprocessed:!0}};if(e<=0)return{result:!1,reason:"Size must always be > 0"};if(t.check&&this.hasParent){var n=this.putMessageOnPipe("checkResize",{id:this.id,newSize:e,fraction:e/this.duration},OA,{selfExecute:!1,direction:ce});if(!n.response.result)return n.response}return this.setNewDuration(e),{result:!0}}}function IA(e){var t=new e.Class(e.attrs,e.props);if(!1===t.result)return t;if(Object.prototype.hasOwnProperty.call(e,"incidents"))for(var n in e.incidents){var r=e.incidents[n],i=IA(r.leaf);if(!1===i.result)return i;var a=t.addIncident(i,r.position);if(!1===a.result)return a}return t}function TA(e){e.descriptor.value=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.exportLiveDefinition();for(var r in e)Vr(r,e[r],!0,"attrs",n);for(var i in t)Vr(i,t[i],!0,"props",n);return IA(n)}}function PA(e){e.descriptor.value=function(){return null===this.inheritedSelector?Object.prototype.hasOwnProperty.call(this.props,"selector")?this.props.selector:null:Object.prototype.hasOwnProperty.call(this.props,"selector")?"&"===this.props.selector.charAt(0)?this.inheritedSelector+this.props.selector.substring(1):"".concat(this.inheritedSelector," ").concat(this.props.selector):this.inheritedSelector}}var DA=function(){function e(t){s(this,e),this.expressionProps=t}return c(e,[{key:"calculateValues",value:function(e){for(var t,n=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:"";if(null==n)return[];for(var i=0,a=Object.entries(n);i0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,r),null===a?(t=n.call(this,i),e(y(t)),t.attrs={},t.props=i):(t=n.call(this,a),e(y(t)),t.attrs=i,t.props=a);var o=ae.validateProps(t.props,EA,t.constructor);return o.result?(t._inheritedSelector=null,t.attributesStaggers=[],t.propsStaggers=[],t.setupDynamicValues(),t.passiveAddition=!0,t._buildTree(),t.passiveAddition=!1,g(t)):g(t,o)}return r}(t);return{F:n,d:[{kind:"field",static:!0,key:"Incident",value:function(){return be}},{kind:"field",static:!0,key:"plugin_npm_name",value:function(){return"motor-cortex-js"}},{kind:"field",static:!0,key:"version",value:function(){return FA}},{kind:"field",static:!0,key:"Channel",value:function(){return se}},{kind:"field",static:!0,key:"ClassName",value:function(){return"Group"}},{kind:"field",static:!0,key:"isGroup",value:function(){return!0}},{kind:"field",static:!0,key:"attrsValidationRules",value:function(){return null}},{kind:"field",static:!0,key:"propsValidationRules",value:function(){return EA}},{kind:"method",decorators:[AA],key:"editAttributes",value:function(){}},{kind:"method",decorators:[CA],key:"editProperties",value:function(){}},{kind:"method",decorators:[_A],key:"resize",value:function(){}},{kind:"method",decorators:[TA],key:"clone",value:function(){}},{kind:"method",decorators:[PA],key:"selector",value:function(){}},{kind:"method",decorators:[kA],key:"getElements",value:function(){}},{kind:"method",decorators:[RA],key:"setupDynamicValues",value:function(){}},{kind:"method",key:"_buildTree",value:function(){this.buildTree()}},{kind:"method",key:"_calculateDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;for(var n in this.children){var r=this.children[n];if(!0===e&&!0===r.leaf.constructor.isGroup&&r.leaf._calculateDuration(!0),"dynamic"===r.leaf.duration){t="dynamic";break}r.position+r.leaf.duration>t&&(t=r.position+r.leaf.duration)}return t!==this.calculatedDuration&&(this.props&&Object.prototype.hasOwnProperty.call(this.props,"duration")&&(this.props.duration=t),this.calculatedDuration=t,!0)}},{kind:"method",key:"_rebuildTree",value:function(){for(var e in this.children){var t=this.children[e];!0===t.leaf.passive&&this.removeIncident(t.id)}this.passiveAddition=!0,this.buildTree(),this.passiveAddition=!1}},{kind:"method",key:"buildTree",value:function(){}},{kind:"method",key:"manageEditAttrProps",value:function(e,t){var n=this.parentNode,r=n.getLeafPosition(this.id),i=JSON.parse(JSON.stringify(this[t]));this[t]=e,n.removeIncident(this.id),this._rebuildTree();var a=n.addIncident(this,r);return a.result||(this[t]=i,this._rebuildTree(),n.addIncident(this,r)),a}},{kind:"method",key:"detachFromParent",value:function(){b(d(n.prototype),"detachFromParent",this).call(this),this.inheritedSelector=null}},{kind:"get",key:"inheritedSelector",value:function(){return this._inheritedSelector}},{kind:"set",key:"inheritedSelector",value:function(e){for(var t in this._inheritedSelector=e,this.children){this.children[t].leaf.inheritedSelector=this.selector()}}},{kind:"get",key:"selectorToPassToChildren",value:function(){return this.selector()}},{kind:"method",key:"exportDefinition",value:function(){var e={ClassName:this.constructor.ClassName,version:this.constructor.version,plugin:this.constructor.plugin||this.constructor.plugin_npm_name,plugin_npm_name:this.constructor.plugin_npm_name,attrs:this.attrs,props:this.props,incidents:{},duration:this.duration};for(var t in this.children){var n=this.children[t];!0!==n.leaf.passive&&(e.incidents[t]={id:n.id,position:n.position,leaf:n.leaf.exportDefinition()})}return e}},{kind:"method",key:"exportLiveDefinition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=JSON.parse(JSON.stringify(this.props));!1===e&&delete t.id;var n={Class:this.constructor,attrs:JSON.parse(JSON.stringify(this.attrs)),props:t,incidents:{}};for(var r in this.children){var i=this.children[r];!0!==i.leaf.passive&&(n.incidents[r]={position:i.position,leaf:i.leaf.exportLiveDefinition(e)})}return n}},{kind:"method",key:"addIncident",value:function(e,t){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{check:!0};if(e.inheritedSelector=this.selectorToPassToChildren,!0===i.check){var a=b(d(n.prototype),"checkAddition",this).call(this,e,t);if(!a.result)return e.inheritedSelector=null,a;if(!0===(r=this.putMessageOnPipe("checkForClip",{},OA,{selfExecute:!0,direction:ce})).response){var o=e.putMessageOnPipe("checkForInvalidSelectors",{},null,{selfExecute:!0,direction:le});if(o.length>0){for(var s=[],u=0;u2&&void 0!==arguments[2]?arguments[2]:window,r=(e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:L)+"."+e).split("."),i=0;i2&&void 0!==arguments[2]?arguments[2]:0,r=t;!1===Array.isArray(t)&&(r=t.split("."));var i=this.getItem(e,r.slice(0,2+n));return(""===i.props.selector||void 0===i.props.selector||null===i.props.selector)&&("props"===r[2]||(!this.isCombo(i)||this.refersToOwnSelector(e,r,n+3)))},cascadeSelectors:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=[],i=0;i2&&void 0!==arguments[2]&&arguments[2];if(r&&"off"===e.audio||!r&&"only"===e.audio)return null;if(Object.prototype.hasOwnProperty.call(e.props,"selector")&&(!r&&"~"===e.props.selector.charAt(0)||r&&"~"!==e.props.selector.charAt(0)&&!e.constructor.isClip))return null;if(e.constructor.isClip){if(!Object.prototype.hasOwnProperty.call(e.props,"selector")||r)return r?e.audioClip:e.realClip;(n=new Ur(e,t)).plugin_channel_class=se}else if(e.constructor.isCombo)n=new $A(e,t);else if(e.constructor.isGroup)for(var i in n=Dr({id:e.id,attrs:e.attrs,props:e.props,Incident:e.constructor.Incident,plugin_npm_name:e.constructor.plugin_npm_name,Channel:e.constructor.Channel,DescriptiveIncident:e}),e.children){var a=HA(e.children[i].leaf,t);null!==a&&n.addChild(a,e.children[i].position)}else n=new Lr(e,t);return n}var GA="@kissmybutton/self-contained-incidents",WA=function(e){h(n,e);var t=v(n);function n(e,r){var i;return s(this,n),(i=t.call(this,e,r)).attrs=e,i.props=r,i.isTheClip=!0,i.blockingWaitings={},i.instantiatedChannels={},i.isHostedClip=!0,i.instantiatedCopiesContexts={},i.instantiatedCopiesUnblockingMethods=[],i.onClipInitialise(),i.runTimeInfo=i.props.runTimeInfo,i.durationSubs=[],i.audioClip=!1,i}return c(n,[{key:"onClipInitialise",value:function(){}},{key:"contextLoading",value:function(){this.context.contextLoaded=!1}},{key:"contextLoaded",value:function(){for(var e in this.context.contextLoaded=!0,this.putMessageOnPipe("contextLoaded",{},{},{selfExecute:!1,direction:le}),this.instantiatedChannels)this.instantiatedChannels[e].recalcScratchValues();for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"all-or-nothing",n=!0,r=[],i=[];for(var a in e){Object.prototype.hasOwnProperty.call(this.instantiatedChannels,a)||(this.instantiatedChannels[a]=new e[a][0].incident.plugin_channel_class({runTimeInfo:this.runTimeInfo,context:this.context,subscribe:this.props.subscribe}));var o=this.instantiatedChannels[a].addIncidents(e[a],t);n=n&&o.result,o.result?i.push(o.execute):r=r.concat(o.errors)}var s=function(){for(var e=0;e0&&(s=t[0].positionDelta);var u=this.checkResize(e.fraction,n,s);if(u.result){return{result:!0,execute:function(){u.execute();for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0,r=!0,i=[],a=[];for(var o in t){var s=ae.systoleDiastoleProjections(t[o],e,n),u=this.instantiatedChannels[o].checkResizedIncidents(s);r=r&&u.result,u.result?a.push(u.execute):i=i.concat(u.errors)}var c=function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,t={};return t[GA]=[{millisecond:e,incident:this,id:this.id}],t}},{key:"setVolume",value:function(e){this.volume=parseFloat(e)}},{key:"_onGetContextOnce",value:function(e){}},{key:"handleRecalcDuration",value:function(e,t){if(this._calculateDuration())for(var n=0;n3&&void 0!==arguments[3]&&arguments[3];if(!1!==this.contextReady){for(var i in n||(n=this.id),this.instantiatedChannels){var a=this.instantiatedChannels[i];a.moveTo(this.runTimeInfo.currentMillisecond,t,n,r)}this.onAfterProgress(e,t)}else this.setBlock()}},{key:"onAfterProgress",value:function(e,t){}},{key:"flash",value:function(){for(var e in this.instantiatedChannels){this.instantiatedChannels[e].moveTo(0,this.runTimeInfo.currentMillisecond,this.id,!0)}}},{key:"subscribeToDurationChange",value:function(e){this.durationSubs.push(e)}},{key:"handleSetBlockingWaiting",value:function(e,t){}},{key:"handleRemoveBlockingWaiting",value:function(e,t){}},{key:"contextReady",get:function(){return this.context.contextLoaded}},{key:"context",get:function(){return this.ownContext}}]),n}(be),JA=function(){function e(){s(this,e),this.output=$.createGain(),this.gainNode=$.createGain(),$.createStereoPanner&&(this.pannerNode=$.createStereoPanner()),$.createStereoPanner?(this.pannerNode.connect(this.gainNode),this.gainNode.connect(this.output),this.input=this.pannerNode):(this.gainNode.connect(this.output),this.input=this.gainNode)}return c(e,[{key:"connect",value:function(e){this.output.connect(e)}},{key:"disconnect",value:function(){this.output.disconnect()}}]),e}();function ZA(e){for(var t=window.atob(e),n=t.length,r=new Uint8Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;s(this,e),this.totalSources=n.length,this.audioSources={},this.elementsByMCID={};for(var i=function(e){var i=n[e],a={mcid:i.mcid||te(),id:i.id,src:i.src,classes:i.classes||[],base64:i.base64||!1,pubSub:new YA,soundLoaded:!1,startValues:i.startValues||{}};if(t.audioSources[a.id]=a,t.elementsByMCID[a.mcid]=a,i.base64)$.decodeAudioData(ZA(i.src),(function(e){t._setBuffer(a,e,r)}));else{var o=new XMLHttpRequest;o.open("GET",a.src,!0),o.responseType="arraybuffer",t.soundLoaded=!1,o.onload=function(){$.decodeAudioData(o.response,(function(e){t._setBuffer(a,e,r)}),t.onError)},o.send()}},a=0;a=0&&r.push(i);return r}}},{key:"getMCID",value:function(e){return e.mcid}},{key:"setMCID",value:function(e,t){e.mcid=t}},{key:"getElementSelectorByMCID",value:function(e){return'[data-mcid="'.concat(e,'"]')}}]),e}(),QA=function(e){h(n,e);var t=v(n);function n(e,r){var i;s(this,n),(i=t.call(this,e,r)).audioNode=new JA,i.audioNode.connect($.destination);var a=new XA(i.props.audioSources,i.audioNode);return i.ownContext=f(f({},a.context),{},{isHostedClip:!0,contextLoaded:!0}),i.audioClip=!0,i}return c(n,[{key:"onProgress",value:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b(d(n.prototype),"onProgress",this).call(this,e,t,this.id,i)}},{key:"_onGetContextOnce",value:function(e){this.audioNode.disconnect(),this.parentClipContext=e,this.audioNode.connect(e.masterNode.input)}},{key:"lastWish",value:function(){this.audioNode.output.disconnect(),this.audioNode.output.connect($.destination)}},{key:"setVolume",value:function(e){this.audioNode.output.gain.value=e}}]),n}(WA),eC=function(e){h(n,e);var t=v(n);function n(){return s(this,n),t.apply(this,arguments)}return c(n,[{key:"onProgress",value:function(e){var t=this;if(!this.element.soundLoaded)return this.setBlock("loading sound"),this.element.pubSub.sub(this.id,(function(){t.unblock()})),!1;if("gain"===this.attributeKey){var n=(this.targetValue-this.getInitialValue())*e+this.getInitialValue();this.element.effectsAudioNode.gainNode.gain.value=n}else if("pan"===this.attributeKey){var r=(this.targetValue-this.getInitialValue())*e+this.getInitialValue();this.element.effectsAudioNode.pannerNode.pan.value=r}}},{key:"getScratchValue",value:function(){return"pan"===this.attributeKey?Object.prototype.hasOwnProperty.call(this.element.startValues,"pan")?this.element.startValues.pan:0:"gain"===this.attributeKey?Object.prototype.hasOwnProperty.call(this.element.startValues,"gain")?this.element.startValues.gain:1:void 0}}]),n}(Tr),tC="|||",nC=function(e){h(n,e);var t=v(n);function n(e){var r;return s(this,n),(r=t.call(this,e)).playingIncidentsIds=[],r.transitioned=!1,e.subscribe(te(),r._stateChange.bind(y(r)),0,1,!0),r}return c(n,[{key:"_stateChange",value:function(e,t){"paused"!==t&&"idle"!==t&&"blocked"!==t||(this._stopPlayingIncidents(),this.transitioned=!0)}},{key:"_stopPlayingIncidents",value:function(){for(var e=0;e3&&void 0!==arguments[3]&&arguments[3];if("transitional"===this.runTimeInfo.state||r){this.transitioned=!0,this._stopPlayingIncidents();for(var i=0;ia.millisecond+o.duration?o.onProgress(1,o.duration,n,!0):o.onProgress((t-a.millisecond)/o.duration,t-a.millisecond,n,!0)}}else{this.transitioned&&(e=0,this.transitioned=!1);for(var s=this,u=Hn(this.incidents,(function(n){return n.millisecond>=e&&n.millisecondt})),c=Hn(this.incidents,(function(n){return s._incidentById(n.id).duration+n.millisecond>e&&s._incidentById(n.id).duration+n.millisecond<=t})),l=0;l=1,d=h?1:(t-p.millisecond)/f.duration,m=h?f.duration:t-p.millisecond,y=f.play(d,m,n);!0===y&&this.playingIncidentsIds.push("".concat(p.id).concat(tC).concat(n))}for(var g=0;g-1&&this.playingIncidentsIds.splice(b,1)}this.runTimeInfo.currentMillisecond=t}}}]),n}(wr),rC=I(null,(function(e){return{F:function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;s(this,t),e(this),this.attrs=n,this.props=r,this.dna=i,this.context=i.context,this.mcid=i.mcid,this.id=r.id||te(),this.modelId=r.modelId,this.gotContext=!1,this.plugin_channel_class=nC,this.mc_plugin_npm_name="motor-cortex-js-media-playback",Object.prototype.hasOwnProperty.call(r,"plugin_channel_class")&&(this.plugin_channel_class=r.plugin_channel_class),Object.prototype.hasOwnProperty.call(r,"mc_plugin_npm_name")&&(this.mc_plugin_npm_name=r.mc_plugin_npm_name),this.hasIncidents=!1,this.autoGenerated=!1,this.onInitialise(n,r)},d:[{kind:"get",key:"selector",value:function(){return this.props.selector}},{kind:"get",key:"element",value:function(){return this.context.getElementByMCID(this.mcid)}},{kind:"method",decorators:[Ir],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"_onGetContextOnce",value:function(){try{if(!0===this.context.fragment)return;this.gotContext||(this.onGetContext(),this.gotContext=!0)}catch(e){console.log(e),console.log(this.mcid)}}},{kind:"method",key:"onGetContext",value:function(){ae.info('Overwritte the "onGetContext" method with the code you want to get executed',"info")}},{kind:"method",key:"lastWish",value:function(){}},{kind:"method",key:"onInitialise",value:function(){ae.info('Overwritte the "onInialise" method with the code you want to get executed',"info")}},{kind:"method",key:"onProgress",value:function(e,t){}},{kind:"method",key:"play",value:function(e){return!0}},{kind:"method",key:"stop",value:function(){}},{kind:"method",decorators:[ge],key:"setBlock",value:function(){}},{kind:"method",decorators:[xe],key:"unblock",value:function(){}}]}})),iC={npm_name:"@kissmybutton/motorcortex-soundsystem",name:"Internal MotorCortex Soundsystem",incidents:[{exportable:function(e){h(n,e);var t=v(n);function n(){return s(this,n),t.apply(this,arguments)}return c(n,[{key:"play",value:function(e){var t=this;if(!this.element.soundLoaded)return this.setBlock("loading sound"),this.element.pubSub.sub(this.id,(function(){t.unblock()})),!1;var n=0;return Object.prototype.hasOwnProperty.call(this.props,"startFrom")&&(n=this.props.startFrom),this.audioNode=$.createBufferSource(),this.audioNode.buffer=this.element.buffer,this.audioNode.connect(this.element.effectsAudioNode.input),this.audioNode.start(0,(e+n)/1e3),!0}},{key:"stop",value:function(){this.audioNode.stop()}}]),n}(rC),name:"AudioPlayback"},{exportable:eC,name:"AudioEffect"}],Clip:{exportable:QA},audio:"only"};function aC(e,t,n,r){var i=!1;for(var a in t)Object.prototype.hasOwnProperty.call(n,a)||(i=!0,r[a]=t[a]);return e.animatedAttributeValue=r,i}function oC(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=e[r],o=t._get(a.id);o.setInitialValue(n,i);var s=aC(o,o.initialValue,o.originalAnimatedAttributeValue,JSON.parse(JSON.stringify(o.animatedAttributeValue)));s&&(o.lastWish(),o.onGetContext()),s&&r0&&void 0!==arguments[0]?arguments[0]:null;s(this,e),this.realArray=[],null!=t&&(this.realArray=t)}return c(e,[{key:"_hasOwnProperty",value:function(e){return Object.prototype.hasOwnProperty.call(this.realArray,e)}},{key:"_get",value:function(e){return this.realArray[e]}},{key:"_set",value:function(e,t){this.realArray[e]=t}},{key:"_keys",value:function(){return Object.keys(this.realArray)}},{key:"_delete",value:function(e){return delete this.realArray[e]}},{key:"_export",value:function(){return this.realArray}}]),e}(),uC=function(){function e(t){s(this,e),this.originalArray=t,this.extraArray={},this.addedKeys=[],this.removedKeys=[]}return c(e,[{key:"_hasOwnProperty",value:function(e){return Object.prototype.hasOwnProperty.call(this.originalArray,e)||Object.prototype.hasOwnProperty.call(this.extraArray,e)}},{key:"_get",value:function(e){return Object.prototype.hasOwnProperty.call(this.extraArray,e)?this.extraArray[e]:Object.prototype.hasOwnProperty.call(this.originalArray,e)?this.originalArray[e]:void 0}},{key:"_set",value:function(e,t){this.extraArray[e]=t,Object.prototype.hasOwnProperty.call(this.originalArray,e)||this.addedKeys.push(e);var n=this.removedKeys.indexOf(e);n>-1&&this.removedKeys.splice(n,1)}},{key:"_keys",value:function(){for(var e=Object.keys(this.originalArray).concat(this.addedKeys),t=0;t-1?(this.addedKeys.splice(t),delete this.extraArray[e]):this.removedKeys.push(e)}},{key:"_export",value:function(){for(var e in this.extraArray)this.originalArray[e]=this.extraArray[e];for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.lanes={},t.lanes&&(this.lanes=t.lanes),this.comboAttributes={},null!=t.comboAttributes&&(this.comboAttributes=t.comboAttributes),this.runTimeInfo=t.runTimeInfo,this.belongingLaneKeysByAnimationId={},t.belongingLaneKeysByAnimationId&&(this.belongingLaneKeysByAnimationId=t.belongingLaneKeysByAnimationId),this.incidentsById=new sC({}),t.incidentsById&&(this.incidentsById=t.incidentsById)}return c(e,[{key:"_resize",value:function(e){for(var t=Object.keys(this.lanes),n=0;n2&&void 0!==arguments[2]&&arguments[2],r=ne(e,t);return!!this.lanes.hasOwnProperty(r)||(n&&this.lanes.setValue(r,[]),!1)}},{key:"getOverlappingAnims",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=this,o=Hn(this.lanes[ne(t,n)],(function(t){var n=e.incident.duration;return null!=i&&(n=i),t.id!==e.incident.id&&r.indexOf(t.id)<0&&(t.millisecond>=e.millisecond&&t.milliseconde.millisecond&&t.millisecond+a.incidentsById._get(t.id).duration<=n+e.millisecond||t.millisecondn+e.millisecond)}));return o}},{key:"addElementToLane",value:function(e,t,n,r){var i=this,a=[],o=ne(e,t);this.incidentsById._set(r.id,r);var s={millisecond:n,id:r.id};this.laneExists(e,t,!0),this.lanes.pushValue(o,s),this.lanes[o].sortBy("millisecond");var u=this.lanes[o],c=this.lanes[o].findIndex((function(e){return e.id===r.id}));return this.belongingLaneKeysByAnimationId.hasOwnProperty(r.id)||this.belongingLaneKeysByAnimationId.setValue(r.id,[]),this.belongingLaneKeysByAnimationId.pushValue(r.id,o),0===c?this.lanes[o].length>1?a.push((function(){r.setInitialValue(i.incidentsById._get(u[1].id).pureInitialValues)})):a.push((function(){r.setInitialValue()})):a.push((function(){r.setInitialValue(i.incidentsById._get(u[c-1].id).animatedAttributeValue)})),Object.prototype.hasOwnProperty.call(this.comboAttributes,t)&&a.push((function(){return oC(u,i.incidentsById,r.initialValue,c)})),c+1=0&&(l[d].millisecond+=t);var m=Qn(l,["millisecond"]);this.lanes[u]=m,l=m;for(var y=function(e){var t=c.animations[e],r=Pn(f,(function(e){return e.id===t})),i=Pn(l,(function(e){return e.id===t})),a=n.incidentsById._get(l[i].id);if(r!==i||i>1){if(r+1r?r:i;oC(l,n.incidentsById,n.incidentsById._get(f[r-1].id).animatedAttributeValue,o,!0)}else n.incidentsById._get(f[r+1].id).setInitialValue(n.incidentsById._get(f[r-1].id).animatedAttributeValue),n.incidentsById._get(f[r+1].id).onGetContext();0===i?h?oC(l,n.incidentsById,n.incidentsById._get(f[0].id).pureInitialValues,i,!0):(a.setInitialValue(n.incidentsById._get(f[0].id).pureInitialValues),a.onGetContext()):h?oC(l,n.incidentsById,n.incidentsById._get(l[i-1].id).animatedAttributeValue,i,!0):(a.setInitialValue(n.incidentsById._get(l[i-1].id).animatedAttributeValue),a.onGetContext()),i+10){var a=this.incidentsById._get(i[0].id),o=a.getScratchValue(e),s=Q(r);Object.prototype.hasOwnProperty.call(this.comboAttributes,s.attribute)?oC(i,this.incidentsById,o,0,!0):a.setInitialValue(o),a.lastWish(),a.onGetContext()}}}}]),e}(),lC=function(e){h(n,e);var t=v(n);function n(e){var r;return s(this,n),(r=t.call(this,e)).comboAttributes={},r.fixedAttributeName="_",null!=e.comboAttributes&&(r.comboAttributes=e.comboAttributes),r.LanesHandler=new cC({comboAttributes:r.comboAttributes,runTimeInfo:r.runTimeInfo}),r}return c(n,[{key:"setComboAttributes",value:function(e){this.comboAttributes=e,this.LanesHandler=new cC({comboAttributes:this.comboAttributes})}},{key:"_resize",value:function(e){this.LanesHandler._resize(e)}},{key:"checkAddition",value:function(e){for(var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all-or-nothing",r=this.LanesHandler.createTestLanesSanbox(),i=[],a=[],o=[],s=function(n){var s=!1,u=e[n],c=u.incident,l=c.mcid,p=c.attribute||t.fixedAttributeName;r.laneExists(l,p),i.push({mcid:l,attribute:p});var f=r.getOverlappingAnims(u,l,p);if(f.length>0&&(s=!0,o.push({type:"unauthorised, overlapping incidents on the same element",meta:{element_mcid:l,attribute:p,incident:u,overlappingAnims:f}})),!s){var h=r.addElementToLane(l,p,u.millisecond,c);a.push((function(){for(var e=0;e0&&"all-or-nothing"===n)return{result:!1,errors:o};var c=this,l=function(){for(var e=0;e0&&a.push({type:"anauthorised, overlapping animations on the same element",meta:{element_mcid:u,attribute:c,newAnimation:h,overlappingAnims:d}});break}if(a.length>0)return{result:!1,errors:a};var m=this;return{result:!0,execute:function(){m.LanesHandler.updateLane(n,t)}}}},{key:"checkResizedIncidents",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=0;r0&&a.push({type:"anauthorised overlapping animations on the same element",meta:{element_mcid:p.mcid,attribute:p.attribute,newAnimation:m,overlappingAnims:y}})}break}if(a.length>0)return{result:!1,errors:a};var g=this,v=function(){for(var t=0;t5&&void 0!==arguments[5]&&arguments[5],o=this,s=Hn(e,(function(e){return e.millisecond+o.incidentsById._get(e.id).duration>=n&&e.millisecond+o.incidentsById._get(e.id).duration<=r||o.incidentsById._get(e.id).duration+e.millisecond>=r&&e.millisecond<=r}));if(0===s.length){if(a&&0===n){var u=this.incidentsById._get(e[0].id);u.onProgress(0,0,i)}return!0}var c=s.length-1,l=this.incidentsById._get(s[c].id),p=s[c].millisecond;if(l.duration+p<=r)l.onProgress(1,l.duration,i);else{var f=(r-p)/l.duration;l.onProgress(f,r-p,i)}}},{key:"slipToLaneBackwards",value:function(e,t,n,r,i){var a=this,o=Hn(e,(function(e){var t=a.incidentsById._get(e.id).duration+e.millisecond;return t<=r&&t>=n||e.millisecond>=n&&e.millisecond<=r||e.millisecondr}));if(0===o.length)return!0;var s=this.incidentsById._get(o[0].id),u=o[0].millisecond;if(u>=r)s.onProgress(0,0,i);else{var c=(r-u)/s.duration;s.onProgress(c,r-u,i)}}},{key:"moveTo",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Object.keys(this.lanes),a=0;at&&this.slipToLaneBackwards(s,u,e,t,n,r)}}},{key:"lanes",get:function(){return this.LanesHandler.lanes}},{key:"incidentsById",get:function(){return this.LanesHandler.incidentsById}}],[{key:"type",get:function(){return"attributes"}}]),n}(se),pC=function(){function e(){s(this,e),this.customEntities={}}return c(e,[{key:"calcClipDims",value:function(e){var t={use:!1,width:null,height:null};return Object.prototype.hasOwnProperty.call(e,"originalDims")&&null!==e.originalDims.width&&void 0!==e.originalDims.width&&null!==e.originalDims.height&&void 0!==e.originalDims.height?{use:!0,width:e.originalDims.width.number+e.originalDims.width.unit,height:e.originalDims.height.number+e.originalDims.height.unit}:(Object.prototype.hasOwnProperty.call(e,"containerParams")&&(Object.prototype.hasOwnProperty.call(e.containerParams,"width")&&(t.use=!0,t.width=e.containerParams.width),Object.prototype.hasOwnProperty.call(e.containerParams,"height")&&(t.use=!0,t.height=e.containerParams.height)),t)}},{key:"scalingCalculator",value:function(e){if(!Object.prototype.hasOwnProperty.call(e,"containerParams")||!Object.prototype.hasOwnProperty.call(e,"originalDims"))return{width:1,height:1};if(!(null!==e.originalDims.width&&void 0!==e.originalDims.width||null!==e.originalDims.height&&void 0!==e.originalDims.height))return{width:1,height:1};var t=Y(e.containerParams),n=null,r=null;return null!==t.width&&null!==e.originalDims.width&&(t.width.unit===e.originalDims.width.unit?n=t.width.number/e.originalDims.width.number:ae.warning("containerParams and originalDims width of Incident have different dimensions.\n containerParams.width will be ignored")),null!==t.height&&null!==e.originalDims.height&&(t.height.unit===e.originalDims.height.unit?r=t.height.number/e.originalDims.height.number:ae.warning("containerParams and originalDims height of Incident have different dimensions.\n containerParams.width will be ignored")),null===n&&null===r?{width:1,height:1}:(null!==n&null===r?r=n:null!==r&null===n&&(n=r),{width:n,height:r})}},{key:"getElementByMCID",value:function(e){if(Object.prototype.hasOwnProperty.call(this.customEntities,e))return this.customEntities[e];if(Object.prototype.hasOwnProperty.call(this.elementsByMCID,e))return this.elementsByMCID[e];var t=this.context.rootElement.querySelector(this.getElementSelectorByMCID(e));return this.elementsByMCID[e]=t,t}},{key:"getElements",value:function(e){if(null==e||""===e)return[];if("!"===e.charAt(0)){if("#"===(e=e.substr(1)).charAt(0))return[this.customEntities[e.substr(1)]];if("."===e.charAt(0)){var t=[];for(var n in this.customEntities){var r=this.customEntities[n];r.classes.indexOf(e.substr(1))>-1&&t.push(r)}return t}}return Array.from(this.context.rootElement.querySelectorAll(e))}},{key:"getMCID",value:function(e){return!0===e.customEntity?e.id:e.getAttribute(R)}},{key:"setMCID",value:function(e,t){e.setAttribute(R,t)}},{key:"getElementSelectorByMCID",value:function(e){return Object.prototype.hasOwnProperty.call(this.customEntities,e)?"!#".concat(e):"[".concat(R,'="').concat(e,'"]')}},{key:"setCustomEntity",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Object.prototype.hasOwnProperty.call(this.customEntities,e)?(ae.error("Clip ".concat(this.id," already has custom Entity with id: ").concat(e)),!1):(this.customEntities[e]={id:e,entity:t,classes:n,customEntity:!0},!0)}}]),e}(),fC=Pi((function(e,t){var n=/[|\\{}()[\]^$+*?.]/g;t.escapeRegExpChars=function(e){return e?String(e).replace(n,"\\$&"):""};var r={"&":"&","<":"<",">":">",'"':""","'":"'"},i=/[&<>'"]/g;function a(e){return r[e]||e}t.escapeXML=function(e){return null==e?"":String(e).replace(i,a)},t.escapeXML.toString=function(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'},t.shallowCopy=function(e,t){for(var n in t=t||{})e[n]=t[n];return e},t.shallowCopyFromList=function(e,t,n){for(var r=0;rt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0;s--){var a=e[t.placement];a.splice(a.indexOf(t.key),1);var o=this.fromElementDescriptor(t),u=this.toElementFinisherExtras((0,r[s])(o)||o);t=u.element,this.addElementPlacement(t,e),u.finisher&&i.push(u.finisher);var l=u.extras;if(l){for(var c=0;c=0;i--){var r=this.fromClassDescriptor(t),s=this.toClassDescriptor((0,e[i])(r)||r);if(void 0!==s.finisher&&n.push(s.finisher),void 0!==s.elements){t=s.elements;for(var a=0;a0&&void 0!==arguments[0]&&arguments[0],e=t?"_":"-";return"".concat(it()).concat(it()).concat(e).concat(it()).concat(e).concat(it())}function st(t,e){return"".concat(t).concat("___").concat(e)}function at(t,e,n){for(var i=e.split("."),r=t,s=0;s=r.level?this[r.key]=window.console[r.consoleMethod].bind(window.console,"MotorCortex - ".concat(r.key,": ")):this[r.key]=function(){}}this.log=n>=3?window.console.log.bind(window.console,"MotorCortex - "):function(){}}return l(t,[{key:"validateProps",value:function(t,e,n){var i=e(t);if(i.length>0){for(var r="Error on plugin's \"".concat(n.plugin_npm_name,'" "').concat(n.ClassName,'" instantiation. Errors (op props):'),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};return ut(this.checkDelete(t,e))}},{key:"recalcScratchValues",value:function(t){}},{key:"checkAddition",value:function(t){return{result:!0,execute:function(){}}}},{key:"checkEdit",value:function(t,e){return{result:!0,execute:function(){}}}},{key:"checkDelete",value:function(t){return{result:!0,execute:function(){}}}},{key:"checkResizedIncidents",value:function(t){return{result:!0,execute:function(){}}}},{key:"moveTo",value:function(t,e,n){}}],[{key:"type",get:function(){return"plain"}}]),t}(),ct="up",ht="down",pt="native.tree.bypass",dt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.parentNode=null,this.isNode=!1,Object.prototype.hasOwnProperty.call(e,"id")?this.id=e.id:this.id=rt(),this.props=e}return l(t,[{key:"name",get:function(){return Object.prototype.hasOwnProperty.call(this.props,"name")?this.props.name:null},set:function(t){this.props.name=t}},{key:"delay",get:function(){return Object.prototype.hasOwnProperty.call(this.props,"delay")?this.props.delay:0},set:function(t){0!==t&&(this.props.delay=t)}},{key:"hiatus",get:function(){return Object.prototype.hasOwnProperty.call(this.props,"hiatus")?this.props.hiatus:0},set:function(t){0!==t&&(this.props.hiatus=t)}},{key:"repeats",get:function(){return Object.prototype.hasOwnProperty.call(this.props,"repeats")?this.props.repeats:1},set:function(t){this.props.repeats=t}},{key:"duration",get:function(){return this.repeats*(this.delay+this.props.duration+this.hiatus)},set:function(t){var e=t/this.duration;this.props.duration*=e,this.hiatus*=e,this.delay*=e}},{key:"setNewDuration",value:function(t){this.duration=t,this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ct})}},{key:"systoleDiastole",value:function(t){this.duration*=t}},{key:"hasParent",get:function(){return null!==this.parentNode}},{key:"attachToNode",value:function(t){this.parentNode=t}},{key:"detachFromParent",value:function(){this.parentNode=null}},{key:"putMessageOnPipe",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Object.prototype.hasOwnProperty.call(i,"direction")||(i.direction=ht),i.direction!==ht||Object.prototype.hasOwnProperty.call(i,"positionDelta")||(i.positionDelta=0),i.selfExecute){var r="handle".concat(Q(t)),s="function"==typeof this[r];if(s){var a=this[r](n,e);if(a!==pt){var o={response:a,responder:this};return i.direction===ct?o:[p(p({},o),{},{positionDelta:i.positionDelta})]}}}return i.direction===ct?this.hasParent?this.parentNode.putMessageOnPipe(t,e,n,{selfExecute:!0,direction:ct}):{response:!1,responder:null}:[]}},{key:"bypass",value:function(){return pt}},{key:"positionOnPyramidion",get:function(){return this.getPositionOnPyramidion()}},{key:"getPositionOnPyramidion",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.hasParent){var e=this.putMessageOnPipe("getPositionOnPyramidion",{delta:t,id:this.id},"Parent",{selfExecute:!1,direction:ct});return e.response}return t}}]),t}(),ft="Leaf has already been attached to another Node",mt="Negative positioning of childs on nodes is not allowed",vt="The Leaf with the requested id couldn't be found on the Tree",yt=function(t){d(n,t);var e=g(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(t=e.call(this,i)).isNode=!0,t.children={},t.calculatedDuration=0,t}return l(n,[{key:"duration",get:function(){return this.repeats*(this.delay+this.calculatedDuration+this.hiatus)},set:function(t){if(0!==this.duration){var e=t/this.duration;for(var n in this.calculatedDuration*=e,this.hiatus*=e,this.delay*=e,this.children){var i=this.children[n];this.editPosition(i.id,i.position*e,!0),i.leaf.systoleDiastole(e)}}}},{key:"_calculateDuration",value:function(){var t=0;for(var e in this.children){var n=this.children[e];n.position+n.leaf.duration>t&&(t=n.position+n.leaf.duration)}return t!==this.calculatedDuration&&(this.calculatedDuration=t,!0)}},{key:"handleRecalcDuration",value:function(t,e){return!this._calculateDuration()||this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ct})}},{key:"getLeafById",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object.prototype.hasOwnProperty.call(this.children,t))return this.children[t].leaf;if(e)return null;for(var n in this.children){var i=this.children[n].leaf;if(i.isNode){var r=i.getLeafById(t);if(null!=r)return r}}return null}},{key:"getLeafPosition",value:function(t){if(Object.prototype.hasOwnProperty.call(this.children,t))return this.children[t].position;var e=this.putMessageOnPipe("getLeafPosition",{id:t},"Groups",{selfExecute:!1,direction:ht});return e.length>0?e[0].positionDelta+e[0].response:void 0}},{key:"handleGetLeafPosition",value:function(t,e){return this.getLeafPosition(e.id)}},{key:"checkAddition",value:function(t,e){return t.hasParent?{result:!1,reason:ft}:e<0?{result:!1,reason:mt}:{result:!0}}},{key:"addChild",value:function(t,e){return t.hasParent?{result:!1,reason:ft}:(this.children[t.id]={id:t.id,leaf:t,position:e},t.attachToNode(this),this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!0,direction:ct}),{result:!0})}},{key:"checkRemoveChild",value:function(t){return Object.prototype.hasOwnProperty.call(this.children,t)?{result:!0}:{result:!1,reason:vt}}},{key:"removeChild",value:function(t){return this.children[t].leaf.detachFromParent(),delete this.children[t],this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!0,direction:ct}),{result:!0}}},{key:"checkEditPosition",value:function(t,e){return e<0?{result:!1,reason:mt}:Object.prototype.hasOwnProperty.call(this.children,t)?{result:!0}:{result:!1,reason:vt}}},{key:"editPosition",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Object.prototype.hasOwnProperty.call(this.children,t))return this.children[t].position=e,n||this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!0,direction:ct}),{result:!0}}},{key:"putMessageOnPipe",value:function(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Object.prototype.hasOwnProperty.call(r,"direction")||(r.direction=ht),r.direction!==ht||Object.prototype.hasOwnProperty.call(r,"positionDelta")||(r.positionDelta=0),r.direction===ct)return k(f(n.prototype),"putMessageOnPipe",this).call(this,t,e,i,r);var s=k(f(n.prototype),"putMessageOnPipe",this).call(this,t,e,i,r);if(s.length>0)return s;for(var a in this.children){var o=this.children[a].leaf,u=p(p({},r),{},{selfExecute:!0,positionDelta:r.positionDelta+this.children[a].position});s.push.apply(s,O(o.putMessageOnPipe(t,e,i,u)))}return s}},{key:"handleGetPositionOnPyramidion",value:function(t,e){var n=e.delta+this.getLeafPosition(e.id);return this.getPositionOnPyramidion(n)}}]),n}(dt);function gt(t){t.descriptor.value=function(t){void 0===this.blockID&&(this.blockID=rt()),this.DescriptiveIncident.putMessageOnPipe("setBlock",{id:this.blockID,description:t,incidentId:this.DescriptiveIncident.id,realIncidentId:this.id},"rootClip",{selfExecute:!0,direction:ct})}}function bt(t){t.descriptor.value=function(){this.DescriptiveIncident.putMessageOnPipe("unBlock",{id:this.blockID},"rootClip",{selfExecute:!0,direction:ct})}}var kt=T(null,(function(t,e){var n=function(e){d(i,e);var n=g(i);function i(e,r){var s;return o(this,i),s=n.call(this,r),t(v(s)),s.mc_plugin_npm_name="motor-cortex-js",s.plugin_channel_class=lt,s.hasIncidents=!0,s.onGroupInitialise(),s.calculatedDuration=0,s}return i}(e);return{F:n,d:[{kind:"method",key:"onGroupInitialise",value:function(){}},{kind:"method",key:"handleAddIncident",value:function(t,e){if(this.id===t){var n=(0,e.incidentFromDescription)(e.incident,e.contextData,e.audio);return null===n?this.bypass():n}return this.bypass()}},{kind:"method",key:"handleMoveIncident",value:function(t,e){if(this.id===t){var n=this.getLeafById(e.incidentId,!0);return null===n?this.bypass():n}return this.bypass()}},{kind:"method",key:"handleRemoveIncident",value:function(t,e){if(this.id===t){var n=this.getLeafById(e.incidentId,!0);return null===n?this.bypass():n}return this.bypass()}},{kind:"method",key:"handleResize",value:function(t){return this.id===t?this:this.bypass()}},{kind:"method",key:"removeChild",value:function(t){this.children[t].leaf.lastWish(),k(f(n.prototype),"removeChild",this).call(this,t)}},{kind:"method",key:"getIncidentsByChannel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={};for(var i in n["motor-cortex-js"]=[{millisecond:t,parentMillisecond:e,incident:this,id:this.id}],this.children){var r=this.children[i],s=r.leaf.getIncidentsByChannel(t+r.position,t);for(var a in s)Object.prototype.hasOwnProperty.call(n,a)?n[a]=n[a].concat(s[a]):n[a]=s[a]}return n}},{kind:"method",key:"lastWish",value:function(){for(var t in this.children)this.children[t].leaf.lastWish()}},{kind:"method",decorators:[gt],key:"setBlock",value:function(){}},{kind:"method",decorators:[bt],key:"unblock",value:function(){}}]}}),yt),xt=function(t){d(n,t);var e=g(n);function n(){return o(this,n),e.apply(this,arguments)}return l(n,[{key:"onInitialise",value:function(){this.incidents=[],this.incidentsById={}}},{key:"_incidentById",value:function(t){return this.incidentsById[t]}},{key:"_resize",value:function(t){for(var e=0;e0)return{result:!1,errors:e};var s=this;return{result:!0,execute:function(){var e;s.incidentsById=Object.assign(s.incidentsById,n),(e=s.incidents).push.apply(e,i),s.incidents.sort((function(t,e){return t.millisecond-e.millisecond}));for(var r=0;r3&&void 0!==arguments[3]&&arguments[3];if(i)for(var r=0;rs.millisecond+a.duration?a.onProgress(1,a.duration,n,!0):a.onProgress((e-s.millisecond)/a.duration,e-s.millisecond,n,!0)}else{var o,u=this;o=e>t?this.incidents.filter((function(n){return n.millisecond+u._incidentById(n.id).duration>=t&&n.millisecond+u._incidentById(n.id).duration<=e||u._incidentById(n.id).duration+n.millisecond>=e&&n.millisecond<=e})):this.incidents.filter((function(n){return n.millisecond+u._incidentById(n.id).duration>=e&&n.millisecond+u._incidentById(n.id).duration<=t||u._incidentById(n.id).duration+n.millisecond>=t&&n.millisecond<=t}));for(var l=0;l=1,d=p?1:(e-c.millisecond)/h.duration,f=p?h.duration:e-c.millisecond;h.onProgress(d,f,n,!1)}}}}]),n}(lt),wt=.1,Ct="function"==typeof Float32Array;function Ot(t,e){return 1-3*e+3*t}function It(t,e){return 3*e-6*t}function Pt(t){return 3*t}function Et(t,e,n){return((Ot(e,n)*t+It(e,n))*t+Pt(e))*t}function At(t,e,n){return 3*Ot(e,n)*t*t+2*It(e,n)*t+Pt(e)}function _t(t){return t}var Dt=function(t,e,n,i){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===i)return _t;for(var r=Ct?new Float32Array(11):new Array(11),s=0;s<11;++s)r[s]=Et(s*wt,t,n);function a(e){for(var i=0,s=1;10!==s&&r[s]<=e;++s)i+=wt;--s;var a=i+(e-r[s])/(r[s+1]-r[s])*wt,o=At(a,t,n);return o>=.001?function(t,e,n,i){for(var r=0;r<4;++r){var s=At(e,n,i);if(0===s)return e;e-=(Et(e,n,i)-t)/s}return e}(e,a,t,n):0===o?a:function(t,e,n,i,r){var s,a,o=0;do{(s=Et(a=e+(n-e)/2,i,r)-t)>0?n=a:e=a}while(Math.abs(s)>1e-7&&++o<10);return a}(e,i,i+wt,t,n)}return function(t){return 0===t?0:1===t?1:Et(a(t),e,i)}};function Tt(t){t.descriptor.value=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n={};return n[this.mc_plugin_npm_name]=[{millisecond:t,parentMillisecond:e,incident:this,id:this.id}],n}}var St=T(null,(function(t){return{F:function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;o(this,e),t(this),this.attrs=n,this.props=i,this.dna=r,this.context=r.context,this.mcid=r.mcid,this.id=i.id||rt(),this.modelId=i.modelId,this.gotContext=!1,this.plugin_channel_class=lt,this.mc_plugin_npm_name="motor-cortex-js",Object.prototype.hasOwnProperty.call(i,"plugin_channel_class")&&(this.plugin_channel_class=i.plugin_channel_class),Object.prototype.hasOwnProperty.call(i,"mc_plugin_npm_name")&&(this.mc_plugin_npm_name=i.mc_plugin_npm_name),this.hasIncidents=!1,this.initialValues={},this.userDefinedInitialValues=n.initialValues||{},this.pureInitialValues=null,this.autoGenerated=!1,this.onInitialise()},d:[{kind:"get",key:"selector",value:function(){return this.props.selector}},{kind:"get",key:"animAttributes",value:function(){return this.attrs.animatedAttrs}},{kind:"set",key:"animAttributes",value:function(t){this.attrs.animatedAttrs[this.attributeKey]=t}},{kind:"method",key:"getScratchValue",value:function(){return 0}},{kind:"get",key:"element",value:function(){return null===this.context?[]:this.context.getElementByMCID?this.context.getElementByMCID(this.mcid):this.context.getElements(this.selector)[0]}},{kind:"get",key:"attributeKey",value:function(){return Object.keys(this.attrs.animatedAttrs)[0]}},{kind:"get",key:"targetValue",value:function(){return this.animAttributes[this.attributeKey]}},{kind:"method",key:"getElementAttribute",value:function(t){return this.element.getAttribute(t)}},{kind:"method",decorators:[Tt],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"hasUserDefinedInitialValue",value:function(){return Object.prototype.hasOwnProperty.call(this.userDefinedInitialValues,this.attributeKey)}},{kind:"method",key:"setInitialValue",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&(this.pureInitialValues=JSON.parse(JSON.stringify(t))),this.hasUserDefinedInitialValue())if(H(this.targetValue)){for(var n in this.userDefinedInitialValues[this.attributeKey])t[n]=this.userDefinedInitialValues[this.attributeKey][n];this.initialValues[this.attributeKey]=t}else this.initialValues[this.attributeKey]=this.userDefinedInitialValues[this.attributeKey];else this.initialValues[this.attributeKey]=t}},{kind:"get",key:"initialValue",value:function(){return this.initialValues[this.attributeKey]}},{kind:"method",key:"_onGetContextOnce",value:function(){try{if(!0===this.context.fragment)return;this.gotContext||(this.onGetContext(),this.gotContext=!0)}catch(t){ot.error(t),ot.error(this.mcid)}}},{kind:"method",key:"onGetContext",value:function(){ot.info('Overwritte the "onGetContext" method with the code you want to get executed',"info")}},{kind:"method",key:"lastWish",value:function(){}},{kind:"method",key:"onInitialise",value:function(){ot.info('Overwritte the "onInialise" method with the code you want to get executed',"info")}},{kind:"method",key:"onProgress",value:function(t,e){}},{kind:"method",decorators:[gt],key:"setBlock",value:function(){}},{kind:"method",decorators:[bt],key:"unblock",value:function(){}}]}})),Mt=function(t){d(n,t);var e=g(n);function n(t,i,r){var s;return o(this,n),(s=e.call(this,t,i,r)).runTimeInfo={currentMillisecond:0},s}return l(n,[{key:"duration",get:function(){return this.DescriptiveIncident.realClip.duration}},{key:"lastWish",value:function(){this.ownClip&&this.ownClip.context.unmount()}},{key:"onGetContext",value:function(){var t=this,e=this.DescriptiveIncident.realClip.exportConstructionArguments(),n=ot.getElementByMCID(this.context,this.mcid),i=p(p({},e.props),{},{selector:void 0,host:n,containerParams:this.DescriptiveIncident.props.containerParams||{},originalDims:this.DescriptiveIncident.constructor.originalDims||{}});this.ownClip=new this.DescriptiveIncident.constructor.Incident(e.attrs,i),this.ownClip.DescriptiveIncident=this.DescriptiveIncident,this.DescriptiveIncident.realClip.addContext({clipId:this.id,context:this.ownClip.context,unblock:function(){return t.unblock()}},!0)}},{key:"onProgress",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!1!==this.DescriptiveIncident.realClip.context.contextLoaded){for(var i in this.DescriptiveIncident.realClip.instantiatedChannels){var r=this.DescriptiveIncident.realClip.instantiatedChannels[i];r.moveTo(this.runTimeInfo.currentMillisecond,e,this.id,n)}this.runTimeInfo.currentMillisecond=e,this.ownClip.onAfterProgress(t,e)}else this.setBlock()}}]),n}(St);function jt(t){var e=new t.Incident(t.attrs,p(p({},t.props),{},{id:t.id||rt()}),{context:t.context,mcid:t.mcid});return e.mc_plugin_npm_name=t.plugin_npm_name,e.plugin_channel_class=t.Channel,e.DescriptiveIncident=t.DescriptiveIncident,e}var Vt={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},easeInSine:function(t){return-1*Math.cos(t*(Math.PI/2))+1},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0==t?1:1*Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1==t?1:1*(1-Math.pow(2,-10*t))},easeInOutExpo:function(t){return 0==t||1==t?t:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){if(0==t||1==t)return t;var e=.3/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/.3)},easeOutElastic:function(t){if(0==t||1==t)return t;var e=.3/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.3)+1},easeInOutElastic:function(t){if(0==t||1==t)return t;var e=.3*1.5,n=e/(2*Math.PI)*Math.asin(1);return t<1?Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/e)*-.5:Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/e)*.5+1},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=-1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-Vt.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t*1:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*Vt.easeInBounce(2*t):.5*(Vt.easeOutBounce(2*t-1)+1)}},Nt=T(null,(function(t,e){return{F:function(e){d(i,e);var n=g(i);function i(e,r,s,a){var u;return o(this,i),u=n.call(this,p(p({},e.props),{},{id:"".concat(e.incidentId,"_").concat(s)})),t(v(u)),u.contexts={},u.constructionIngredients=e,u.mcid=s,u.DescriptiveIncident=a,u.mc_plugin_npm_name=e.plugin_npm_name,u.plugin_channel_class=e.Channel,u.addContext(r),u.timeScale=1,a.realClip.duration>0&&(u.timeScale=u.props.duration/a.realClip.duration),a.realClip.subscribeToDurationChange((function(t){u.props.duration=u.timeScale*t,u.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ct})})),u.easing=Vt.linear,Object.prototype.hasOwnProperty.call(u.props,"easing")&&(Array.isArray(u.props.easing)?u.easing=Dt(u.props.easing[0],u.props.easing[1],u.props.easing[2],u.props.easing[3]):u.easing=Vt[u.props.easing]),u}return i}(e),d:[{kind:"get",key:"originalContext",value:function(){return this.contexts[this.originalContextKey]}},{kind:"method",key:"onProgress",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.delay+this.props.duration+this.hiatus,s=e%r;0!==e&&0===s&&(s=this.delay+this.props.duration);var a=s-this.delay;a<0?a=0:a>this.props.duration&&(a=this.props.duration);var o=0===this.props.duration?0:a/this.props.duration,u=this.easing(o),l=u*this.props.duration*(1/this.timeScale);!1!==this.originalContext.context.contextLoaded&&this.contexts[n].onProgress(u,l,i)}},{kind:"method",key:"addContext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];0===Object.keys(this.contexts).length&&(this.originalContextKey=t.clipId);var n=p(p({},this.constructionIngredients),{},{context:t.context,mcid:this.mcid,Incident:Mt,DescriptiveIncident:this.DescriptiveIncident});this.contexts[t.clipId]=jt(n),e&&this.contexts[t.clipId]._onGetContextOnce()}},{kind:"method",key:"handleAddContext",value:function(t,e){return this.addContext(e,!0),!0}},{kind:"method",key:"handleContextLoaded",value:function(t,e){this._onGetContextOnce()}},{kind:"method",decorators:[Tt],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"gotContext",value:function(){for(var t in this.contexts)this.contexts[t].gotContext()}},{kind:"method",key:"_onGetContextOnce",value:function(){if(!1!==this.originalContext.contextLoaded)for(var t in this.contexts)this.contexts[t]._onGetContextOnce()}},{kind:"method",key:"lastWish",value:function(){for(var t in this.contexts)this.contexts[t].lastWish()}},{kind:"method",key:"onGetContext",value:function(){if(!1!==this.originalContext.contextLoaded)for(var t in this.contexts)this.contexts[t].onGetContext()}}]}}),dt),$t=T(null,(function(t,e){var n=function(e){d(i,e);var n=g(i);function i(e,r,s,a){var u;if(o(this,i),u=n.call(this,p(p({},e.props),{},{id:null!==a?"".concat(e.incidentId,"_").concat(s,"_").concat(a):"".concat(e.incidentId,"_").concat(s)})),t(v(u)),u.contexts={},u.constructionIngredients=e,u.mcid=s,u.attribute=a,u.mc_plugin_npm_name=e.plugin_npm_name,u.plugin_channel_class=e.Channel,u.DescriptiveIncident=e.DescriptiveIncident,u.addContext(r),null!==a){var l=u.constructionIngredients.attrs.animatedAttrs[u.attribute];Array.isArray(l)?u.originalAnimatedAttributeValue=O(l):H(l)?u.originalAnimatedAttributeValue=p({},l):u.originalAnimatedAttributeValue=l}return u.easing=Vt.linear,Object.prototype.hasOwnProperty.call(u.props,"easing")&&(Array.isArray(u.props.easing)?u.easing=Dt(u.props.easing[0],u.props.easing[1],u.props.easing[2],u.props.easing[3]):u.easing=Vt[u.props.easing]),u}return i}(e);return{F:n,d:[{kind:"get",key:"originalContext",value:function(){return this.contexts[this.originalContextKey]}},{kind:"get",key:"duration",value:function(){return k(f(n.prototype),"duration",this)}},{kind:"set",key:"duration",value:function(t){for(var e in w(f(n.prototype),"duration",t,this,!0),this.contexts)this.contexts[e].duration=t}},{kind:"method",key:"addContext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!1;0===Object.keys(this.contexts).length&&(this.originalContextKey=t.clipId,this.originalClipContext=t.context,n=!0);var i=p(p({},this.constructionIngredients),{},{context:t.context,mcid:this.mcid}),r=jt(i);this.contexts[t.clipId]=r,n||null==this.attribute||this.contexts[t.clipId].setInitialValue(this.initialValue),e&&this.contexts[t.clipId].context.contextLoaded&&this.contexts[t.clipId]._onGetContextOnce()}},{kind:"method",key:"handleAddContext",value:function(t,e){return this.addContext(e,!0),!0}},{kind:"method",key:"handleContextLoaded",value:function(t,e){return this._onGetContextOnce(),!0}},{kind:"method",decorators:[Tt],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"onProgress",value:function(t,e,n){var i=e%(this.delay+this.props.duration+this.hiatus);0!==e&&0===i&&(i=this.delay+this.props.duration);var r=i-this.delay;r<0?r=0:r>this.props.duration&&(r=this.props.duration);var s=r/this.props.duration,a=this.easing(s),o=a*this.props.duration;if(null!=n)!1!==this.originalContext.context.contextLoaded&&this.contexts[n].onProgress(a,o);else for(var u in this.contexts)this.originalContextKey===u&&!0===this.originalContext.fragment||this.contexts[u].onProgress(a,o)}},{kind:"get",key:"animatedAttributeValue",value:function(){return this.constructionIngredients.attrs.animatedAttrs[this.attribute]}},{kind:"set",key:"animatedAttributeValue",value:function(t){this.constructionIngredients.attrs.animatedAttrs[this.attribute]=t}},{kind:"method",key:"gotContext",value:function(){for(var t in this.contexts)this.contexts[t].gotContext()}},{kind:"method",key:"_onGetContextOnce",value:function(){if(!1!==this.originalContext.context.contextLoaded)for(var t in this.contexts)this.contexts[t]._onGetContextOnce()}},{kind:"method",key:"lastWish",value:function(){for(var t in this.contexts)this.contexts[t].lastWish()}},{kind:"method",key:"onGetContext",value:function(){if(!1!==this.originalContext.contextLoaded)for(var t in this.contexts)this.contexts[t].context.contextLoaded&&this.contexts[t].onGetContext()}},{kind:"get",key:"initialValue",value:function(){return this.originalContext.initialValue}},{kind:"get",key:"scratchValue",value:function(){return this.originalContext.scratchValue}},{kind:"get",key:"pureInitialValues",value:function(){return this.originalContext.pureInitialValues}},{kind:"method",key:"setInitialValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];for(var n in null===t&&(t=this.getScratchValue()),this.contexts)this.contexts[n].setInitialValue(JSON.parse(JSON.stringify(t)),e)}},{kind:"method",key:"getScratchValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.originalContext.context.contextLoaded)return 0;if(null!=t)return this.contexts[t].getScratchValue();var e=Object.keys(this.contexts);if(Object.prototype.hasOwnProperty.call(this.originalClipContext,"nonFragmentedContext")){var n=p(p({},this.constructionIngredients),{},{context:this.originalClipContext.nonFragmentedContext,mcid:this.mcid}),i=jt(n);return i.getScratchValue()}return 1===e.length?this.originalContext.getScratchValue():this.contexts[e[1]].getScratchValue()}},{kind:"method",key:"setCompoAttrKeyValue",value:function(t,e){for(var n in this.contexts)this.contexts[n].attrs.animatedAttrs[this.attribute][t]=e,this.contexts[n].lastWish(),this.contexts[n].onGetContext()}},{kind:"method",key:"play",value:function(t,e,n){return this.contexts[n].play(e)}},{kind:"method",key:"stop",value:function(t){this.contexts[t].stop()}}]}}),dt),Bt=function(t){d(n,t);var e=g(n);function n(t,i,r,s,a){var u;return o(this,n),(u=e.call(this,{},{id:"".concat(t.id,"_").concat(r)})).mcid=r,u.selector=s,u.data=a,u.setUp(t,i),u}return l(n,[{key:"setUp",value:function(t,e){for(var n in this.data.attrs.animatedAttrs){var i={};i[n]=this.data.attrs.animatedAttrs[n];var r=p(p({},this.data.attrs),{},{animatedAttrs:i}),s=p(p({},this.data.props),{},{selector:this.selector}),a={incidentId:t.id,attrs:r,props:s,Incident:t.constructor.Incident,plugin_npm_name:t.constructor.plugin_npm_name,Channel:t.constructor.Channel,DescriptiveIncident:t},o=new $t(a,e,this.mcid,n);this.addChild(o,0)}}}]),n}(kt);var Lt=function(t){d(n,t);var e=g(n);function n(t,i){var r;return o(this,n),(r=e.call(this,{},{id:t.id})).contexts={},r.contexts[i.clipId]=i.context,r.originalContextKey=i.clipId,r.initParams=i.context.initParams,r.instantiatedCopiesContexts=i.instantiatedCopiesContexts,r.descriptiveIncident=t,r.staggerAttrs=[],r.staggerProps=[],r.setUp(t,i),r}return l(n,[{key:"originalContext",get:function(){return this.contexts[this.originalContextKey]}},{key:"parsePropsDynamicValues",value:function(t,e){for(var n=0;n0&&(this.descriptiveIncident.dynamicDurationValue=1*this.duration),i}},{key:"lastWish",value:function(){this.descriptiveIncident.propsStaggers.length>0&&(this.descriptiveIncident.dynamicDurationValue=null,this.descriptiveIncident.putMessageOnPipe("setDurationDynamic",{},"Groups",{selfExecute:!1,direction:ct})),k(f(n.prototype),"lastWish",this).call(this)}},{key:"_getElementMCID",value:function(t){var e=this.originalContext.getMCID(t);return e||(e=rt(!0),this.originalContext.setMCID(t,e)),e}},{key:"_setElementMCID",value:function(t,e,n){t.getMCID(e)||t.setMCID(e,n)}},{key:"_prepareAttrsPropsForElement",value:function(t,e){var n=function(t,e){for(var n=[],i=0;i0){r=JSON.parse(JSON.stringify(t.attrs));for(var a=0;a0){s=JSON.parse(JSON.stringify(t.props));for(var o=0;o2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:R,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;Object.prototype.hasOwnProperty.call(r,i)||(r[i]={});for(var s=r[i],a=t.split("."),o=0;o=0?this[o]:n.indexOf(o)>=0?void 0:(i&&null!==s&&(o=s[o]),Object.prototype.hasOwnProperty.call(e,o)?e[o]:t[o])},isArray:function(){return i},_getFromProxy:function(t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},set:function(){return!1},sortBy:function(t){if(s=null,!i)return!1;s=function(t,e){for(var n=[],i=0;i-1&&n.splice(o,1)}else r.setValue(i[i.length-1],s),r.restoreKey(i[i.length-1]);return!0},pushValue:function(e,n){var i=e.split("."),r=this.__createPathProxies(i),s=r.currentObject;if(void 0===r.currentRealObect)return!1;var a=i[i.length-1],o=s[a],u=t[a];if(""===e&&(o=this,u=t),1!==i.length)return s.pushValue(a,n);var l=!1;if(void 0!==o){if(l=!0,!o.isArray())return!1}else if(!Array.isArray(u))return!1;if(!l){var c=zt(u);s[a]=c,o=s[a]}return o.push(n),!0},push:function(t){return!!this.isArray()&&("object"===a(t)?e[r]=zt(t):e[r]=t,r+=1,!0)},removePathKey:function(t){var e=t.split(".");return this.__createPathProxies(e).currentObject.removeKey(e[e.length-1]),!0},removeKey:function(t){n.push(t)},restoreKey:function(t){var e=n.indexOf(t);e>-1&&n.splice(e,1)},hasOwnProperty:function(t){return!(n.indexOf(t)>-1)&&void 0!==this[t]},getKeys:function(){if(i)return[];for(var r=[],s=Object.keys(t),a=Object.keys(e),o=[].concat(O(s),O(a)),u=o.filter((function(t,e){return o.indexOf(t)===e})),l=0;l0)e[s]=e[s]||{},t(e[s],n[s],i);else{if(!0===i.skipIfExist&&void 0!==e[s])continue;e[s]=n[s]}var r;return e},Kt={required:"The '{field}' field is required.",string:"The '{field}' field must be a string.",stringEmpty:"The '{field}' field must not be empty.",stringMin:"The '{field}' field length must be greater than or equal to {expected} characters long.",stringMax:"The '{field}' field length must be less than or equal to {expected} characters long.",stringLength:"The '{field}' field length must be {expected} characters long.",stringPattern:"The '{field}' field fails to match the required pattern.",stringContains:"The '{field}' field must contain the '{expected}' text.",stringEnum:"The '{field}' field does not match any of the allowed values.",stringNumeric:"The '{field}' field must be a numeric string.",stringAlpha:"The '{field}' field must be an alphabetic string.",stringAlphanum:"The '{field}' field must be an alphanumeric string.",stringAlphadash:"The '{field}' field must be an alphadash string.",stringHex:"The '{field}' field must be a hex string.",stringSingleLine:"The '{field}' field must be a single line string.",stringBase64:"The '{field}' field must be a base64 string.",number:"The '{field}' field must be a number.",numberMin:"The '{field}' field must be greater than or equal to {expected}.",numberMax:"The '{field}' field must be less than or equal to {expected}.",numberEqual:"The '{field}' field must be equal to {expected}.",numberNotEqual:"The '{field}' field can't be equal to {expected}.",numberInteger:"The '{field}' field must be an integer.",numberPositive:"The '{field}' field must be a positive number.",numberNegative:"The '{field}' field must be a negative number.",array:"The '{field}' field must be an array.",arrayEmpty:"The '{field}' field must not be an empty array.",arrayMin:"The '{field}' field must contain at least {expected} items.",arrayMax:"The '{field}' field must contain less than or equal to {expected} items.",arrayLength:"The '{field}' field must contain {expected} items.",arrayContains:"The '{field}' field must contain the '{expected}' item.",arrayUnique:"The '{actual}' value in '{field}' field does not unique the '{expected}' values.",arrayEnum:"The '{actual}' value in '{field}' field does not match any of the '{expected}' values.",tuple:"The '{field}' field must be an array.",tupleEmpty:"The '{field}' field must not be an empty array.",tupleLength:"The '{field}' field must contain {expected} items.",boolean:"The '{field}' field must be a boolean.",currency:"The '{field}' must be a valid currency format",date:"The '{field}' field must be a Date.",dateMin:"The '{field}' field must be greater than or equal to {expected}.",dateMax:"The '{field}' field must be less than or equal to {expected}.",enumValue:"The '{field}' field value '{expected}' does not match any of the allowed values.",equalValue:"The '{field}' field value must be equal to '{expected}'.",equalField:"The '{field}' field value must be equal to '{expected}' field value.",forbidden:"The '{field}' field is forbidden.",function:"The '{field}' field must be a function.",email:"The '{field}' field must be a valid e-mail.",emailEmpty:"The '{field}' field must not be empty.",emailMin:"The '{field}' field length must be greater than or equal to {expected} characters long.",emailMax:"The '{field}' field length must be less than or equal to {expected} characters long.",luhn:"The '{field}' field must be a valid checksum luhn.",mac:"The '{field}' field must be a valid MAC address.",object:"The '{field}' must be an Object.",objectStrict:"The object '{field}' contains forbidden keys: '{actual}'.",objectMinProps:"The object '{field}' must contain at least {expected} properties.",objectMaxProps:"The object '{field}' must contain {expected} properties at most.",url:"The '{field}' field must be a valid URL.",urlEmpty:"The '{field}' field must not be empty.",uuid:"The '{field}' field must be a valid UUID.",uuidVersion:"The '{field}' field must be a valid UUID version provided.",classInstanceOf:"The '{field}' field must be an instance of the '{expected}' class.",objectID:"The '{field}' field must be an valid ObjectID"},Jt=function(){const t=[];return t.push("\n\t\treturn value;\n\t"),{source:t.join("\n")}},Wt=function({schema:t,messages:e},n,i){const r=[];if(r.push(`\n\t\tif (!Array.isArray(value)) {\n\t\t\t${this.makeError({type:"array",actual:"value",messages:e})}\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t`),!1===t.empty&&r.push(`\n\t\t\tif (len === 0) {\n\t\t\t\t${this.makeError({type:"arrayEmpty",actual:"value",messages:e})}\n\t\t\t}\n\t\t`),null!=t.min&&r.push(`\n\t\t\tif (len < ${t.min}) {\n\t\t\t\t${this.makeError({type:"arrayMin",expected:t.min,actual:"len",messages:e})}\n\t\t\t}\n\t\t`),null!=t.max&&r.push(`\n\t\t\tif (len > ${t.max}) {\n\t\t\t\t${this.makeError({type:"arrayMax",expected:t.max,actual:"len",messages:e})}\n\t\t\t}\n\t\t`),null!=t.length&&r.push(`\n\t\t\tif (len !== ${t.length}) {\n\t\t\t\t${this.makeError({type:"arrayLength",expected:t.length,actual:"len",messages:e})}\n\t\t\t}\n\t\t`),null!=t.contains&&r.push(`\n\t\t\tif (value.indexOf(${JSON.stringify(t.contains)}) === -1) {\n\t\t\t\t${this.makeError({type:"arrayContains",expected:JSON.stringify(t.contains),actual:"value",messages:e})}\n\t\t\t}\n\t\t`),!0===t.unique&&r.push(`\n\t\t\tif(len > (new Set(value)).size) {\n\t\t\t\t${this.makeError({type:"arrayUnique",expected:"Array.from(new Set(value.filter((item, index) => value.indexOf(item) !== index)))",actual:"value",messages:e})}\n\t\t\t}\n\t\t`),null!=t.enum){const n=JSON.stringify(t.enum);r.push(`\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tif (${n}.indexOf(value[i]) === -1) {\n\t\t\t\t\t${this.makeError({type:"arrayEnum",expected:'"'+t.enum.join(", ")+'"',actual:"value[i]",messages:e})}\n\t\t\t\t}\n\t\t\t}\n\t\t`)}if(null!=t.items){r.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t");const e=n+"[]",s=this.getRuleFromSchema(t.items),a='arr[i] = context.fn[%%INDEX%%](arr[i], (parentField ? parentField : "") + "[" + i + "]", parent, errors, context)';r.push(this.compileRule(s,i,e,a,"arr[i]")),r.push("\n\t\t\t}\n\t\t")}return r.push("\n\t\treturn value;\n\t"),{source:r.join("\n")}},Ht=function({schema:t,messages:e},n,i){const r=[];let s=!1;return r.push("\n\t\tvar origValue = value;\n\t"),!0===t.convert&&(s=!0,r.push('\n\t\t\tif (typeof value !== "boolean") {\n\t\t\t\tif (\n\t\t\t\tvalue === 1\n\t\t\t\t|| value === "true"\n\t\t\t\t|| value === "1"\n\t\t\t\t|| value === "on"\n\t\t\t\t) {\n\t\t\t\t\tvalue = true;\n\t\t\t\t} else if (\n\t\t\t\tvalue === 0\n\t\t\t\t|| value === "false"\n\t\t\t\t|| value === "0"\n\t\t\t\t|| value === "off"\n\t\t\t\t) {\n\t\t\t\t\tvalue = false;\n\t\t\t\t}\n\t\t\t}\n\t\t')),r.push(`\n\t\tif (typeof value !== "boolean") {\n\t\t\t${this.makeError({type:"boolean",actual:"origValue",messages:e})}\n\t\t}\n\t\t\n\t\treturn value;\n\t`),{sanitized:s,source:r.join("\n")}},Ut=function({schema:t,messages:e,index:n},i,r){const s=[],a=t.instanceOf.name?t.instanceOf.name:"";return r.customs[n]?r.customs[n].schema=t:r.customs[n]={schema:t},s.push(`\n\t\tif (!(value instanceof context.customs[${n}].schema.instanceOf))\n\t\t\t${this.makeError({type:"classInstanceOf",actual:"value",expected:"'"+a+"'",messages:e})}\n\t`),s.push("\n\t\treturn value;\n\t"),{source:s.join("\n")}},Qt=function({schema:t,messages:e,index:n},i,r){const s=[];return s.push(`\n\t\t${this.makeCustomValidator({fnName:"check",path:i,schema:t,messages:e,context:r,ruleIndex:n})}\n\t\treturn value;\n\t`),{source:s.join("\n")}};var Xt=function({schema:t,messages:e},n,i){const r=t.currencySymbol||null,s=t.thousandSeparator||",",a=t.decimalSeparator||".",o=t.customRegex;let u=!t.symbolOptional,l="(?=.*\\d)^(-?~1|~1-?)(([0-9]\\d{0,2}(~2\\d{3})*)|0)?(\\~3\\d{1,2})?$".replace(/~1/g,r?`\\${r}${u?"":"?"}`:"").replace("~2",s).replace("~3",a);const c=[];return c.push(`\n\t\tif (!value.match(${o||new RegExp(l)})) {\n\t\t\t${this.makeError({type:"currency",actual:"value",messages:e})}\n\t\t\treturn value;\n\t\t}\n\n\t\treturn value;\n\t`),{source:c.join("\n")}},Zt=function({schema:t,messages:e},n,i){const r=[];let s=!1;return r.push("\n\t\tvar origValue = value;\n\t"),!0===t.convert&&(s=!0,r.push("\n\t\t\tif (!(value instanceof Date)) {\n\t\t\t\tvalue = new Date(value);\n\t\t\t}\n\t\t")),r.push(`\n\t\tif (!(value instanceof Date) || isNaN(value.getTime()))\n\t\t\t${this.makeError({type:"date",actual:"origValue",messages:e})}\n\n\t\treturn value;\n\t`),{sanitized:s,source:r.join("\n")}};const Yt=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,te=/^\S+@\S+\.\S+$/;var ee=function({schema:t,messages:e},n,i){const r=[],s="precise"==t.mode?Yt:te;let a=!1;return r.push(`\n\t\tif (typeof value !== "string") {\n\t\t\t${this.makeError({type:"string",actual:"value",messages:e})}\n\t\t\treturn value;\n\t\t}\n\t`),t.empty?r.push("\n\t\t\tif (value.length === 0) return value;\n\t\t"):r.push(`\n\t\t\tif (value.length === 0) {\n\t\t\t\t${this.makeError({type:"emailEmpty",actual:"value",messages:e})}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t`),t.normalize&&(a=!0,r.push("\n\t\t\tvalue = value.trim().toLowerCase();\n\t\t")),null!=t.min&&r.push(`\n\t\t\tif (value.length < ${t.min}) {\n\t\t\t\t${this.makeError({type:"emailMin",expected:t.min,actual:"value.length",messages:e})}\n\t\t\t}\n\t\t`),null!=t.max&&r.push(`\n\t\t\tif (value.length > ${t.max}) {\n\t\t\t\t${this.makeError({type:"emailMax",expected:t.max,actual:"value.length",messages:e})}\n\t\t\t}\n\t\t`),r.push(`\n\t\tif (!${s.toString()}.test(value)) {\n\t\t\t${this.makeError({type:"email",actual:"value",messages:e})}\n\t\t}\n\n\t\treturn value;\n\t`),{sanitized:a,source:r.join("\n")}},ne=function({schema:t,messages:e},n,i){return{source:`\n\t\t\tif (${JSON.stringify(t.values||[])}.indexOf(value) === -1)\n\t\t\t\t${this.makeError({type:"enumValue",expected:'"'+t.values.join(", ")+'"',actual:"value",messages:e})}\n\t\t\t\n\t\t\treturn value;\n\t\t`}},ie=function({schema:t,messages:e},n,i){const r=[];return t.field?(t.strict?r.push(`\n\t\t\t\tif (value !== parent["${t.field}"])\n\t\t\t`):r.push(`\n\t\t\t\tif (value != parent["${t.field}"])\n\t\t\t`),r.push(`\n\t\t\t\t${this.makeError({type:"equalField",actual:"value",expected:JSON.stringify(t.field),messages:e})}\n\t\t`)):(t.strict?r.push(`\n\t\t\t\tif (value !== ${JSON.stringify(t.value)})\n\t\t\t`):r.push(`\n\t\t\t\tif (value != ${JSON.stringify(t.value)})\n\t\t\t`),r.push(`\n\t\t\t\t${this.makeError({type:"equalValue",actual:"value",expected:JSON.stringify(t.value),messages:e})}\n\t\t`)),r.push("\n\t\treturn value;\n\t"),{source:r.join("\n")}},re=function({schema:t,messages:e},n,i){const r=[];return r.push("\n\t\tif (value !== null && value !== undefined) {\n\t"),t.remove?r.push("\n\t\t\treturn undefined;\n\t\t"):r.push(`\n\t\t\t${this.makeError({type:"forbidden",actual:"value",messages:e})}\n\t\t`),r.push("\n\t\t}\n\n\t\treturn value;\n\t"),{source:r.join("\n")}},se=function({schema:t,messages:e},n,i){return{source:`\n\t\t\tif (typeof value !== "function")\n\t\t\t\t${this.makeError({type:"function",actual:"value",messages:e})}\n\n\t\t\treturn value;\n\t\t`}},ae=function({schema:t,messages:e},n,i){const r=[];r.push("\n\t\tvar prevErrLen = errors.length;\n\t\tvar errBefore;\n\t\tvar hasValid = false;\n\t\tvar newVal = value;\n\t");for(let e=0;e ${t.max}) {\n\t\t\t\t${this.makeError({type:"numberMax",expected:t.max,actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),null!=t.equal&&r.push(`\n\t\t\tif (value !== ${t.equal}) {\n\t\t\t\t${this.makeError({type:"numberEqual",expected:t.equal,actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),null!=t.notEqual&&r.push(`\n\t\t\tif (value === ${t.notEqual}) {\n\t\t\t\t${this.makeError({type:"numberNotEqual",expected:t.notEqual,actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.integer&&r.push(`\n\t\t\tif (value % 1 !== 0) {\n\t\t\t\t${this.makeError({type:"numberInteger",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.positive&&r.push(`\n\t\t\tif (value <= 0) {\n\t\t\t\t${this.makeError({type:"numberPositive",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.negative&&r.push(`\n\t\t\tif (value >= 0) {\n\t\t\t\t${this.makeError({type:"numberNegative",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),r.push("\n\t\treturn value;\n\t"),{sanitized:s,source:r.join("\n")}};const ue=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/,le=/["'\\\n\r\u2028\u2029]/g;function ce(t){return t.replace(le,(function(t){switch(t){case'"':case"'":case"\\":return"\\"+t;case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029"}}))}var he=function({schema:t,messages:e},n,i){const r=[];r.push(`\n\t\tif (typeof value !== "object" || value === null || Array.isArray(value)) {\n\t\t\t${this.makeError({type:"object",actual:"value",messages:e})}\n\t\t\treturn value;\n\t\t}\n\t`);const s=t.properties||t.props;if(s){r.push("var parentObj = value;"),r.push("var parentField = field;");const a=Object.keys(s);for(let t=0;t ${t.maxProps}) {\n\t\t\t\t${this.makeError({type:"objectMaxProps",expected:t.maxProps,actual:"props.length",messages:e})}\n\t\t\t}\n\t\t`),s?r.push("\n\t\t\treturn parentObj;\n\t\t"):r.push("\n\t\t\treturn value;\n\t\t"),{source:r.join("\n")}},pe=function({schema:t,messages:e,index:n},i,r){const s=[];return r.customs[n]?r.customs[n].schema=t:r.customs[n]={schema:t},s.push(`\n\t\tconst ObjectID = context.customs[${n}].schema.ObjectID;\n\t\tif (!ObjectID.isValid(value)) {\n\t\t\t${this.makeError({type:"objectID",actual:"value",messages:e})}\n\t\t\treturn;\n\t\t}\n\t`),!0===t.convert?s.push("return new ObjectID(value)"):"hexString"===t.convert?s.push("return value.toString()"):s.push("return value"),{source:s.join("\n")}};const de=/^-?[0-9]\d*(\.\d+)?$/,fe=/^[a-zA-Z]+$/,me=/^[a-zA-Z0-9]+$/,ve=/^[a-zA-Z0-9_-]+$/,ye=/^[0-9a-fA-F]+$/,ge=/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+/]{3}=)?$/;var be=function({schema:t,messages:e},n,i){const r=[];let s=!1;if(!0===t.convert&&(s=!0,r.push('\n\t\t\tif (typeof value !== "string") {\n\t\t\t\tvalue = String(value);\n\t\t\t}\n\t\t')),r.push(`\n\t\tif (typeof value !== "string") {\n\t\t\t${this.makeError({type:"string",actual:"value",messages:e})}\n\t\t\treturn value;\n\t\t}\n\n\t\tvar origValue = value;\n\t`),t.trim&&(s=!0,r.push("\n\t\t\tvalue = value.trim();\n\t\t")),t.trimLeft&&(s=!0,r.push("\n\t\t\tvalue = value.trimLeft();\n\t\t")),t.trimRight&&(s=!0,r.push("\n\t\t\tvalue = value.trimRight();\n\t\t")),t.padStart){s=!0;const e=null!=t.padChar?t.padChar:" ";r.push(`\n\t\t\tvalue = value.padStart(${t.padStart}, ${JSON.stringify(e)});\n\t\t`)}if(t.padEnd){s=!0;const e=null!=t.padChar?t.padChar:" ";r.push(`\n\t\t\tvalue = value.padEnd(${t.padEnd}, ${JSON.stringify(e)});\n\t\t`)}if(t.lowercase&&(s=!0,r.push("\n\t\t\tvalue = value.toLowerCase();\n\t\t")),t.uppercase&&(s=!0,r.push("\n\t\t\tvalue = value.toUpperCase();\n\t\t")),t.localeLowercase&&(s=!0,r.push("\n\t\t\tvalue = value.toLocaleLowerCase();\n\t\t")),t.localeUppercase&&(s=!0,r.push("\n\t\t\tvalue = value.toLocaleUpperCase();\n\t\t")),r.push("\n\t\t\tvar len = value.length;\n\t"),!1===t.empty&&r.push(`\n\t\t\tif (len === 0) {\n\t\t\t\t${this.makeError({type:"stringEmpty",actual:"value",messages:e})}\n\t\t\t}\n\t\t`),null!=t.min&&r.push(`\n\t\t\tif (len < ${t.min}) {\n\t\t\t\t${this.makeError({type:"stringMin",expected:t.min,actual:"len",messages:e})}\n\t\t\t}\n\t\t`),null!=t.max&&r.push(`\n\t\t\tif (len > ${t.max}) {\n\t\t\t\t${this.makeError({type:"stringMax",expected:t.max,actual:"len",messages:e})}\n\t\t\t}\n\t\t`),null!=t.length&&r.push(`\n\t\t\tif (len !== ${t.length}) {\n\t\t\t\t${this.makeError({type:"stringLength",expected:t.length,actual:"len",messages:e})}\n\t\t\t}\n\t\t`),null!=t.pattern){let n=t.pattern;"string"==typeof t.pattern&&(n=new RegExp(t.pattern,t.patternFlags));const i=`\n\t\t\tif (!${n.toString()}.test(value))\n\t\t\t\t${this.makeError({type:"stringPattern",expected:`"${n.toString().replace(/"/g,"\\$&")}"`,actual:"origValue",messages:e})}\n\t\t`;r.push(`\n\t\t\tif (${t.empty} === true && len === 0) {\n\t\t\t\t// Do nothing\n\t\t\t} else {\n\t\t\t\t${i}\n\t\t\t}\n\t\t`)}if(null!=t.contains&&r.push(`\n\t\t\tif (value.indexOf("${t.contains}") === -1) {\n\t\t\t\t${this.makeError({type:"stringContains",expected:'"'+t.contains+'"',actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),null!=t.enum){const n=JSON.stringify(t.enum);r.push(`\n\t\t\tif (${n}.indexOf(value) === -1) {\n\t\t\t\t${this.makeError({type:"stringEnum",expected:'"'+t.enum.join(", ")+'"',actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`)}return!0===t.numeric&&r.push(`\n\t\t\tif (!${de.toString()}.test(value) ) {\n\t\t\t\t${this.makeError({type:"stringNumeric",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.alpha&&r.push(`\n\t\t\tif(!${fe.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringAlpha",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.alphanum&&r.push(`\n\t\t\tif(!${me.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringAlphanum",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.alphadash&&r.push(`\n\t\t\tif(!${ve.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringAlphadash",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.hex&&r.push(`\n\t\t\tif(value.length % 2 !== 0 || !${ye.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringHex",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),!0===t.singleLine&&r.push(`\n\t\t\tif(value.includes("\\n")) {\n\t\t\t\t${this.makeError({type:"stringSingleLine",messages:e})}\n\t\t\t}\n\t\t`),!0===t.base64&&r.push(`\n\t\t\tif(!${ge.toString()}.test(value)) {\n\t\t\t\t${this.makeError({type:"stringBase64",actual:"origValue",messages:e})}\n\t\t\t}\n\t\t`),r.push("\n\t\treturn value;\n\t"),{sanitized:s,source:r.join("\n")}},ke=function({schema:t,messages:e},n,i){const r=[];if(null!=t.items){if(!Array.isArray(t.items))throw new Error(`Invalid '${t.type}' schema. The 'items' field must be an array.`);if(0===t.items.length)throw new Error(`Invalid '${t.type}' schema. The 'items' field must not be an empty array.`)}if(r.push(`\n\t\tif (!Array.isArray(value)) {\n\t\t\t${this.makeError({type:"tuple",actual:"value",messages:e})}\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t`),!1===t.empty&&r.push(`\n\t\t\tif (len === 0) {\n\t\t\t\t${this.makeError({type:"tupleEmpty",actual:"value",messages:e})}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t`),null!=t.items){r.push(`\n\t\t\tif (${t.empty} !== false && len === 0) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (len !== ${t.items.length}) {\n\t\t\t\t${this.makeError({type:"tupleLength",expected:t.items.length,actual:"len",messages:e})}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t`),r.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t");for(let e=0;e 0)) {\n\t\t\t\t${this.makeError({type:"luhn",actual:"value",messages:e})}\n\t\t\t}\n\n\t\t\treturn value;\n\t\t`}};function Ae(t){var e={exports:{}};return t(e,e.exports),e.exports}function _e(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}let De,Te,Se,Me;var je=function(t){De||(De=_e("prettier"),Te={parser:"babel",useTabs:!1,printWidth:120,trailingComma:"none",tabWidth:4,singleQuote:!1,semi:!0,bracketSpacing:!0},Se=_e("cli-highlight"),Me={language:"js",theme:Se.fromJson({keyword:["white","bold"],built_in:"magenta",literal:"cyan",number:"magenta",regexp:"red",string:["yellow","bold"],symbol:"plain",class:"blue",attr:"plain",function:["white","bold"],title:"plain",params:"green",comment:"grey"})});const e=De.format(t,Te);return Se.highlight(e,Me)};var Ve=class{constructor(t){if(this.opts={},this.defaults={},this.messages=Object.assign({},Kt),this.rules={any:Jt,array:Wt,boolean:Ht,class:Ut,custom:Qt,currency:Xt,date:Zt,email:ee,enum:ne,equal:ie,forbidden:re,function:se,multi:ae,number:oe,object:he,objectID:pe,string:be,tuple:ke,url:we,uuid:Oe,mac:Pe,luhn:Ee},this.aliases={},this.cache=new Map,t){if(qt(this.opts,t),t.defaults&&qt(this.defaults,t.defaults),t.messages)for(const e in t.messages)this.addMessage(e,t.messages[e]);if(t.aliases)for(const e in t.aliases)this.alias(e,t.aliases[e]);if(t.customRules)for(const e in t.customRules)this.add(e,t.customRules[e]);if(t.plugins){const e=t.plugins;if(!Array.isArray(e))throw new Error("Plugins type must be array");e.forEach(this.plugin.bind(this))}}}validate(t,e){return this.compile(e)(t)}wrapRequiredCheckSourceCode(t,e,n,i){const r=[];let s,a=!0===t.schema.optional||"forbidden"===t.schema.type,o=!0===t.schema.optional||!0===t.schema.nullable||"forbidden"===t.schema.type;if(null!=t.schema.default){let e;a=!1,!0!==t.schema.nullable&&(o=!1),"function"==typeof t.schema.default?(n.customs[t.index]||(n.customs[t.index]={}),n.customs[t.index].defaultFn=t.schema.default,e=`context.customs[${t.index}].defaultFn()`):e=JSON.stringify(t.schema.default),s=`\n\t\t\t\tvalue = ${e};\n\t\t\t\t${i} = value;\n\t\t\t`}else s=this.makeError({type:"required",actual:"value",messages:t.messages});return r.push(`\n\t\t\tif (value === undefined) { ${a?"\n// allow undefined\n":s} }\n\t\t\telse if (value === null) { ${o?"\n// allow null\n":s} }\n\t\t\t${e?`else { ${e} }`:""}\n\t\t`),r.join("\n")}compile(t){if(null===t||"object"!=typeof t)throw new Error("Invalid schema.");const e=this,n={index:0,rules:[],fn:[],customs:{}};if(this.cache.clear(),!0!==t.$$root)if(Array.isArray(t)){t=this.getRuleFromSchema(t).schema}else{const e=Object.assign({},t);t={type:"object",strict:e.$$strict,properties:e},delete e.$$strict}const i=["var errors = [];","var field;","var parent = null;"],r=this.getRuleFromSchema(t);i.push(this.compileRule(r,n,null,"context.fn[%%INDEX%%](value, field, null, errors, context);","value")),i.push("if (errors.length) {"),i.push('\n\t\t\treturn errors.map(err => {\n\t\t\t\tif (err.message)\n\t\t\t\t\terr.message = err.message\n\t\t\t\t\t\t.replace(/\\{field\\}/g, err.field || "")\n\t\t\t\t\t\t.replace(/\\{expected\\}/g, err.expected != null ? err.expected : "")\n\t\t\t\t\t\t.replace(/\\{actual\\}/g, err.actual != null ? err.actual : "");\n\n\t\t\t\treturn err;\n\t\t\t});\n\t\t'),i.push("}"),i.push("return true;");const s=i.join("\n"),a=new Function("value","context",s);if(this.opts.debug){let t=function(t){return t};"undefined"==typeof window&&(t=je),n.fn.forEach(((e,n)=>console.log(t(`// Context.fn[${n}]\n`+e.toString())))),console.log(t("// Main check function\n"+a.toString()))}return this.cache.clear(),function(t){return n.data=t,a.call(e,t,n)}}compileRule(t,e,n,i,r){const s=[],a=this.cache.get(t.schema);if(a)(t=a).cycle=!0,t.cycleStack=[],s.push(this.wrapRequiredCheckSourceCode(t,`\n\t\t\t\tvar rule = context.rules[${t.index}];\n\t\t\t\tif (rule.cycleStack.indexOf(value) === -1) {\n\t\t\t\t\trule.cycleStack.push(value);\n\t\t\t\t\t${i.replace(/%%INDEX%%/g,t.index)}\n\t\t\t\t\trule.cycleStack.pop(value);\n\t\t\t\t}\n\t\t\t`,e,r));else{this.cache.set(t.schema,t),t.index=e.index,e.rules[e.index]=t;const a=null!=n?n:"$$root";e.index++;const o=t.ruleFunction.call(this,t,n,e);o.source=o.source.replace(/%%INDEX%%/g,t.index);const u=new Function("value","field","parent","errors","context",o.source);e.fn[t.index]=u,s.push(this.wrapRequiredCheckSourceCode(t,i.replace(/%%INDEX%%/g,t.index),e,r)),s.push(this.makeCustomValidator({vName:r,path:a,schema:t.schema,context:e,messages:t.messages,ruleIndex:t.index}))}return s.join("\n")}getRuleFromSchema(t){if("string"==typeof t)t=this.parseShortHand(t);else if(Array.isArray(t)){if(0==t.length)throw new Error("Invalid schema.");(t={type:"multi",rules:t}).rules.map((t=>this.getRuleFromSchema(t))).every((t=>1==t.schema.optional))&&(t.optional=!0)}if(t.$$type){const e=t.$$type,n=this.getRuleFromSchema(e).schema;delete t.$$type;const i=Object.assign({},t);for(const e in t)delete t[e];qt(t,n,{skipIfExist:!0}),t.props=i}const e=this.aliases[t.type];e&&(delete t.type,t=qt(t,e,{skipIfExist:!0}));const n=this.rules[t.type];if(!n)throw new Error("Invalid '"+t.type+"' type in validator schema.");return{messages:Object.assign({},this.messages,t.messages),schema:qt(t,this.defaults[t.type],{skipIfExist:!0}),ruleFunction:n}}parseShortHand(t){const e=t.split("|").map((t=>t.trim()));let n,i=e[0];return n=i.endsWith("[]")?this.getRuleFromSchema({type:"array",items:i.slice(0,-2)}).schema:{type:e[0]},e.slice(1).map((t=>{const e=t.indexOf(":");if(-1!==e){const i=t.substr(0,e).trim();let r=t.substr(e+1).trim();"true"===r||"false"===r?r="true"===r:Number.isNaN(Number(r))||(r=Number(r)),n[i]=r}else t.startsWith("no-")?n[t.slice(3)]=!1:n[t]=!0})),n}makeError({type:t,field:e,expected:n,actual:i,messages:r}){const s={type:`"${t}"`,message:`"${r[t]}"`};s.field=e?`"${e}"`:"field",null!=n&&(s.expected=n),null!=i&&(s.actual=i);return`errors.push({ ${Object.keys(s).map((t=>`${t}: ${s[t]}`)).join(", ")} });`}makeCustomValidator({vName:t="value",fnName:e="custom",ruleIndex:n,path:i,schema:r,context:s,messages:a}){const o="rule"+n,u="fnCustomErrors"+n;if("function"==typeof r[e]){if(s.customs[n]?(s.customs[n].messages=a,s.customs[n].schema=r):s.customs[n]={messages:a,schema:r},this.opts.useNewCustomCheckerFunction)return`\n const ${o} = context.customs[${n}];\n\t\t\t\t\tconst ${u} = [];\n\t\t\t\t\t${t} = ${o}.schema.${e}.call(this, ${t}, ${u} , ${o}.schema, "${i}", parent, context);\n\t\t\t\t\tif (Array.isArray(${u} )) {\n ${u} .forEach(err => errors.push(Object.assign({ message: ${o}.messages[err.type], field }, err)));\n\t\t\t\t\t}\n\t\t\t\t`;const l="res_"+o;return`\n\t\t\t\tconst ${o} = context.customs[${n}];\n\t\t\t\tconst ${l} = ${o}.schema.${e}.call(this, ${t}, ${o}.schema, "${i}", parent, context);\n\t\t\t\tif (Array.isArray(${l})) {\n\t\t\t\t\t${l}.forEach(err => errors.push(Object.assign({ message: ${o}.messages[err.type], field }, err)));\n\t\t\t\t}\n\t\t`}return""}add(t,e){this.rules[t]=e}addMessage(t,e){this.messages[t]=e}alias(t,e){if(this.rules[t])throw new Error("Alias name must not be a rule name");this.aliases[t]=e}plugin(t){if("function"!=typeof t)throw new Error("Plugin fn type must be function");return t(this)}},Ne="INUMBER",$e="IOP1",Be="IOP2",Le="IOP3",Fe="IVAR",Re="IVARNAME",ze="IFUNCALL",Ge="IFUNDEF",qe="IEXPR",Ke="IEXPREVAL",Je="IMEMBER",We="IENDSTATEMENT",He="IARRAY";function Ue(t,e){this.type=t,this.value=null!=e?e:0}function Qe(t){return new Ue($e,t)}function Xe(t){return new Ue(Be,t)}function Ze(t){return new Ue(Le,t)}function Ye(t,e,n,i,r){for(var s,a,o,u,l=[],c=[],h=0;h1)a=l.pop(),s=l.pop(),u=n[p.value],p=new Ue(Ne,u(s.value,a.value)),l.push(p);else if(d===Le&&l.length>2)o=l.pop(),a=l.pop(),s=l.pop(),"?"===p.value?l.push(s.value?a.value:o.value):(u=i[p.value],p=new Ue(Ne,u(s.value,a.value,o.value)),l.push(p));else if(d===$e&&l.length>0)s=l.pop(),u=e[p.value],p=new Ue(Ne,u(s.value)),l.push(p);else if(d===qe){for(;l.length>0;)c.push(l.shift());c.push(new Ue(qe,Ye(p.value,e,n,i,r)))}else if(d===Je&&l.length>0)s=l.pop(),l.push(new Ue(Ne,s.value[p.value]));else{for(;l.length>0;)c.push(l.shift());c.push(p)}}for(;l.length>0;)c.push(l.shift());return c}function tn(t,e,n){for(var i=[],r=0;r0;)o.unshift(sn(l.pop(),n));if(!(a=l.pop()).apply||!a.call)throw new Error(a+" is not a function");l.push(a.apply(void 0,o))}else if(d===Ge)l.push(function(){for(var t=l.pop(),i=[],r=p.value;r-- >0;)i.unshift(l.pop());var s=l.pop(),a=function(){for(var r=Object.assign({},n),s=0,a=i.length;s0;)o.unshift(l.pop());l.push(o)}}if(l.length>1)throw new Error("invalid Expression (parity)");return 0===l[0]?0:sn(l[0],n)}function nn(t,e,n){return rn(t)?t:{type:Ke,value:function(n){return en(t.value,e,n)}}}function rn(t){return t&&t.type===Ke}function sn(t,e){return rn(t)?t.value(e):t}function an(t,e){for(var n,i,r,s,a,o,u=[],l=0;l0;)a.unshift(u.pop());s=u.pop(),u.push(s+"("+a.join(", ")+")")}else if(h===Ge){for(i=u.pop(),o=c.value,a=[];o-- >0;)a.unshift(u.pop());n=u.pop(),e?u.push("("+n+" = function("+a.join(", ")+") { return "+i+" })"):u.push("("+n+"("+a.join(", ")+") = "+i+")")}else if(h===Je)n=u.pop(),u.push(n+"."+c.value);else if(h===He){for(o=c.value,a=[];o-- >0;)a.unshift(u.pop());u.push("["+a.join(", ")+"]")}else if(h===qe)u.push("("+an(c.value,e)+")");else if(h!==We)throw new Error("invalid Expression")}return u.length>1&&(u=e?[u.join(",")]:[u.join(";")]),String(u[0])}function on(t){return"string"==typeof t?JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):t}function un(t,e){for(var n=0;n=this.expression.length?this.newToken(hn,"EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},xn.prototype.isString=function(){var t=!1,e=this.pos,n=this.expression.charAt(e);if("'"===n||'"'===n)for(var i=this.expression.indexOf(n,e+1);i>=0&&this.pos"9")))break}if(e>t){var i=this.expression.substring(t,e);if(i in this.consts)return this.current=this.newToken(dn,this.consts[i]),this.pos+=i.length,!0}return!1},xn.prototype.isNamedOp=function(){for(var t=this.pos,e=t;e"9")))break}if(e>t){var i=this.expression.substring(t,e);if(this.isOperatorEnabled(i)&&(i in this.binaryOps||i in this.unaryOps||i in this.ternaryOps))return this.current=this.newToken(pn,i),this.pos+=i.length,!0}return!1},xn.prototype.isName=function(){for(var t=this.pos,e=t,n=!1;e"9"))break}else n=!0}if(n){var r=this.expression.substring(t,e);return this.current=this.newToken(gn,r),this.pos+=r.length,!0}return!1},xn.prototype.isWhitespace=function(){for(var t=!1,e=this.expression.charAt(this.pos);!(" "!==e&&"\t"!==e&&"\n"!==e&&"\r"!==e||(t=!0,this.pos++,this.pos>=this.expression.length));)e=this.expression.charAt(this.pos);return t};var wn=/^[0-9a-f]{4}$/i;function Cn(t,e,n){this.parser=t,this.tokens=e,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=!1!==n.allowMemberAccess}xn.prototype.unescape=function(t){var e=t.indexOf("\\");if(e<0)return t;for(var n=t.substring(0,e);e>=0;){var i=t.charAt(++e);switch(i){case"'":n+="'";break;case'"':n+='"';break;case"\\":n+="\\";break;case"/":n+="/";break;case"b":n+="\b";break;case"f":n+="\f";break;case"n":n+="\n";break;case"r":n+="\r";break;case"t":n+="\t";break;case"u":var r=t.substring(e+1,e+5);wn.test(r)||this.parseError("Illegal escape sequence: \\u"+r),n+=String.fromCharCode(parseInt(r,16)),e+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+i+'"')}++e;var s=t.indexOf("\\",e);n+=t.substring(e,s<0?t.length:s),e=s}return n},xn.prototype.isComment=function(){return"/"===this.expression.charAt(this.pos)&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},xn.prototype.isRadixInteger=function(){var t,e,n=this.pos;if(n>=this.expression.length-2||"0"!==this.expression.charAt(n))return!1;if(++n,"x"===this.expression.charAt(n))t=16,e=/^[0-9a-f]$/i,++n;else{if("b"!==this.expression.charAt(n))return!1;t=2,e=/^[01]$/i,++n}for(var i=!1,r=n;n="0"&&t<="9"||!s&&"."===t);)"."===t?s=!0:a=!0,n++,e=a;if(e&&(r=n),"e"===t||"E"===t){n++;for(var o=!0,u=!1;n="0"&&t<="9"))break;u=!0,o=!1}else o=!1;n++}u||(n=r)}return e?(this.current=this.newToken(dn,parseFloat(this.expression.substring(i,n))),this.pos=n):this.pos=r,e},xn.prototype.isOperator=function(){var t=this.pos,e=this.expression.charAt(this.pos);if("+"===e||"-"===e||"*"===e||"/"===e||"%"===e||"^"===e||"?"===e||":"===e||"."===e)this.current=this.newToken(pn,e);else if("∙"===e||"•"===e)this.current=this.newToken(pn,"*");else if(">"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(pn,">="),this.pos++):this.current=this.newToken(pn,">");else if("<"===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(pn,"<="),this.pos++):this.current=this.newToken(pn,"<");else if("|"===e){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(pn,"||"),this.pos++}else if("="===e)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(pn,"=="),this.pos++):this.current=this.newToken(pn,e);else{if("!"!==e)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(pn,"!="),this.pos++):this.current=this.newToken(pn,e)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=t,!1)},xn.prototype.isOperatorEnabled=function(t){return this.parser.isOperatorEnabled(t)},xn.prototype.getCoordinates=function(){var t,e=0,n=-1;do{e++,t=this.pos-n,n=this.expression.indexOf("\n",n+1)}while(n>=0&&n=",">","in"];Cn.prototype.parseComparison=function(t){for(this.parseAddSub(t);this.accept(pn,On);){var e=this.current;this.parseAddSub(t),t.push(Xe(e.value))}};var In=["+","-","||"];Cn.prototype.parseAddSub=function(t){for(this.parseTerm(t);this.accept(pn,In);){var e=this.current;this.parseTerm(t),t.push(Xe(e.value))}};var Pn=["*","/","%"];function En(t,e){return Number(t)+Number(e)}function An(t,e){return t-e}function _n(t,e){return t*e}function Dn(t,e){return t/e}function Tn(t,e){return t%e}function Sn(t,e){return Array.isArray(t)&&Array.isArray(e)?t.concat(e):""+t+e}function Mn(t,e){return t===e}function jn(t,e){return t!==e}function Vn(t,e){return t>e}function Nn(t,e){return t=e}function Bn(t,e){return t<=e}function Ln(t,e){return Boolean(t&&e)}function Fn(t,e){return Boolean(t||e)}function Rn(t,e){return un(e,t)}function zn(t){return(Math.exp(t)-Math.exp(-t))/2}function Gn(t){return(Math.exp(t)+Math.exp(-t))/2}function qn(t){return t===1/0?1:t===-1/0?-1:(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}function Kn(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))}function Jn(t){return Math.log(t+Math.sqrt(t*t-1))}function Wn(t){return Math.log((1+t)/(1-t))/2}function Hn(t){return Math.log(t)*Math.LOG10E}function Un(t){return-t}function Qn(t){return!t}function Xn(t){return t<0?Math.ceil(t):Math.floor(t)}function Zn(t){return Math.random()*(t||1)}function Yn(t){return ei(t+1)}Cn.prototype.parseTerm=function(t){for(this.parseFactor(t);this.accept(pn,Pn);){var e=this.current;this.parseFactor(t),t.push(Xe(e.value))}},Cn.prototype.parseFactor=function(t){var e=this.tokens.unaryOps;if(this.save(),this.accept(pn,(function(t){return t.value in e}))){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===mn&&"("===this.nextToken.value)return this.restore(),void this.parseExponential(t);if(this.nextToken.type===bn||this.nextToken.type===yn||this.nextToken.type===hn||this.nextToken.type===mn&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(t)}var n=this.current;this.parseFactor(t),t.push(Qe(n.value))}else this.parseExponential(t)},Cn.prototype.parseExponential=function(t){for(this.parsePostfixExpression(t);this.accept(pn,"^");)this.parseFactor(t),t.push(Xe("^"))},Cn.prototype.parsePostfixExpression=function(t){for(this.parseFunctionCall(t);this.accept(pn,"!");)t.push(Qe("!"))},Cn.prototype.parseFunctionCall=function(t){var e=this.tokens.unaryOps;if(this.accept(pn,(function(t){return t.value in e}))){var n=this.current;this.parseAtom(t),t.push(Qe(n.value))}else for(this.parseMemberExpression(t);this.accept(mn,"(");)if(this.accept(mn,")"))t.push(new Ue(ze,0));else{var i=this.parseArgumentList(t);t.push(new Ue(ze,i))}},Cn.prototype.parseArgumentList=function(t){for(var e=0;!this.accept(mn,")");)for(this.parseExpression(t),++e;this.accept(yn);)this.parseExpression(t),++e;return e},Cn.prototype.parseMemberExpression=function(t){for(this.parseAtom(t);this.accept(pn,".")||this.accept(vn,"[");){var e=this.current;if("."===e.value){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect(gn),t.push(new Ue(Je,this.current.value))}else{if("["!==e.value)throw new Error("unexpected symbol: "+e.value);if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(t),this.expect(vn,"]"),t.push(Xe("["))}}};var ti=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function ei(t){var e,n;if(function(t){return isFinite(t)&&t===Math.round(t)}(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var i=t-2,r=t-1;i>1;)r*=i,i--;return 0===r&&(r=1),r}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*ei(1-t));if(t>=171.35)return 1/0;if(t>85){var s=t*t,a=s*t,o=a*t,u=o*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*s)-139/(51840*a)-571/(2488320*o)+163879/(209018880*u)+5246819/(75246796800*u*t))}--t,n=ti[0];for(var l=1;l0?(i=r/e)*i:r}return e===1/0?1/0:e*Math.sqrt(t)}function ri(t,e,n){return t?e:n}function si(t,e){return void 0===e||0==+e?Math.round(t):(t=+t,e=-+e,isNaN(t)||"number"!=typeof e||e%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math.round(+(t[0]+"e"+(t[1]?+t[1]-e:-e)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+e:e))))}function ai(t,e,n){return n&&(n[t]=e),e}function oi(t,e){return t[0|e]}function ui(t){return 1===arguments.length&&Array.isArray(t)?Math.max.apply(Math,t):Math.max.apply(Math,arguments)}function li(t){return 1===arguments.length&&Array.isArray(t)?Math.min.apply(Math,t):Math.min.apply(Math,arguments)}function ci(t,e){if("function"!=typeof t)throw new Error("First argument to map is not a function");if(!Array.isArray(e))throw new Error("Second argument to map is not an array");return e.map((function(e,n){return t(e,n)}))}function hi(t,e,n){if("function"!=typeof t)throw new Error("First argument to fold is not a function");if(!Array.isArray(n))throw new Error("Second argument to fold is not an array");return n.reduce((function(e,n,i){return t(e,n,i)}),e)}function pi(t,e){if("function"!=typeof t)throw new Error("First argument to filter is not a function");if(!Array.isArray(e))throw new Error("Second argument to filter is not an array");return e.filter((function(e,n){return t(e,n)}))}function di(t,e){if(!Array.isArray(e)&&"string"!=typeof e)throw new Error("Second argument to indexOf is not a string or array");return e.indexOf(t)}function fi(t,e){if(!Array.isArray(e))throw new Error("Second argument to join is not an array");return e.join(t)}function mi(t){return(t>0)-(t<0)||+t}var vi=1/3;function yi(t){return t<0?-Math.pow(-t,vi):Math.pow(t,vi)}function gi(t){return Math.exp(t)-1}function bi(t){return Math.log(1+t)}function ki(t){return Math.log(t)/Math.LN2}function xi(t){this.options=t||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||zn,cosh:Math.cosh||Gn,tanh:Math.tanh||qn,asinh:Math.asinh||Kn,acosh:Math.acosh||Jn,atanh:Math.atanh||Wn,sqrt:Math.sqrt,cbrt:Math.cbrt||yi,log:Math.log,log2:Math.log2||ki,ln:Math.log,lg:Math.log10||Hn,log10:Math.log10||Hn,expm1:Math.expm1||gi,log1p:Math.log1p||bi,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||Xn,"-":Un,"+":Number,exp:Math.exp,not:Qn,length:ni,"!":Yn,sign:Math.sign||mi},this.binaryOps={"+":En,"-":An,"*":_n,"/":Dn,"%":Tn,"^":Math.pow,"||":Sn,"==":Mn,"!=":jn,">":Vn,"<":Nn,">=":$n,"<=":Bn,and:Ln,or:Fn,in:Rn,"=":ai,"[":oi},this.ternaryOps={"?":ri},this.functions={random:Zn,fac:Yn,min:li,max:ui,hypot:Math.hypot||ii,pyt:Math.hypot||ii,pow:Math.pow,atan2:Math.atan2,if:ri,gamma:ei,roundTo:si,map:ci,fold:hi,filter:pi,indexOf:di,join:fi},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}xi.prototype.parse=function(t){var e=[],n=new Cn(this,new xn(this,t),{allowMemberAccess:this.options.allowMemberAccess});return n.parseExpression(e),n.expect(hn,"EOF"),new cn(e,this)},xi.prototype.evaluate=function(t,e){return this.parse(t).evaluate(e)};var wi=new xi;xi.parse=function(t){return wi.parse(t)},xi.evaluate=function(t,e){return wi.parse(t).evaluate(e)};var Ci={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",and:"logical",or:"logical",not:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};xi.prototype.isOperatorEnabled=function(t){var e=function(t){return Ci.hasOwnProperty(t)?Ci[t]:t}(t),n=this.options.operators||{};return!(e in n)||!!n[e]};var Oi=function(t){t=t.replace(/ /g,"");var e=/\(([^\(\)]|\(([^\(\)]|\(([^\(\)]|\(([^\(\)])*\))*\))*\))*\)/.exec(t);if(void 0===e)return{result:!1};var n=t.split(")");return{result:!0,unit:n[n.length-1],expression:e[0]}},Ii=function(){function t(e){o(this,t),this.expressionProps=e}return l(t,[{key:"resize",value:function(t){var e=Oi(this.expressionProps.expression),n="(".concat(e.expression,"*").concat(t,")");return"".concat(G.mathExpPreface,"(").concat(n,")").concat(this.expressionProps.unit)}},{key:"calculateValues",value:function(t,e){for(var n,i=t.length,r=(new xi).parse(this.expressionProps.expression),s=[],a=(c(n={},G.totalElements,i),c(n,G.initParams,e),n),o=0;o1&&void 0!==arguments[1])||arguments[1];if(t=t.replace(/ /g,""),e&&!Pi(t))return!1;var n=/.*\((.*)\).*/,i=n.exec(t)[1],r=i.split(",");return{start:r[0],end:r[1],startFraction:1*r[2]||0,easing:r[3]||"linear",mode:r[4]||"linear",reverse:"true"===r[5]}};var Ai=function(){function t(e){o(this,t),this.staggerProps=e}return l(t,[{key:"resize",value:function(t){return this.staggerProps.from*=t,this.staggerProps.to*=t,!0===this.staggerProps.integer&&(this.staggerProps.from=Math.round(this.staggerProps.from),this.staggerProps.to=Math.round(this.staggerProps.to)),"@stagger(".concat(this.staggerProps.from).concat(this.staggerProps.unit,", ").concat(this.staggerProps.to).concat(this.staggerProps.unit,", ").concat(this.staggerProps.fraction||0,", ").concat(this.staggerProps.easing||"linear",", ").concat(this.staggerProps.mode||"linear",", ").concat(this.staggerProps.reverse||!1,")")}},{key:"calculateValues",value:function(t){for(var e,n,i,r,s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=[];if("linear"===n)for(var s=0;s analysis.start){\n ").concat(this.makeError({type:"amount",actual:"analysis.start",messages:{amount:"The provided start "+G.staggerPreface+" value is smaller than the minimum accepted value ("+i.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < analysis.start){\n ").concat(this.makeError({type:"amount",actual:"analysis.start",messages:{amount:"The provided start "+G.staggerPreface+" value is bigger than the maximum accepted value ("+i.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!analysis.start.match(").concat(Ti,")){\n ").concat(this.makeError({type:"amount",actual:"analysis.start",messages:{amount:"The provided start "+G.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(!isNumeric(analysis.end)){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+G.staggerPreface+" value is invalid"}}),";\n return;\n } else {\n endNumberPart = analysis.end*1;\n if(").concat(Object.prototype.hasOwnProperty.call(i,"min"),"){\n if(").concat(i.min," > analysis.end){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+G.staggerPreface+" value is smaller than the minimum accepted value ("+i.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < analysis.end){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+G.staggerPreface+" value is bigger than the maximum accepted value ("+i.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!analysis.end.match(").concat(Ti,")){\n ").concat(this.makeError({type:"amount",actual:"analysis.end",messages:{amount:"The provided end "+G.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(analysis.startFraction < 0 || analysis.startFraction > 1){\n ").concat(this.makeError({type:"amount",actual:"analysis.startFraction",messages:{amount:"The "+G.staggerPreface+" fraction must be a number >=0 and <=1"}}),";\n return;\n }\n\n if(easingKeys.indexOf(analysis.easing) < 0){\n ").concat(this.makeError({type:"amount",actual:"analysis.startFraction",messages:{amount:"The provided "+G.staggerPreface+" easing is not recognised by the system"}}),";\n return;\n }\n\n if(analysis.mode !== 'linear' && analysis.mode !== 'omni'){\n ").concat(this.makeError({type:"amount",actual:"analysis.mode",messages:{amount:G.staggerPreface+" mode can only be either linear or omni"}}),";\n return;\n }\n\n if(analysis.reverse !== true && analysis.reverse !== false){\n ").concat(this.makeError({type:"amount",actual:"analysis.reverse",messages:{amount:G.staggerPreface+" reverse needs to be either true or false"}}),";\n return;\n }\n\n return value;\n }\n } else if(value.trim().startsWith('").concat(G.patternValue,"')){\n if(!patternRegexp.test(value.replace(/ /g, ''))){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+G.patternValue+" expression is invalid"}}),";\n return;\n }\n const patternValues = extractParenthesisAttrsAsArray(value);\n for(let i=0; i valToCheck){\n ").concat(this.makeError({type:"amount",actual:"valToCheck",messages:{amount:"The provided value is smaller than the minimum accepted value ("+i.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < valToCheck){\n ").concat(this.makeError({type:"amount",actual:"valToCheck",messages:{amount:"The provided start value is bigger than the maximum accepted value ("+i.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!valToCheck.match(").concat(Ti,")){\n ").concat(this.makeError({type:"amount",actual:"valToCheck",messages:{amount:"The provided value is not an integer"}}),";\n return;\n }\n }\n }\n }\n return value;\n } else if(value.trim().startsWith('").concat(G.attibuteValue,"')){\n if(!attributeRegexp.test(value)){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+G.attibuteValue+" expression is invalid"}}),";\n return;\n }\n\n return value;\n } else if(value.trim().startsWith('").concat(G.mathExpPreface,"')){\n const validity = validateExpression(value);\n if(validity.result === false){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+G.expressionPreface+" expression is invalid"}}),';\n return;\n } else {\n if(validity.unit !== ""){\n ').concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+G.expressionPreface+" expression includes units"}}),";\n return;\n }\n\n return value;\n }\n }\n }\n\n\n if(typeof value !== 'number'){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided value is not a number"}}),";\n return;\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < value){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided amount is bigger than the maximum accepted value"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"min"),"){\n if(").concat(i.min," > value){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided amount is lower than the minimum accepted value"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(value !== parseInt(value, 10)){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The provided amount is not an integer"}}),";\n return;\n }\n }\n return value;\n\n ")}})),Si.add("measurement",(function(t,e,n){var i=t.schema,r=t.messages,s=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)("+i.units.join("|")+")$","gi"),a=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)","gi");return{source:"\n let startUnits, endUnits, startNumberPart, endNumberPart;\n const staggerValidation = ".concat(_i,";\n const staggerAnalyser = ").concat(Ei,';\n const easingKeys = "').concat(Object.keys(Vt).join(","),"\".split(',');\n const validateExpression = ").concat(Oi,";\n const validUnits = ['").concat(i.units.join("','"),"'];\n const attributeRegexp = /^").concat(G.attibuteValue,"\\([_A-z0-9-]*\\)$/;\n const patternRegexp = /^").concat(G.patternValue,"\\(([_A-z0-9.%-]+?(,[_A-z0-9.%-]+)*?)\\)$/;\n const extractParenthesisAttrsAsArray = ").concat(tt,";\n\n if(typeof value !== 'string' && !(value instanceof String)){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:r}),"\n return ;\n }\n\n if(value.trim().startsWith('").concat(G.attibuteValue,"')){\n if(!attributeRegexp.test(value)){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+G.attibuteValue+" expression is invalid"}}),";\n return;\n }\n\n return value;\n } else if(value.trim().startsWith('").concat(G.staggerPreface,"')){\n const staggerValid = staggerValidation(value);\n if(staggerValid === false){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:{measurement:"The "+G.staggerPreface+" expression is invalid"}}),";\n return;\n } else {\n const analysis = staggerAnalyser(value, false);\n if(!analysis.start.match(").concat(s,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+G.staggerPreface+" value is invalid"}}),";\n return;\n } else {\n var numberPart = analysis.start.match(").concat(a,")[0];\n startNumberPart = numberPart;\n startUnits = analysis.start.toString().substring(numberPart.length);\n if(").concat(Object.prototype.hasOwnProperty.call(i,"min"),"){\n if(").concat(i.min," > numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+G.staggerPreface+" value is smaller than the minimum accepted value ("+i.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+G.staggerPreface+" value is bigger than the maximum accepted value ("+i.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!numberPart.match(").concat(Ti,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.start",messages:{measurement:"The provided start "+G.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(!analysis.end.match(").concat(s,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+G.staggerPreface+" value is invalid"}}),";\n return;\n } else {\n var numberPart = analysis.end.match(").concat(a,")[0];\n endNumberPart = numberPart;\n endUnits = analysis.end.toString().substring(numberPart.length);\n if(").concat(Object.prototype.hasOwnProperty.call(i,"min"),"){\n if(").concat(i.min," > numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+G.staggerPreface+" value is smaller than the minimum accepted value ("+i.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+G.staggerPreface+" value is bigger than the maximum accepted value ("+i.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!numberPart.match(").concat(Ti,")){\n ").concat(this.makeError({type:"measurement",actual:"analysis.end",messages:{measurement:"The provided end "+G.staggerPreface+" value is not an integer"}}),";\n return;\n }\n }\n }\n\n if(startUnits !== endUnits){\n ").concat(this.makeError({type:"measurement",actual:"analysis.startFraction",messages:{measurement:"The "+G.staggerPreface+" start and end must always have the same units"}}),";\n return;\n }\n\n if(analysis.startFraction < 0 || analysis.startFraction > 1){\n ").concat(this.makeError({type:"measurement",actual:"analysis.startFraction",messages:{measurement:"The "+G.staggerPreface+" fraction must be a number >=0 and <=1"}}),";\n return;\n }\n\n if(easingKeys.indexOf(analysis.easing) < 0){\n ").concat(this.makeError({type:"measurement",actual:"analysis.startFraction",messages:{measurement:"The provided "+G.staggerPreface+" easing is not recognised by the system"}}),";\n return;\n }\n\n if(analysis.mode !== 'linear' && analysis.mode !== 'omni'){\n ").concat(this.makeError({type:"measurement",actual:"analysis.mode",messages:{measurement:G.staggerPreface+" mode can only be either linear or omni"}}),";\n return;\n }\n\n if(analysis.reverse !== true && analysis.reverse !== false){\n ").concat(this.makeError({type:"measurement",actual:"analysis.reverse",messages:{measurement:G.staggerPreface+" reverse needs to be either true or false"}}),";\n return;\n }\n\n return value;\n }\n } else if(value.trim().startsWith('").concat(G.patternValue,"')){\n if(!patternRegexp.test(value.replace(/ /g, ''))){\n ").concat(this.makeError({type:"amount",actual:"value",messages:{amount:"The "+G.patternValue+" expression is invalid"}}),";\n return;\n }\n const patternValues = extractParenthesisAttrsAsArray(value);\n for(let i=0; i numberPart){\n ").concat(this.makeError({type:"measurement",actual:"valToCheck",messages:{measurement:"The provided value is smaller than the minimum accepted value ("+i.min+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"valToCheck",messages:{measurement:"The provided value is bigger than the maximum accepted value ("+i.max+")"}}),";\n return;\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!numberPart.match(").concat(Ti,")){\n ").concat(this.makeError({type:"measurement",actual:"valToCheck",messages:{measurement:"The provided value is not an integer"}}),";\n return;\n }\n }\n }\n }\n return value;\n } else if(value.trim().startsWith('").concat(G.mathExpPreface,"')){\n const validity = validateExpression(value);\n if(validity.result === false){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:{measurement:"The "+G.expressionPreface+" expression is invalid"}}),";\n return;\n } else {\n if(validUnits.indexOf(validity.unit) < 0){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:{measurement:"The "+G.expressionPreface+" expression has non-supported units"}}),";\n return;\n }\n\n return value;\n }\n }\n\n\n if(!value.match(").concat(s,")){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:r}),"\n } else {\n var numberPart = value.match(").concat(a,")[0];\n if(").concat(Object.prototype.hasOwnProperty.call(i,"min"),"){\n if(").concat(i.min," > numberPart){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:r}),"\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"max"),"){\n if(").concat(i.max," < numberPart){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:r}),"\n }\n }\n if(").concat(Object.prototype.hasOwnProperty.call(i,"integer"),"){\n if(!numberPart.match(").concat(Ti,")){\n ").concat(this.makeError({type:"measurement",actual:"value",messages:r}),"\n }\n }\n }\n return value;\n ")}})),Si.add("html",(function(t,e,n){t.schema;var i=t.messages;return{source:"\n if(value === null){\n ".concat(this.makeError({type:"html",actual:"value",messages:i}),"\n } else {\n return value;\n }\n ")}})),Si.add("css",(function(t,e,n){t.schema;var i=t.messages;return{source:"\n if(value === null){\n ".concat(this.makeError({type:"css",actual:"value",messages:i}),"\n } else {\n return value;\n }\n ")}})),Si.add("color",(function(t,e,n){t.schema;var i=t.messages;return{source:"\n if(typeof value !== 'string' && !(value instanceof String)){\n ".concat(this.makeError({type:"measurement",actual:"value",messages:i}),"\n return ;\n }\n if(!value.match(").concat(Di,') && [\n "aliceblue",\n "antiquewhite",\n "aqua",\n "aquamarine",\n "azure",\n "beige",\n "bisque",\n "black",\n "blanchedalmond",\n "blue",\n "blueviolet",\n "brown",\n "burlywood",\n "cadetblue",\n "chartreuse",\n "chocolate",\n "coral",\n "cornflowerblue",\n "cornsilk",\n "crimson",\n "cyan",\n "darkblue",\n "darkcyan",\n "darkgoldenrod",\n "darkgray",\n "darkgrey",\n "darkgreen",\n "darkkhaki",\n "darkmagenta",\n "darkolivegreen",\n "darkorange",\n "darkorchid",\n "darkred",\n "darksalmon",\n "darkseagreen",\n "darkslateblue",\n "darkslategray",\n "darkslategrey",\n "darkturquoise",\n "darkviolet",\n "deeppink",\n "deepskyblue",\n "dimgray",\n "dimgrey",\n "dodgerblue",\n "firebrick",\n "floralwhite",\n "forestgreen",\n "fuchsia",\n "gainsboro",\n "ghostwhite",\n "gold",\n "goldenrod",\n "gray",\n "grey",\n "green",\n "greenyellow",\n "honeydew",\n "hotpink",\n "indianred",\n "indigo",\n "ivory",\n "khaki",\n "lavender",\n "lavenderblush",\n "lawngreen",\n "lemonchiffon",\n "lightblue",\n "lightcoral",\n "lightcyan",\n "lightgoldenrodyellow",\n "lightgray",\n "lightgrey",\n "lightgreen",\n "lightpink",\n "lightsalmon",\n "lightseagreen",\n "lightskyblue",\n "lightslategray",\n "lightslategrey",\n "lightsteelblue",\n "lightyellow",\n "lime",\n "limegreen",\n "linen",\n "magenta",\n "maroon",\n "mediumaquamarine",\n "mediumblue",\n "mediumorchid",\n "mediumpurple",\n "mediumseagreen",\n "mediumslateblue",\n "mediumspringgreen",\n "mediumturquoise",\n "mediumvioletred",\n "midnightblue",\n "mintcream",\n "mistyrose",\n "moccasin",\n "navajowhite",\n "navy",\n "oldlace",\n "olive",\n "olivedrab",\n "orange",\n "orangered",\n "orchid",\n "palegoldenrod",\n "palegreen",\n "paleturquoise",\n "palevioletred",\n "papayawhip",\n "peachpuff",\n "peru",\n "pink",\n "plum",\n "powderblue",\n "purple",\n "rebeccapurple",\n "red",\n "rosybrown",\n "royalblue",\n "saddlebrown",\n "salmon",\n "sandybrown",\n "seagreen",\n "seashell",\n "sienna",\n "silver",\n "skyblue",\n "slateblue",\n "slategray",\n "slategrey",\n "snow",\n "springgreen",\n "steelblue",\n "tan",\n "teal",\n "thistle",\n "tomato",\n "turquoise",\n "violet",\n "wheat",\n "white",\n "whitesmoke",\n "yellow",\n "yellowgreen",\n ].indexOf(value.toLowerCase()) < 0){\n ').concat(this.makeError({type:"color",actual:"value",messages:i}),"\n }\n return value;\n ")}}));var Mi=["cm","mm","in","px","pt","pc","em","ex","ch","rem","vw","vh","vmin","vmax","%"],ji=[{type:"string",optional:!0,default:"linear",enum:["linear","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce"]},{type:"array",optional:!0,length:4,items:{type:"number"}}],Vi={type:"string",empty:!1,trim:!0,optional:!0},Ni={type:"string",empty:!1,trim:!0,optional:!0},$i={type:"string",empty:!1,optional:!1},Bi={type:"amount",optional:!1,integer:!0,min:0},Li={type:"amount",optional:!0,integer:!0,min:0},Fi={type:"amount",integer:!0,min:1,optional:!0},Ri={type:"amount",integer:!0,min:0,optional:!0},zi={type:"amount",integer:!0,min:0,optional:!0},Gi={type:"html",optional:!0},qi={type:"css",optional:!0},Ki={type:"array",optional:!0,items:{type:"object",props:{type:"string",src:"string"}}},Ji={type:"array",items:{type:"object",strict:!0,props:{src:"string",id:"string",mcid:{type:"string",optional:!0},classes:{type:"array",optional:!0,items:"string"},base64:{type:"boolean",optional:!0},startValues:{optional:!0,type:"object",props:{gain:{optional:!0,type:"number"},pan:{optional:!0,type:"number"}}}}},optional:!0},Wi=Si.compile({id:Vi,name:Ni,selector:p(p({},$i),{},{optional:!0}),easing:ji,duration:Bi,startFrom:{type:"amount",integer:!0,min:0,optional:!0},repeats:Fi,hiatus:Ri,delay:zi}),Hi={type:"object",optional:!0,props:{width:{type:"measurement",units:Mi,optional:!0},height:{type:"measurement",units:Mi,optional:!0}}},Ui={type:"string",enum:["on","off","only"],optional:!0},Qi=Si.compile({props:[{type:"object",strict:!0,props:{id:Vi,name:Ni,selector:p(p({},$i),{},{optional:!0}),repeats:Fi,hiatus:Ri,delay:zi,easing:ji,duration:Li,html:Gi,css:qi,audioSources:Ji,audio:Ui,containerParams:Hi,fonts:Ki,initParams:{type:"object",optional:!0}}},{type:"object",strict:!0,props:{id:Vi,name:Ni,host:{type:"any",optional:!1},duration:Li,html:Gi,css:qi,audioSources:Ji,audio:Ui,containerParams:Hi,fonts:Ki,initParams:{type:"object",optional:!0}}},{type:"object",strict:!0,props:{root:{type:"boolean",optional:!0},name:Ni,id:Vi,audioSources:Ji,audio:p(p({},Ui),{},{enum:["on"]})}}]}),Xi=Si.compile({selector:p(p({},$i),{},{optional:!0,strict:!0}),name:Ni}),Zi=Si.compile({selector:p(p({},$i),{},{strict:!0,optional:!0}),name:Ni,repeats:{type:"amount",integer:!0,min:1,optional:!0},hiatus:{type:"amount",integer:!0,min:0,optional:!0},delay:{type:"amount",integer:!0,min:0,optional:!0}});function Yi(t){var e=new t.Class(t.attrs,t.props);if(!1===e.result)return e;if(Object.prototype.hasOwnProperty.call(t,"incidents"))for(var n in t.incidents){var i=t.incidents[n],r=Yi(i.leaf);if(!1===r.result)return r;var s=e.addIncident(r,i.position);if(!1===s.result)return s}return e}function tr(t){t.descriptor.value=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.exportLiveDefinition();for(var i in t)Rt(i,t[i],!0,"attrs",n);for(var r in e)Rt(r,e[r],!0,"props",n);return Yi(n)}}Si.compile({selector:$i,duration:Bi});var er="mc.descriptive.decisionAuthority";function nr(t){t.descriptor.value=function(t){if(null!==this.constructor.attrsValidationRules){var e=this.constructor.attrsValidationMethod(t);if(e.length>0)return{result:!1,errors:e}}return!0===this.putMessageOnPipe("checkForClip",{},er,{selfExecute:!0,direction:ct}).response?this.manageEditAttrProps(t,"attrs"):(this.attrs=t,{result:!0})}}function ir(t){t.descriptor.value=function(t){var e=ot.validateProps(t,this.constructor.propsValidationRules,this.constructor);return e.result?!0===this.putMessageOnPipe("checkForClip",{},er,{selfExecute:!0,direction:ct}).response?this.manageEditAttrProps(t,"props"):(this.props=t,{result:!0}):e}}function rr(t){t.descriptor.value=function(){return null!==this.props.host&&void 0!==this.props.host?[this.props.host]:this.hasParent&&this.putMessageOnPipe("checkForClip",{},er,{selfExecute:!0,direction:ct}).response?this.putMessageOnPipe("getElements",{selector:this.selector()},er,{selfExecute:!1,direction:ct}).response:[]}}function sr(t){t.descriptor.value=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{check:!0};if("dynamic"===this.duration)return{result:!1,reason:"Incidents with dynamic duration can't be resized. Once the Incident enters a Clip it'll become resizable"};if(t===this.duration)return{result:!0,meta:{unprocessed:!0}};if(t<=0)return{result:!1,reason:"Size must always be > 0"};if(e.check&&this.hasParent){var n=this.putMessageOnPipe("checkResize",{id:this.id,newSize:t,fraction:t/this.duration},er,{selfExecute:!1,direction:ct});if(!n.response.result)return n.response}return this.setNewDuration(t),{result:!0}}}function ar(t){t.descriptor.value=function(){return null===this.inheritedSelector?Object.prototype.hasOwnProperty.call(this.props,"selector")?this.props.selector:null:Object.prototype.hasOwnProperty.call(this.props,"selector")?"&"===this.props.selector.charAt(0)?this.inheritedSelector+this.props.selector.substring(1):"".concat(this.inheritedSelector," ").concat(this.props.selector):this.inheritedSelector}}var or=function(){function t(e){o(this,t),this.expressionProps=e}return l(t,[{key:"calculateValues",value:function(t){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:"";if(!n)return[];for(var r=0,s=Object.entries(n);r0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o(this,i),null===s?(e=n.call(this,r),t(v(e)),e.attrs={},e.props=r):(e=n.call(this,s),t(v(e)),e.attrs=r,e.props=s);var a=ot.validateProps(e.props,Xi,e.constructor);return a.result?(e._inheritedSelector=null,e.attributesStaggers=[],e.propsStaggers=[],e.setupDynamicValues(),e.passiveAddition=!0,e._buildTree(),e.passiveAddition=!1,y(e)):y(e,a)}return i}(e);return{F:n,d:[{kind:"field",static:!0,key:"Incident",value:function(){return kt}},{kind:"field",static:!0,key:"plugin_npm_name",value:function(){return"motor-cortex-js"}},{kind:"field",static:!0,key:"version",value:function(){return Gt}},{kind:"field",static:!0,key:"Channel",value:function(){return lt}},{kind:"field",static:!0,key:"ClassName",value:function(){return"Group"}},{kind:"field",static:!0,key:"isGroup",value:function(){return!0}},{kind:"field",static:!0,key:"attrsValidationRules",value:function(){return null}},{kind:"field",static:!0,key:"propsValidationRules",value:function(){return Xi}},{kind:"method",decorators:[nr],key:"editAttributes",value:function(){}},{kind:"method",decorators:[ir],key:"editProperties",value:function(){}},{kind:"method",decorators:[sr],key:"resize",value:function(){}},{kind:"method",decorators:[tr],key:"clone",value:function(){}},{kind:"method",decorators:[ar],key:"selector",value:function(){}},{kind:"method",decorators:[rr],key:"getElements",value:function(){}},{kind:"method",decorators:[pr],key:"setupDynamicValues",value:function(){}},{kind:"method",key:"_buildTree",value:function(){this.buildTree()}},{kind:"method",key:"_calculateDuration",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=0;for(var n in this.children){var i=this.children[n];if(!0===t&&!0===i.leaf.constructor.isGroup&&i.leaf._calculateDuration(!0),"dynamic"===i.leaf.duration){e="dynamic";break}i.position+i.leaf.duration>e&&(e=i.position+i.leaf.duration)}return e!==this.calculatedDuration&&(this.calculatedDuration=e,!0)}},{kind:"method",key:"_rebuildTree",value:function(){for(var t in this.children){var e=this.children[t];!0===e.leaf.passive&&this.removeIncident(e.id)}this.passiveAddition=!0,this.buildTree(),this.passiveAddition=!1}},{kind:"method",key:"buildTree",value:function(){}},{kind:"get",key:"duration",value:function(){return"dynamic"===this.calculatedDuration?this.calculatedDuration:k(f(n.prototype),"duration",this)}},{kind:"set",key:"duration",value:function(t){w(f(n.prototype),"duration",t,this,!0)}},{kind:"method",key:"manageEditAttrProps",value:function(t,e){var n=this.parentNode,i=n.getLeafPosition(this.id),r=JSON.parse(JSON.stringify(this[e]));this[e]=t,n.removeIncident(this.id),this._rebuildTree();var s=n.addIncident(this,i);return s.result||(this[e]=r,this._rebuildTree(),n.addIncident(this,i)),s}},{kind:"method",key:"detachFromParent",value:function(){k(f(n.prototype),"detachFromParent",this).call(this),this.inheritedSelector=null}},{kind:"get",key:"inheritedSelector",value:function(){return this._inheritedSelector}},{kind:"set",key:"inheritedSelector",value:function(t){for(var e in this._inheritedSelector=t,this.children){this.children[e].leaf.inheritedSelector=this.selector()}}},{kind:"get",key:"selectorToPassToChildren",value:function(){return this.selector()}},{kind:"method",key:"exportDefinition",value:function(){var t={ClassName:this.constructor.ClassName,version:this.constructor.version,plugin:this.constructor.plugin||this.constructor.plugin_npm_name,plugin_npm_name:this.constructor.plugin_npm_name,attrs:this.attrs,props:this.props,incidents:{},duration:this.duration};for(var e in this.children){var n=this.children[e];!0!==n.leaf.passive&&(t.incidents[e]={id:n.id,position:n.position,leaf:n.leaf.exportDefinition()})}return t}},{kind:"method",key:"exportLiveDefinition",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=JSON.parse(JSON.stringify(this.props));!1===t&&delete e.id;var n={Class:this.constructor,attrs:JSON.parse(JSON.stringify(this.attrs)),props:e,incidents:{}};for(var i in this.children){var r=this.children[i];!0!==r.leaf.passive&&(n.incidents[i]={position:r.position,leaf:r.leaf.exportLiveDefinition(t)})}return n}},{kind:"method",key:"addIncident",value:function(t,e){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{check:!0};if(t.inheritedSelector=this.selectorToPassToChildren,!0===r.check){var s=k(f(n.prototype),"checkAddition",this).call(this,t,e);if(!s.result)return t.inheritedSelector=null,s;if(!0===(i=this.putMessageOnPipe("checkForClip",{},er,{selfExecute:!0,direction:ct})).response){var a=t.putMessageOnPipe("checkForInvalidSelectors",{},null,{selfExecute:!0,direction:ht});if(a.length>0){for(var o=[],u=0;u2&&void 0!==arguments[2]?arguments[2]:window,i=(t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:R)+"."+t).split("."),r=0;r2&&void 0!==arguments[2]?arguments[2]:0,i=e;!1===Array.isArray(e)&&(i=e.split("."));var r=this.getItem(t,i.slice(0,2+n));return(""===r.props.selector||void 0===r.props.selector||null===r.props.selector)&&("props"===i[2]||(!this.isCombo(r)||this.refersToOwnSelector(t,i,n+3)))},cascadeSelectors:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=[],r=0;r2&&void 0!==arguments[2]&&arguments[2];if(i&&"off"===t.audio||!i&&"only"===t.audio)return null;if(Object.prototype.hasOwnProperty.call(t.props,"selector")&&(!i&&"~"===t.props.selector.charAt(0)||i&&"~"!==t.props.selector.charAt(0)&&!t.constructor.isClip))return null;if(t.constructor.isClip){if(!Object.prototype.hasOwnProperty.call(t.props,"selector")||i)return i?t.audioClip:t.realClip;(n=new Ft(t,e)).plugin_channel_class=lt}else if(t.constructor.isCombo)n=new vr(t,e);else if(t.constructor.isGroup)for(var r in n=jt({id:t.id,attrs:t.attrs,props:t.props,Incident:t.constructor.Incident,plugin_npm_name:t.constructor.plugin_npm_name,Channel:t.constructor.Channel,DescriptiveIncident:t}),t.children){var s=yr(t.children[r].leaf,e);null!==s&&n.addChild(s,t.children[r].position)}else n=new Lt(t,e);return n}var gr="@kissmybutton/self-contained-incidents",br=function(t){d(n,t);var e=g(n);function n(t,i){var r;return o(this,n),(r=e.call(this,t,i)).attrs=t,r.props=i,r.isTheClip=!0,r.blockingWaitings={},r.instantiatedChannels={},r.isHostedClip=!0,r.instantiatedCopiesContexts={},r.instantiatedCopiesUnblockingMethods=[],r.onClipInitialise(),r.runTimeInfo=r.props.runTimeInfo,r.durationSubs=[],r.audioClip=!1,r}return l(n,[{key:"contextReady",get:function(){return this.context.contextLoaded}},{key:"onClipInitialise",value:function(){}},{key:"contextLoading",value:function(){this.context.contextLoaded=!1}},{key:"contextLoaded",value:function(){for(var t in this.context.contextLoaded=!0,this.putMessageOnPipe("contextLoaded",{},{},{selfExecute:!1,direction:ht}),this.instantiatedChannels)this.instantiatedChannels[t].recalcScratchValues();for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"all-or-nothing",n=!0,i=[],r=[];for(var s in t){Object.prototype.hasOwnProperty.call(this.instantiatedChannels,s)||(this.instantiatedChannels[s]=new t[s][0].incident.plugin_channel_class({runTimeInfo:this.runTimeInfo,context:this.context,subscribe:this.props.subscribe}));var a=this.instantiatedChannels[s].addIncidents(t[s],e);n=n&&a.result,a.result?r.push(a.execute):i=i.concat(a.errors)}var o=function(){for(var t=0;t0&&(o=e[0].positionDelta);var u=this.checkResize(t.fraction,n,o);if(u.result){return{result:!0,execute:function(){u.execute();for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0,i=!0,r=[],s=[];for(var a in e){var o=ot.systoleDiastoleProjections(e[a],t,n),u=this.instantiatedChannels[a].checkResizedIncidents(o);i=i&&u.result,u.result?s.push(u.execute):r=r.concat(u.errors)}var l=function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:0,e={};return e[gr]=[{millisecond:t,incident:this,id:this.id}],e}},{key:"setVolume",value:function(t){this.volume=parseFloat(t)}},{key:"_onGetContextOnce",value:function(t){}},{key:"handleRecalcDuration",value:function(t,e){if(this._calculateDuration())for(var n=0;n3&&void 0!==arguments[3]&&arguments[3];if(!1!==this.contextReady){for(var r in n||(n=this.id),this.instantiatedChannels){var s=this.instantiatedChannels[r];s.moveTo(this.runTimeInfo.currentMillisecond,e,n,i)}this.onAfterProgress(t,e)}else this.setBlock()}},{key:"onAfterProgress",value:function(t,e){}},{key:"flash",value:function(){for(var t in this.instantiatedChannels){this.instantiatedChannels[t].moveTo(0,this.runTimeInfo.currentMillisecond,this.id,!0)}}},{key:"subscribeToDurationChange",value:function(t){this.durationSubs.push(t)}},{key:"handleSetBlockingWaiting",value:function(t,e){}},{key:"handleRemoveBlockingWaiting",value:function(t,e){}}]),n}(kt),kr=function(){function t(){o(this,t),this.output=q.createGain(),this.gainNode=q.createGain(),q.createStereoPanner&&(this.pannerNode=q.createStereoPanner()),q.createStereoPanner?(this.pannerNode.connect(this.gainNode),this.gainNode.connect(this.output),this.input=this.pannerNode):(this.gainNode.connect(this.output),this.input=this.gainNode)}return l(t,[{key:"connect",value:function(t){this.output.connect(t)}},{key:"disconnect",value:function(){this.output.disconnect()}}]),t}();function xr(t){for(var e=window.atob(t),n=e.length,i=new Uint8Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;o(this,t),this.totalSources=n.length,this.audioSources={},this.elementsByMCID={};for(var r=function(t){var r=n[t],s={mcid:r.mcid||rt(),id:r.id,src:r.src,classes:r.classes||[],base64:r.base64||!1,pubSub:new Cr,soundLoaded:!1,startValues:r.startValues||{}};if(e.audioSources[s.id]=s,e.elementsByMCID[s.mcid]=s,r.base64)q.decodeAudioData(xr(r.src),(function(t){e._setBuffer(s,t,i)}));else{var a=new XMLHttpRequest;a.open("GET",s.src,!0),a.responseType="arraybuffer",e.soundLoaded=!1,a.onload=function(){q.decodeAudioData(a.response,(function(t){e._setBuffer(s,t,i)}),e.onError)},a.send()}},s=0;s=0&&i.push(r);return i}}},{key:"getMCID",value:function(t){return t.mcid}},{key:"setMCID",value:function(t,e){t.mcid=e}},{key:"getElementSelectorByMCID",value:function(t){return'[data-mcid="'.concat(t,'"]')}}]),t}(),Ir=function(t){d(n,t);var e=g(n);function n(t,i){var r;o(this,n),(r=e.call(this,t,i)).audioNode=new kr,r.audioNode.connect(q.destination);var s=new Or(r.props.audioSources,r.audioNode);return r.ownContext=p(p({},s.context),{},{isHostedClip:!0}),r.audioClip=!0,r}return l(n,[{key:"onProgress",value:function(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];k(f(n.prototype),"onProgress",this).call(this,t,e,this.id,r)}},{key:"_onGetContextOnce",value:function(t){this.audioNode.disconnect(),this.parentClipContext=t,this.audioNode.connect(t.masterNode.input)}},{key:"lastWish",value:function(){this.audioNode.output.disconnect(),this.audioNode.output.connect(q.destination)}},{key:"setVolume",value:function(t){this.audioNode.output.gain.value=t}}]),n}(br),Pr=function(t){d(n,t);var e=g(n);function n(){return o(this,n),e.apply(this,arguments)}return l(n,[{key:"onProgress",value:function(t){var e=this;if(!this.element.soundLoaded)return this.setBlock("loading sound"),this.element.pubSub.sub(this.id,(function(){e.unblock()})),!1;if("gain"===this.attributeKey){var n=(this.targetValue-this.initialValues)*t+this.initialValues;this.element.effectsAudioNode.gainNode.gain.value=n}else if("pan"===this.attributeKey){var i=(this.targetValue-this.initialValues)*t+this.initialValues;this.element.effectsAudioNode.pannerNode.pan.value=i}}},{key:"getScratchValue",value:function(){return"pan"===this.attributeKey?Object.prototype.hasOwnProperty.call(this.element.startValues,"pan")?this.element.startValues.pan:0:"gain"===this.attributeKey?Object.prototype.hasOwnProperty.call(this.element.startValues,"gain")?this.element.startValues.gain:1:void 0}}]),n}(St),Er="|||",Ar=function(t){d(n,t);var e=g(n);function n(t){var i;return o(this,n),(i=e.call(this,t)).playingIncidentsIds=[],i.transitioned=!1,t.subscribe(rt(),i._stateChange.bind(v(i)),0,1,!0),i}return l(n,[{key:"_stateChange",value:function(t,e){"paused"!==e&&"idle"!==e&&"blocked"!==e||(this._stopPlayingIncidents(),this.transitioned=!0)}},{key:"_stopPlayingIncidents",value:function(){for(var t=0;t3&&void 0!==arguments[3]&&arguments[3];if("transitional"===this.runTimeInfo.state||i){this.transitioned=!0,this._stopPlayingIncidents();for(var r=0;ro+u.duration?(l=1,c=u.duration):l=(c=e-o)/u.duration,u.onProgress(l,c,n,!0)}}else{this.transitioned&&(t=0,this.transitioned=!1);for(var h=this.incidents,p=0;p=t&&fe){var b=(e-f)/v>=1,k=b?1:(e-f)/v,x=b?v:e-f,w=m.play(k,x,n);w&&this.playingIncidentsIds.push(g)}else if(y>t&&y<=e){m.stop(n);var C=this.playingIncidentsIds.indexOf(g);C>-1&&this.playingIncidentsIds.splice(C,1)}}this.runTimeInfo.currentMillisecond=e}}}]),n}(xt),_r=T(null,(function(t){return{F:function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;o(this,e),t(this),this.attrs=n,this.props=i,this.dna=r,this.context=r.context,this.mcid=r.mcid,this.id=i.id||rt(),this.modelId=i.modelId,this.gotContext=!1,this.plugin_channel_class=Ar,this.mc_plugin_npm_name="motor-cortex-js-media-playback",Object.prototype.hasOwnProperty.call(i,"plugin_channel_class")&&(this.plugin_channel_class=i.plugin_channel_class),Object.prototype.hasOwnProperty.call(i,"mc_plugin_npm_name")&&(this.mc_plugin_npm_name=i.mc_plugin_npm_name),this.hasIncidents=!1,this.autoGenerated=!1,this.onInitialise(n,i)},d:[{kind:"get",key:"selector",value:function(){return this.props.selector}},{kind:"get",key:"element",value:function(){return this.context.getElementByMCID(this.mcid)}},{kind:"method",decorators:[Tt],key:"getIncidentsByChannel",value:function(){}},{kind:"method",key:"_onGetContextOnce",value:function(){try{if(!0===this.context.fragment)return;this.gotContext||(this.onGetContext(),this.gotContext=!0)}catch(t){ot.error(t),ot.error(this.mcid)}}},{kind:"method",key:"onGetContext",value:function(){ot.info('Overwritte the "onGetContext" method with the code you want to get executed',"info")}},{kind:"method",key:"lastWish",value:function(){}},{kind:"method",key:"onInitialise",value:function(){ot.info('Overwritte the "onInialise" method with the code you want to get executed',"info")}},{kind:"method",key:"onProgress",value:function(t,e){}},{kind:"method",key:"play",value:function(t){return!0}},{kind:"method",key:"stop",value:function(){}},{kind:"method",decorators:[gt],key:"setBlock",value:function(){}},{kind:"method",decorators:[bt],key:"unblock",value:function(){}}]}})),Dr={npm_name:"@kissmybutton/motorcortex-soundsystem",name:"Internal MotorCortex Soundsystem",incidents:[{exportable:function(t){d(n,t);var e=g(n);function n(){return o(this,n),e.apply(this,arguments)}return l(n,[{key:"play",value:function(t){var e=this;if(!this.element.soundLoaded)return this.setBlock("loading sound"),this.element.pubSub.sub(this.id,(function(){e.unblock()})),!1;var n=0;return Object.prototype.hasOwnProperty.call(this.props,"startFrom")&&(n=this.props.startFrom),this.audioNode=q.createBufferSource(),this.audioNode.buffer=this.element.buffer,this.audioNode.connect(this.element.effectsAudioNode.input),this.audioNode.start(0,(t+n)/1e3),!0}},{key:"stop",value:function(){this.audioNode.stop()}}]),n}(_r),name:"AudioPlayback"},{exportable:Pr,name:"AudioEffect"}],Clip:{exportable:Ir},audio:"only"},Tr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o(this,t),this.realArray=[],null!=e&&(this.realArray=e)}return l(t,[{key:"_hasOwnProperty",value:function(t){return Object.prototype.hasOwnProperty.call(this.realArray,t)}},{key:"_get",value:function(t){return this.realArray[t]}},{key:"_set",value:function(t,e){this.realArray[t]=e}},{key:"_keys",value:function(){return Object.keys(this.realArray)}},{key:"_delete",value:function(t){return delete this.realArray[t]}},{key:"_export",value:function(){return this.realArray}}]),t}(),Sr=function(){function t(e){o(this,t),this.originalArray=e,this.extraArray={},this.addedKeys=[],this.removedKeys=[]}return l(t,[{key:"_hasOwnProperty",value:function(t){return Object.prototype.hasOwnProperty.call(this.originalArray,t)||Object.prototype.hasOwnProperty.call(this.extraArray,t)}},{key:"_get",value:function(t){return Object.prototype.hasOwnProperty.call(this.extraArray,t)?this.extraArray[t]:Object.prototype.hasOwnProperty.call(this.originalArray,t)?this.originalArray[t]:void 0}},{key:"_set",value:function(t,e){this.extraArray[t]=e,Object.prototype.hasOwnProperty.call(this.originalArray,t)||this.addedKeys.push(t);var n=this.removedKeys.indexOf(t);n>-1&&this.removedKeys.splice(n,1)}},{key:"_keys",value:function(){for(var t=Object.keys(this.originalArray).concat(this.addedKeys),e=0;e-1?(this.addedKeys.splice(e),delete this.extraArray[t]):this.removedKeys.push(t)}},{key:"_export",value:function(){for(var t in this.extraArray)this.originalArray[t]=this.extraArray[t];for(var e=0;e4&&void 0!==arguments[4]&&arguments[4],s=t[i],a=e._get(s.id);a.setInitialValue(n,r);var o=Mr(a,a.initialValue,a.originalAnimatedAttributeValue,JSON.parse(JSON.stringify(a.animatedAttributeValue)));o&&(a.lastWish(),a.onGetContext()),o&&i0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.lanes={},e.lanes&&(this.lanes=e.lanes),this.comboAttributes={},null!=e.comboAttributes&&(this.comboAttributes=e.comboAttributes),this.belongingLaneKeysByAnimationId={},e.belongingLaneKeysByAnimationId&&(this.belongingLaneKeysByAnimationId=e.belongingLaneKeysByAnimationId),this.incidentsById=new Tr({}),e.incidentsById&&(this.incidentsById=e.incidentsById)}return l(t,[{key:"_resize",value:function(t){for(var e=Object.keys(this.lanes),n=0;n2&&void 0!==arguments[2]&&arguments[2],i=st(t,e);return!!this.lanes.hasOwnProperty(i)||(n&&this.lanes.setValue(i,[]),!1)}},{key:"getOverlappingAnims",value:function(t,e,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return Array.from(this.lanes[st(e,n)]||[]).filter((function(e){var n=t.incident.duration;null!=s&&(n=s);var a=i.incidentsById._get(e.id).duration;return e.id!==t.incident.id&&!r.includes(e.id)&&(e.millisecond>=t.millisecond&&e.millisecondt.millisecond&&e.millisecond+a<=n+t.millisecond||e.millisecondn+t.millisecond)}))}},{key:"addElementToLane",value:function(t,e,n,i){var r=this,s=[],a=st(t,e);this.incidentsById._set(i.id,i);var o={millisecond:n,id:i.id};this.laneExists(t,e,!0),this.lanes.pushValue(a,o),this.lanes[a].sortBy("millisecond");var u=this.lanes[a],l=this.lanes[a].findIndex((function(t){return t.id===i.id}));return Object.prototype.hasOwnProperty.call(i.id)||this.belongingLaneKeysByAnimationId.setValue(i.id,[]),this.belongingLaneKeysByAnimationId.pushValue(i.id,a),0===l?this.lanes[a].length>1?s.push((function(){i.setInitialValue(r.incidentsById._get(u[1].id).pureInitialValues)})):s.push((function(){i.setInitialValue()})):s.push((function(){i.setInitialValue(r.incidentsById._get(u[l-1].id).animatedAttributeValue)})),Object.prototype.hasOwnProperty.call(this.comboAttributes,e)&&s.push((function(){return jr(u,r.incidentsById,i.initialValue,l)})),l+1i?i:r;jr(h,n.incidentsById,n.incidentsById._get(d[i-1].id).animatedAttributeValue,o,!0)}else n.incidentsById._get(d[i+1].id).setInitialValue(n.incidentsById._get(d[i-1].id).animatedAttributeValue),n.incidentsById._get(d[i+1].id).onGetContext();if(0===r?f?jr(h,n.incidentsById,n.incidentsById._get(d[0].id).pureInitialValues,r,!0):(s.setInitialValue(n.incidentsById._get(d[0].id).pureInitialValues),s.onGetContext()):f?jr(h,n.incidentsById,n.incidentsById._get(h[r-1].id).animatedAttributeValue,r,!0):(s.setInitialValue(n.incidentsById._get(h[r-1].id).animatedAttributeValue),s.onGetContext()),r+1>=h.length)return"continue";if(f)return jr(h,n.incidentsById,s.animatedAttributeValue,r+1,!0),"continue";var u=n.incidentsById._get(h[r+1].id);u.setInitialValue(s.animatedAttributeValue),u.onGetContext()},y=0;y=a.length||!1===m))if(Object.prototype.hasOwnProperty.call(this.comboAttributes,h.attribute))jr(a,this.incidentsById,m,o,!0);else{var v=this.incidentsById._get(a[o].id);v.setInitialValue(m),v.onGetContext()}}else c.onProgress(0,0),delete this.lanes[r[s]],Object.prototype.hasOwnProperty.call(e,r[s])&&delete e[r[s]]}delete this.belongingLaneKeysByAnimationId[t[n]]}return e}},{key:"recalcScratchValues",value:function(t){for(var e=Object.keys(this.lanes),n=0;n0){var s=this.incidentsById._get(r[0].id),a=s.getScratchValue(t),o=nt(i);Object.prototype.hasOwnProperty.call(this.comboAttributes,o.attribute)?jr(r,this.incidentsById,a,0,!0):s.setInitialValue(a),s.lastWish(),s.onGetContext()}}}}]),t}(),Nr=function(t){d(n,t);var e=g(n);function n(t){var i;return o(this,n),(i=e.call(this,t)).comboAttributes={},i.fixedAttributeName="_",null!=t.comboAttributes&&(i.comboAttributes=t.comboAttributes),i.LanesHandler=new Vr({comboAttributes:i.comboAttributes}),i}return l(n,[{key:"setComboAttributes",value:function(t){this.comboAttributes=t,this.LanesHandler=new Vr({comboAttributes:this.comboAttributes})}},{key:"lanes",get:function(){return this.LanesHandler.lanes}},{key:"incidentsById",get:function(){return this.LanesHandler.incidentsById}},{key:"_resize",value:function(t){this.LanesHandler._resize(t)}},{key:"checkAddition",value:function(t){for(var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all-or-nothing",i=this.LanesHandler.createTestLanesSanbox(),r=[],s=[],a=[],o=function(n){var o=!1,u=t[n],l=u.incident,c=l.mcid,h=l.attribute||e.fixedAttributeName;i.laneExists(c,h),r.push({mcid:c,attribute:h});var p=i.getOverlappingAnims(u,c,h);if(p.length>0&&(o=!0,a.push({type:"unauthorised, overlapping incidents on the same element",meta:{element_mcid:c,attribute:h,incident:u,overlappingAnims:p}})),!o){var d=i.addElementToLane(c,h,u.millisecond,l);s.push((function(){for(var t=0;t0&&"all-or-nothing"===n)return{result:!1,errors:a};var l=this.LanesHandler,c=function(){for(var t=0;t0&&s.push({type:"anauthorised, overlapping animations on the same element",meta:{element_mcid:u,attribute:l,newAnimation:d,overlappingAnims:f}});break}if(s.length>0)return{result:!1,errors:s};var m=this;return{result:!0,execute:function(){m.LanesHandler.updateLane(n,e)}}}},{key:"checkResizedIncidents",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=0;i0&&s.push({type:"anauthorised overlapping animations on the same element",meta:{element_mcid:h.mcid,attribute:h.attribute,newAnimation:v,overlappingAnims:y}})}break}if(s.length>0)return{result:!1,errors:s};var g=this,b=function(){for(var e=0;e4&&void 0!==arguments[4]&&arguments[4],a=t.filter((function(t){var i=r.incidentsById._get(t.id).duration+t.millisecond;return i>=e&&i<=n||i>=n&&t.millisecond<=n}));if(0===a.length){if(s&&0===e){var o=this.incidentsById._get(t[0].id);o.onProgress(0,0,i)}return!0}var u=a.length-1,l=this.incidentsById._get(a[u].id),c=a[u].millisecond,h=1,p=l.duration;l.duration+c>n&&(h=(p=n-c)/l.duration),l.onProgress(h,p,i)}},{key:"slipToLaneBackwards",value:function(t,e,n,i){var r=this,s=t.filter((function(t){var i=r.incidentsById._get(t.id).duration+t.millisecond;return i<=n&&i>=e||t.millisecond>=e&&t.millisecond<=n||t.millisecondn}));if(0===s.length)return!0;var a=this.incidentsById._get(s[0].id),o=s[0].millisecond,u=0,l=0;o3&&void 0!==arguments[3]&&arguments[3],r=Object.keys(this.lanes),s=0;s-1&&e.push(i)}return e}}return Array.from(this.context.rootElement.querySelectorAll(t))}},{key:"getMCID",value:function(t){return!0===t.customEntity?t.id:t.getAttribute(L)}},{key:"setMCID",value:function(t,e){t.setAttribute(L,e)}},{key:"getElementSelectorByMCID",value:function(t){return Object.prototype.hasOwnProperty.call(this.customEntities,t)?"!#".concat(t):"[".concat(L,'="').concat(t,'"]')}},{key:"setCustomEntity",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Object.prototype.hasOwnProperty.call(this.customEntities,t)?(ot.error("Clip ".concat(this.id," already has custom Entity with id: ").concat(t)),!1):(this.customEntities[t]={id:t,entity:e,classes:n,customEntity:!0},!0)}}]),t}(),Br=Ae((function(t,e){var n=/[|\\{}()[\]^$+*?.]/g;e.escapeRegExpChars=function(t){return t?String(t).replace(n,"\\$&"):""};var i={"&":"&","<":"<",">":">",'"':""","'":"'"},r=/[&<>'"]/g;function s(t){return i[t]||t}e.escapeXML=function(t){return null==t?"":String(t).replace(r,s)},e.escapeXML.toString=function(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'},e.shallowCopy=function(t,e){for(var n in e=e||{})t[n]=e[n];return t},e.shallowCopyFromList=function(t,e,n){for(var i=0;i @@ -805,40 +869,13 @@ * @project EJS * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} */ -var n=a.default,r=!1,o=hC,s="locals",u=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],c=u.concat("cache"),l=/^\uFEFF/;function p(e,n){var r;if(n.some((function(n){return r=t.resolveInclude(e,n,!0),i.default.existsSync(r)})))return r}function f(e,n){var r,i=e.filename,a=arguments.length>1;if(e.cache){if(!i)throw new Error("cache option requires a filename");if(r=t.cache.get(i))return r;a||(n=d(i).toString().replace(l,""))}else if(!a){if(!i)throw new Error("Internal EJS error: no file name or template provided");n=d(i).toString().replace(l,"")}return r=t.compile(n,e),e.cache&&t.cache.set(i,r),r}function h(e,n,r){var i;if(!r){if("function"==typeof t.promiseImpl)return new t.promiseImpl((function(t,r){try{t(i=f(e)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{i=f(e)(n)}catch(e){return r(e)}r(null,i)}function d(e){return t.fileLoader(e)}function m(e,n){var r=fC.shallowCopy({},n);if(r.filename=function(e,n){var r,a,o=n.views,s=/^[A-Za-z]+:\\|^\//.exec(e);if(s&&s.length)e=e.replace(/^\/*/,""),r=Array.isArray(n.root)?p(e,n.root):t.resolveInclude(e,n.root||"/",!0);else if(n.filename&&(a=t.resolveInclude(e,n.filename),i.default.existsSync(a)&&(r=a)),!r&&Array.isArray(o)&&(r=p(e,o)),!r&&"function"!=typeof n.includer)throw new Error('Could not find the include file "'+n.escapeFunction(e)+'"');return r}(e,r),"function"==typeof n.includer){var a=n.includer(e,r.filename);if(a&&(a.filename&&(r.filename=a.filename),a.template))return f(r,a.template)}return f(r)}function y(e,t,n,r,i){var a=t.split("\n"),o=Math.max(r-3,0),s=Math.min(a.length,r+3),u=i(n),c=a.slice(o,s).map((function(e,t){var n=t+o+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=u,e.message=(u||"ejs")+":"+r+"\n"+c+"\n\n"+e.message,e}function g(e){return e.replace(/;(\s*$)/,"$1")}function v(e,n){n=n||{};var r={};this.templateText=e,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",r.client=n.client||!1,r.escapeFunction=n.escape||n.escapeFunction||fC.escapeXML,r.compileDebug=!1!==n.compileDebug,r.debug=!!n.debug,r.filename=n.filename,r.openDelimiter=n.openDelimiter||t.openDelimiter||"<",r.closeDelimiter=n.closeDelimiter||t.closeDelimiter||">",r.delimiter=n.delimiter||t.delimiter||"%",r.strict=n.strict||!1,r.context=n.context,r.cache=n.cache||!1,r.rmWhitespace=n.rmWhitespace,r.root=n.root,r.includer=n.includer,r.outputFunctionName=n.outputFunctionName,r.localsName=n.localsName||t.localsName||s,r.views=n.views,r.async=n.async,r.destructuredLocals=n.destructuredLocals,r.legacyInclude=void 0===n.legacyInclude||!!n.legacyInclude,r.strict?r._with=!1:r._with=void 0===n._with||n._with,this.opts=r,this.regex=this.createRegex()}t.cache=fC.cache,t.fileLoader=i.default.readFileSync,t.localsName=s,t.promiseImpl=new Function("return this;")().Promise,t.resolveInclude=function(e,t,r){var i=n.dirname,a=n.extname,o=(0,n.resolve)(r?t:i(t),e);return a(e)||(o+=".ejs"),o},t.compile=function(e,t){return t&&t.scope&&(r||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),r=!0),t.context||(t.context=t.scope),delete t.scope),new v(e,t).compile()},t.render=function(e,t,n){var r=t||{},i=n||{};return 2==arguments.length&&fC.shallowCopyFromList(i,r,u),f(i,e)(r)},t.renderFile=function(){var e,t,n,r=Array.prototype.slice.call(arguments),i=r.shift(),a={filename:i};return"function"==typeof arguments[arguments.length-1]&&(e=r.pop()),r.length?(t=r.shift(),r.length?fC.shallowCopy(a,r.pop()):(t.settings&&(t.settings.views&&(a.views=t.settings.views),t.settings["view cache"]&&(a.cache=!0),(n=t.settings["view options"])&&fC.shallowCopy(a,n)),fC.shallowCopyFromList(a,t,c)),a.filename=i):t={},h(a,t,e)},t.Template=v,t.clearCache=function(){t.cache.reset()},v.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},v.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=fC.escapeRegExpChars(this.opts.delimiter),n=fC.escapeRegExpChars(this.opts.openDelimiter),r=fC.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,r),new RegExp(e)},compile:function(){var e,t,r,i=this.opts,a="",o="",s=i.escapeFunction;if(!this.source){if(this.generateSource(),a+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',i.outputFunctionName&&(a+=" var "+i.outputFunctionName+" = __append;\n"),i.destructuredLocals&&i.destructuredLocals.length){for(var u=" var __locals = ("+i.localsName+" || {}),\n",c=0;c0&&(u+=",\n "),u+=l+" = __locals."+l}a+=u+";\n"}!1!==i._with&&(a+=" with ("+i.localsName+" || {}) {\n",o+=" }\n"),o+=" return __output;\n",this.source=a+this.source+o}e=i.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+(i.filename?JSON.stringify(i.filename):"undefined")+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,i.client&&(e="escapeFn = escapeFn || "+s.toString()+";\n"+e,i.compileDebug&&(e="rethrow = rethrow || "+y.toString()+";\n"+e)),i.strict&&(e='"use strict";\n'+e),i.debug&&console.log(e),i.compileDebug&&i.filename&&(e=e+"\n//# sourceURL="+i.filename+"\n");try{if(i.async)try{r=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else r=Function;t=new r(i.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(i.filename&&(e.message+=" in "+i.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",i.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var p=i.client?t:function(e){return t.apply(i.context,[e||{},s,function(t,n){var r=fC.shallowCopy({},e);return n&&(r=fC.shallowCopy(r,n)),m(t,i)(r)},y])};if(i.filename&&"function"==typeof Object.defineProperty){var f=i.filename,h=n.basename(f,n.extname(f));try{Object.defineProperty(p,"name",{value:h,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return p},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(a,o){var s;if(0===a.indexOf(r+n)&&0!==a.indexOf(r+n+n)&&(s=t[o+2])!=n+i&&s!="-"+n+i&&s!="_"+n+i)throw new Error('Could not find matching close tag for "'+a+'".');e.scanLine(a)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),i=[];r;)0!==(e=r.index)&&(i.push(t.substring(0,e)),t=t.slice(e)),i.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&i.push(t),i},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=v.modes.EVAL;break;case r+n+"=":this.mode=v.modes.ESCAPED;break;case r+n+"-":this.mode=v.modes.RAW;break;case r+n+"#":this.mode=v.modes.COMMENT;break;case r+n+n:this.mode=v.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+i:this.mode=v.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+i,n+i)+'")\n';break;case n+i:case"-"+n+i:case"_"+n+i:this.mode==v.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case v.modes.EVAL:case v.modes.ESCAPED:case v.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case v.modes.EVAL:this.source+=" ; "+e+"\n";break;case v.modes.ESCAPED:this.source+=" ; __append(escapeFn("+g(e)+"))\n";break;case v.modes.RAW:this.source+=" ; __append("+g(e)+")\n";break;case v.modes.COMMENT:break;case v.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},t.escapeXML=fC.escapeXML,t.__express=t.renderFile,t.VERSION=o,t.name="ejs","undefined"!=typeof window&&(window.ejs=t)}));function mC(e){e.descriptor.value=function(e,t){return J(e)?e(t):dC.render(e,{initParams:t})}}var yC=I(null,(function(e,t){return{F:function(t){h(r,t);var n=v(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(s(this,r),t=n.call(this),e(y(t)),!W(i))return ae.error("ContextHandler expects an object on its constructor. ".concat(o(i)," passed")),g(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"html"))return ae.error("ContextHandler expects the html key on its constructor properties which is missing"),g(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"css"))return ae.error("ContextHandler expects the css key on its constructor properties which is missing"),g(t,!1);if(Object.prototype.hasOwnProperty.call(i,"initParams")||ae.info("ContextHandler got null initParams"),!Object.prototype.hasOwnProperty.call(i,"host"))return ae.error("ContextHandler expects the host key on its constructor properties which is missing"),g(t,!1);t.isDOM=!0;var a=i.host.ownerDocument;if(!a.getElementById("@kissmybutton/motorcortex/iframeContextHandler/css")){var u="\n iframe[seamless]{\n background-color: transparent;\n border: 0px none transparent;\n padding: 0px;\n overflow: hidden;\n }\n ",c=a.createElement("style");c.id="@kissmybutton/motorcortex/iframeContextHandler/css",c.type="text/css";var l=a.head||a.getElementsByTagName("head")[0];c.styleSheet?c.styleSheet.cssText=u:c.appendChild(a.createTextNode(u)),l.appendChild(c)}var p=a.createElement("iframe");i.host.appendChild(p);var f=t.scalingCalculator(i),h=t.calcClipDims(i);p.setAttribute("seamless","seamless"),!0===h.use&&(null!==h.width&&p.setAttribute("width",h.width),null!==h.height&&p.setAttribute("height",h.height)),p.style.transform="scale(".concat(f.width,", ").concat(f.height,")"),p.style.transformOrigin="top left",p.style.position="absolute",p.src="";var d=p.contentWindow||p.contentDocument;d.document&&(d=d.document),d.write(t.compileHTML(i.html,i.initParams));var m="\n body{\n padding:0;\n margin:0;\n }\n ",v=d.createElement("style");v.type="text/css",v.styleSheet?v.styleSheet.cssText=t.compileHTML(i.css,i.initParams)+m:v.appendChild(a.createTextNode(t.compileHTML(i.css,i.initParams)+m));var x=d.head||d.getElementsByTagName("head")[0];if(x.appendChild(v),Object.prototype.hasOwnProperty.call(i,"fonts"))for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:{};if(s(this,r),t=n.call(this),e(y(t)),!W(i))return ae.error("ContextHandler expects an object on its constructor. ".concat(o(i)," passed")),g(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"html"))return ae.error("ContextHandler expects the html key on its constructor properties which is missing"),g(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"css"))return ae.error("ContextHandler expects the css key on its constructor properties which is missing"),g(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"host"))return ae.error("ContextHandler expects the host key on its constructor properties which is missing"),g(t,!1);t.isDOM=!0;var a=i.host.shadowRoot;a||(a=i.host.attachShadow({mode:"open"}));var u=document.createElement("div"),c=t.scalingCalculator(i),l=t.calcClipDims(i);u.setAttribute("data-motorocortex-container","true"),!0===l.use&&(null!==l.width&&(u.style.width=l.width),null!==l.height&&(u.style.height=l.height)),u.style.transform="scale(".concat(c.width,", ").concat(c.height,")"),u.style.transformOrigin="top left",u.style.position="absolute",u.style.overflow="hidden",u.innerHTML=t.compileHTML(i.html,i.initParams),a.appendChild(u);var p=document.createElement("slot");a.appendChild(p);var f=document.createElement("style");if(f.type="text/css",f.styleSheet?f.styleSheet.cssText=t.compileHTML(i.css,i.initParams):f.appendChild(document.createTextNode("[data-motorocortex-container] { all: initial; }"+t.compileHTML(i.css,i.initParams))),a.appendChild(f),t.fontTags=[],Object.prototype.hasOwnProperty.call(i,"fonts"))for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,n),null===o?(r={},i=a):(r=a,i=o),e=t.call(this,r,i),i=f(f({},i),{},{html:""!==e.html?e.html:i.html,css:""!==e.css?e.css:i.css,fonts:e.fonts.length>0?e.fonts:i.fonts});var u=F;e.clipType=u;var c=new(document.head.createShadowRoot||document.head.attachShadow?gC:yC)(i);return e.ownContext=f(f({},c.context),{},{isHostedClip:e.isHostedClip,contextLoaded:!0,initParams:i.initParams}),e.iframe=c.iframeElement,e.forceExportIncidents=!0,e.onAfterRender(),e}return c(n,[{key:"onAfterRender",value:function(){}},{key:"exportConstructionArguments",value:function(){return{attrs:this.attrs,props:f(f({},this.props),{},{host:void 0,html:!0===this.DescriptiveIncident.constructor.customClip?"":this.ownContext.rootElement.innerHTML})}}},{key:"setCustomEntity",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.context.setCustomEntity(e,t,n)}},{key:"html",get:function(){return""}},{key:"css",get:function(){return""}},{key:"fonts",get:function(){return[]}},{key:"rootElement",get:function(){return this.ownContext.clipContainer}}]),n}(WA),xC=I(null,(function(e,t){return{F:function(t){h(r,t);var n=v(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,r),t=n.call(this),e(y(t));var a=f({},i);if(!W(a))return ae.error("HTMLFragmentContextHandler expects an object on its constructor. ".concat(o(a)," passed")),g(t,!1);Object.prototype.hasOwnProperty.call(a,"html")||(a.html=""),t.isDOM=!0;var u=document.createDocumentFragment(),c=document.createElement("div");return Object.prototype.hasOwnProperty.call(a,"containerParams")&&(Object.prototype.hasOwnProperty.call(a,"width")&&(c.style.width=a.containerParams.width),Object.prototype.hasOwnProperty.call(a,"height")&&(c.style.height=a.containerParams.height)),c.innerHTML=t.compileHTML(a.html,a.initParams),u.appendChild(c),c.style.overflow="hidden",t.rootElement=c,t.context={document:document,window:window,clipContainer:t.rootElement,rootElement:c,unmount:function(){a.host.removeChild(u)},getElements:t.getElements.bind(y(t)),getMCID:t.getMCID.bind(y(t)),setMCID:t.setMCID.bind(y(t)),getElementSelectorByMCID:t.getElementSelectorByMCID.bind(y(t)),getElementByMCID:t.getElementByMCID.bind(y(t)),setCustomEntity:t.setCustomEntity.bind(y(t)),fragment:!0},t.elementsByMCID={},t}return r}(t),d:[{kind:"method",decorators:[mC],key:"compileHTML",value:function(){}}]}}),pC),bC=function(e){h(n,e);var t=v(n);function n(){var e,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,n),null===o?(r={},i=a):(r=a,i=o),e=t.call(this,r,i);var u=new xC(f(f({},i),{},{html:Object.prototype.hasOwnProperty.call(i,"html")?i.html:e.html,css:Object.prototype.hasOwnProperty.call(i,"css")?i.css:e.css,fonts:Object.prototype.hasOwnProperty.call(i,"fonts")?i.fonts:e.fonts}));return e.ownContext=f(f({},u.context),{},{isHostedClip:!1}),e.iframe=u.iframeElement,e.forceExportIncidents=!0,e.onDOMCLipInitialise(),e}return c(n,[{key:"exportConstructionArguments",value:function(){return{attrs:this.attrs,props:f(f({},this.props),{},{html:this.ownContext.rootElement.innerHTML})}}},{key:"onDOMCLipInitialise",value:function(){}},{key:"rootElement",get:function(){return this.ownContext.clipContainer}}]),n}(WA),wC=function(){function e(){s(this,e)}return c(e,[{key:"addIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"moveIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"removeIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"resizeIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"getIncidentsByChannel",value:function(){return{}}},{key:"flash",value:function(){}},{key:"_resize",value:function(){}},{key:"onProgress",value:function(){}},{key:"duration",get:function(){return 0}}]),e}(),NC=function(e){h(n,e);var t=v(n);function n(e,r){var i;return s(this,n),(i=t.call(this,e,r)).runTimeInfo={currentMillisecond:0,state:"idle"},i.listeners={},i.previousTimeStamp=-1,i.speed=1,i}return c(n,[{key:"_setState",value:function(e){if(e!==this.runTimeInfo.state)for(var t in this.runTimeInfo.state=e,this.putMessageOnPipe("setState",e,"Clips",{selfExecute:!1,direction:le}),this.listeners){this.listeners[t].funct(this.runTimeInfo.currentMillisecond,e)}}},{key:"handleSetState",value:function(e,t){this._setState(t)}},{key:"play",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("idle"===this.runTimeInfo.state||"paused"===this.runTimeInfo.state||"armed"===this.runTimeInfo.state||"transitional"===this.runTimeInfo.state||"blocked"===this.runTimeInfo.state){if("paused"===this.runTimeInfo.state){var n=(new Date).getTime()-this.pauseMoment;this.previousTimeStamp+=n}this._setState("playing"),this.onPlay(),t||window.requestAnimationFrame((function(t){e.step(t)}))}}},{key:"pause",value:function(){"playing"===this.runTimeInfo.state&&(this._setState("paused"),this.pauseMoment=(new Date).getTime(),this.onWait())}},{key:"arm",value:function(){"transitional"===this.runTimeInfo.state&&this._setState("armed")}},{key:"complete",value:function(){this._setState("idle"),this.previousTimeStamp=-1}},{key:"stop",value:function(){this._setState("transitional"),this.previousTimeStamp=-1}},{key:"block",value:function(){this._setState("blocked"),this.previousTimeStamp=-1}},{key:"onPlay",value:function(){}},{key:"onWait",value:function(){}},{key:"playableProgress",value:function(e,t){if(this.isTheRootClip){for(var n in this.listeners){var r=this.listeners[n];!0!==r.onlyOnStateChange&&(Math.abs(t+r.cavaDelta-this.runTimeInfo.currentMillisecond)>r.threshold?(r.funct(X(t,r.roundTo),this.runTimeInfo.state),r.cavaDelta=0):r.cavaDelta+=Math.abs(t-this.runTimeInfo.currentMillisecond))}return this.onProgress(e,t),this.runTimeInfo.currentMillisecond=t,!0}return!1}},{key:"step",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("playing"===this.runTimeInfo.state){var n=this;-1===this.previousTimeStamp&&(this.previousTimeStamp=e);var r={milliseconds:Math.round(this.runTimeInfo.currentMillisecond+(e-this.previousTimeStamp)*this.speed),fraction:(this.runTimeInfo.currentMillisecond+(e-this.previousTimeStamp)*this.speed)/this.duration};if(r.fraction>=1)return this.playableProgress(1,this.duration),void this.complete();if(r.fraction<0)return this.playableProgress(0,0),void this.complete();this.playableProgress(r.fraction,r.milliseconds),this.previousTimeStamp=e,t||window.requestAnimationFrame(n.step.bind(n))}}},{key:"subscribe",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n||(n=0),r||(r=1),this.listeners[e]={funct:t,threshold:n,roundTo:r,cavaDelta:0,onlyOnStateChange:i}}},{key:"unsubscribe",value:function(e){Object.prototype.hasOwnProperty.call(this.listeners,e)&&delete this.listeners[e]}},{key:"subscribeToDurationChange",value:function(e){return!!this.isTheRootClip&&(this.realClip.subscribeToDurationChange(e),!0)}},{key:"executionSpeed",set:function(e){if(!this.isTheRootClip)return!1;this.speed=parseFloat(e)}}]),n}(LA),MC=function(){function e(t){s(this,e),this.runTimeInfo={currentMillisecond:0,state:"transitional"},this.id=te(),this.realClip=t.descriptiveIncident.realClip;var n=t.descriptiveIncident.realClip.exportConstructionArguments(),r=f(f({},n.props),{},{selector:void 0,host:t.host,id:this.id});this.ownClip=new t.descriptiveIncident.constructor.Incident(n.attrs,r),t.descriptiveIncident.realClip.addContext({clipId:this.id,context:this.ownClip.ownContext,synchronize:t.synchronize,runTimeInfo:this.runTimeInfo},!0)}return c(e,[{key:"onProgress",value:function(e,t){for(var n in this.realClip.instantiatedChannels){this.realClip.instantiatedChannels[n].moveTo(this.runTimeInfo.currentMillisecond,t,this.id,!0)}this.runTimeInfo.currentMillisecond=t}}]),e}(),EC=function(e){h(n,e);var t=v(n);function n(e){var r,i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;s(this,n),null===o?(i={},a=e):(i=e,a=o),(r=t.call(this,i,a)).initParams=a.initParams||{};var u=r._validateProps();if(!u.result)return g(r,u);r.isTheRootClip=!1,r.isExportableToJSONFormat=!0,Object.prototype.hasOwnProperty.call(a,"html")&&J(a.html)&&(r.isExportableToJSONFormat=!1);var c={id:r.id,attrs:i,props:f(f({},a),{},{html:Object.prototype.hasOwnProperty.call(a,"html")?a.html:r.html,css:Object.prototype.hasOwnProperty.call(a,"css")?a.css:r.css,fonts:Object.prototype.hasOwnProperty.call(a,"fonts")?a.fonts:r.fonts,runTimeInfo:r.runTimeInfo,subscribe:r.subscribe.bind(y(r))}),plugin_npm_name:r.constructor.plugin_npm_name,Channel:r.constructor.Channel,DescriptiveIncident:y(r)};if(r.audio="on",Object.prototype.hasOwnProperty.call(r.constructor,"audio")&&(r.audio=r.constructor.audio),Object.prototype.hasOwnProperty.call(a,"audio")&&(r.audio=a.audio),Object.prototype.hasOwnProperty.call(a,"selector")&&void 0!==a.selector&&!0!==r.constructor.customClip)c.Incident=bC;else if(Object.prototype.hasOwnProperty.call(a,"selector")&&void 0!==a.selector&&!0===r.constructor.customClip){delete c.props.selector;var l=new bC({html:'
'});c.props.host=l.rootElement,c.Incident=r.constructor.Incident}else"only"===r.audio&&!0!==r.props.root?r.isTheRootClip=!1:(r.isTheRootClip=!0,r.blockingWaitings={},c.Incident=r.constructor.Incident);if("on"===r.audio||"off"===r.audio?r.realClip=Dr(c):r.realClip=new wC,"on"===r.audio||"only"===r.audio){var p={id:r.id,attrs:{},props:{audioSources:Object.prototype.hasOwnProperty.call(a,"audioSources")?a.audioSources:r.audioSources,runTimeInfo:r.runTimeInfo,subscribe:r.subscribe.bind(y(r))},plugin_npm_name:r.constructor.plugin_npm_name,Channel:r.constructor.Channel,Incident:QA,DescriptiveIncident:y(r)};r.audioClip=Dr(p)}else r.audio="off",r.audioClip=new wC;return r.passiveAddition=!0,r._buildTree(),r.passiveAddition=!1,r}return c(n,[{key:"_validateProps",value:function(){return ae.validateProps({props:this.props},MA,this.constructor,this.id)}},{key:"exportLiveDefinition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=b(d(n.prototype),"exportLiveDefinition",this).call(this,e);return J(this.props.html)&&(t.props.html=this.props.html),J(this.props.css)&&(t.props.css=this.props.css),t}},{key:"_buildTree",value:function(){void 0!==this.realClip&&this.buildTree()}},{key:"resize",value:function(e){return this.realClip._resize(e/this.duration),this.audioClip._resize(e/this.duration),this.duration=e,this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ce}),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ce}),{result:!0}}},{key:"manageEditAttrProps",value:function(e,t){return{result:!1,errors:["Clips attributes and properties can not be edited"]}}},{key:"handleCheckForClip",value:function(e,t){return!0}},{key:"handleGetElements",value:function(e,t){return this.realClip.getElements(t.selector)}},{key:"handleCheckAddition",value:function(e,t){var n=this.realClip.addIncident(t),r=this.audioClip.addIncident(t);return!0===n.result&&!0===r.result?(n.execute(),r.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ce}),{result:!0}):n}},{key:"handleCheckMove",value:function(e,t){var n=this.realClip.moveIncident(t),r=this.audioClip.moveIncident(t);return!0===n.result&&!0===r.result?(n.execute(),r.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ce}),{result:!0}):n}},{key:"handleCheckDeletion",value:function(e,t){var n=this.realClip.removeIncident(t),r=this.audioClip.removeIncident(t);return!0===n.result&&!0===r.result?(n.execute(),r.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ce}),{result:!0}):n}},{key:"handleCheckResize",value:function(e,t){var n=this.realClip.resizeIncident(t),r=this.audioClip.resizeIncident(t);return!0===n.result&&!0===r.result?(n.execute(),r.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ce}),{result:!0}):n}},{key:"handleFlash",value:function(e,t){if(!this.isTheRootClip)return this.bypass();this.flash()}},{key:"handleSetBlock",value:function(e,t){if(!this.isTheRootClip)return this.bypass();"transitional"!==this.runTimeInfo.state&&("blocked"!==this.runTimeInfo.state&&(this.statusBeforeBlock=this.runTimeInfo.state),this.blockingWaitings[t.id]=t,this.block())}},{key:"handleUnBlock",value:function(e,t){if(!this.isTheRootClip)return this.bypass();Object.prototype.hasOwnProperty.call(this.blockingWaitings,t.id)&&(delete this.blockingWaitings[t.id],0===Object.keys(this.blockingWaitings).length&&("playing"===this.statusBeforeBlock?(this.previousTimeStamp=-1,this.play()):this.arm()))}},{key:"stop",value:function(){b(d(n.prototype),"stop",this).call(this),this.blockingWaitings={}}},{key:"onProgress",value:function(e,t){this.realClip.onProgress(e,t),this.audioClip.onProgress(e,t)}},{key:"paste",value:function(e){return this.isTheRootClip?new MC({host:e,descriptiveIncident:this}):null}},{key:"flash",value:function(){this.realClip.flash()}},{key:"setVolume",value:function(e){return e<0||e>1?{result:!1,errors:[{type:"invalid volume number"}]}:"off"===this.audio?{result:!1,errors:[{type:"can not set volume of Clip with audio off"}]}:(this.audioClip.setVolume(e),{result:!0})}},{key:"selectorToPassToChildren",get:function(){return null}},{key:"inheritedSelector",get:function(){return this._inheritedSelector},set:function(e){this._inheritedSelector=e}},{key:"html",get:function(){return""}},{key:"css",get:function(){return""}},{key:"fonts",get:function(){return[]}},{key:"audioSources",get:function(){return[]}}]),n}(NC);l(EC,"isClip",!0),l(EC,"Incident",vC),l(EC,"plugin_npm_name","@kissmybutton/self-contained-incidents"),l(EC,"version",FA),l(EC,"Channel",wr),l(EC,"ClassName","HTMLClip"),l(EC,"propsValidationRules",MA);var SC=cA.compile({incidents:{type:"array",items:{type:"object",props:{position:{type:"amount",integer:!0,min:0,optional:!1},attrs:{type:"object",optional:!1},props:{type:"object",optional:!1},incidentClass:{type:"any",optional:!1}}}}}),OC=function(e){h(n,e);var t=v(n);function n(e,r){var i;s(this,n),null!==(i=t.call(this,e,r)).incidents&&(i.attrs.incidents=i.incidents,i.attributesStaggers=[],i.propsStaggers=[],i.setupDynamicValues());var a=ae.validateProps(i.props,SA,i.constructor);if(!a.result)return g(i,a);var o=SC(i.attrs);if(o.length>0)return ae.error("The provided attributes for Combo Incident are invalid"),g(i,{result:!1,errors:o});for(var u=[],c=0;c0&&u.concat(p.errors)}var f=ae.validateProps(l.props,l.incidentClass.propsValidationRules,l.incidentClass);!1===f.result&&u.concat(f.errors)}return u.length>0?g(i,{result:!1,errors:u}):(i.dynamicDurationValue=null,i)}return c(n,[{key:"addIncident",value:function(){var e="Combos don't accept any Incidents to be added on their timeline externally";return ae.error(e),{result:!1,errors:[e]}}},{key:"moveIncident",value:function(){var e="Combo Incidents don't allow external manipulation of their Incidents";return ae.error(e),{result:!1,errors:[e]}}},{key:"removeIncident",value:function(){var e="Combo Incidents don't allow external manipulation of their Incidents";return ae.error(e),{result:!1,errors:[e]}}},{key:"handleCheckAddition",value:function(e,t){return!1}},{key:"handleCheckMove",value:function(e,t){return!1}},{key:"handleCheckDeletion",value:function(e,t){return!1}},{key:"handleCheckResize",value:function(e,t){return!1}},{key:"exportDefinition",value:function(){var e=f(f({},this.attrs),{},{incidents:function e(t){for(var n=[],r=0;r0&&void 0!==arguments[0])||arguments[0],t=this.attrs;null!==this.incidents&&(t=f(f({},this.attrs),{},{incidents:void 0}));var n=JSON.parse(JSON.stringify(this.props));!1===e&&delete n.id;var r={Class:this.constructor,attrs:t,props:n,incidents:{}};return r}},{key:"incidents",get:function(){return null}},{key:"duration",get:function(){return null!==this.dynamicDurationValue?this.dynamicDurationValue:"dynamic"}}]),n}(LA);l(OC,"isCombo",!0),l(OC,"ClassName","Combo"),l(OC,"attrsValidationRules",null),l(OC,"propsValidationRules",SA);var AC=I(null,(function(e,t){var n=function(t){h(r,t);var n=v(r);function r(t,i){var a;s(this,r),void 0===i&&(i=t,t={}),a=n.call(this,i),e(y(a));var o=ae.validateProps(i,bA,a.constructor,a.id);return o.result?(a.inheritedSelector=null,a.attrs=t,Object.prototype.hasOwnProperty.call(i,"duration")||(i.duration=0),a.props=i,a.attributesStaggers=[],a.propsStaggers=[],a.setupDynamicValues(),a.dynamicDurationValue=null,a.passive=!1,a):g(a,o)}return r}(t);return{F:n,d:[{kind:"field",static:!0,key:"Incident",value:function(){return Tr}},{kind:"field",static:!0,key:"plugin_npm_name",value:function(){return"motor-cortex-js-attribute"}},{kind:"field",static:!0,key:"version",value:function(){return FA}},{kind:"field",static:!0,key:"Channel",value:function(){return lC}},{kind:"field",static:!0,key:"ClassName",value:function(){return"Incident"}},{kind:"field",static:!0,key:"attrsValidationRules",value:function(){return null}},{kind:"field",static:!0,key:"propsValidationRules",value:function(){return bA}},{kind:"method",decorators:[AA],key:"editAttributes",value:function(){}},{kind:"method",decorators:[CA],key:"editProperties",value:function(){}},{kind:"method",decorators:[_A],key:"resize",value:function(){}},{kind:"method",decorators:[TA],key:"clone",value:function(){}},{kind:"method",decorators:[PA],key:"selector",value:function(){}},{kind:"method",decorators:[kA],key:"getElements",value:function(){}},{kind:"method",decorators:[RA],key:"setupDynamicValues",value:function(){}},{kind:"get",key:"duration",value:function(){return null!==this.dynamicDurationValue?this.dynamicDurationValue:this.propsStaggers.length>0?"dynamic":b(d(n.prototype),"duration",this)}},{kind:"set",key:"duration",value:function(e){if(this.propsStaggers.length>0){for(var t=0;t0&&void 0!==arguments[0])||arguments[0],t=JSON.parse(JSON.stringify(this.props));return!1===e&&delete t.id,{Class:this.constructor,attrs:JSON.parse(JSON.stringify(this.attrs)),props:t}}}]}}),fe),CC=function(){function e(t){if(s(this,e),!Object.prototype.hasOwnProperty.call(t,"incident"))return ae.error('Journey constructor expects an Incident on its properties on the key "incident"'),!1;this.memory=t.calpuleMemory,this.stations=[],this.incident=t.incident,this.startMillisecond=1*this.incident.runTimeInfo.currentMillisecond,this.startState="".concat(this.incident.runTimeInfo.state),this.incident.stop()}return c(e,[{key:"station",value:function(e){this.stations.length>0&&this.stations[this.stations.length-1],this.stations.push(e),this.incident.playableProgress(e/this.incident.duration,e)}},{key:"destination",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null!=e?this.station(e):e=this.stations[this.stations.length-1],this.incident.playableProgress(e/this.incident.duration,e),"playing"===this.startState||"blocked"===this.startState&&"playing"===this.incident.statusBeforeBlock?this.incident.play():e>=this.incident.duration?this.incident.complete():this.incident.arm(),this.memory.push(this.exportJourneyLog)}},{key:"exportJourneyLog",value:function(){return{startMillisecond:this.startMillisecond,startState:this.startState,stations:this.stations}}}]),e}(),kC=function(){function e(){s(this,e),this.memory=[]}return c(e,[{key:"startJourney",value:function(e){return e?new CC({incident:e,calpuleMemory:this.memory}):(ae.error("startJourney expects an Incident as an argument"),!1)}}]),e}(),_C=function(){var e=function(e,t){return e.startsWith("on")&&"function"==typeof t},t=function(e){return e.substr(2).toLowerCase()},n=function(e){return"function"==typeof e};function r(e){var t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild}function i(n,r){if(!r)return n;for(var i=0,a=Object.entries(r);i2?a-2:0),u=2;u0){for(var p="Error on plugin's \"".concat(e.npm_name,'" Clip instantiation. Errors:'),f=0;f0){for(var l="Error on plugin's \"".concat(e.npm_name,'" "').concat(e.incidents[n].name,'" instantiation. Errors:'),p=0;p1;if(t.cache){if(!r)throw new Error("cache option requires a filename");if(i=e.cache.get(r))return i;s||(n=f(r).toString().replace(c,""))}else if(!s){if(!r)throw new Error("Internal EJS error: no file name or template provided");n=f(r).toString().replace(c,"")}return i=e.compile(n,t),t.cache&&e.cache.set(r,i),i}function d(t,n,i){var r;if(!i){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,i){try{e(r=p(t)(n))}catch(t){i(t)}}));throw new Error("Please provide a callback function")}try{r=p(t)(n)}catch(t){return i(t)}i(null,r)}function f(t){return e.fileLoader(t)}function m(t,n){var i=Br.shallowCopy({},n);if(i.filename=function(t,n){var i,s,a=n.views,o=/^[A-Za-z]+:\\|^\//.exec(t);if(o&&o.length)t=t.replace(/^\/*/,""),i=Array.isArray(n.root)?h(t,n.root):e.resolveInclude(t,n.root||"/",!0);else if(n.filename&&(s=e.resolveInclude(t,n.filename),r.default.existsSync(s)&&(i=s)),!i&&Array.isArray(a)&&(i=h(t,a)),!i&&"function"!=typeof n.includer)throw new Error('Could not find the include file "'+n.escapeFunction(t)+'"');return i}(t,i),"function"==typeof n.includer){var s=n.includer(t,i.filename);if(s&&(s.filename&&(i.filename=s.filename),s.template))return p(i,s.template)}return p(i)}function v(t,e,n,i,r){var s=e.split("\n"),a=Math.max(i-3,0),o=Math.min(s.length,i+3),u=r(n),l=s.slice(a,o).map((function(t,e){var n=e+a+1;return(n==i?" >> ":" ")+n+"| "+t})).join("\n");throw t.path=u,t.message=(u||"ejs")+":"+i+"\n"+l+"\n\n"+t.message,t}function y(t){return t.replace(/;(\s*$)/,"$1")}function g(t,n){n=n||{};var i={};this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",i.client=n.client||!1,i.escapeFunction=n.escape||n.escapeFunction||Br.escapeXML,i.compileDebug=!1!==n.compileDebug,i.debug=!!n.debug,i.filename=n.filename,i.openDelimiter=n.openDelimiter||e.openDelimiter||"<",i.closeDelimiter=n.closeDelimiter||e.closeDelimiter||">",i.delimiter=n.delimiter||e.delimiter||"%",i.strict=n.strict||!1,i.context=n.context,i.cache=n.cache||!1,i.rmWhitespace=n.rmWhitespace,i.root=n.root,i.includer=n.includer,i.outputFunctionName=n.outputFunctionName,i.localsName=n.localsName||e.localsName||o,i.views=n.views,i.async=n.async,i.destructuredLocals=n.destructuredLocals,i.legacyInclude=void 0===n.legacyInclude||!!n.legacyInclude,i.strict?i._with=!1:i._with=void 0===n._with||n._with,this.opts=i,this.regex=this.createRegex()}e.cache=Br.cache,e.fileLoader=r.default.readFileSync,e.localsName=o,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(t,e,i){var r=n.dirname,s=n.extname,a=(0,n.resolve)(i?e:r(e),t);return s(t)||(a+=".ejs"),a},e.compile=function(t,e){return e&&e.scope&&(i||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),i=!0),e.context||(e.context=e.scope),delete e.scope),new g(t,e).compile()},e.render=function(t,e,n){var i=e||{},r=n||{};return 2==arguments.length&&Br.shallowCopyFromList(r,i,u),p(r,t)(i)},e.renderFile=function(){var t,e,n,i=Array.prototype.slice.call(arguments),r=i.shift(),s={filename:r};return"function"==typeof arguments[arguments.length-1]&&(t=i.pop()),i.length?(e=i.shift(),i.length?Br.shallowCopy(s,i.pop()):(e.settings&&(e.settings.views&&(s.views=e.settings.views),e.settings["view cache"]&&(s.cache=!0),(n=e.settings["view options"])&&Br.shallowCopy(s,n)),Br.shallowCopyFromList(s,e,l)),s.filename=r):e={},d(s,e,t)},e.Template=g,e.clearCache=function(){e.cache.reset()},g.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},g.prototype={createRegex:function(){var t="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",e=Br.escapeRegExpChars(this.opts.delimiter),n=Br.escapeRegExpChars(this.opts.openDelimiter),i=Br.escapeRegExpChars(this.opts.closeDelimiter);return t=t.replace(/%/g,e).replace(//g,i),new RegExp(t)},compile:function(){var t,e,i,r=this.opts,s="",a="",o=r.escapeFunction,u=r.filename?JSON.stringify(r.filename):"undefined";if(!this.source){if(this.generateSource(),s+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',r.outputFunctionName&&(s+=" var "+r.outputFunctionName+" = __append;\n"),r.destructuredLocals&&r.destructuredLocals.length){for(var l=" var __locals = ("+r.localsName+" || {}),\n",c=0;c0&&(l+=",\n "),l+=h+" = __locals."+h}s+=l+";\n"}!1!==r._with&&(s+=" with ("+r.localsName+" || {}) {\n",a+=" }\n"),a+=" return __output;\n",this.source=s+this.source+a}t=r.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+u+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,r.client&&(t="escapeFn = escapeFn || "+o.toString()+";\n"+t,r.compileDebug&&(t="rethrow = rethrow || "+v.toString()+";\n"+t)),r.strict&&(t='"use strict";\n'+t),r.debug&&console.log(t),r.compileDebug&&r.filename&&(t=t+"\n//# sourceURL="+u+"\n");try{if(r.async)try{i=new Function("return (async function(){}).constructor;")()}catch(t){throw t instanceof SyntaxError?new Error("This environment does not support async/await"):t}else i=Function;e=new i(r.localsName+", escapeFn, include, rethrow",t)}catch(t){throw t instanceof SyntaxError&&(r.filename&&(t.message+=" in "+r.filename),t.message+=" while compiling ejs\n\n",t.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",t.message+="https://github.com/RyanZim/EJS-Lint",r.async||(t.message+="\n",t.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),t}var p=r.client?e:function(t){return e.apply(r.context,[t||{},o,function(e,n){var i=Br.shallowCopy({},t);return n&&(i=Br.shallowCopy(i,n)),m(e,r)(i)},v])};if(r.filename&&"function"==typeof Object.defineProperty){var d=r.filename,f=n.basename(d,n.extname(d));try{Object.defineProperty(p,"name",{value:f,writable:!1,enumerable:!1,configurable:!0})}catch(t){}}return p},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var t=this,e=this.parseTemplateText(),n=this.opts.delimiter,i=this.opts.openDelimiter,r=this.opts.closeDelimiter;e&&e.length&&e.forEach((function(s,a){var o;if(0===s.indexOf(i+n)&&0!==s.indexOf(i+n+n)&&(o=e[a+2])!=n+r&&o!="-"+n+r&&o!="_"+n+r)throw new Error('Could not find matching close tag for "'+s+'".');t.scanLine(s)}))},parseTemplateText:function(){for(var t,e=this.templateText,n=this.regex,i=n.exec(e),r=[];i;)0!==(t=i.index)&&(r.push(e.substring(0,t)),e=e.slice(t)),r.push(i[0]),e=e.slice(i[0].length),i=n.exec(e);return e&&r.push(e),r},_addOutput:function(t){if(this.truncate&&(t=t.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!t)return t;t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+t+'")\n'},scanLine:function(t){var e,n=this.opts.delimiter,i=this.opts.openDelimiter,r=this.opts.closeDelimiter;switch(e=t.split("\n").length-1,t){case i+n:case i+n+"_":this.mode=g.modes.EVAL;break;case i+n+"=":this.mode=g.modes.ESCAPED;break;case i+n+"-":this.mode=g.modes.RAW;break;case i+n+"#":this.mode=g.modes.COMMENT;break;case i+n+n:this.mode=g.modes.LITERAL,this.source+=' ; __append("'+t.replace(i+n+n,i+n)+'")\n';break;case n+n+r:this.mode=g.modes.LITERAL,this.source+=' ; __append("'+t.replace(n+n+r,n+r)+'")\n';break;case n+r:case"-"+n+r:case"_"+n+r:this.mode==g.modes.LITERAL&&this._addOutput(t),this.mode=null,this.truncate=0===t.indexOf("-")||0===t.indexOf("_");break;default:if(this.mode){switch(this.mode){case g.modes.EVAL:case g.modes.ESCAPED:case g.modes.RAW:t.lastIndexOf("//")>t.lastIndexOf("\n")&&(t+="\n")}switch(this.mode){case g.modes.EVAL:this.source+=" ; "+t+"\n";break;case g.modes.ESCAPED:this.source+=" ; __append(escapeFn("+y(t)+"))\n";break;case g.modes.RAW:this.source+=" ; __append("+y(t)+")\n";break;case g.modes.COMMENT:break;case g.modes.LITERAL:this._addOutput(t)}}else this._addOutput(t)}this.opts.compileDebug&&e&&(this.currentLine+=e,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=Br.escapeXML,e.__express=e.renderFile,e.VERSION=a,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}));function Rr(t,e){return U(t)?t(e):Fr.render(t,{initParams:e})}var zr=function(t){d(n,t);var e=g(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,n),t=e.call(this),!H(i))return ot.error("ContextHandler expects an object on its constructor. ".concat(a(i)," passed")),y(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"html"))return ot.error("ContextHandler expects the html key on its constructor properties which is missing"),y(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"css"))return ot.error("ContextHandler expects the css key on its constructor properties which is missing"),y(t,!1);if(Object.prototype.hasOwnProperty.call(i,"initParams")||ot.info("ContextHandler got null initParams"),!Object.prototype.hasOwnProperty.call(i,"host"))return ot.error("ContextHandler expects the host key on its constructor properties which is missing"),y(t,!1);t.isDOM=!0;var r=i.host.ownerDocument;if(!r.getElementById("@kissmybutton/motorcortex/iframeContextHandler/css")){var s="\n iframe[seamless]{\n background-color: transparent;\n border: 0px none transparent;\n padding: 0px;\n overflow: hidden;\n }\n ",u=r.createElement("style");u.id="@kissmybutton/motorcortex/iframeContextHandler/css",u.type="text/css";var l=r.head||r.getElementsByTagName("head")[0];u.styleSheet?u.styleSheet.cssText=s:u.appendChild(r.createTextNode(s)),l.appendChild(u)}var c=r.createElement("iframe");i.host.appendChild(c);var h=t.scalingCalculator(i),p=t.calcClipDims(i);c.setAttribute("seamless","seamless"),!0===p.use&&(null!==p.width&&c.setAttribute("width",p.width),null!==p.height&&c.setAttribute("height",p.height)),c.style.transform="scale(".concat(h.width,", ").concat(h.height,")"),c.style.transformOrigin="top left",c.style.position="absolute",c.src="";var d=c.contentWindow||c.contentDocument;d.document&&(d=d.document),d.write(Rr(i.html,i.initParams));var f="\n body{\n padding:0;\n margin:0;\n }\n ",m=d.createElement("style");m.type="text/css",m.styleSheet?m.styleSheet.cssText=Rr(i.css,i.initParams)+f:m.appendChild(r.createTextNode(Rr(i.css,i.initParams)+f));var g=d.head||d.getElementsByTagName("head")[0];if(g.appendChild(m),Object.prototype.hasOwnProperty.call(i,"fonts"))for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,n),t=e.call(this),!H(i))return ot.error("ContextHandler expects an object on its constructor. ".concat(a(i)," passed")),y(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"html"))return ot.error("ContextHandler expects the html key on its constructor properties which is missing"),y(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"css"))return ot.error("ContextHandler expects the css key on its constructor properties which is missing"),y(t,!1);if(!Object.prototype.hasOwnProperty.call(i,"host"))return ot.error("ContextHandler expects the host key on its constructor properties which is missing"),y(t,!1);t.isDOM=!0;var r=i.host.shadowRoot;r||(r=i.host.attachShadow({mode:"open"}));var s=document.createElement("div"),u=t.scalingCalculator(i),l=t.calcClipDims(i);s.setAttribute("data-motorocortex-container","true"),!0===l.use&&(null!==l.width&&(s.style.width=l.width),null!==l.height&&(s.style.height=l.height)),s.style.transform="scale(".concat(u.width,", ").concat(u.height,")"),s.style.transformOrigin="top left",s.style.position="absolute",s.style.overflow="hidden",s.innerHTML=Rr(i.html,i.initParams),r.appendChild(s);var c=document.createElement("slot");r.appendChild(c);var h=document.createElement("style");if(h.type="text/css",h.styleSheet?h.styleSheet.cssText=Rr(i.css,i.initParams):h.appendChild(document.createTextNode("[data-motorocortex-container] { all: initial; }"+Rr(i.css,i.initParams))),r.appendChild(h),t.fontTags=[],Object.prototype.hasOwnProperty.call(i,"fonts"))for(var p=0;p0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o(this,n),null===a?(i={},r=s):(i=s,r=a),t=e.call(this,i,r),r=p(p({},r),{},{html:""!==t.html?t.html:r.html,css:""!==t.css?t.css:r.css,fonts:t.fonts.length>0?t.fonts:r.fonts});var u=F;t.clipType=u;var l=new(document.head.createShadowRoot||document.head.attachShadow?Gr:zr)(r);return t.ownContext=p(p({},l.context),{},{isHostedClip:t.isHostedClip,initParams:r.initParams}),t.iframe=l.iframeElement,t.forceExportIncidents=!0,t.onAfterRender(),t}return l(n,[{key:"onAfterRender",value:function(){}},{key:"html",get:function(){return""}},{key:"css",get:function(){return""}},{key:"fonts",get:function(){return[]}},{key:"rootElement",get:function(){return this.context.clipContainer}},{key:"exportConstructionArguments",value:function(){return{attrs:this.attrs,props:p(p({},this.props),{},{host:void 0,html:!0===this.DescriptiveIncident.constructor.customClip?"":this.context.rootElement.innerHTML})}}},{key:"setCustomEntity",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this.context.setCustomEntity(t,e,n)}}]),n}(br),Kr=function(t){d(n,t);var e=g(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,n),t=e.call(this);var r=p({},i);if(!H(r))return ot.error("HTMLFragmentContextHandler expects an object on its constructor. ".concat(a(r)," passed")),y(t,!1);Object.prototype.hasOwnProperty.call(r,"html")||(r.html=""),t.isDOM=!0;var s=document.createDocumentFragment(),u=document.createElement("div");return Object.prototype.hasOwnProperty.call(r,"containerParams")&&(Object.prototype.hasOwnProperty.call(r,"width")&&(u.style.width=r.containerParams.width),Object.prototype.hasOwnProperty.call(r,"height")&&(u.style.height=r.containerParams.height)),u.innerHTML=Rr(r.html,r.initParams),s.appendChild(u),u.style.overflow="hidden",t.rootElement=u,t.context={document:document,window:window,clipContainer:t.rootElement,rootElement:u,unmount:function(){r.host.removeChild(s)},getElements:t.getElements.bind(v(t)),getMCID:t.getMCID.bind(v(t)),setMCID:t.setMCID.bind(v(t)),getElementSelectorByMCID:t.getElementSelectorByMCID.bind(v(t)),getElementByMCID:t.getElementByMCID.bind(v(t)),setCustomEntity:t.setCustomEntity.bind(v(t)),fragment:!0},t.elementsByMCID={},t}return n}($r),Jr=function(t){d(n,t);var e=g(n);function n(){var t,i,r,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o(this,n),null===a?(i={},r=s):(i=s,r=a),t=e.call(this,i,r);var u=new Kr(p(p({},r),{},{html:Object.prototype.hasOwnProperty.call(r,"html")?r.html:t.html,css:Object.prototype.hasOwnProperty.call(r,"css")?r.css:t.css,fonts:Object.prototype.hasOwnProperty.call(r,"fonts")?r.fonts:t.fonts}));return t.ownContext=p(p({},u.context),{},{isHostedClip:!1}),t.iframe=u.iframeElement,t.forceExportIncidents=!0,t.onDOMCLipInitialise(),t}return l(n,[{key:"exportConstructionArguments",value:function(){return{attrs:this.attrs,props:p(p({},this.props),{},{html:this.context.rootElement.innerHTML})}}},{key:"onDOMCLipInitialise",value:function(){}},{key:"rootElement",get:function(){return this.context.clipContainer}}]),n}(br),Wr=function(){function t(){o(this,t)}return l(t,[{key:"duration",get:function(){return 0}},{key:"addIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"moveIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"removeIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"resizeIncident",value:function(){return{result:!0,execute:function(){}}}},{key:"getIncidentsByChannel",value:function(){return{}}},{key:"flash",value:function(){}},{key:"_resize",value:function(){}},{key:"onProgress",value:function(){}}]),t}(),Hr=function(){function t(e){o(this,t),this.runTimeInfo={currentMillisecond:0,state:"transitional"},this.id=rt(),this.realClip=e.descriptiveIncident.realClip;var n=e.descriptiveIncident.realClip.exportConstructionArguments(),i=p(p({},n.props),{},{selector:void 0,host:e.host,id:this.id});this.ownClip=new e.descriptiveIncident.constructor.Incident(n.attrs,i),e.descriptiveIncident.realClip.addContext({clipId:this.id,context:this.ownClip.context,synchronize:e.synchronize,runTimeInfo:this.runTimeInfo},!0)}return l(t,[{key:"onProgress",value:function(t,e){for(var n in this.realClip.instantiatedChannels){this.realClip.instantiatedChannels[n].moveTo(this.runTimeInfo.currentMillisecond,e,this.id,!0)}this.runTimeInfo.currentMillisecond=e}}]),t}(),Ur=T(null,(function(t,e){var n=function(e){d(i,e);var n=g(i);function i(e){var r,s,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o(this,i),null===u?(s={},a=e):(s=e,a=u),r=n.call(this,s,a),t(v(r)),r.initParams=a.initParams||{};var l=r._validateProps();if(!l.result)return y(r,l);r.isTheRootClip=!1,r.isExportableToJSONFormat=!0,Object.prototype.hasOwnProperty.call(a,"html")&&U(a.html)&&(r.isExportableToJSONFormat=!1);var c={id:r.id,attrs:s,props:p(p({},a),{},{html:Object.prototype.hasOwnProperty.call(a,"html")?a.html:r.html,css:Object.prototype.hasOwnProperty.call(a,"css")?a.css:r.css,fonts:Object.prototype.hasOwnProperty.call(a,"fonts")?a.fonts:r.fonts,runTimeInfo:r.runTimeInfo,subscribe:r.subscribe.bind(v(r)),repeats:1,delay:0,hiatus:0}),plugin_npm_name:r.constructor.plugin_npm_name,Channel:r.constructor.Channel,DescriptiveIncident:v(r)};if(r.audio="on",Object.prototype.hasOwnProperty.call(r.constructor,"audio")&&(r.audio=r.constructor.audio),Object.prototype.hasOwnProperty.call(a,"audio")&&(r.audio=a.audio),Object.prototype.hasOwnProperty.call(a,"selector")&&void 0!==a.selector&&!0!==r.constructor.customClip)c.Incident=Jr;else if(Object.prototype.hasOwnProperty.call(a,"selector")&&void 0!==a.selector&&!0===r.constructor.customClip){delete c.props.selector;var h=new Jr({html:'
'});c.props.host=h.rootElement,c.Incident=r.constructor.Incident}else"only"===r.audio&&!0!==r.props.root?r.isTheRootClip=!1:(r.isTheRootClip=!0,r.blockingWaitings={},c.Incident=r.constructor.Incident);if("on"===r.audio||"off"===r.audio?r.realClip=jt(c):r.realClip=new Wr,"on"===r.audio||"only"===r.audio){var d={id:r.id,attrs:{},props:{audioSources:Object.prototype.hasOwnProperty.call(a,"audioSources")?a.audioSources:r.audioSources,runTimeInfo:r.runTimeInfo,subscribe:r.subscribe.bind(v(r))},plugin_npm_name:r.constructor.plugin_npm_name,Channel:r.constructor.Channel,Incident:Ir,DescriptiveIncident:v(r)};r.audioClip=jt(d)}else r.audio="off",r.audioClip=new Wr;return r.attributesStaggers=[],r.propsStaggers=[],r.setupDynamicValues(),r.dynamicDurationValue=null,r.passiveAddition=!0,r._buildTree(),r.passiveAddition=!1,r.constructor.isAnimation&&Object.prototype.hasOwnProperty.call(r.props,"duration")&&r.resize(r.duration),r}return i}(e);return{F:n,d:[{kind:"field",static:!0,key:"isClip",value:function(){return!0}},{kind:"field",static:!0,key:"Incident",value:function(){return qr}},{kind:"field",static:!0,key:"plugin_npm_name",value:function(){return"@kissmybutton/self-contained-incidents"}},{kind:"field",static:!0,key:"version",value:function(){return Gt}},{kind:"field",static:!0,key:"Channel",value:function(){return xt}},{kind:"field",static:!0,key:"ClassName",value:function(){return"HTMLClip"}},{kind:"field",static:!0,key:"propsValidationRules",value:function(){return Qi}},{kind:"method",key:"_validateProps",value:function(){return ot.validateProps({props:this.props},Qi,this.constructor,this.id)}},{kind:"get",key:"selectorToPassToChildren",value:function(){return null}},{kind:"get",key:"inheritedSelector",value:function(){return this._inheritedSelector}},{kind:"set",key:"inheritedSelector",value:function(t){this._inheritedSelector=t}},{kind:"get",key:"html",value:function(){return""}},{kind:"get",key:"css",value:function(){return""}},{kind:"get",key:"fonts",value:function(){return[]}},{kind:"get",key:"audioSources",value:function(){return[]}},{kind:"method",decorators:[pr],key:"setupDynamicValues",value:function(){}},{kind:"get",key:"duration",value:function(){return null!==this.dynamicDurationValue?this.dynamicDurationValue:this.propsStaggers.length>0?"dynamic":Object.prototype.hasOwnProperty.call(this.props,"duration")?this.repeats*(this.delay+this.props.duration+this.hiatus):k(f(n.prototype),"duration",this)}},{kind:"set",key:"duration",value:function(t){if(0!=this.propsStaggers.length){for(var e=0;e0&&void 0!==arguments[0])||arguments[0],e=k(f(n.prototype),"exportLiveDefinition",this).call(this,t);return this.constructor.isAnimation&&(e.props.duration=this.props.duration?this.props.duration:this.calculatedDuration),U(this.props.html)&&(e.props.html=this.props.html),U(this.props.css)&&(e.props.css=this.props.css),e}},{kind:"method",key:"_buildTree",value:function(){void 0!==this.realClip&&this.buildTree()}},{kind:"method",key:"resize",value:function(t){if("dynamic"===this.duration)return{result:!1,reason:"Incidents with dynamic duration can't be resized. Once the Incident enters a Clip it'll become resizable"};var e=t/this.duration;return this.realClip._resize(e),this.audioClip._resize(e),this.duration=t,this.constructor.isAnimation&&(this.props.duration?this.props.duration*=e:this.props.duration=this.calculatedDuration),this.putMessageOnPipe("recalcDuration",{},"Groups",{selfExecute:!1,direction:ct}),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ct}),{result:!0}}},{kind:"method",key:"manageEditAttrProps",value:function(t,e){return{result:!1,errors:["Clips attributes and properties can not be edited"]}}},{kind:"method",key:"handleCheckForClip",value:function(t,e){return!0}},{kind:"method",key:"handleGetElements",value:function(t,e){return this.realClip.getElements(e.selector)}},{kind:"method",key:"handleCheckAddition",value:function(t,e){var n=this.realClip.addIncident(e),i=this.audioClip.addIncident(e);return!0===n.result&&!0===i.result?(n.execute(),i.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ct}),{result:!0}):n}},{kind:"method",key:"handleCheckMove",value:function(t,e){var n=this.realClip.moveIncident(e),i=this.audioClip.moveIncident(e);return!0===n.result&&!0===i.result?(n.execute(),i.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ct}),{result:!0}):n}},{kind:"method",key:"handleCheckDeletion",value:function(t,e){var n=this.realClip.removeIncident(e),i=this.audioClip.removeIncident(e);return!0===n.result&&!0===i.result?(n.execute(),i.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ct}),{result:!0}):n}},{kind:"method",key:"handleCheckResize",value:function(t,e){var n=this.realClip.resizeIncident(e),i=this.audioClip.resizeIncident(e);return!0===n.result&&!0===i.result?(n.execute(),i.execute(),this.putMessageOnPipe("flash",{},"RootClip",{selfExecute:!0,direction:ct}),{result:!0}):n}},{kind:"method",key:"handleFlash",value:function(t,e){if(!this.isTheRootClip)return this.bypass();this.flash()}},{kind:"method",key:"exportDefinition",value:function(){var t=k(f(n.prototype),"exportDefinition",this).call(this);return this.constructor.isAnimation&&(t.props.duration=this.props.duration?this.props.duration:this.calculatedDuration),t}},{kind:"method",key:"handleSetBlock",value:function(t,e){if(!this.isTheRootClip)return this.bypass();"transitional"!==this.runTimeInfo.state&&("blocked"!==this.runTimeInfo.state&&(this.statusBeforeBlock=this.runTimeInfo.state),this.blockingWaitings[e.id]=e,this.block())}},{kind:"method",key:"handleUnBlock",value:function(t,e){if(!this.isTheRootClip)return this.bypass();Object.prototype.hasOwnProperty.call(this.blockingWaitings,e.id)&&(delete this.blockingWaitings[e.id],0===Object.keys(this.blockingWaitings).length&&("playing"===this.statusBeforeBlock?(this.previousTimeStamp=-1,this.play()):this.arm()))}},{kind:"method",key:"stop",value:function(){k(f(n.prototype),"stop",this).call(this),this.blockingWaitings={}}},{kind:"method",key:"onProgress",value:function(t,e){this.realClip.onProgress(t,e),this.audioClip.onProgress(t,e)}},{kind:"method",key:"paste",value:function(t){return this.isTheRootClip?new Hr({host:t,descriptiveIncident:this}):null}},{kind:"method",key:"flash",value:function(){this.realClip.flash()}},{kind:"method",key:"setVolume",value:function(t){return t<0||t>1?{result:!1,errors:[{type:"invalid volume number"}]}:"off"===this.audio?{result:!1,errors:[{type:"can not set volume of Clip with audio off"}]}:(this.audioClip.setVolume(t),{result:!0})}}]}}),function(t){d(n,t);var e=g(n);function n(t,i){var r;return o(this,n),(r=e.call(this,t,i)).runTimeInfo={currentMillisecond:0,state:"idle"},r.listeners={},r.previousTimeStamp=-1,r.speed=1,r}return l(n,[{key:"_setState",value:function(t){if(t!==this.runTimeInfo.state)for(var e in this.runTimeInfo.state=t,this.putMessageOnPipe("setState",t,"Clips",{selfExecute:!1,direction:ht}),this.listeners){this.listeners[e].funct(this.runTimeInfo.currentMillisecond,t)}}},{key:"handleSetState",value:function(t,e){this._setState(e)}},{key:"play",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("idle"===this.runTimeInfo.state||"paused"===this.runTimeInfo.state||"armed"===this.runTimeInfo.state||"transitional"===this.runTimeInfo.state||"blocked"===this.runTimeInfo.state){if("paused"===this.runTimeInfo.state){var n=(new Date).getTime()-this.pauseMoment;this.previousTimeStamp+=n}this._setState("playing"),this.onPlay(),e||window.requestAnimationFrame((function(e){t.step(e)}))}}},{key:"pause",value:function(){"playing"===this.runTimeInfo.state&&(this._setState("paused"),this.pauseMoment=(new Date).getTime(),this.onWait())}},{key:"arm",value:function(){"transitional"!==this.runTimeInfo.state&&"blocked"!==this.runTimeInfo.state||this._setState("armed")}},{key:"complete",value:function(){this._setState("idle"),this.previousTimeStamp=-1}},{key:"stop",value:function(){this._setState("transitional"),this.previousTimeStamp=-1}},{key:"block",value:function(){this._setState("blocked"),this.previousTimeStamp=-1}},{key:"onPlay",value:function(){}},{key:"onWait",value:function(){}},{key:"playableProgress",value:function(t,e){if(this.isTheRootClip){for(var n in this.listeners){var i=this.listeners[n];!0!==i.onlyOnStateChange&&(Math.abs(e+i.cavaDelta-this.runTimeInfo.currentMillisecond)>i.threshold?(i.funct(et(e,i.roundTo),this.runTimeInfo.state),i.cavaDelta=0):i.cavaDelta+=Math.abs(e-this.runTimeInfo.currentMillisecond))}return this.onProgress(t,e),this.runTimeInfo.currentMillisecond=e,!0}return!1}},{key:"executionSpeed",set:function(t){if(!this.isTheRootClip)return!1;this.speed=parseFloat(t)}},{key:"step",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("playing"===this.runTimeInfo.state){var n=this;-1===this.previousTimeStamp&&(this.previousTimeStamp=t);var i={milliseconds:Math.round(this.runTimeInfo.currentMillisecond+(t-this.previousTimeStamp)*this.speed),fraction:(this.runTimeInfo.currentMillisecond+(t-this.previousTimeStamp)*this.speed)/this.duration};if(i.fraction>=1)return this.playableProgress(1,this.duration),void this.complete();if(i.fraction<0)return this.playableProgress(0,0),void this.complete();this.playableProgress(i.fraction,i.milliseconds),this.previousTimeStamp=t,e||window.requestAnimationFrame(n.step.bind(n))}}},{key:"subscribe",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n||(n=0),i||(i=1),this.listeners[t]={funct:e,threshold:n,roundTo:i,cavaDelta:0,onlyOnStateChange:r}}},{key:"unsubscribe",value:function(t){Object.prototype.hasOwnProperty.call(this.listeners,t)&&delete this.listeners[t]}},{key:"subscribeToDurationChange",value:function(t){return!!this.isTheRootClip&&(this.realClip.subscribeToDurationChange(t),!0)}}]),n}(dr)),Qr=Si.compile({incidents:{type:"array",items:{type:"object",props:{position:{type:"amount",integer:!0,min:0,optional:!1},attrs:{type:"object",optional:!1},props:{type:"object",optional:!1},incidentClass:{type:"any",optional:!1}}}}}),Xr=function(t){d(n,t);var e=g(n);function n(t,i){var r;o(this,n),null!==(r=e.call(this,t,i)).incidents&&(r.attrs.incidents=r.incidents,r.attributesStaggers=[],r.propsStaggers=[],r.setupDynamicValues());var s=ot.validateProps(r.props,Zi,r.constructor);if(!s.result)return y(r,s);var a=Qr(r.attrs);if(a.length>0)return ot.error("The provided attributes for Combo Incident are invalid"),y(r,{result:!1,errors:a});for(var u=[],l=0;l0&&u.concat(h.errors)}var p=ot.validateProps(c.props,c.incidentClass.propsValidationRules,c.incidentClass);!1===p.result&&u.concat(p.errors)}return u.length>0?y(r,{result:!1,errors:u}):(r.dynamicDurationValue=null,r)}return l(n,[{key:"incidents",get:function(){return null}},{key:"duration",get:function(){return null!==this.dynamicDurationValue?this.dynamicDurationValue:"dynamic"}},{key:"addIncident",value:function(){var t="Combos don't accept any Incidents to be added on their timeline externally";return ot.error(t),{result:!1,errors:[t]}}},{key:"moveIncident",value:function(){var t="Combo Incidents don't allow external manipulation of their Incidents";return ot.error(t),{result:!1,errors:[t]}}},{key:"removeIncident",value:function(){var t="Combo Incidents don't allow external manipulation of their Incidents";return ot.error(t),{result:!1,errors:[t]}}},{key:"handleCheckAddition",value:function(t,e){return!1}},{key:"handleCheckMove",value:function(t,e){return!1}},{key:"handleCheckDeletion",value:function(t,e){return!1}},{key:"handleCheckResize",value:function(t,e){return!1}},{key:"exportDefinition",value:function(){var t=p(p({},this.attrs),{},{incidents:function t(e){for(var n=[],i=0;i0&&void 0!==arguments[0])||arguments[0],e=this.attrs;null!==this.incidents&&(e=p(p({},this.attrs),{},{incidents:void 0}));var n=JSON.parse(JSON.stringify(this.props));!1===t&&delete n.id;var i={Class:this.constructor,attrs:e,props:n,incidents:{}};return i}}]),n}(dr);c(Xr,"isCombo",!0),c(Xr,"ClassName","Combo"),c(Xr,"attrsValidationRules",null),c(Xr,"propsValidationRules",Zi);var Zr=T(null,(function(t,e){var n=function(e){d(i,e);var n=g(i);function i(e,r){var s;o(this,i),void 0===r&&(r=e,e={}),s=n.call(this,r),t(v(s));var a=ot.validateProps(r,Wi,s.constructor,s.id);return a.result?(s.inheritedSelector=null,s.attrs=e,Object.prototype.hasOwnProperty.call(r,"duration")||(r.duration=0),s.props=r,s.attributesStaggers=[],s.propsStaggers=[],s.setupDynamicValues(),s.dynamicDurationValue=null,s.passive=!1,s):y(s,a)}return i}(e);return{F:n,d:[{kind:"field",static:!0,key:"Incident",value:function(){return St}},{kind:"field",static:!0,key:"plugin_npm_name",value:function(){return"motor-cortex-js-attribute"}},{kind:"field",static:!0,key:"version",value:function(){return Gt}},{kind:"field",static:!0,key:"Channel",value:function(){return Nr}},{kind:"field",static:!0,key:"ClassName",value:function(){return"Incident"}},{kind:"field",static:!0,key:"attrsValidationRules",value:function(){return null}},{kind:"field",static:!0,key:"propsValidationRules",value:function(){return Wi}},{kind:"method",decorators:[nr],key:"editAttributes",value:function(){}},{kind:"method",decorators:[ir],key:"editProperties",value:function(){}},{kind:"method",decorators:[sr],key:"resize",value:function(){}},{kind:"method",decorators:[tr],key:"clone",value:function(){}},{kind:"method",decorators:[ar],key:"selector",value:function(){}},{kind:"method",decorators:[rr],key:"getElements",value:function(){}},{kind:"method",decorators:[pr],key:"setupDynamicValues",value:function(){}},{kind:"get",key:"duration",value:function(){return null!==this.dynamicDurationValue?this.dynamicDurationValue:this.propsStaggers.length>0?"dynamic":k(f(n.prototype),"duration",this)}},{kind:"set",key:"duration",value:function(t){if(this.propsStaggers.length>0){for(var e=0;e0&&void 0!==arguments[0])||arguments[0],e=JSON.parse(JSON.stringify(this.props));return!1===t&&delete e.id,{Class:this.constructor,attrs:JSON.parse(JSON.stringify(this.attrs)),props:e}}}]}}),dt),Yr=function(){var t=function(t,e){return t.startsWith("on")&&"function"==typeof e},e=function(t){return t.substr(2).toLowerCase()},n=function(t){return"function"==typeof t};function i(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstChild}function r(n,i){if(!i)return n;for(var r=0,s=Object.entries(i);r2?s-2:0),u=2;u0&&this.stations[this.stations.length-1],this.stations.push(t),this.incident.playableProgress(t/this.incident.duration,t)}},{key:"destination",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null!=t?this.station(t):t=this.stations[this.stations.length-1],this.incident.playableProgress(t/this.incident.duration,t),"playing"===this.startState||"blocked"===this.startState&&"playing"===this.incident.statusBeforeBlock?this.incident.play():t>=this.incident.duration?this.incident.complete():this.incident.arm(),this.memory.push(this.exportJourneyLog)}},{key:"exportJourneyLog",value:function(){return{startMillisecond:this.startMillisecond,startState:this.startState,stations:this.stations}}}]),t}(),es=function(){function t(){o(this,t),this.memory=[]}return l(t,[{key:"startJourney",value:function(t){return t?new ts({incident:t,capsuleMemory:this.memory}):(ot.error("startJourney expects an Incident as an argument"),!1)}}]),t}(),ns=function(t){d(n,t);var e=g(n);function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o(this,n);var r={audio:"only",audioSources:t};return null!==i&&(r.id=i),e.call(this,r)}return n}(Ur);function is(t){if(Object.prototype.hasOwnProperty.call(t,"default")&&(t=t.default),Object.prototype.hasOwnProperty.call(t,"npm_name")||(t.npm_name="plugin_".concat((new Date).getTime())),!function(t){Object.prototype.hasOwnProperty.call(t,"default")&&(t=t.default);var e=t.npm_name,n=!0;if(Object.prototype.hasOwnProperty.call(t,"name")||ot.notice("Notice on plugin ".concat(e,'. A plugin is always good to have its name on\n its main.js file, under the key "name". It\'s missing from this plugin')),Object.prototype.hasOwnProperty.call(t,"version")||ot.notice("Notice on ".concat(e,". Plugin should always expose its version number on main.js file.\n Plugin version is missing")),Object.prototype.hasOwnProperty.call(t,"incidents")||Object.prototype.hasOwnProperty.call(t,"Clip")||(ot.error("Error on plugin ".concat(e,'. A plugin must expose at least one Incident or a Clip.\n Exposed plugin Incidents should be defined on the "incidents" key of the main.js file while Clips on the "Clip".')),n=!1),Object.prototype.hasOwnProperty.call(t,"incidents")&&!Array.isArray(t.incidents))ot.error("Error on plugin ".concat(e,'. thePlugin exposed Incidents are defined on the "incidents" key of the main.js file in array format.\n Please refer to the documentation')),n=!1;else if(Object.prototype.hasOwnProperty.call(t,"incidents"))for(var i=0;i0){for(var h="Error on plugin's \"".concat(t.npm_name,'" Clip instantiation. Errors:'),p=0;p0){for(var c="Error on plugin's \"".concat(t.npm_name,'" "').concat(t.incidents[n].name,'" instantiation. Errors:'),h=0;h2&&void 0!==arguments[2]&&arguments[2];function o(e){return"number"==typeof e&&isFinite(e)}var s=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)","gi"),i=null,a=null;if(Object.prototype.hasOwnProperty.call(e,"width")){var l=e.width.match(s)[0],r=e.width.substring(l.length);i=!o(Number(l))||"%"!==r&&"px"!==r?null:{number:Number(l),unit:r}}if(Object.prototype.hasOwnProperty.call(e,"height")){var c=e.height.match(s)[0],p=e.height.substring(c.length);a=!o(Number(c))||"%"!==p&&"px"!==p?null:{number:Number(c),unit:p}}var d=1,u=1;null!==i&&"px"===i.unit&&i.number!==t.width&&(d=t.width/i.number),null!==a&&"px"===a.unit&&a.number!==t.height&&(u=t.height/a.number);var m=1;m=n?u>d?u:d:u<=d?u:d;var h={};if(null!==i){var g;g="px"===i.unit?i.number*m:i.number/100*t.width*m;var v=t.width-g;h.left=v/2}if(null!==i){var f;f="px"===a.unit?a.number*m:a.number/100*t.height*m;var b=t.height-f;h.top=b/2}return{scale:m,position:h}},g=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;e=Math.floor(e/16);var o=Math.random()>.5,s=("x"==t?n:3&n|8).toString(16);return o?s.toUpperCase():s}))};var v=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports={};t.playSVG='\n \n \n\n\n',t.dcSVG='\n \n\nCreated by potrace 1.15, written by Peter Selinger 2001-2017\n\n\n\n\n\n\n',t.pauseSVG='\n \n \n \n',t.replaySVG='\n \n Svg Vector Icons : http://www.onlinewebfonts.com/icon \n \n \n \n \n \n',t.volumeSVG='\n \n \n \n \n \n',t.volumeMuteSVG='\n \n \n \n \n \n',t.settingsSVG='\n \n \n\n\n',t.arrowRightSVG='\n \n \n \n',t.arrowLeftSVG='\n \n \n \n',t.fullScreenSVG='\n \n \n \n \n \n\n\n',t.loopSVG='\n\n \n \n \n\n',t.loadingSVG='\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n'})),f={name:"mc-player",set playerName(e){this.name+="-"+e}},b=function(e,t){var n={default:{"settings-background-color":"whitesmoke","hms-background-color":"whitesmoke","background-color":"whitesmoke","grad-height":"0px",color:"black","svg-color":"black","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"red","cursor-color":"red","speedbar-cursor-color":"red","button-opacity":"1","hover-color":"rgba(200, 200, 200, 0.5)","slider-off-color":"#ccc","slider-on-color":"red","preview-border":"2px solid #fff",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},dark:{"settings-background-color":"black","hms-background-color":"black","background-color":"black","grad-height":"0px",color:"white","svg-color":"white","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"red","cursor-color":"red","speedbar-cursor-color":"red","button-opacity":"1","hover-color":"rgba(90, 90, 90, 0.5)","slider-off-color":"#ccc","slider-on-color":"red","preview-border":"2px solid rgba(0,0,0,1)",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},whiteGold:{"settings-background-color":"white","hms-background-color":"white","background-color":"white","grad-height":"0px",color:"#a17f1a","svg-color":"#a17f1a","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"#a17f1a","cursor-color":"#a17f1a","speedbar-cursor-color":"#a17f1a","button-opacity":"1","hover-color":"rgba(200, 200, 200, 0.5)","slider-off-color":"#ccc","slider-on-color":"#a17f1a","preview-border":"2px solid #808086",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},darkGold:{"settings-background-color":"black","hms-background-color":"black","background-color":"black","grad-height":"0px",color:"#a17f1a","svg-color":"#a17f1a","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"#a17f1a","cursor-color":"#a17f1a","speedbar-cursor-color":"#a17f1a","button-opacity":"1","hover-color":"rgba(90, 90, 90, 0.5)","slider-off-color":"#ccc","slider-on-color":"#a17f1a","preview-border":"2px solid #808086",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},transparent:{"background-color":"transparent","settings-background-color":"rgba(0,0,0,0.9)","hms-background-color":"rgba(0,0,0,0.5)","preview-border":"2px solid #fff",color:"#e8eaeb","grad-height":"200px","svg-color":"#e8eaeb","loopbar-color":"#cfcfd0","totalbar-color":"#797979","speedbar-color":"#999","runningbar-color":"red","cursor-color":"#9e2d11","cursor-style::before":'\n box-shadow: 0px 0px 6px 6px red;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n display: block;\n content: "";\n background-color: red;\n position: relative;\n left: -2px;\n top: -2px;\n ',"cursor-style::after":'\n width: 6px;\n height: 6px;\n border-radius: 100%;\n box-shadow: 0px 0px 6px 6px red;\n content: "";\n display: block;\n position: absolute;\n background-color: red;\n right: -2px;\n bottom: -2px;\n ',"speedbar-cursor-color":"red","button-opacity":"1","hover-color":"rgba(200, 200, 200, 0.5)","slider-off-color":"#ccc","slider-on-color":"red",border:"1px solid rgba(255,255,255,0.1)","svg-selected-color":"red","loopbar-boundaries-style":"\n transform: translate(-50%,-37%);\n position: absolute;\n width: 18px;\n background-color: #ff0000;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n position: absolute;\n width: 18px;\n background-color: #ff0000;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n width: 18px;\n height: 9px;\n border-radius: 100%;\n top: 1.5px;\n ","loopbar-boundaries-style::before":'\n width: 16px;\n height: 5px;\n background: #ff0000;\n border-radius: 100%;\n display: block;\n content: "";\n position: relative;\n left: -2px;\n top: 2px;\n ',"loopbar-boundaries-style::after":'\n width: 14px;\n height: 11px;\n border-radius: 100%;\n background: #ff0000;\n content: "";\n display: block;\n position: relative;\n top: -6px;\n left: 5px;\n ',"theme-style":"\n #".concat(t,"-loopbar-start {\n left: -9px !important;\n transform: rotate(180deg);\n top: -2px;\n }\n ")},"mc-green":{"background-color":"#141416","settings-background-color":"rgba(0,0,0,0.9)","hms-background-color":"rgba(0,0,0,0.5)","preview-border":"2px solid #254a42",color:"#999","grad-height":"0px","svg-color":"#999","loopbar-color":"rgba(0,184,139,0.2)","loopbar-boundaries-color":"#00b88b","totalbar-color":"rgba(255, 255, 255, 0.11)","speedbar-color":"#999","runningbar-color":"#00b88b","cursor-color":"#00b88b","speedbar-cursor-color":"#00b88b","button-opacity":"1","hover-color":"rgba(0,184,139,0.2)","slider-off-color":"#ccc","slider-on-color":"#00b88b",border:"1px solid rgba(255,255,255,0.1)","controls-border":"1px solid #151515","svg-selected-color":"#00b88b","loopbar-boundaries-style":"\n transform: translate(-50%,-37%);\n position: absolute;\n width: 18px;\n background-color: #00b88b;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n position: absolute;\n width: 18px;\n background-color: #00b88b;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n width: 18px;\n height: 9px;\n border-radius: 100%;\n top: 1.5px;\n ","loopbar-boundaries-style::before":'\n width: 16px;\n height: 5px;\n background: #00b88b;\n border-radius: 100%;\n display: block;\n content: "";\n position: relative;\n left: -2px;\n top: 2px;\n ',"loopbar-boundaries-style::after":'\n width: 14px;\n height: 11px;\n border-radius: 100%;\n background: #00b88b;\n content: "";\n display: block;\n position: relative;\n top: -6px;\n left: 5px;\n ',"theme-style":"\n #".concat(t,"-loopbar-start {\n left: -9px !important;\n transform: rotate(180deg);\n top: -2px;\n }\n ")},"mc-blue":{"background-color":"#141416","settings-background-color":"rgba(0,0,0,0.9)","hms-background-color":"rgba(0,0,0,0.5)","preview-border":"2px solid #254453",color:"#999","grad-height":"0px","svg-color":"#999","loopbar-color":"rgba(0,153,225,0.2)","loopbar-boundaries-color":"#0099e1","totalbar-color":"rgba(255, 255, 255, 0.11)","speedbar-color":"#999","runningbar-color":"#0099e1","cursor-color":"#0099e1","speedbar-cursor-color":"#0099e1","button-opacity":"1","hover-color":"rgba(0,153,225,0.2)","slider-off-color":"#ccc","slider-on-color":"#0099e1",border:"1px solid rgba(255,255,255,0.1)","controls-border":"1px solid #151515","svg-selected-color":"#0099e1","loopbar-boundaries-style":"\n transform: translate(-50%,-37%);\n position: absolute;\n width: 18px;\n background-color: #0099e1;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n position: absolute;\n width: 18px;\n background-color: #0099e1;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n width: 18px;\n height: 9px;\n border-radius: 100%;\n top: 1.5px;\n ","loopbar-boundaries-style::before":'\n width: 16px;\n height: 5px;\n background: #0099e1;\n border-radius: 100%;\n display: block;\n content: "";\n position: relative;\n left: -2px;\n top: 2px;\n ',"loopbar-boundaries-style::after":'\n width: 14px;\n height: 11px;\n border-radius: 100%;\n background: #0099e1;\n content: "";\n display: block;\n position: relative;\n top: -6px;\n left: 5px;\n ',"theme-style":"\n #".concat(t,"-loopbar-start {\n left: -9px !important;\n transform: rotate(180deg);\n top: -2px;\n }\n ")},"on-top":{"background-height":"100%","pointer-event-panel-height":"calc(100% - 44px)","controls-bottom":"0px","settings-panel-bottom":"48px","controls-position":"0px"},"position-bottom":{"background-height":"calc(100% - 44px)","pointer-event-panel-height":"calc(100% - 44px)","controls-bottom":"-0px","settings-panel-bottom":"48px","controls-position":"40px"}};return n[e]},y=c,x=d,w=u,B=m,k=c,L=function(e,t,n){if(void 0!==o(n)){if(!1===n){e.elements.volumeBarActive.style.width=100*e.settings.previousVolume+"%",e.clip.setVolume(e.settings.previousVolume),e.settings.volumeMute=!1;var s=document.createElement("span");s.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(s)}else if(!0===n){e.settings.volumeMute=!0,e.elements.volumeBarActive.style.width="0%",e.clip.setVolume(0);var i=document.createElement("span");i.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(i)}e.options.muted=e.settings.volumeMute,e.eventBroadcast("mute-change",e.settings.volumeMute)}if(void 0!==o(t)){if(e.settings.volume=t,e.settings.volume>0&&(e.settings.previousVolume=t),e.elements.volumeBarActive.style.width=100*e.settings.volume+"%",e.clip.setVolume(e.settings.volume),e.settings.volume>0){e.settings.volumeMute=!1;var a=document.createElement("span");a.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(a)}else if(0===e.settings.volume){e.settings.volumeMute=!0;var l=document.createElement("span");l.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(l)}e.options.volume=e.settings.volume,e.eventBroadcast("volume-change",e.settings.volume),e.eventBroadcast("mute-change",e.settings.volumeMute)}},M=function(e){var t=!1;e.elements.volumeBtn.onclick=function(){if(e.settings.volumeMute){e.elements.volumeBarActive.style.width=100*e.settings.previousVolume+"%",e.clip.setVolume(e.settings.previousVolume),e.settings.volumeMute=!1;var t=document.createElement("span");t.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(t)}else{e.settings.volumeMute=!0,e.elements.volumeBarActive.style.width="0%",e.clip.setVolume(0);var n=document.createElement("span");n.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(n)}e.eventBroadcast("volume-change",e.settings.previousVolume),e.eventBroadcast("mute-change",e.settings.volumeMute)};var n=!1;e.elements.volumeBtn.onmouseover=function(){n=!0,e.elements.volumeCursor.classList.add("".concat(e.name,"-volume-cursor-transition")),e.elements.volumeBar.classList.add("".concat(e.name,"-volume-width-transition")),e.elements.volumeBarHelper.classList.add("".concat(e.name,"-volume-width-transition")),e.elements.timeDisplay.classList.add("".concat(e.name,"-time-width-transition"))},k("".concat(e.name,"-left-controls")).onmouseout=function(){if(n&&!t){var o=event.toElement||event.relatedTarget||event.target;(function(e,t){var n=t.parentNode;for(;null!=n;){if(n==e)return!0;n=n.parentNode}return!1})(k("".concat(e.name,"-left-controls")),o)||o===k("".concat(e.name,"-left-controls"))||(n=!1,e.elements.volumeCursor.classList.remove("".concat(e.name,"-volume-cursor-transition")),e.elements.volumeBar.classList.remove("".concat(e.name,"-volume-width-transition")),e.elements.volumeBarHelper.classList.remove("".concat(e.name,"-volume-width-transition")),e.elements.timeDisplay.classList.remove("".concat(e.name,"-time-width-transition")))}},e.listeners.onCursorMoveVolumeBar=function(t){t.preventDefault();var n=(t.clientX||((t.touches||[])[0]||{}).clientX)-e.elements.volumeBarHelper.getBoundingClientRect().left;if(n<0?n=0:n>e.elements.volumeBarHelper.offsetWidth&&(n=e.elements.volumeBarHelper.offsetWidth),e.settings.volume=Number((n/e.elements.volumeBarHelper.offsetWidth).toFixed(2)),e.elements.volumeBarActive.style.width=100*e.settings.volume+"%",e.clip.setVolume(e.settings.volume),e.settings.volume>0){e.settings.volumeMute=!1;var o=document.createElement("span");o.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(o)}else if(0===e.settings.volume){e.settings.volumeMute=!0;var s=document.createElement("span");s.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(s)}e.eventBroadcast("volume-change",e.settings.volume),e.eventBroadcast("mute-change",e.settings.volumeMute)},e.listeners.onMouseUpVolumeBar=function(n){t=!1,e.elements.listenerHelper.style.pointerEvents="none",n.preventDefault(),e.settings.volume>0&&(e.settings.previousVolume=e.settings.volume),B("mouseup",e.listeners.onMouseUpVolumeBar,!1),B("touchend",e.listeners.onMouseUpVolumeBar,!1),B("mousemove",e.listeners.onCursorMoveVolumeBar,!1),B("touchmove",e.listeners.onCursorMoveVolumeBar,!1)},e.listeners.onMouseDownVolumeBar=function(n){t=!0,e.elements.listenerHelper.style.pointerEvents="auto",n.preventDefault(),e.listeners.onCursorMoveVolumeBar(n),w("mouseup",e.listeners.onMouseUpVolumeBar,!1),w("touchend",e.listeners.onMouseUpVolumeBar,!1),w("mousemove",e.listeners.onCursorMoveVolumeBar,!1),w("touchmove",e.listeners.onCursorMoveVolumeBar,!1)},e.elements.volumeBarHelper.addEventListener("mousedown",e.listeners.onMouseDownVolumeBar,!1),e.elements.volumeCursor.addEventListener("mousedown",e.listeners.onMouseDownVolumeBar,!1),e.elements.volumeBarHelper.addEventListener("touchstart",e.listeners.onMouseDownVolumeBar,{passive:!1},!1),e.elements.volumeCursor.addEventListener("touchstart",e.listeners.onMouseDownVolumeBar,{passive:!1},!1)};var E=u,T=m,S=u,C=m,V=u,P=m,z=c,H=u,D=m,N=function(e,t){t&&t.preventDefault();var n=z("".concat(e.name,"-show-indicator-checkbox"));n.checked?(n.checked=!1,e.elements.indicator.style.visibility="hidden"):(n.checked=!0,e.elements.indicator.style.visibility="visible"),e.eventBroadcast("show-indicator-change",n.checked)},W=function(e,t){t&&t.preventDefault();var n=z("".concat(e.name,"-pointer-events-checkbox"));n.checked?(n.checked=!1,e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="auto",z("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"):(n.checked=!0,e.options.pointerEvents=!1,e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="none",z("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"),e.eventBroadcast("show-pointer-events-change",n.checked)},F=function(e,t){t&&t.preventDefault(),e.elements.volumeControl.classList.toggle("".concat(e.name,"-volume-width-transition")),e.elements.volumeControl.classList.toggle("".concat(e.name,"-hide"));var n=z("".concat(e.name,"-show-volume-checkbox"));n.checked?(n.checked=!1,e.elements.volumeControl.style.visibility="hidden",e.elements.timeDisplay.style.left="45px"):(n.checked=!0,e.elements.volumeControl.style.visibility="visible",e.elements.timeDisplay.style.left=""),e.eventBroadcast("show-volume-change",n.checked)},I=function(e,t){t&&t.preventDefault();var n=z("".concat(e.name,"-show-preview-checkbox"));n.checked?(n.checked=!1,z("".concat(e.name,"-hover-display")).style.visibility="hidden",z("".concat(e.name,"-hover-display")).style.display="none",e.options.preview=!1):(e.previewClip||e.createPreviewDisplay(),n.checked=!0,z("".concat(e.name,"-hover-display")).style.visibility="visible",z("".concat(e.name,"-hover-display")).style.display="flex",e.options.preview=!0),e.eventBroadcast("show-preview-change",n.checked)},O=function(e){e.elements.settingsShowIndicator.onclick=function(t){return N(e,t)},e.elements.settingsPointerEvents.onclick=function(t){return W(e,t)},e.elements.settingsShowVolume.onclick=function(t){return F(e,t)},e.elements.settingsShowPreview.onclick=function(t){return I(e,t)},e.elements.settingsButton.onclick=function(t){t.preventDefault();var n=z("".concat(e.name,"-controls")),o=function t(n){if(e.elements.settingsPanel.contains(n.target))return!0;e.elements.settingsPanel.classList.toggle("".concat(e.name,"-hide")),e.elements.settingsPanel.classList.toggle("m-fadeOut"),e.elements.settingsPanel.classList.toggle("m-fadeIn"),e.elements.settingsPanel.className.includes("m-fadeOut")&&(D("click",t,!1),e.eventBroadcast("state-change",e.state))};e.elements.settingsPanel.className.includes("m-fadeOut")?(n.classList.value.includes("force-show-controls")||n.classList.toggle("force-show-controls"),H("click",o,!1)):D("click",o,!1)}},A=function(e,t){"showIndicator"===t?N(e):"showPointerEvents"===t?W(e):"showVolume"===t?F(e):"showPreview"===t&&I(e)},G=c,U=u,R=m,j=function(e){e.elements.settingsSpeedButtonShow.onclick=e.elements.settingsSpeedButtonHide.onclick=function(t){t.preventDefault(),e.elements.settingsPanel.classList.toggle("".concat(e.name,"-settings-speed-panel")),e.elements.settingsPanel.className.includes("".concat(e.name,"-settings-speed-panel"))?(e.elements.settingsMainPanel.style.display="none",e.elements.settingsSpeedPanel.style.display="block"):(e.elements.settingsSpeedPanel.style.display="none",e.elements.settingsMainPanel.style.display="block")};var t=function(t){t.preventDefault();var n=e.elements.speedBar.getBoundingClientRect(),o=(t.clientY||((t.touches||[])[0]||{}).clientY)-n.top;(o-=8)<0?o=0:o>e.elements.speedBar.offsetHeight-16&&(o=e.elements.speedBar.offsetHeight-16);var s=-1*((o=Math.floor(o))/(16*(e.options.speedValues.length-1))-1),i=1/(e.options.speedValues.length-1),a=e.calculateSpeed(i,e.options.speedValues,s);G("".concat(e.name,"-speed-runtime")).innerHTML=a+"0",G("".concat(e.name,"-speed-cursor")).style.top=o+"px",e.clip.executionSpeed=a,e.eventBroadcast("speed-change",e.clip.executionSpeed)},n=function n(o){var s;e.elements.listenerHelper.style.pointerEvents="none",o.preventDefault(),R("mouseup",n,!1),R("touchend",n,!1),R("mousemove",t,!1),R("touchmove",t,!1),G("".concat(e.name,"-speed-runtime")).innerHTML="Speed",s=1==e.clip.speed?"Normal":e.clip.speed,e.elements.speedCurrent.innerHTML=s},o=function(o){e.elements.listenerHelper.style.pointerEvents="auto",o.preventDefault(),t(o),U("mouseup",n,!1),U("touchend",n,!1),U("mousemove",t,!1),U("touchmove",t,!1)};e.elements.speedBarHelper.addEventListener("mousedown",o,!1),e.elements.speedBarHelper.addEventListener("touchstart",o,{passive:!1},!1)},X=function(e,t){var n;t=parseFloat(t)||1,e.eventBroadcast("speed-change",t),n=1==t?"Normal":t,e.clip.executionSpeed=t,e.elements.speedCurrent.innerHTML=n},J=c,q=function(e){e.settings.loopActivated=!e.settings.loopActivated,e.eventBroadcast("loop-change",e.settings.loopActivated),e.elements.loopButton.classList.toggle("svg-selected"),e.elements.loopBarStart.classList.toggle("m-fadeOut"),e.elements.loopBarEnd.classList.toggle("m-fadeOut"),e.elements.loopBarStart.classList.toggle("m-fadeIn"),e.elements.loopBarStart.classList.toggle("".concat(e.name,"-hide")),e.elements.loopBarEnd.classList.toggle("m-fadeIn"),e.elements.loopBarEnd.classList.toggle("".concat(e.name,"-hide")),J("".concat(e.name,"-loop-time")).classList.toggle("m-fadeOut"),J("".concat(e.name,"-loop-time")).classList.toggle("m-fadeIn"),J("".concat(e.name,"-loop-time")).classList.toggle("".concat(e.name,"-hide")),e.elements.loopEndTime.innerHTML=e.settings.loopEndMillisecond,e.elements.loopStartTime.innerHTML=e.settings.loopStartMillisecond,e.settings.needsUpdate=!0,e.settings.loopActivated||(e.elements.loopBar.style.left="0%",e.elements.loopBar.style.width="100%",e.settings.loopStartMillisecond=0,e.settings.loopEndMillisecond=e.clip.duration,e.settings.loopLastPositionXPxls=0,e.settings.loopLastPositionXPercentage=0,e.elements.runningBar.style.width=e.clip.runTimeInfo.currentMillisecond/e.clip.duration*100+"%")},Y=q,_=function(e){e.elements.loopButton.onclick=function(){return q(e)}},K=c;function Q(e,t){for(var n=t.parentNode;null!=n;){if(n==e)return!0;n=n.parentNode}return!1}var Z=g,$=c,ee=u,te=m,ne=r,oe=c,se=new n.default.TimeCapsule,ie=c,ae=p,le=d,re=h;return function(){function e(t){var n,o=this;for(var s in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.id=t.id||Date.now(),t.preview=t.preview||!1,t.showVolume=t.showVolume||!1,t.showIndicator=t.showIndicator||!1,t.theme=t.theme||"transparent on-top",t.host=t.host||t.clip.props.host,t.buttons=t.buttons||{},t.timeFormat=t.timeFormat||"ss",t.backgroundColor=t.backgroundColor||"black",t.scaleToFit=null===(n=t.scaleToFit)||void 0===n||n,void 0===t.pointerEvents||null===t.pointerEvents?t.pointerEvents=!1:t.pointerEvents=Boolean(t.pointerEvents),t.onMillisecondChange=t.onMillisecondChange||null,t.speedValues=t.speedValues||[-2,-1,-.5,0,.5,1,2],t.muted=t.muted||!1,t.controls=0!=t.controls,t.loop=t.loop||!1,t.volume=void 0!==t.volume?t.volume:1,t.currentScript=t.currentScript||null,t.speedValues)isFinite(t.speedValues[s])||t.speedValues.splice(s,1);t.speedValues.sort((function(e,t){return e-t})),this.className=f.name,f.playerName=t.id,this.options=t,this.id=this.options.id,this.name=f.name,this.previewClip=null,this.clip=t.clip,this.clipClass=t.clipClass,this.state=this.clip.runTimeInfo.state,this.listeners={},this.previewScale=.25,this.settings={volume:1,journey:null,previousVolume:1,volumeMute:!1,needsUpdate:!0,resizeLoop:!1,loopJourney:!1,previewJourney:null,loopActivated:!1,requestingLoop:!1,playAfterResize:!1,loopStartMillisecond:0,loopLastPositionXPxls:0,loopLastPositionXPercentage:0,loopEndMillisecond:this.clip.duration,controls:!0},function(e){e.elements={};var t=e.clip.props.host;t.offsetWidth||(t.style.width=e.clip.props.containerParams.width),t.offsetHeight||(t.style.height=e.clip.props.containerParams.height);var n=document.createElement("link");n.rel="preconnect",n.href="https://fonts.gstatic.com";var o=document.createElement("link");o.rel="stylesheet",o.href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap";var s=document.getElementsByTagName("head")[0];if(s.appendChild(n),s.appendChild(o),t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.overflow="hidden",e.clip.props.host.style.position="relative",e.clip.props.host.style.zIndex="0",e.elements.mcPlayer=x("div"),e.elements.mcPlayer.id="".concat(e.name),e.elements.mcPlayer.className="".concat(e.className),e.elements.mcPlayer.innerHTML=function(e){return'\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n ').concat(e.svg.playSVG,'\n \n
\n
\n
\n ').concat(e.svg.volumeSVG,'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n ').concat(e.svg.loopSVG,'
\n \n \n :\n \n \n \n ').concat(e.svg.settingsSVG,'\n \n ').concat(e.svg.dcSVG,'\n \n \n ').concat(e.svg.fullScreenSVG,'\n \n \n\n \n
\n
    \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n
    ').concat(e.svg.arrowRightSVG,'
    \n \n
  • \n
\n
    \n
  • \n
    ').concat(e.svg.arrowLeftSVG,"
    \n
\n
\n \n
\n
\n \n
\n
\n \n \n \n')}({svg:v,name:e.name}),"string"==typeof e.options.host){var i=document.querySelectorAll(e.options.host);for(var a in i)isNaN(a)||i[a].appendChild(e.elements.mcPlayer)}else e.options.host.appendChild(e.elements.mcPlayer);for(var l in e.elements.pointerEventPanel=y("".concat(e.name,"-pointer-event-panel")),e.elements.listenerHelper=y("".concat(e.name,"-listener-helper")),e.elements.loopBar=y("".concat(e.name,"-loopbar")),e.elements.totalBar=y("".concat(e.name,"-totalbar")),e.elements.indicator=y("".concat(e.name,"-indicator")),e.elements.loopButton=y("".concat(e.name,"-loop-btn")),e.elements.volumeBar=y("".concat(e.name,"-volumebar")),e.elements.totalTime=y("".concat(e.name,"-time-total")),e.elements.volumeControl=y("".concat(e.name,"-volume")),e.elements.volumeBtn=y("".concat(e.name,"-volume-btn")),e.elements.runningBar=y("".concat(e.name,"-runningbar")),e.elements.loopBarEnd=y("".concat(e.name,"-loopbar-end")),e.elements.statusButton=y("".concat(e.name,"-status-btn")),e.elements.speedBar=y("".concat(e.name,"-speed-value-bar")),e.elements.currentTime=y("".concat(e.name,"-time-current")),e.elements.timeDisplay=y("".concat(e.name,"-time-display")),e.elements.speedCurrent=y("".concat(e.name,"-speed-current")),e.elements.loopBarStart=y("".concat(e.name,"-loopbar-start")),e.elements.volumeCursor=y("".concat(e.name,"-volume-cursor")),e.elements.settingsButton=y("".concat(e.name,"-settings-btn")),e.elements.donkeyclipButton=y("".concat(e.name,"-dc-btn")),e.elements.timeSeparator=y("".concat(e.name,"-time-separator")),e.elements.settingsPanel=y("".concat(e.name,"-settings-panel")),e.elements.settingsMainPanel=y("".concat(e.name,"-main-settings")),e.elements.fullScreenButton=y("".concat(e.name,"-full-screen-btn")),e.elements.volumeBarHelper=y("".concat(e.name,"-volumebar-helper")),e.elements.volumeBarActive=y("".concat(e.name,"-volumebar-active")),e.elements.settingsSpeedPanel=y("".concat(e.name,"-speed-settings")),e.elements.settingsShowVolume=y("".concat(e.name,"-settings-volume")),e.elements.settingsShowPreview=y("".concat(e.name,"-settings-preview")),e.elements.settingsPointerEvents=y("".concat(e.name,"-settings-pointer-events")),e.elements.speedBarHelper=y("".concat(e.name,"-speed-value-helperbar")),e.elements.settingsShowIndicator=y("".concat(e.name,"-settings-indicator")),e.elements.settingsSpeedButtonShow=y("".concat(e.name,"-settings-speed-show")),e.elements.settingsSpeedButtonHide=y("".concat(e.name,"-settings-speed-hide")),e.elements.volumeBarActive.style.width=100*e.settings.volume+"%",e.elements.currentTime.innerHTML=e.timeFormat(0),e.elements.totalTime.innerHTML=e.timeFormat(e.clip.duration),e.elements.timeSeparator.innerHTML="/",e.elements.settingsPanel.classList.add("m-fadeOut","".concat(e.name,"-hide")),e.options.showIndicator?(e.elements.indicator.style.visibility="visible",e.elements.statusButton.style.width="35px",e.elements.statusButton.style.height="20px",e.elements.statusButton.style.bottom="5px"):e.elements.indicator.style.visibility="hidden",e.elements.indicator.innerHTML=e.clip.runTimeInfo.state,e.elements.settingsSpeedPanel.style.display="none",e.elements.settingsSpeedPanel.getElementsByTagName("li")[1].classList.add("no-hover"),e.elements.loopBarStart.style.left="0%",e.elements.loopBarStart.classList.add("m-fadeOut","".concat(e.name,"-hide")),e.elements.loopBarEnd.style.left="100%",e.elements.loopBarEnd.classList.add("m-fadeOut","".concat(e.name,"-hide")),e.elements.loopStartTime=y("".concat(e.name,"-loopbar-start-time")),e.elements.loopEndTime=y("".concat(e.name,"-loopbar-end-time")),e.elements.editableLoopStartTime=document.createElement("input"),e.elements.editableLoopStartTime.type="text",e.elements.editableLoopStartTime.size=y("".concat(e.name,"-time-total")).innerHTML.length+1,e.elements.editableLoopStartTime.maxLength=y("".concat(e.name,"-time-total")).innerHTML.length,e.elements.editableLoopStartTime.style.height=y("".concat(e.name,"-time-total")).offsetHeight,e.elements.editableLoopStartTime.value=y("".concat(e.name,"-loopbar-start-time")).innerHTML,e.elements.editableLoopStartTime.style.fontSize="8px",e.elements.editableLoopEndTime=document.createElement("input"),e.elements.editableLoopEndTime.type="text",e.elements.editableLoopEndTime.size=y("".concat(e.name,"-time-total")).innerHTML.length+1,e.elements.editableLoopEndTime.maxLength=y("".concat(e.name,"-time-total")).innerHTML.length,e.elements.editableLoopEndTime.style.height=y("".concat(e.name,"-time-total")).offsetHeight,e.elements.editableLoopEndTime.value=y("".concat(e.name,"-loopbar-start-time")).innerHTML,e.elements.editableLoopEndTime.pattern="d*",e.elements.editableLoopEndTime.style.fontSize="8px",y("".concat(e.name,"-loop-time")).classList.add("m-fadeOut","".concat(e.name,"-hide")),y("".concat(e.name,"-hover-display")).classList.add("m-fadeOut"),y("".concat(e.name,"-show-volume-checkbox")).checked=e.options.showVolume,y("".concat(e.name,"-show-indicator-checkbox")).checked=e.options.showIndicator,y("".concat(e.name,"-show-preview-checkbox")).checked=e.options.preview,y("".concat(e.name,"-pointer-events-checkbox")).checked=e.options.pointerEvents,e.options.pointerEvents?(e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="none",y("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"):(e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="auto",y("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"),e.elements.listenerHelper.style.pointerEvents="none",e.options.showVolume?(e.elements.timeDisplay.style.left="",e.elements.volumeControl.style.visibility="visible"):(e.elements.timeDisplay.style.left="45px",e.elements.volumeControl.style.visibility="hidden",e.elements.volumeControl.classList.toggle("".concat(e.name,"-hide")),e.elements.volumeControl.classList.toggle("".concat(e.name,"-volume-width-transition"))),e.options.speedValues){var r=x("div");r.className="".concat(e.name,"-speed-value-step");var c=x("div");c.className="".concat(e.name,"-speed-value"),c.dataset.speedValue=e.options.speedValues[l],c.innerHTML=e.options.speedValues[l],c.dataset.zone=l,y("".concat(e.name,"-speed-value")).prepend(c),e.elements.speedBar.prepend(r)}!1===e.options.buttons.fullScreen&&e.elements.fullScreenButton.remove(),!1===e.options.buttons.settings&&e.elements.settingsButton.remove(),!1===e.options.buttons.donkeyclip&&e.elements.donkeyclipButton.remove(),!1===e.options.buttons.loop&&e.elements.loopButton.remove()}(this),this.setTheme(),this.setSpeed(),this.subscribeToTimer(),this.subscribeToDurationChange(),this.addEventListeners(),this.scaleClipHost(),this.eventBroadcast("state-change",this.state),this.options.preview&&this.createPreviewDisplay(),this.resizeTimeout=setTimeout((function(){}),20),window.addEventListener("resize",(function(){clearTimeout(o.resizeTimeout),o.resizeTimeout=setTimeout((function(){o.options.preview&&o.setPreviewDimentions(),o.options.scaleToFit&&o.scaleClipHost()}),20)})),this.changeSettings(t,!0)}var t,n,o;return t=e,(n=[{key:"changeSettings",value:function(e,t){e.theme=e.theme||"transparent on-top",e.speed=e.speed||1,e.volume=e.volume||1,e.clip=e.clip||this.clip,e.clip!==this.options.clip&&(t=!0,this.clip=e.clip,this.options.clip=e.clip),!1===e.controls?ie(this.name).style.display="none":!0===e.controls&&(ie(this.name).style.display="unset"),void 0!==e.loop&&(this.options.loop!==e.loop||t&&this.options.loop)&&Y(this),void 0!==e.muted&&(this.options.muted!==e.muted||t&&this.options.muted)&&L(this,void 0,e.mute),void 0!==e.volume&&(this.options.volume!==e.volume||t&&this.options.volume)&&L(this,e.volume,void 0),void 0!==e.speed&&(this.options.speed!==e.speed||t&&this.options.speed)&&X(this,e.speed),void 0!==e.scaleToFit&&(this.options.scaleToFit!==e.scaleToFit||t&&this.options.scaleToFit)&&(this.options.scaleToFit=e.scaleToFit,this.scaleClipHost()),void 0!==e.showVolume&&this.options.showVolume!==e.showVolume&&A(this,"showVolume"),void 0!==e.preview&&this.options.preview!==e.preview&&A(this,"showPreview"),void 0!==e.theme&&this.options.theme!==e.theme&&(this.options.theme=e.theme,this.setTheme()),this.options=l(l({},this.options),e)}},{key:"scaleClipHost",value:function(){if(this.options.scaleToFit){var e=this.clip.props.containerParams.width,t=this.clip.props.containerParams.height,n=re({width:e,height:t},{width:this.clip.props.host.offsetWidth,height:this.clip.props.host.offsetHeight},"cover"===this.options.scaleToFit);this.clip.realClip.rootElement.style.transform="scale(".concat(n.scale),this.clip.realClip.rootElement.style.left=n.position.left+"px",this.clip.realClip.rootElement.style.top=n.position.top+"px"}else this.clip.realClip.rootElement.style.transform="scale(1)",this.clip.realClip.rootElement.style.left="0px",this.clip.realClip.rootElement.style.top="0px";this.eventBroadcast("scale-change",this.options.scaleToFit)}},{key:"createLoop",value:function(e,t){this.settings.loopStartMillisecond=e,this.settings.loopEndMillisecond=t,this.elements.loopBar.style.left=e/this.clip.duration*100+"%",this.elements.loopBar.style.width=(t-e)/this.clip.duration*100+"%",this.createJourney(e),this.elements.runningBar.style.width="0%",!this.settings.loopActivated&&Y(this)}},{key:"createJourney",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.clip;setTimeout((function(){var s=n.before,i=void 0===s?null:s,a=n.after,l=void 0===a?null:a;i&&o[i](),t.settings.journey=se.startJourney(o),t.settings.journey.station(e),t.settings.journey.destination(),l&&o[l]()}),0)}},{key:"millisecondChange",value:function(e,t,n,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.state!==t&&(this.state=t,this.eventBroadcast("state-change",t)),!this.settings.needsUpdate)return this.clip.pause(),1;var i=this.settings,a=i.loopActivated,l=i.loopEndMillisecond,r=i.loopStartMillisecond,c=this.clip.duration,p=this.elements,d=p.totalBar,u=p.loopBar,m=u.offsetWidth,h=u.offsetLeft/d.offsetWidth,g=e-c*h,v=c/d.offsetWidth*m;return e>=l&&a&&this.clip.speed>=0?(this.createJourney(r+1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):e>=l&&a&&this.clip.speed<0?(this.createJourney(l-1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):e<=r&&a&&this.clip.speed>=0?(this.createJourney(r+1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):e<=r&&a&&this.clip.speed<0?(this.createJourney(l-1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):(o&&this.createJourney(e,{after:this.settings.playAfterResize?"play":null}),this.elements.runningBar.style.width=g/v*100+"%",this.elements.currentTime.innerHTML=this.timeFormat(e),void(this.options.onMillisecondChange&&s&&this.options.onMillisecondChange(e)))}},{key:"eventBroadcast",value:function(e,t){var n=ie("".concat(this.name,"-controls"));"state-change"===e?(this.options.currentScript&&(this.options.currentScript.dataset.status=t),"paused"===t||"idle"===t||"transitional"===t||"armed"===t||"blocked"===t?(n.classList.value.includes("force-show-controls")||n.classList.toggle("force-show-controls"),this.elements.statusButton.innerHTML=v.playSVG,this.elements.statusButton.appendChild(this.elements.indicator),this.elements.indicator.innerHTML="".concat(t.charAt(0).toUpperCase()+t.slice(1)),"blocked"===t&&(this.elements.pointerEventPanel.innerHTML='\n
'.concat(v.loadingSVG,"
"))):(n.classList.value.includes("force-show-controls")&&n.classList.toggle("force-show-controls"),this.elements.statusButton.innerHTML=v.pauseSVG,this.elements.statusButton.appendChild(this.elements.indicator),this.elements.indicator.innerHTML="Playing",this.elements.pointerEventPanel.innerHTML="","playing"===t&&this.clip.runTimeInfo.currentMillisecond===this.clip.duration&&this.clip.speed>=0?this.createJourney(1,{after:"play"}):("playing"===t&&0===this.clip.runTimeInfo.currentMillisecond&&this.clip.speed<0||"playing"===t&&this.clip.runTimeInfo.currentMillisecond===this.clip.duration&&this.clip.speed<0)&&this.createJourney(this.clip.duration-1,{after:"play"}))):"duration-change"===e?(this.elements.totalTime.innerHTML=this.timeFormat(this.clip.duration),this.settings.loopEndMillisecond=this.clip.duration,this.elements.pointerEventPanel.innerHTML="",this.millisecondChange(this.clip.runTimeInfo.currentMillisecond)):this.options.currentScript&&("volume-change"===e?(this.options.volume=t,this.options.currentScript.dataset.volume=t):"speed-change"===e?(this.options.speed=t,this.options.currentScript.dataset.speed=t):"mute-change"===e?t?(this.options.muted=!0,this.options.currentScript.dataset.muted=""):(this.options.muted=!1,delete this.options.currentScript.dataset.muted):"loop-change"===e?t?(this.options.loop=!0,this.options.currentScript.dataset.loop=""):(this.options.loop=!1,delete this.options.currentScript.dataset.loop):"scale-change"===e?t?(this.options.scaleToFit=!0,this.options.currentScript.dataset.scaleToFit=""):(this.options.scaleToFit=!1,delete this.options.currentScript.dataset.scaleToFit):"show-volume-change"===e?t?(this.options.showVolume=!0,this.options.currentScript.dataset.showVolume=""):(this.options.showVolume=!1,delete this.options.currentScript.dataset.showVolume):"show-preview-change"===e&&(t?(this.options.preview=!0,this.options.currentScript.dataset.preview=""):(this.options.preview=!1,delete this.options.currentScript.dataset.preview)))}},{key:"subscribeToDurationChange",value:function(){this.clip.subscribeToDurationChange(this.subscribeToDurationChangeCallback.bind(this))}},{key:"subscribeToDurationChangeCallback",value:function(){this.eventBroadcast("duration-change")}},{key:"subscribeToTimer",value:function(){this.clip.subscribe(this.id,this.millisecondChange.bind(this))}},{key:"handleDragStart",value:function(){this.settings.needsUpdate=!0,this.settings.journey=se.startJourney(this.clip)}},{key:"timeFormat",value:function(e){if("ss"===this.options.timeFormat){var t=e/1e3/60/60,n=t%1*60,o=n%1*60,s=("0"+parseInt(t)).slice(-2),i=("0"+parseInt(n)).slice(-2),a=("0"+parseInt(o)).slice(-2);return"".concat("00"===s?"":s+":").concat(i,":").concat(a)}return e}},{key:"handleDrag",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];isFinite(e)||(e=0);var n=this.clip.duration,o=this.settings.journey,s=this.elements,i=s.loopBar,a=s.totalBar,l=s.runningBar,r=s.currentTime,c=e+i.offsetLeft,p=Math.round(n*c/a.offsetWidth);r.innerHTML=this.timeFormat(p),l.style.width=e/i.offsetWidth*100+"%",o.station(p),this.options.onMillisecondChange&&t&&this.options.onMillisecondChange(p)}},{key:"handleDragEnd",value:function(){this.settings.journey.destination()}},{key:"createProgressDrag",value:function(e){this.handleDragStart(),this.handleDrag(e),this.handleDragEnd()}},{key:"addEventListeners",value:function(){var e;(e=this).listeners.onCursorMoveLoopEnd=function(t){t.preventDefault();var n=(t.clientX||((t.touches||[])[0]||{}).clientX)-e.elements.totalBar.getBoundingClientRect().left;n<0?n=0:n>e.elements.totalBar.offsetWidth&&(n=e.elements.totalBar.offsetWidth),e.elements.runningBar.offsetWidth>=e.elements.loopBar.offsetWidth&&(e.elements.runningBar.style.width=e.elements.loopBar.offsetWidth+"px"),e.settings.loopLastPositionXPxls-n<0?e.elements.loopBar.style.width=Math.abs(e.settings.loopLastPositionXPxls-n)+"px":(e.elements.loopBar.style.left=n+"px",e.settings.loopLastPositionXPxls=n),e.settings.loopEndMillisecond=Math.round(e.clip.duration*((parseFloat(e.elements.loopBar.style.left)||0)+parseFloat(e.elements.loopBar.style.width))/e.elements.totalBar.offsetWidth),e.settings.loopEndMilliseconde.settings.loopEndMillisecond&&(e.settings.loopStartMillisecond=e.settings.loopEndMillisecond,e.settings.loopJourney=!0),e.elements.loopEndTime.innerHTML=e.settings.loopEndMillisecond,e.elements.loopStartTime.innerHTML=e.settings.loopStartMillisecond},e.listeners.onMouseUpLoopEnd=function(t){if(e.elements.listenerHelper.style.pointerEvents="none",e.settings.resizeLoop=!1,t.preventDefault(),e.elements.runningBar.style.width=e.elements.runningBar.offsetWidth/e.elements.loopBar.offsetWidth*100+"%",e.elements.loopBar.style.left=e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth*100+"%",e.elements.loopBar.style.width=e.elements.loopBar.offsetWidth/e.elements.totalBar.offsetWidth*100+"%",e.settings.loopJourney&&(e.createProgressDrag(e.elements.runningBar.offsetWidth),e.settings.loopJourney=!1),C("mouseup",e.listeners.onMouseUpLoopEnd,!1),C("touchend",e.listeners.onMouseUpLoopEnd,!1),C("mousemove",e.listeners.onCursorMoveLoopEnd,!1),C("touchmove",e.listeners.onCursorMoveLoopEnd,!1),e.elements.loopBar.addEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.addEventListener("touchstart",e.listeners.onMouseDown,{passive:!0},!1),e.settings.playAfterResize){var n;if("idle"===e.clip.runTimeInfo.state)n=e.clip.speed>=0?e.settings.loopStartMillisecond+1:e.settings.loopEndMillisecond-1,e.settings.needsUpdate=!0,e.createJourney(n,{before:"pause",after:"play"});else if("completed"===e.clip.runTimeInfo.state){var o;o=e.clip.speed>=0?e.settings.loopStartMillisecond+1:e.settings.loopEndMillisecond-1,e.settings.needsUpdate=!0,e.createJourney(o,{before:"pause",after:"play"})}else e.clip.play();e.settings.playAfterResize=!1}},e.listeners.onMouseDownLoopEnd=function(t){e.elements.listenerHelper.style.pointerEvents="auto",e.settings.resizeLoop=!0,e.settings.needsUpdate=!0,"playing"===e.clip.runTimeInfo.state&&(e.clip.pause(),e.settings.playAfterResize=!0),t.preventDefault(),e.elements.runningBar.style.width=e.elements.runningBar.offsetWidth+"px",e.elements.loopBar.style.left=e.elements.loopBar.offsetLeft+"px",e.elements.loopBar.style.width=e.elements.loopBar.offsetWidth+"px",e.elements.loopBar.removeEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.removeEventListener("touchstart",e.listeners.onMouseDown,!1),e.listeners.onCursorMoveLoopEnd(t),S("mouseup",e.listeners.onMouseUpLoopEnd,!1),S("touchend",e.listeners.onMouseUpLoopEnd,!1),S("mousemove",e.listeners.onCursorMoveLoopEnd,!1),S("touchmove",e.listeners.onCursorMoveLoopEnd,!1)},e.elements.loopBarEnd.addEventListener("mousedown",e.listeners.onMouseDownLoopEnd,!1),e.elements.loopBarEnd.addEventListener("touchstart",e.listeners.onMouseDownLoopEnd,{passive:!1},!1),function(e){e.listeners.onCursorMove=function(t){t.preventDefault();var n=(t.clientX||((t.touches||[])[0]||{}).clientX)-e.elements.loopBar.getBoundingClientRect().left;n<0?n=0:n>e.elements.loopBar.offsetWidth&&(n=e.elements.loopBar.offsetWidth),e.handleDrag(n)},e.listeners.onMouseUp=function(){e.elements.listenerHelper.style.pointerEvents="none",P("mouseup",e.listeners.onMouseUp,!1),P("touchend",e.listeners.onMouseUp,!1),P("mousemove",e.listeners.onCursorMove,!1),P("touchmove",e.listeners.onCursorMove,!1),e.handleDragEnd(e.settings)},e.listeners.onMouseDown=function(t){e.elements.listenerHelper.style.pointerEvents="auto","playing"===e.clip.runTimeInfo.state&&(e.settings.playAfterResize=!0),e.handleDragStart(e.clip),e.listeners.onCursorMove(t),V("mouseup",e.listeners.onMouseUp,!1),V("touchend",e.listeners.onMouseUp,!1),V("mousemove",e.listeners.onCursorMove,!1),V("touchmove",e.listeners.onCursorMove,!1)},e.elements.loopBar.addEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.addEventListener("touchstart",e.listeners.onMouseDown,{passive:!1},!1)}(this),function(e){e.listeners.onCursorMoveLoopStart=function(t){t.preventDefault();var n=t.clientX||((t.touches||[])[0]||{}).clientX,o=e.elements.totalBar.getBoundingClientRect(),s=Math.round(n-o.left),i=Math.round(e.settings.loopEndMillisecond/e.clip.duration*e.elements.totalBar.offsetWidth);s<0?s=0:s>e.elements.totalBar.offsetWidth&&(s=e.elements.totalBar.offsetWidth);var a=e.clip.runTimeInfo.currentMillisecond/e.clip.duration*e.elements.totalBar.offsetWidth-s;e.elements.loopBar.style.left=s+"px",e.elements.loopBar.style.width=i-s+"px",e.elements.runningBar.style.width=a+"px",e.settings.loopLastPositionXPxls=s,e.settings.loopStartMillisecond=Math.round(e.clip.duration*e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth),e.settings.loopEndMilliseconde.clip.runTimeInfo.currentMillisecond&&(e.settings.loopJourney=!0)},e.listeners.onMouseUpLoopStart=function(t){var n;e.elements.listenerHelper.style.pointerEvents="none",e.settings.resizeLoop=!1,t.preventDefault(),e.settings.loopJourney&&(e.createProgressDrag(e.elements.runningBar.offsetWidth),e.settings.loopJourney=!1),e.elements.loopBar.style.left=e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth*100+"%",e.elements.loopBar.style.width=e.elements.loopBar.offsetWidth/e.elements.totalBar.offsetWidth*100+"%",e.settings.loopStartMillisecond=Math.round(e.clip.duration*e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth),e.elements.runningBar.style.width=e.elements.runningBar.offsetWidth/e.elements.loopBar.offsetWidth*100+"%",T("mouseup",e.listeners.onMouseUpLoopStart,!1),T("touchend",e.listeners.onMouseUpLoopStart,!1),T("mousemove",e.listeners.onCursorMoveLoopStart,!1),T("touchmove",e.listeners.onCursorMoveLoopStart,!1),e.elements.loopBar.addEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.addEventListener("touchstart",e.listeners.onMouseDown,{passive:!0},!1),e.settings.playAfterResize&&("idle"===e.clip.runTimeInfo.state?(n=e.clip.speed>=0?e.settings.loopStartMillisecond+1:e.settings.loopEndMillisecond-1,e.settings.needsUpdate=!0,e.createJourney(n,{before:"pause",after:"play"})):e.clip.play(),e.settings.playAfterResize=!1)},e.listeners.onMouseDownLoopStart=function(t){e.elements.listenerHelper.style.pointerEvents="auto",e.settings.resizeLoop=!0,t.preventDefault(),e.settings.needsUpdate=!0,"playing"===e.clip.runTimeInfo.state&&(e.clip.pause(),e.settings.playAfterResize=!0),e.elements.loopBar.removeEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.removeEventListener("touchstart",e.listeners.onMouseDown,!1),e.listeners.onCursorMoveLoopStart(t),E("mouseup",e.listeners.onMouseUpLoopStart,!1),E("touchend",e.listeners.onMouseUpLoopStart,!1),E("mousemove",e.listeners.onCursorMoveLoopStart,!1),E("touchmove",e.listeners.onCursorMoveLoopStart,!1)},e.elements.loopBarStart.addEventListener("mousedown",e.listeners.onMouseDownLoopStart,!1),e.elements.loopBarStart.addEventListener("touchstart",e.listeners.onMouseDownLoopStart,{passive:!1},!1)}(this),function(e){e.listeners.editableLoopStartTime=function(){e.elements.editableLoopStartTime.value=e.elements.loopStartTime.innerHTML,e.elements.loopStartTime.replaceWith(e.elements.editableLoopStartTime),e.elements.editableLoopStartTime.focus()},e.listeners.editableLoopEndTime=function(){e.elements.editableLoopEndTime.value=e.elements.loopEndTime.innerHTML,e.elements.loopEndTime.replaceWith(e.elements.editableLoopEndTime),e.elements.editableLoopEndTime.focus()},e.elements.editableLoopEndTime.onkeydown=e.elements.editableLoopStartTime.onkeydown=function(t){t.preventDefault(),13===t.keyCode&&(e.elements.editableLoopStartTime.onfocusout(),e.elements.editableLoopEndTime.onfocusout()),8===t.keyCode&&(t.target.value=t.target.value.toString().substring(0,t.target.value.toString().length-1)),13===t.keyCode&&t.target.blur();var n=parseFloat((t.target.value||0).toString()+t.key);if(!(n>e.clip.duration))if(t.target.value=n,t.target===e.elements.editableLoopStartTime){var o=e.elements.totalBar.getBoundingClientRect(),s={preventDefault:function(){},clientX:e.elements.totalBar.offsetWidth/e.clip.duration*t.target.value+o.left};e.listeners.onMouseDownLoopStart(s),e.listeners.onCursorMoveLoopStart(s),e.listeners.onMouseUpLoopStart(s)}else if(t.target===e.elements.editableLoopEndTime){var i=e.elements.totalBar.getBoundingClientRect(),a={preventDefault:function(){},clientX:e.elements.totalBar.offsetWidth/e.clip.duration*t.target.value+i.left};e.listeners.onMouseDownLoopEnd(a),e.listeners.onCursorMoveLoopEnd(a),e.listeners.onMouseUpLoopEnd(a)}},e.elements.loopStartTime.onclick=e.listeners.editableLoopStartTime,e.elements.loopEndTime.onclick=e.listeners.editableLoopEndTime,e.elements.editableLoopStartTime.onfocusout=function(){e.elements.editableLoopStartTime.replaceWith(e.elements.loopStartTime)},e.elements.editableLoopEndTime.onfocusout=function(){e.elements.editableLoopEndTime.replaceWith(e.elements.loopEndTime)}}(this),M(this),function(e){e.elements.statusButton.onclick=function(t){return t.preventDefault(),"playing"===e.clip.runTimeInfo.state?e.clip.pause():"paused"!==e.clip.runTimeInfo.state&&"idle"!==e.clip.runTimeInfo.state&&"transitional"!==e.clip.runTimeInfo.state&&"armed"!==e.clip.runTimeInfo.state||e.clip.play(),!1}}(this),O(this),j(this),_(this),function(e){K("".concat(e.name,"-controls")).onmouseover=function(){e.settings.loopActivated&&(e.elements.loopBarStart.classList.remove("m-fadeOut"),e.elements.loopBarEnd.classList.remove("m-fadeOut"),e.elements.loopBarStart.classList.add("m-fadeIn"),e.elements.loopBarEnd.classList.add("m-fadeIn"))},K("".concat(e.name,"-controls")).onmouseout=function(t){var n=t.toElement||t.relatedTarget||t.target;Q(this,n)||n===this||e.settings.loopActivated&&(e.elements.loopBarStart.classList.add("m-fadeOut"),e.elements.loopBarEnd.classList.add("m-fadeOut"),e.elements.loopBarStart.classList.remove("m-fadeIn"),e.elements.loopBarEnd.classList.remove("m-fadeIn"))};var t=!1;K("".concat(e.name,"-controls")).ontouchstart=function(n){var o=n.toElement||n.relatedTarget||n.target;Q(e.elements.statusButton,o)||o===e.elements.statusButton||Q(e.elements.settingsButton,o)||o===e.elements.settingsButton||Q(e.elements.fullScreenButton,o)||o===e.elements.fullScreenButton||Q(e.elements.loopButton,o)||o===e.elements.loopButton||Q(e.elements.totalBar,o)||o===e.elements.totalBar||(e.elements.settings.showVolume&&(e.elements.volumeControl.className="".concat(e.name,"-volume-width-transition"),e.elements.volumeBar.className="".concat(e.name,"-volume-width-transition"),e.elements.volumeBarHelper.className="".concat(e.name,"-volume-width-transition")),e.elements.timeDisplay.className="".concat(e.name,"-time-width-transition"),e.elements.volumeCursor.className="".concat(e.name,"-volume-cursor-transition"),t=!0)},window.addEventListener("touchstart",(function(n){var o=n.toElement||n.relatedTarget||n.target;Q(K("".concat(e.name,"-controls")),o)||o===K("".concat(e.name,"-controls"))||t&&(e.elements.volumeControl.className="",e.elements.volumeBar.className="",e.elements.volumeBarHelper.className="",e.elements.timeDisplay.className="",e.elements.volumeCursor.className="")}))}(this),function(e){e.elements.fullScreenButton.addEventListener("click",(function(){var t=e.clip.props.host.className.includes("full-screen");e.clip.props.host!==e.options.host&&!t&&e.clip.props.host.appendChild(e.elements.mcPlayer),e.clip.props.host!==e.options.host&&t&&e.options.host.appendChild(e.elements.mcPlayer),t?e.exitFullscreen():e.launchIntoFullscreen(e.clip.props.host)}))}(this),function(e){e.elements.donkeyclipButton.addEventListener("click",(function(){var t=Z(),n=window.open("https://donkeyclip.com?u=".concat(t)),o=e.clip.exportDefinition(),s=e.clipClass;window.addEventListener("message",(function(e){e.data===t&&n.postMessage(JSON.stringify({definition:o,clipClass:s,u:t}),"*")}),!1)}))}(this),function(e){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){var t=function(){e.options.preview&&($("".concat(e.name,"-hover-display")).classList.toggle("m-fadeIn"),$("".concat(e.name,"-hover-display")).classList.toggle("m-fadeOut"),e.elements.loopBar.onmousemove=o)},n=function n(){e.options.preview&&(t(),e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=t,e.elements.loopBar.onmousemove=o,te("mouseup",n,!1),te("touchend",n,!1),te("mousemove",o,!1),te("touchmove",o,!1))};e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=t,e.elements.loopBar.onmousedown=function(){e.options.preview&&(e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=null,e.elements.loopBar.onmousemove=null,ee("mouseup",n,!1),ee("touchend",n,!1),ee("mousemove",o,!1),ee("touchmove",o,!1))},e.elements.loopBar.onmouseup=function(){e.options.preview&&(te("mouseup",n,!1),te("touchend",n,!1),te("mousemove",o,!1),te("touchmove",o,!1),e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=t,e.elements.loopBar.onmousemove=o)};var o=function(t){var n=t.clientX,o=e.elements.loopBar.getBoundingClientRect();if(n-o.left+e.settings.loopLastPositionXPxls>e.settings.loopLastPositionXPxls+e.elements.loopBar.offsetWidth&&!e.settings.resizeLoop)$("".concat(e.name,"-hover-millisecond")).innerHTML=e.timeFormat(e.settings.loopEndMillisecond);else if(n-o.left<0&&!e.settings.resizeLoop)$("".concat(e.name,"-hover-millisecond")).innerHTML=e.timeFormat(e.settings.loopStartMillisecond);else{var s=n-o.left+e.settings.loopLastPositionXPxls;s<0&&(s=0);var i=$("".concat(e.name,"-hover-display")).offsetWidth/2,a=$("".concat(e.name,"-hover-display")).offsetWidth/2,l=s-a;s-i<0?l=0:s+i>e.elements.totalBar.offsetWidth&&(l=e.elements.totalBar.offsetWidth-a-i);var r=Math.round(s/e.elements.totalBar.offsetWidth*e.clip.duration);if(e.options.preview){var c=r/e.clip.duration;e.previewClip.onProgress(c,r)}$("".concat(e.name,"-hover-millisecond")).innerHTML=e.timeFormat(r),$("".concat(e.name,"-hover-display")).style.left=l+"px"}}}}(this),function(e){document.addEventListener("fullscreenchange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),document.addEventListener("webkitfullscreenchange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),document.addEventListener("mozfullscreenchange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),document.addEventListener("MSFullscreenChange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),ne("body")[0].addEventListener("click",(function(t){if(t.target.className==="".concat(e.name,"-speed-value")){var n=t.target.dataset.speedValue-0;e.clip.executionSpeed=t.target.dataset.speedValue,n=1==e.clip.speed?"Normal":e.clip.speed,e.elements.speedCurrent.innerHTML=n;var o=1/(e.options.speedValues.length-1),s=-1*(t.target.dataset.zone*o-1)*(16*(e.options.speedValues.length-1));oe("".concat(e.name,"-speed-cursor")).style.top=s+"px"}}))}(this)}},{key:"launchIntoFullscreen",value:function(e){this.options.preview&&this.setPreviewDimentions(),e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}},{key:"exitFullscreen",value:function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}},{key:"setTheme",value:function(){ie(this.name+"-style")&&ae("head")[0].removeChild(ie(this.name+"-style")),this.options.theme.replace(/\s\s+/g," "),this.options.theme.trim(),this.options.theme.includes("on-top")||this.options.theme.includes("position-bottom")||(this.options.theme+=" on-top");var e={};for(var t in this.options.theme.split(" ")){var n=b(this.options.theme.split(" ")[t],this.name);for(var o in n||{})e[o]=n[o]}var s=function(e,t,n){return"\n#".concat(t,", #").concat(t," *{\n font-family:'Ubuntu' !important;\n}\n#").concat(t," .background {\n background-color: ").concat(n.backgroundColor,";\n width:100%;\n height:").concat(e["background-height"],";;\n position:absolute;\n top:0px;\n left:0px;\n z-index:-2000;\n}\n\n#").concat(t," .full-screen #").concat(t,"-controls {\n position:fixed;\n left:0px;\n bottom:0px;\n}\n\n#").concat(t," .full-screen #").concat(t,"-settings-panel {\n position:fixed;\n bottom: 45px;\n}\n\n#").concat(t," .svg,#").concat(t," .svg *,#").concat(t," svg,#").concat(t," svg * {\n fill: ").concat(e["svg-color"],";\n}\n\n#").concat(t," .svg.arrow * {\n stroke: ").concat(e["svg-color"],";\n fill: transparent;\n}\n\n#").concat(t," .pointer-event-panel {\n height: ").concat(e["pointer-event-panel-height"],";\n display:flex;\n align-items:center;\n justify-content:center;\n}\n#").concat(t,"-pointer-event-panel{\n width:100%;\n position:absolute;\n z-index:100;\n}\n#").concat(t,"-listener-helper{\n width:100%;\n height:calc( 100% - 45px );\n position:absolute;\n z-index:110;\n}\n#").concat(t," .svg-selected svg{\n fill: ").concat(e["svg-selected-color"],";\n stroke: ").concat(e["svg-selected-color"],";\n}\n#").concat(t,"-hover-display{\n display: flex;\n visibility:hidden;\n opacity:0;\n background-color: black;\n position: absolute;\n bottom: 30px;\n left: 0px;\n align-items: flex-end;\n justify-content: center;\n}\n#").concat(t,"-hover-display-clip{\n width:100%;\n height:100%;\n overflow:hidden;\n position:relative;\n}\n#").concat(t,"-hover-display-border{\n border: ").concat(e["preview-border"],";\n position:absolute;\n width:calc(100% - 4px);\n height:calc(100% - 4px);\n z-index:2;\n}\n\n#").concat(t,"-hover-millisecond {\n font-weight:bold;\n padding:3px;\n height:18px;\n margin:0px;\n line-height:12px;\n font-size:10px;\n text-align: center;\n min-width:20px;\n max-width:100px;\n z-index:2;\n position:absolute;\n bottom:-25px;\n}\n#").concat(t,",\n#").concat(t," ::before,\n#").concat(t," :::after,\n#").concat(t," div,\n#").concat(t," p,\n#").concat(t," span,\n#").concat(t," ul,\n#").concat(t," li {\n font-weight: 400;\n line-height: 1.9 !important;\n color: ").concat(e.color,';\n font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;\n box-sizing:border-box;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n#').concat(t," {\n line-height: 1.9;\n font-size: 12px;\n overflow:hidden;\n height: calc(100% + ").concat(e["controls-position"],");\n width:100%;\n position: absolute;\n top: 0px;\n left: 0px;\n color: ").concat(e.color,";\n pointer-events:auto;\n}\n\n#").concat(t," .force-show-controls {\n opacity:1 !important;\n}\n\n").concat(n.theme.includes("position-bottom")?"\n #".concat(t,"-controls {\n opacity:1 !important;\n }\n "):"#".concat(t,":hover #").concat(t,"-controls {\n opacity:1 !important;\n}\n"),"\n\n#").concat(t,":hover {\n pointer-events:none;\n}\n\n#").concat(t,"-settings-speed-hide {\n text-align:right;\n}\n\n#").concat(t," .grad {\n pointer-events:none !important;\n background-image: linear-gradient(\n rgba(0,0,0,00.001),\n rgba(0,0,0,00.004),\n rgba(0,0,0,00.007),\n rgba(0,0,0,00.01),\n rgba(0,0,0,0.04),\n rgba(0,0,0,0.07),\n rgba(0,0,0,0.1),\n rgba(0,0,0,0.15),\n rgba(0,0,0,0.2),\n rgba(0,0,0,0.25),\n rgba(0,0,0,0.3),\n rgba(0,0,0,0.35),\n rgba(0,0,0,0.4),\n rgba(0,0,0,0.45),\n rgba(0,0,0,0.5),\n rgba(0,0,0,0.55),\n rgba(0,0,0,0.6),\n rgba(0,0,0,0.65),\n rgba(0,0,0,0.7),\n rgba(0,0,0,0.75),\n rgba(0,0,0,0.8),\n rgba(0,0,0,0.88)\n );\n position:absolute;\n width:100%;\n height:").concat(e["grad-height"],";\n left:0px;\n bottom:0px;\n z-index:-1;\n}\n\n#").concat(t," #").concat(t,"-controls {\n touch-action: none;\n background-color: ").concat(e["background-color"],";\n border: ").concat(e["controls-border"],";\n position: absolute;\n bottom: ").concat(e["controls-bottom"],";\n left: 0px;\n width: 100%;\n z-index:100;\n height: 44px;\n opacity:0;\n display:flex;\n border-radius: 6px;\n align-items:center;\n -webkit-transition: opacity 0.2s ease;\n -moz-transition: opacity 0.2s ease;\n transition: opacity 0.2s ease;\n}\n\n#").concat(t," #").concat(t,"-totalbar {\n width: calc(100% - 20px);\n height: 5px;\n margin: 0px 10px 0px 10px;\n background-color: ").concat(e["totalbar-color"],";\n position: absolute;\n top: 0px;\n left: 0px;\n}\n\n#").concat(t," #").concat(t,"-loopbar {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0px;\n left: 0px;\n background-color: ").concat(e["loopbar-color"],";\n}\n\n#").concat(t," .").concat(t,"-loop-boundaries::before {\n ").concat(e["loopbar-boundaries-style::before"],"\n\n}\n#").concat(t," .").concat(t,"-loop-boundaries {\n transform:translate(-50%,-37%);\n position:absolute;\n width:18px;\n background-color:").concat(e["loopbar-boundaries-color"],";\n height:18px;\n border-radius:10px;\n z-index:40;\n ").concat(e["loopbar-boundaries-style"],"\n}\n\n#").concat(t," .").concat(t,"-loop-boundaries::after {\n ").concat(e["loopbar-boundaries-style::after"],"\n\n}\n\n#").concat(t," #").concat(t,"-helperbar {\n position: absolute;\n height: 20px;\n top: -10px;\n left: 0px;\n right: 0px;\n z-index:2;\n}\n\n#").concat(t," #").concat(t,"-runningbar {\n position: relative;\n width: 0px;\n max-width:100%;\n height: 100%;\n background-color: ").concat(e["runningbar-color"],";\n}\n\n#").concat(t," #").concat(t,"-cursor {\n transform:translate(50%,-36%);\n right: 0px;\n overflow:hidden;\n top: 0px;\n width: 0px;\n height: 0px;\n position: absolute;\n background-color: ").concat(e["cursor-color"],";\n border-radius: 10px;\n z-index: 5;\n}\n\n#").concat(t," #").concat(t,"-cursor::before {\n ").concat(e["cursor-style::before"],"\n}\n\n#").concat(t," #").concat(t,"-cursor::after {\n ").concat(e["cursor-style::after"],"\n}\n\n#").concat(t," #").concat(t,"-left-controls,#").concat(t," #").concat(t,"-right-controls {\n display: flex;\n align-items:center;\n height: 100%;\n padding: 5px 5px 0px;\n}\n#").concat(t," #").concat(t,"-right-controls {\n position:absolute;\n right:0px;\n}\n\n\n#").concat(t," #").concat(t,"-left-controls > div,#").concat(t," #").concat(t,"-right-controls > div {\n display: inline-flex;\n align-items:center;\n margin:0 10px 0 10px;\n overflow:hidden;\n}\n\n\n#").concat(t," #").concat(t,"-time-display span {\n display: table-cell;\n vertical-align: middle;\n}\n\n#").concat(t," #").concat(t,"-status-btn {\n opacity: ").concat(e["button-opacity"],";\n}\n#").concat(t," #").concat(t,"-status-btn svg{\n width:20px;\n height:18px;\n}\n#").concat(t," #").concat(t,"-volume {\n opacity: ").concat(e["button-opacity"],";\n position: relative;\n}\n#").concat(t," #").concat(t,"-volume-btn {\n width: 20px;\n height: 15px;\n}\n\n#").concat(t," #").concat(t,"-volumebar {\n width: 0px;\n height: 3px;\n background-color: ").concat(e["loopbar-color"],";\n -webkit-transition: left 0.1s ease;\n -moz-transition: left 0.1s ease;\n transition: left 0.1s ease;\n position:relative;\n left:5px;\n}\n\n#").concat(t," #").concat(t,"-volumebar-helper {\n position: absolute;\n width: 0px;\n height: 15px;\n bottom: 0px;\n z-index: 10;\n left: 25px;\n}\n\n#").concat(t," #").concat(t,"-volumebar-active {\n position: relative;\n width: 0%;\n height: 100%;\n background-color: ").concat(e.color,";\n position:relative;\n bottom:0px;\n}\n\n#").concat(t," #").concat(t,"-volume-cursor {\n transform:translate(50%,-36%);\n right: 0px;\n top: 0px;\n width: 0px;\n height: 0px;\n position: absolute;\n background-color: ").concat(e.color,";\n border-radius: 10px;\n z-index: 5;\n}\n\n#").concat(t," .").concat(t,"-loopbar-time {\n width:auto;\n height:12px;\n background-color:").concat(e["background-color"],";\n line-height:10px;\n font-size:10px;\n}\n\n#").concat(t," #").concat(t,"-loop-time {\n margin: 7px;\n}\n\n#").concat(t," #").concat(t,"-dc-btn {\n background-repeat: no-repeat;\n background-size: 100% 100%;\n width: 20px;\n height: 15px;\n margin: 7px 10px 5px 0px;\n transform: scale(1.5,1.5);\n}\n\n#").concat(t," #").concat(t,"-loop-btn {\n opacity: ").concat(e["button-opacity"],";\n display:flex;\n align-items:center;\n}\n\n\n#").concat(t," #").concat(t,"-settings-btn {\n overflow:hidden;\n opacity: ").concat(e["button-opacity"],";\n}\n\n#").concat(t," #").concat(t,"-full-screen-btn {\n opacity: ").concat(e["button-opacity"],";\n}\n\n#").concat(t," .").concat(t,"-speed-btn {\n opacity: ").concat(e["button-opacity"],";\n height: 14px;\n}\n\n#").concat(t," #").concat(t,"-settings-panel {\n touch-action: none;\n box-sizing: border-box;\n position: absolute;\n z-index:102;\n background-color: ").concat(e["settings-background-color"],";\n bottom: ").concat(e["settings-panel-bottom"],";\n border: ").concat(e.border,";\n right: 8px;\n width: 167px;\n padding: 5px;\n margin: 0px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," .").concat(t,"-hide {\n display:none !important;\n}\n\n#").concat(t," #").concat(t,"-speed-value-bar {\n position: relative;\n width: 5px;\n background-color: ").concat(e["speedbar-color"],";\n display: inline-block;\n box-sizing: border-box;\n height: ").concat(16*n.speedValues.length,"px;\n float: left;\n margin-right:15px;\n}\n\n#").concat(t," #").concat(t,"-speed-value-helperbar {\n position: absolute;\n width: 25px;\n height: ").concat(16*n.speedValues.length,"px;\n float: left;\n left: 18px;\n z-index:10;\n}\n\n\n#").concat(t," #").concat(t,"-speed-value-bar:hover,\n#").concat(t," #").concat(t,"-speed-value-helperbar {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-volumebar:hover,\n#").concat(t," #").concat(t,"-volumebar-helper:hover,\n#").concat(t," #").concat(t,"-volume-btn:hover,\n#").concat(t," #").concat(t,"-volumebar:active,\n#").concat(t," #").concat(t,"-volumebar-helper:active,\n#").concat(t," #").concat(t,"-volume-btn:active {\n cursor:pointer;\n}\n\n#").concat(t," #").concat(t,"-speed-cursor {\n position: absolute;\n background-color: ").concat(e["speedbar-cursor-color"],";\n top: 0px;\n left: 0px;\n}\n\n#").concat(t," #").concat(t,"-speed-cursor div {\n position: absolute;\n background-color: ").concat(e["speedbar-cursor-color"],";\n left: -2.5px;\n top: -4px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n}\n\n#").concat(t," #").concat(t,"-time-separator{\n margin:0 3px;\n}\n#").concat(t," #").concat(t,"-speed-cursor:hover {\n cursor: pointer;\n}\n\n#").concat(t," .").concat(t,"-speed-value-step {\n width: 16px;\n background-color: ").concat(e["speedbar-color"],";\n display: inline-block;\n box-sizing: border-box;\n height: 2px;\n margin-top: 7px;\n margin-bottom: 7px;\n float: left;\n}\n\n#").concat(t," #").concat(t,"-speed-value {\n display: inline-block;\n box-sizing: border-box;\n height: ").concat(16*n.speedValues.length,"px;\n text-align: left;\n}\n\n#").concat(t," .").concat(t,"-speed-value {\n box-sizing: border-box;\n height: 16px;\n font-size: 12px;\n}\n\n#").concat(t," #").concat(t,"-indicator {\n font-size: 8px !important;\n position: absolute;\n bottom: -3px;\n color: ").concat(e.color,";\n}\n\n\n#").concat(t," #").concat(t,"-speed-settings li.no-hover { \n height: ").concat(16*n.speedValues.length+10-2,"px !important; \n}\n\n#").concat(t," #").concat(t,"-settings-panel.").concat(t,"-settings-speed-panel {\n overflow: hidden;\n width: 92px;\n position:absolute;\n z-index:120;\n /*height: ").concat(16*n.speedValues.length+32+20,"px;*/\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-settings-panel.").concat(t,"-settings-speed-panel .").concat(t,"-speed-btn {\n float: left;\n}\n\n#").concat(t," .").concat(t,"-settings-speed-panel ul:first-child {\n text-align: right;\n}\n\n#").concat(t," #").concat(t,"-speed-current {\n float: right;\n padding-right: 10px\n}\n\n#").concat(t," #").concat(t,"-settings-panel .").concat(t,"-speed-btn {\n float: right;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul {\n width: 100%;\n margin: 0px;\n padding: 0px;\n overflow: hidden;\n}\n\n#").concat(t," #").concat(t,"-settings-panel.").concat(t,"-settings-speed-panel ul li {\n min-width: 70px;\n display: flex;\n height: 32px;\n align-items: center;\n justify-content:center;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li.no-hover:hover {\n background-color: transparent;\n cursor: default;\n}\n\n#").concat(t," div.").concat(t,"-speed-value:hover {\n background-color: ").concat(e["hover-color"],";\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li {\n /*position: relative;\n width: 100%;\n min-width: 154px;*/\n list-style-type: none;\n margin: 0px;\n padding: 5px;\n display: flex;\n height:32px;\n align-items:center;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li label {\n margin: 0px;\n}\n\n#").concat(t," .switch {\n position: relative;\n display: inline-block;\n width: 32px;\n height: 18px;\n}\n\n#").concat(t," .switch input {\n display: none;\n}\n\n#").concat(t," .settings-switch {\n position: absolute;\n right: 24px;\n}\n\n#").concat(t," .settings-switch::after {\n clear: both;\n}\n\n#").concat(t," .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ").concat(e["slider-off-color"],";\n -webkit-transition: .4s;\n transition: .4s;\n}\n\n#").concat(t,' .slider:before {\n position: absolute;\n content: "";\n height: 16px;\n width: 16px;\n left: 1px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: .4s;\n transition: .4s;\n}\n\n#').concat(t," input:checked+.slider {\n background-color: ").concat(e["slider-on-color"],";\n}\n\n#").concat(t," input:focus+.slider {\n box-shadow: 0 0 1px ").concat(e["slider-on-color"],";\n}\n\n#").concat(t," input:checked+.slider:before {\n -webkit-transform: translateX(16px);\n -ms-transform: translateX(16px);\n transform: translateX(16px);\n}\n\n\n/* Rounded sliders */\n\n#").concat(t," .slider.round {\n border-radius: 34px;\n}\n\n#").concat(t," .slider.round:before {\n border-radius: 50%;\n}\n\n\n#").concat(t," .m-fadeOut {\n visibility: hidden !important;\n opacity: 0 !important;\n}\n\n#").concat(t," .m-fadeIn {\n visibility: visible !important;\n opacity: 1 !important;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li:hover {\n background-color: ").concat(e["hover-color"],";\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li label:hover {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-loopbar:hover {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-status-btn:hover {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-controls:active #").concat(t,"-cursor,\n#").concat(t," #").concat(t,"-controls:hover #").concat(t,"-cursor {\n width: 16px;\n height: 16px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-volume .").concat(t,"-volume-cursor-transition {\n width: 12px;\n height: 12px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-volume .").concat(t,"-volume-width-transition\n {\n width: 50px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-time-display.").concat(t,"-time-width-transition {\n position:relative;\n left: 10px;\n -webkit-transition: left 0.3s ease;\n -moz-transition: left 0.3s ease;\n transition: left 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-settings-speed:hover .").concat(t,"-speed-btn {\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-status-btn:hover {\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-loop-btn:hover,\n#").concat(t," #").concat(t,"-dc-btn:hover\n {\n cursor: pointer;\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n#").concat(t," #").concat(t,"-settings-btn:hover {\n cursor: pointer;\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-full-screen-btn:hover {\n cursor: pointer;\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n").concat(e["theme-style"],"\n")}(e,this.name,this.options),i=le("style");i.id=this.name+"-style",i.styleSheet?i.styleSheet.cssText=s:i.appendChild(document.createTextNode(s)),ae("head")[0].appendChild(i),this.eventBroadcast("theme-change",this.options.theme)}},{key:"setSpeed",value:function(){var e,t=this;e=1==this.clip.speed?"Normal":this.clip.speed,this.elements.speedCurrent.innerHTML=e;var n=-1*(function(){for(var e=0;et.clip.speed)return e+Math.abs((t.clip.speed-t.options.speedValues[e])/(t.options.speedValues[e]-t.options.speedValues[e+1]))}()*(1/(this.options.speedValues.length-1))-1)*(this.options.speedValues.length-1)*16;ie("".concat(this.name,"-speed-cursor")).style.top=n+"px"}},{key:"calculateSpeed",value:function(e,t,n){var o=Math.floor(n/e);if(o===t.length-1)return t[o].toFixed(1);var s=(n/e%1*Math.abs(t[o]-t[o+1])+t[o]).toFixed(1);return 0==s?"0.0":s}},{key:"createPreviewDisplay",value:function(){this.previewClip=this.clip.paste(ie("".concat(this.name,"-hover-display-clip")));var e=ie("".concat(this.name,"-hover-display"));window.previewClip=this.previewClip,e.style.position="absolute",e.style.background=this.options.backgroundColor,e.style.zIndex=1,this.setPreviewDimentions()}},{key:"setPreviewDimentions",value:function(){var e=this.clip.props.host,t=this.previewClip.ownClip.props.host,n=e.offsetWidth,o=e.offsetHeight,s=n*this.previewScale;s>300&&(s=300,this.previewScale=s/n);var i=n*this.previewScale,a=o*this.previewScale,l=re({width:this.clip.props.containerParams.width,height:this.clip.props.containerParams.height},{width:i,height:a},"cover"===this.options.scaleToFit);this.previewClip.ownClip.rootElement.style.transform="scale(".concat(l.scale),this.previewClip.ownClip.rootElement.style.left=l.position.left+"px",this.previewClip.ownClip.rootElement.style.top=l.position.top+"px",ie("".concat(this.name,"-hover-display")).style.width=i+"px",ie("".concat(this.name,"-hover-display")).style.height=a+"px",t.style.boxSizing="border-box"}}])&&s(t.prototype,n),o&&s(t,o),e}()})); +!function(e,t){ true?module.exports=t(__webpack_require__(0)):undefined}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];function o(e){return"number"==typeof e&&isFinite(e)}var s=new RegExp("^[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)","gi"),i=null,a=null;if(Object.prototype.hasOwnProperty.call(e,"width")){var l=e.width.match(s)[0],r=e.width.substring(l.length);i=!o(Number(l))||"%"!==r&&"px"!==r?null:{number:Number(l),unit:r}}if(Object.prototype.hasOwnProperty.call(e,"height")){var c=e.height.match(s)[0],p=e.height.substring(c.length);a=!o(Number(c))||"%"!==p&&"px"!==p?null:{number:Number(c),unit:p}}var d=1,u=1;null!==i&&"px"===i.unit&&i.number!==t.width&&(d=t.width/i.number),null!==a&&"px"===a.unit&&a.number!==t.height&&(u=t.height/a.number);var m=1;m=n?u>d?u:d:u<=d?u:d;var h={};if(null!==i){var g;g="px"===i.unit?i.number*m:i.number/100*t.width*m;var v=t.width-g;h.left=v/2}if(null!==i){var f;f="px"===a.unit?a.number*m:a.number/100*t.height*m;var b=t.height-f;h.top=b/2}return{scale:m,position:h}},g=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;e=Math.floor(e/16);var o=Math.random()>.5,s=("x"==t?n:3&n|8).toString(16);return o?s.toUpperCase():s}))};var v=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=e.exports={};t.playSVG='\n \n \n\n\n',t.dcSVG='\n \n\nCreated by potrace 1.15, written by Peter Selinger 2001-2017\n\n\n\n\n\n\n',t.pauseSVG='\n \n \n \n',t.replaySVG='\n \n Svg Vector Icons : http://www.onlinewebfonts.com/icon \n \n \n \n \n \n',t.volumeSVG='\n \n \n \n \n \n',t.volumeMuteSVG='\n \n \n \n \n \n',t.settingsSVG='\n \n \n\n\n',t.arrowRightSVG='\n \n \n \n',t.arrowLeftSVG='\n \n \n \n',t.fullScreenSVG='\n \n \n \n \n \n\n\n',t.loopSVG='\n\n \n \n \n\n',t.loadingSVG='\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n'})),f={name:"mc-player",set playerName(e){this.name+="-"+e}},b=function(e,t){var n={default:{"settings-background-color":"whitesmoke","hms-background-color":"whitesmoke","background-color":"whitesmoke","grad-height":"0px",color:"black","svg-color":"black","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"red","cursor-color":"red","speedbar-cursor-color":"red","button-opacity":"1","hover-color":"rgba(200, 200, 200, 0.5)","slider-off-color":"#ccc","slider-on-color":"red","preview-border":"2px solid #fff",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},dark:{"settings-background-color":"black","hms-background-color":"black","background-color":"black","grad-height":"0px",color:"white","svg-color":"white","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"red","cursor-color":"red","speedbar-cursor-color":"red","button-opacity":"1","hover-color":"rgba(90, 90, 90, 0.5)","slider-off-color":"#ccc","slider-on-color":"red","preview-border":"2px solid rgba(0,0,0,1)",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},whiteGold:{"settings-background-color":"white","hms-background-color":"white","background-color":"white","grad-height":"0px",color:"#a17f1a","svg-color":"#a17f1a","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"#a17f1a","cursor-color":"#a17f1a","speedbar-cursor-color":"#a17f1a","button-opacity":"1","hover-color":"rgba(200, 200, 200, 0.5)","slider-off-color":"#ccc","slider-on-color":"#a17f1a","preview-border":"2px solid #808086",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},darkGold:{"settings-background-color":"black","hms-background-color":"black","background-color":"black","grad-height":"0px",color:"#a17f1a","svg-color":"#a17f1a","loopbar-color":"#808086","speedbar-color":"#999","runningbar-color":"#a17f1a","cursor-color":"#a17f1a","speedbar-cursor-color":"#a17f1a","button-opacity":"1","hover-color":"rgba(90, 90, 90, 0.5)","slider-off-color":"#ccc","slider-on-color":"#a17f1a","preview-border":"2px solid #808086",border:"1px solid rgba(255,255,255,0.2)","controls-border":"none","svg-selected-color":"red","loopbar-boundaries-style::before":"","loopbar-boundaries-style::after":"","theme-style":"","loopbar-boundaries-color":"#808086"},transparent:{"background-color":"transparent","settings-background-color":"rgba(0,0,0,0.9)","hms-background-color":"rgba(0,0,0,0.5)","preview-border":"2px solid #fff",color:"#e8eaeb","grad-height":"200px","svg-color":"#e8eaeb","loopbar-color":"#cfcfd0","totalbar-color":"#797979","speedbar-color":"#999","runningbar-color":"red","cursor-color":"#9e2d11","cursor-style::before":'\n box-shadow: 0px 0px 6px 6px red;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n display: block;\n content: "";\n background-color: red;\n position: relative;\n left: -2px;\n top: -2px;\n ',"cursor-style::after":'\n width: 6px;\n height: 6px;\n border-radius: 100%;\n box-shadow: 0px 0px 6px 6px red;\n content: "";\n display: block;\n position: absolute;\n background-color: red;\n right: -2px;\n bottom: -2px;\n ',"speedbar-cursor-color":"red","button-opacity":"1","hover-color":"rgba(200, 200, 200, 0.5)","slider-off-color":"#ccc","slider-on-color":"red",border:"1px solid rgba(255,255,255,0.1)","svg-selected-color":"red","loopbar-boundaries-style":"\n transform: translate(-50%,-37%);\n position: absolute;\n width: 18px;\n background-color: #ff0000;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n position: absolute;\n width: 18px;\n background-color: #ff0000;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n width: 18px;\n height: 9px;\n border-radius: 100%;\n top: 1.5px;\n ","loopbar-boundaries-style::before":'\n width: 16px;\n height: 5px;\n background: #ff0000;\n border-radius: 100%;\n display: block;\n content: "";\n position: relative;\n left: -2px;\n top: 2px;\n ',"loopbar-boundaries-style::after":'\n width: 14px;\n height: 11px;\n border-radius: 100%;\n background: #ff0000;\n content: "";\n display: block;\n position: relative;\n top: -6px;\n left: 5px;\n ',"theme-style":"\n #".concat(t,"-loopbar-start {\n left: -9px !important;\n transform: rotate(180deg);\n top: -2px;\n }\n ")},"mc-green":{"background-color":"#141416","settings-background-color":"rgba(0,0,0,0.9)","hms-background-color":"rgba(0,0,0,0.5)","preview-border":"2px solid #254a42",color:"#999","grad-height":"0px","svg-color":"#999","loopbar-color":"rgba(0,184,139,0.2)","loopbar-boundaries-color":"#00b88b","totalbar-color":"rgba(255, 255, 255, 0.11)","speedbar-color":"#999","runningbar-color":"#00b88b","cursor-color":"#00b88b","speedbar-cursor-color":"#00b88b","button-opacity":"1","hover-color":"rgba(0,184,139,0.2)","slider-off-color":"#ccc","slider-on-color":"#00b88b",border:"1px solid rgba(255,255,255,0.1)","controls-border":"1px solid #151515","svg-selected-color":"#00b88b","loopbar-boundaries-style":"\n transform: translate(-50%,-37%);\n position: absolute;\n width: 18px;\n background-color: #00b88b;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n position: absolute;\n width: 18px;\n background-color: #00b88b;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n width: 18px;\n height: 9px;\n border-radius: 100%;\n top: 1.5px;\n ","loopbar-boundaries-style::before":'\n width: 16px;\n height: 5px;\n background: #00b88b;\n border-radius: 100%;\n display: block;\n content: "";\n position: relative;\n left: -2px;\n top: 2px;\n ',"loopbar-boundaries-style::after":'\n width: 14px;\n height: 11px;\n border-radius: 100%;\n background: #00b88b;\n content: "";\n display: block;\n position: relative;\n top: -6px;\n left: 5px;\n ',"theme-style":"\n #".concat(t,"-loopbar-start {\n left: -9px !important;\n transform: rotate(180deg);\n top: -2px;\n }\n ")},"mc-blue":{"background-color":"#141416","settings-background-color":"rgba(0,0,0,0.9)","hms-background-color":"rgba(0,0,0,0.5)","preview-border":"2px solid #254453",color:"#999","grad-height":"0px","svg-color":"#999","loopbar-color":"rgba(0,153,225,0.2)","loopbar-boundaries-color":"#0099e1","totalbar-color":"rgba(255, 255, 255, 0.11)","speedbar-color":"#999","runningbar-color":"#0099e1","cursor-color":"#0099e1","speedbar-cursor-color":"#0099e1","button-opacity":"1","hover-color":"rgba(0,153,225,0.2)","slider-off-color":"#ccc","slider-on-color":"#0099e1",border:"1px solid rgba(255,255,255,0.1)","controls-border":"1px solid #151515","svg-selected-color":"#0099e1","loopbar-boundaries-style":"\n transform: translate(-50%,-37%);\n position: absolute;\n width: 18px;\n background-color: #0099e1;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n position: absolute;\n width: 18px;\n background-color: #0099e1;\n height: 18px;\n border-radius: 10px;\n z-index: 40;\n width: 18px;\n height: 9px;\n border-radius: 100%;\n top: 1.5px;\n ","loopbar-boundaries-style::before":'\n width: 16px;\n height: 5px;\n background: #0099e1;\n border-radius: 100%;\n display: block;\n content: "";\n position: relative;\n left: -2px;\n top: 2px;\n ',"loopbar-boundaries-style::after":'\n width: 14px;\n height: 11px;\n border-radius: 100%;\n background: #0099e1;\n content: "";\n display: block;\n position: relative;\n top: -6px;\n left: 5px;\n ',"theme-style":"\n #".concat(t,"-loopbar-start {\n left: -9px !important;\n transform: rotate(180deg);\n top: -2px;\n }\n ")},"on-top":{"background-height":"100%","pointer-event-panel-height":"calc(100% - 44px)","controls-bottom":"0px","settings-panel-bottom":"48px","controls-position":"0px"},"position-bottom":{"background-height":"calc(100% - 44px)","pointer-event-panel-height":"calc(100% - 44px)","controls-bottom":"-0px","settings-panel-bottom":"48px","controls-position":"40px"}};return n[e]},y=c,x=d,w=u,B=m,k=c,L=function(e,t,n){if(void 0!==o(n)){if(!1===n){e.elements.volumeBarActive.style.width=100*e.settings.previousVolume+"%",e.clip.setVolume(e.settings.previousVolume),e.settings.volumeMute=!1;var s=document.createElement("span");s.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(s)}else if(!0===n){e.settings.volumeMute=!0,e.elements.volumeBarActive.style.width="0%",e.clip.setVolume(0);var i=document.createElement("span");i.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(i)}e.options.muted=e.settings.volumeMute,e.eventBroadcast("mute-change",e.settings.volumeMute)}if(void 0!==o(t)){if(e.settings.volume=t,e.settings.volume>0&&(e.settings.previousVolume=t),e.elements.volumeBarActive.style.width=100*e.settings.volume+"%",e.clip.setVolume(e.settings.volume),e.settings.volume>0){e.settings.volumeMute=!1;var a=document.createElement("span");a.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(a)}else if(0===e.settings.volume){e.settings.volumeMute=!0;var l=document.createElement("span");l.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(l)}e.options.volume=e.settings.volume,e.eventBroadcast("volume-change",e.settings.volume),e.eventBroadcast("mute-change",e.settings.volumeMute)}},M=function(e){var t=!1;e.elements.volumeBtn.onclick=function(){if(e.settings.volumeMute){e.elements.volumeBarActive.style.width=100*e.settings.previousVolume+"%",e.clip.setVolume(e.settings.previousVolume),e.settings.volumeMute=!1;var t=document.createElement("span");t.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(t)}else{e.settings.volumeMute=!0,e.elements.volumeBarActive.style.width="0%",e.clip.setVolume(0);var n=document.createElement("span");n.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(n)}e.eventBroadcast("volume-change",e.settings.previousVolume),e.eventBroadcast("mute-change",e.settings.volumeMute)};var n=!1;e.elements.volumeBtn.onmouseover=function(){n=!0,e.elements.volumeCursor.classList.add("".concat(e.name,"-volume-cursor-transition")),e.elements.volumeBar.classList.add("".concat(e.name,"-volume-width-transition")),e.elements.volumeBarHelper.classList.add("".concat(e.name,"-volume-width-transition")),e.elements.timeDisplay.classList.add("".concat(e.name,"-time-width-transition"))},k("".concat(e.name,"-left-controls")).onmouseout=function(){if(n&&!t){var o=event.toElement||event.relatedTarget||event.target;(function(e,t){var n=t.parentNode;for(;null!=n;){if(n==e)return!0;n=n.parentNode}return!1})(k("".concat(e.name,"-left-controls")),o)||o===k("".concat(e.name,"-left-controls"))||(n=!1,e.elements.volumeCursor.classList.remove("".concat(e.name,"-volume-cursor-transition")),e.elements.volumeBar.classList.remove("".concat(e.name,"-volume-width-transition")),e.elements.volumeBarHelper.classList.remove("".concat(e.name,"-volume-width-transition")),e.elements.timeDisplay.classList.remove("".concat(e.name,"-time-width-transition")))}},e.listeners.onCursorMoveVolumeBar=function(t){t.preventDefault();var n=(t.clientX||((t.touches||[])[0]||{}).clientX)-e.elements.volumeBarHelper.getBoundingClientRect().left;if(n<0?n=0:n>e.elements.volumeBarHelper.offsetWidth&&(n=e.elements.volumeBarHelper.offsetWidth),e.settings.volume=Number((n/e.elements.volumeBarHelper.offsetWidth).toFixed(2)),e.elements.volumeBarActive.style.width=100*e.settings.volume+"%",e.clip.setVolume(e.settings.volume),e.settings.volume>0){e.settings.volumeMute=!1;var o=document.createElement("span");o.innerHTML=v.volumeSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(o)}else if(0===e.settings.volume){e.settings.volumeMute=!0;var s=document.createElement("span");s.innerHTML=v.volumeMuteSVG,e.elements.volumeBtn.getElementsByTagName("svg")[0].replaceWith(s)}e.eventBroadcast("volume-change",e.settings.volume),e.eventBroadcast("mute-change",e.settings.volumeMute)},e.listeners.onMouseUpVolumeBar=function(n){t=!1,e.elements.listenerHelper.style.pointerEvents="none",n.preventDefault(),e.settings.volume>0&&(e.settings.previousVolume=e.settings.volume),B("mouseup",e.listeners.onMouseUpVolumeBar,!1),B("touchend",e.listeners.onMouseUpVolumeBar,!1),B("mousemove",e.listeners.onCursorMoveVolumeBar,!1),B("touchmove",e.listeners.onCursorMoveVolumeBar,!1)},e.listeners.onMouseDownVolumeBar=function(n){t=!0,e.elements.listenerHelper.style.pointerEvents="auto",n.preventDefault(),e.listeners.onCursorMoveVolumeBar(n),w("mouseup",e.listeners.onMouseUpVolumeBar,!1),w("touchend",e.listeners.onMouseUpVolumeBar,!1),w("mousemove",e.listeners.onCursorMoveVolumeBar,!1),w("touchmove",e.listeners.onCursorMoveVolumeBar,!1)},e.elements.volumeBarHelper.addEventListener("mousedown",e.listeners.onMouseDownVolumeBar,!1),e.elements.volumeCursor.addEventListener("mousedown",e.listeners.onMouseDownVolumeBar,!1),e.elements.volumeBarHelper.addEventListener("touchstart",e.listeners.onMouseDownVolumeBar,{passive:!1},!1),e.elements.volumeCursor.addEventListener("touchstart",e.listeners.onMouseDownVolumeBar,{passive:!1},!1)};var E=u,T=m,S=u,C=m,V=u,P=m,z=c,H=u,D=m,N=function(e,t){t&&t.preventDefault();var n=z("".concat(e.name,"-show-indicator-checkbox"));n.checked?(n.checked=!1,e.elements.indicator.style.visibility="hidden"):(n.checked=!0,e.elements.indicator.style.visibility="visible"),e.eventBroadcast("show-indicator-change",n.checked)},W=function(e,t){t&&t.preventDefault();var n=z("".concat(e.name,"-pointer-events-checkbox"));n.checked?(n.checked=!1,e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="auto",z("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"):(n.checked=!0,e.options.pointerEvents=!1,e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="none",z("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"),e.eventBroadcast("show-pointer-events-change",n.checked)},F=function(e,t){t&&t.preventDefault(),e.elements.volumeControl.classList.toggle("".concat(e.name,"-volume-width-transition")),e.elements.volumeControl.classList.toggle("".concat(e.name,"-hide"));var n=z("".concat(e.name,"-show-volume-checkbox"));n.checked?(n.checked=!1,e.elements.volumeControl.style.visibility="hidden",e.elements.timeDisplay.style.left="45px"):(n.checked=!0,e.elements.volumeControl.style.visibility="visible",e.elements.timeDisplay.style.left=""),e.eventBroadcast("show-volume-change",n.checked)},I=function(e,t){t&&t.preventDefault();var n=z("".concat(e.name,"-show-preview-checkbox"));n.checked?(n.checked=!1,z("".concat(e.name,"-hover-display")).style.visibility="hidden",z("".concat(e.name,"-hover-display")).style.display="none",e.options.preview=!1):(e.previewClip||e.createPreviewDisplay(),n.checked=!0,z("".concat(e.name,"-hover-display")).style.visibility="visible",z("".concat(e.name,"-hover-display")).style.display="flex",e.options.preview=!0),e.eventBroadcast("show-preview-change",n.checked)},O=function(e){e.elements.settingsShowIndicator.onclick=function(t){return N(e,t)},e.elements.settingsPointerEvents.onclick=function(t){return W(e,t)},e.elements.settingsShowVolume.onclick=function(t){return F(e,t)},e.elements.settingsShowPreview.onclick=function(t){return I(e,t)},e.elements.settingsButton.onclick=function(t){t.preventDefault();var n=z("".concat(e.name,"-controls")),o=function t(n){if(e.elements.settingsPanel.contains(n.target))return!0;e.elements.settingsPanel.classList.toggle("".concat(e.name,"-hide")),e.elements.settingsPanel.classList.toggle("m-fadeOut"),e.elements.settingsPanel.classList.toggle("m-fadeIn"),e.elements.settingsPanel.className.includes("m-fadeOut")&&(D("click",t,!1),e.eventBroadcast("state-change",e.state))};e.elements.settingsPanel.className.includes("m-fadeOut")?(n.classList.value.includes("force-show-controls")||n.classList.toggle("force-show-controls"),H("click",o,!1)):D("click",o,!1)}},A=function(e,t){"showIndicator"===t?N(e):"showPointerEvents"===t?W(e):"showVolume"===t?F(e):"showPreview"===t&&I(e)},G=c,U=u,R=m,j=function(e){e.elements.settingsSpeedButtonShow.onclick=e.elements.settingsSpeedButtonHide.onclick=function(t){t.preventDefault(),e.elements.settingsPanel.classList.toggle("".concat(e.name,"-settings-speed-panel")),e.elements.settingsPanel.className.includes("".concat(e.name,"-settings-speed-panel"))?(e.elements.settingsMainPanel.style.display="none",e.elements.settingsSpeedPanel.style.display="block"):(e.elements.settingsSpeedPanel.style.display="none",e.elements.settingsMainPanel.style.display="block")};var t=function(t){t.preventDefault();var n=e.elements.speedBar.getBoundingClientRect(),o=(t.clientY||((t.touches||[])[0]||{}).clientY)-n.top;(o-=8)<0?o=0:o>e.elements.speedBar.offsetHeight-16&&(o=e.elements.speedBar.offsetHeight-16);var s=-1*((o=Math.floor(o))/(16*(e.options.speedValues.length-1))-1),i=1/(e.options.speedValues.length-1),a=e.calculateSpeed(i,e.options.speedValues,s);G("".concat(e.name,"-speed-runtime")).innerHTML=a+"0",G("".concat(e.name,"-speed-cursor")).style.top=o+"px",e.clip.executionSpeed=a,e.eventBroadcast("speed-change",e.clip.executionSpeed)},n=function n(o){var s;e.elements.listenerHelper.style.pointerEvents="none",o.preventDefault(),R("mouseup",n,!1),R("touchend",n,!1),R("mousemove",t,!1),R("touchmove",t,!1),G("".concat(e.name,"-speed-runtime")).innerHTML="Speed",s=1==e.clip.speed?"Normal":e.clip.speed,e.elements.speedCurrent.innerHTML=s},o=function(o){e.elements.listenerHelper.style.pointerEvents="auto",o.preventDefault(),t(o),U("mouseup",n,!1),U("touchend",n,!1),U("mousemove",t,!1),U("touchmove",t,!1)};e.elements.speedBarHelper.addEventListener("mousedown",o,!1),e.elements.speedBarHelper.addEventListener("touchstart",o,{passive:!1},!1)},X=function(e,t){var n;t=parseFloat(t)||1,e.eventBroadcast("speed-change",t),n=1==t?"Normal":t,e.clip.executionSpeed=t,e.elements.speedCurrent.innerHTML=n},J=c,q=function(e){e.settings.loopActivated=!e.settings.loopActivated,e.eventBroadcast("loop-change",e.settings.loopActivated),e.elements.loopButton.classList.toggle("svg-selected"),e.elements.loopBarStart.classList.toggle("m-fadeOut"),e.elements.loopBarEnd.classList.toggle("m-fadeOut"),e.elements.loopBarStart.classList.toggle("m-fadeIn"),e.elements.loopBarStart.classList.toggle("".concat(e.name,"-hide")),e.elements.loopBarEnd.classList.toggle("m-fadeIn"),e.elements.loopBarEnd.classList.toggle("".concat(e.name,"-hide")),J("".concat(e.name,"-loop-time")).classList.toggle("m-fadeOut"),J("".concat(e.name,"-loop-time")).classList.toggle("m-fadeIn"),J("".concat(e.name,"-loop-time")).classList.toggle("".concat(e.name,"-hide")),e.elements.loopEndTime.innerHTML=e.settings.loopEndMillisecond,e.elements.loopStartTime.innerHTML=e.settings.loopStartMillisecond,e.settings.needsUpdate=!0,e.settings.loopActivated||(e.elements.loopBar.style.left="0%",e.elements.loopBar.style.width="100%",e.settings.loopStartMillisecond=0,e.settings.loopEndMillisecond=e.clip.duration,e.settings.loopLastPositionXPxls=0,e.settings.loopLastPositionXPercentage=0,e.elements.runningBar.style.width=e.clip.runTimeInfo.currentMillisecond/e.clip.duration*100+"%")},Y=q,_=function(e){e.elements.loopButton.onclick=function(){return q(e)}},K=c;function Q(e,t){for(var n=t.parentNode;null!=n;){if(n==e)return!0;n=n.parentNode}return!1}var Z=function(e){var t=e.clip.props.host.className.includes("full-screen");e.clip.props.host!==e.options.host&&!t&&e.clip.props.host.appendChild(e.elements.mcPlayer),e.clip.props.host!==e.options.host&&t&&e.options.host.appendChild(e.elements.mcPlayer),t?e.exitFullscreen():e.launchIntoFullscreen(e.clip.props.host)},$=Z,ee=function(e){e.elements.fullScreenButton.onclick=function(){return Z(e)}},te=g,ne=c,oe=u,se=m,ie=r,ae=c,le=new n.default.TimeCapsule,re=c,ce=p,pe=d,de=h;return function(){function e(t){var n,o=this;for(var s in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.id=t.id||Date.now(),t.preview=t.preview||!1,t.showVolume=t.showVolume||!1,t.showIndicator=t.showIndicator||!1,t.theme=t.theme||"transparent on-top",t.host=t.host||t.clip.props.host,t.buttons=t.buttons||{},t.timeFormat=t.timeFormat||"ss",t.backgroundColor=t.backgroundColor||"black",t.fullscreen=t.fullscreen||!1,t.scaleToFit=null===(n=t.scaleToFit)||void 0===n||n,void 0===t.pointerEvents||null===t.pointerEvents?t.pointerEvents=!1:t.pointerEvents=Boolean(t.pointerEvents),t.onMillisecondChange=t.onMillisecondChange||null,t.speedValues=t.speedValues||[-2,-1,-.5,0,.5,1,2],t.muted=t.muted||!1,t.controls=0!=t.controls,t.loop=t.loop||!1,t.volume=void 0!==t.volume?t.volume:1,t.currentScript=t.currentScript||null,t.speedValues)isFinite(t.speedValues[s])||t.speedValues.splice(s,1);t.speedValues.sort((function(e,t){return e-t})),this.className=f.name,f.playerName=t.id,this.options=t,this.id=this.options.id,this.name=f.name,this.previewClip=null,this.clip=t.clip,this.clipClass=t.clipClass,this.state=this.clip.runTimeInfo.state,this.listeners={},this.previewScale=.25,this.settings={volume:1,journey:null,previousVolume:1,volumeMute:!1,needsUpdate:!0,resizeLoop:!1,loopJourney:!1,previewJourney:null,loopActivated:!1,requestingLoop:!1,playAfterResize:!1,loopStartMillisecond:0,loopLastPositionXPxls:0,loopLastPositionXPercentage:0,loopEndMillisecond:this.clip.duration,controls:!0},function(e){e.elements={};var t=e.clip.props.host;t.offsetWidth||(t.style.width=e.clip.props.containerParams.width),t.offsetHeight||(t.style.height=e.clip.props.containerParams.height);var n=document.createElement("link");n.rel="preconnect",n.href="https://fonts.gstatic.com";var o=document.createElement("link");o.rel="stylesheet",o.href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap";var s=document.getElementsByTagName("head")[0];if(s.appendChild(n),s.appendChild(o),t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.overflow="hidden",e.clip.props.host.style.position="relative",e.clip.props.host.style.zIndex="0",e.elements.mcPlayer=x("div"),e.elements.mcPlayer.id="".concat(e.name),e.elements.mcPlayer.className="".concat(e.className),e.elements.mcPlayer.innerHTML=function(e){return'\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n ').concat(e.svg.playSVG,'\n \n
\n
\n
\n ').concat(e.svg.volumeSVG,'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n ').concat(e.svg.loopSVG,'
\n \n \n :\n \n \n \n ').concat(e.svg.settingsSVG,'\n \n ').concat(e.svg.dcSVG,'\n \n \n ').concat(e.svg.fullScreenSVG,'\n \n \n\n \n
\n
    \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n \n
  • \n
  • \n \n
    ').concat(e.svg.arrowRightSVG,'
    \n \n
  • \n
\n
    \n
  • \n
    ').concat(e.svg.arrowLeftSVG,"
    \n
\n
\n \n
\n
\n \n
\n
\n \n \n \n')}({svg:v,name:e.name}),"string"==typeof e.options.host){var i=document.querySelectorAll(e.options.host);for(var a in i)isNaN(a)||i[a].appendChild(e.elements.mcPlayer)}else e.options.host.appendChild(e.elements.mcPlayer);for(var l in e.elements.pointerEventPanel=y("".concat(e.name,"-pointer-event-panel")),e.elements.listenerHelper=y("".concat(e.name,"-listener-helper")),e.elements.loopBar=y("".concat(e.name,"-loopbar")),e.elements.totalBar=y("".concat(e.name,"-totalbar")),e.elements.indicator=y("".concat(e.name,"-indicator")),e.elements.loopButton=y("".concat(e.name,"-loop-btn")),e.elements.volumeBar=y("".concat(e.name,"-volumebar")),e.elements.totalTime=y("".concat(e.name,"-time-total")),e.elements.volumeControl=y("".concat(e.name,"-volume")),e.elements.volumeBtn=y("".concat(e.name,"-volume-btn")),e.elements.runningBar=y("".concat(e.name,"-runningbar")),e.elements.loopBarEnd=y("".concat(e.name,"-loopbar-end")),e.elements.statusButton=y("".concat(e.name,"-status-btn")),e.elements.speedBar=y("".concat(e.name,"-speed-value-bar")),e.elements.currentTime=y("".concat(e.name,"-time-current")),e.elements.timeDisplay=y("".concat(e.name,"-time-display")),e.elements.speedCurrent=y("".concat(e.name,"-speed-current")),e.elements.loopBarStart=y("".concat(e.name,"-loopbar-start")),e.elements.volumeCursor=y("".concat(e.name,"-volume-cursor")),e.elements.settingsButton=y("".concat(e.name,"-settings-btn")),e.elements.donkeyclipButton=y("".concat(e.name,"-dc-btn")),e.elements.timeSeparator=y("".concat(e.name,"-time-separator")),e.elements.settingsPanel=y("".concat(e.name,"-settings-panel")),e.elements.settingsMainPanel=y("".concat(e.name,"-main-settings")),e.elements.fullScreenButton=y("".concat(e.name,"-full-screen-btn")),e.elements.volumeBarHelper=y("".concat(e.name,"-volumebar-helper")),e.elements.volumeBarActive=y("".concat(e.name,"-volumebar-active")),e.elements.settingsSpeedPanel=y("".concat(e.name,"-speed-settings")),e.elements.settingsShowVolume=y("".concat(e.name,"-settings-volume")),e.elements.settingsShowPreview=y("".concat(e.name,"-settings-preview")),e.elements.settingsPointerEvents=y("".concat(e.name,"-settings-pointer-events")),e.elements.speedBarHelper=y("".concat(e.name,"-speed-value-helperbar")),e.elements.settingsShowIndicator=y("".concat(e.name,"-settings-indicator")),e.elements.settingsSpeedButtonShow=y("".concat(e.name,"-settings-speed-show")),e.elements.settingsSpeedButtonHide=y("".concat(e.name,"-settings-speed-hide")),e.elements.volumeBarActive.style.width=100*e.settings.volume+"%",e.elements.currentTime.innerHTML=e.timeFormat(0),e.elements.totalTime.innerHTML=e.timeFormat(e.clip.duration),e.elements.timeSeparator.innerHTML="/",e.elements.settingsPanel.classList.add("m-fadeOut","".concat(e.name,"-hide")),e.options.showIndicator?(e.elements.indicator.style.visibility="visible",e.elements.statusButton.style.width="35px",e.elements.statusButton.style.height="20px",e.elements.statusButton.style.bottom="5px"):e.elements.indicator.style.visibility="hidden",e.elements.indicator.innerHTML=e.clip.runTimeInfo.state,e.elements.settingsSpeedPanel.style.display="none",e.elements.settingsSpeedPanel.getElementsByTagName("li")[1].classList.add("no-hover"),e.elements.loopBarStart.style.left="0%",e.elements.loopBarStart.classList.add("m-fadeOut","".concat(e.name,"-hide")),e.elements.loopBarEnd.style.left="100%",e.elements.loopBarEnd.classList.add("m-fadeOut","".concat(e.name,"-hide")),e.elements.loopStartTime=y("".concat(e.name,"-loopbar-start-time")),e.elements.loopEndTime=y("".concat(e.name,"-loopbar-end-time")),e.elements.editableLoopStartTime=document.createElement("input"),e.elements.editableLoopStartTime.type="text",e.elements.editableLoopStartTime.size=y("".concat(e.name,"-time-total")).innerHTML.length+1,e.elements.editableLoopStartTime.maxLength=y("".concat(e.name,"-time-total")).innerHTML.length,e.elements.editableLoopStartTime.style.height=y("".concat(e.name,"-time-total")).offsetHeight,e.elements.editableLoopStartTime.value=y("".concat(e.name,"-loopbar-start-time")).innerHTML,e.elements.editableLoopStartTime.style.fontSize="8px",e.elements.editableLoopEndTime=document.createElement("input"),e.elements.editableLoopEndTime.type="text",e.elements.editableLoopEndTime.size=y("".concat(e.name,"-time-total")).innerHTML.length+1,e.elements.editableLoopEndTime.maxLength=y("".concat(e.name,"-time-total")).innerHTML.length,e.elements.editableLoopEndTime.style.height=y("".concat(e.name,"-time-total")).offsetHeight,e.elements.editableLoopEndTime.value=y("".concat(e.name,"-loopbar-start-time")).innerHTML,e.elements.editableLoopEndTime.pattern="d*",e.elements.editableLoopEndTime.style.fontSize="8px",y("".concat(e.name,"-loop-time")).classList.add("m-fadeOut","".concat(e.name,"-hide")),y("".concat(e.name,"-hover-display")).classList.add("m-fadeOut"),y("".concat(e.name,"-show-volume-checkbox")).checked=e.options.showVolume,y("".concat(e.name,"-show-indicator-checkbox")).checked=e.options.showIndicator,y("".concat(e.name,"-show-preview-checkbox")).checked=e.options.preview,y("".concat(e.name,"-pointer-events-checkbox")).checked=e.options.pointerEvents,e.options.pointerEvents?(e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="none",y("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"):(e.elements.mcPlayer.style.pointerEvents="none",e.elements.pointerEventPanel.style.pointerEvents="auto",y("".concat(e.name,"-controls")).style.pointerEvents="auto",e.elements.settingsPanel.style.pointerEvents="auto"),e.elements.listenerHelper.style.pointerEvents="none",e.options.showVolume?(e.elements.timeDisplay.style.left="",e.elements.volumeControl.style.visibility="visible"):(e.elements.timeDisplay.style.left="45px",e.elements.volumeControl.style.visibility="hidden",e.elements.volumeControl.classList.toggle("".concat(e.name,"-hide")),e.elements.volumeControl.classList.toggle("".concat(e.name,"-volume-width-transition"))),e.options.speedValues){var r=x("div");r.className="".concat(e.name,"-speed-value-step");var c=x("div");c.className="".concat(e.name,"-speed-value"),c.dataset.speedValue=e.options.speedValues[l],c.innerHTML=e.options.speedValues[l],c.dataset.zone=l,y("".concat(e.name,"-speed-value")).prepend(c),e.elements.speedBar.prepend(r)}!1===e.options.buttons.fullScreen&&e.elements.fullScreenButton.remove(),!1===e.options.buttons.settings&&e.elements.settingsButton.remove(),!1===e.options.buttons.donkeyclip&&e.elements.donkeyclipButton.remove(),!1===e.options.buttons.loop&&e.elements.loopButton.remove()}(this),this.setTheme(),this.setSpeed(),this.subscribeToTimer(),this.subscribeToDurationChange(),this.addEventListeners(),this.scaleClipHost(),this.eventBroadcast("state-change",this.state),this.options.preview&&this.createPreviewDisplay(),this.resizeTimeout=setTimeout((function(){}),20),window.addEventListener("resize",(function(){clearTimeout(o.resizeTimeout),o.resizeTimeout=setTimeout((function(){o.options.preview&&o.setPreviewDimentions(),o.options.scaleToFit&&o.scaleClipHost()}),20)})),this.changeSettings(t,!0)}var t,n,o;return t=e,(n=[{key:"changeSettings",value:function(e,t){e.theme=e.theme||"transparent on-top",e.speed=e.speed||1,e.volume=e.volume||1,e.clip=e.clip||this.clip,e.clip!==this.options.clip&&(t=!0,this.clip=e.clip,this.options.clip=e.clip),!1===e.controls?re(this.name).style.display="none":!0===e.controls&&(re(this.name).style.display="unset"),void 0!==e.loop&&(this.options.loop!==e.loop||t&&this.options.loop)&&Y(this),void 0!==e.fullscreen&&(this.options.fullscreen!==e.fullscreen||t&&this.options.fullscreen)&&$(this),void 0!==e.muted&&(this.options.muted!==e.muted||t&&this.options.muted)&&L(this,void 0,e.mute),void 0!==e.volume&&(this.options.volume!==e.volume||t&&this.options.volume)&&L(this,e.volume,void 0),void 0!==e.speed&&(this.options.speed!==e.speed||t&&this.options.speed)&&X(this,e.speed),void 0!==e.scaleToFit&&(this.options.scaleToFit!==e.scaleToFit||t&&this.options.scaleToFit)&&(this.options.scaleToFit=e.scaleToFit,this.scaleClipHost()),void 0!==e.showVolume&&this.options.showVolume!==e.showVolume&&A(this,"showVolume"),void 0!==e.preview&&this.options.preview!==e.preview&&A(this,"showPreview"),void 0!==e.theme&&this.options.theme!==e.theme&&(this.options.theme=e.theme,this.setTheme()),this.options=l(l({},this.options),e)}},{key:"scaleClipHost",value:function(){if(this.options.scaleToFit){var e=this.clip.props.containerParams.width,t=this.clip.props.containerParams.height,n=de({width:e,height:t},{width:this.clip.props.host.offsetWidth,height:this.clip.props.host.offsetHeight},"cover"===this.options.scaleToFit);this.clip.realClip.rootElement.style.transform="scale(".concat(n.scale),this.clip.realClip.rootElement.style.left=n.position.left+"px",this.clip.realClip.rootElement.style.top=n.position.top+"px"}else this.clip.realClip.rootElement.style.transform="scale(1)",this.clip.realClip.rootElement.style.left="0px",this.clip.realClip.rootElement.style.top="0px";this.eventBroadcast("scale-change",this.options.scaleToFit)}},{key:"createLoop",value:function(e,t){this.settings.loopStartMillisecond=e,this.settings.loopEndMillisecond=t,this.elements.loopBar.style.left=e/this.clip.duration*100+"%",this.elements.loopBar.style.width=(t-e)/this.clip.duration*100+"%",this.createJourney(e),this.elements.runningBar.style.width="0%",!this.settings.loopActivated&&Y(this)}},{key:"createJourney",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.clip;setTimeout((function(){var s=n.before,i=void 0===s?null:s,a=n.after,l=void 0===a?null:a;i&&o[i](),t.settings.journey=le.startJourney(o),t.settings.journey.station(e),t.settings.journey.destination(),l&&o[l]()}),0)}},{key:"millisecondChange",value:function(e,t,n,o){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.state!==t&&(this.state=t,this.eventBroadcast("state-change",t)),!this.settings.needsUpdate)return this.clip.pause(),1;var i=this.settings,a=i.loopActivated,l=i.loopEndMillisecond,r=i.loopStartMillisecond,c=this.clip.duration,p=this.elements,d=p.totalBar,u=p.loopBar,m=u.offsetWidth,h=u.offsetLeft/d.offsetWidth,g=e-c*h,v=c/d.offsetWidth*m;return e>=l&&a&&this.clip.speed>=0?(this.createJourney(r+1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):e>=l&&a&&this.clip.speed<0?(this.createJourney(l-1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):e<=r&&a&&this.clip.speed>=0?(this.createJourney(r+1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):e<=r&&a&&this.clip.speed<0?(this.createJourney(l-1,{after:this.settings.playAfterResize||"playing"==this.clip.runTimeInfo.state?"play":null}),1):(o&&this.createJourney(e,{after:this.settings.playAfterResize?"play":null}),this.elements.runningBar.style.width=g/v*100+"%",this.elements.currentTime.innerHTML=this.timeFormat(e),void(this.options.onMillisecondChange&&s&&this.options.onMillisecondChange(e)))}},{key:"eventBroadcast",value:function(e,t){var n=re("".concat(this.name,"-controls"));"state-change"===e?(this.options.currentScript&&(this.options.currentScript.dataset.status=t),"paused"===t||"idle"===t||"transitional"===t||"armed"===t||"blocked"===t?(n.classList.value.includes("force-show-controls")||n.classList.toggle("force-show-controls"),this.elements.statusButton.innerHTML=v.playSVG,this.elements.statusButton.appendChild(this.elements.indicator),this.elements.indicator.innerHTML="".concat(t.charAt(0).toUpperCase()+t.slice(1)),this.elements.pointerEventPanel.innerHTML="blocked"===t?'\n
'.concat(v.loadingSVG,"
"):""):(n.classList.value.includes("force-show-controls")&&n.classList.toggle("force-show-controls"),this.elements.statusButton.innerHTML=v.pauseSVG,this.elements.statusButton.appendChild(this.elements.indicator),this.elements.indicator.innerHTML="Playing",this.elements.pointerEventPanel.innerHTML="","playing"===t&&this.clip.runTimeInfo.currentMillisecond===this.clip.duration&&this.clip.speed>=0?this.createJourney(1,{after:"play"}):("playing"===t&&0===this.clip.runTimeInfo.currentMillisecond&&this.clip.speed<0||"playing"===t&&this.clip.runTimeInfo.currentMillisecond===this.clip.duration&&this.clip.speed<0)&&this.createJourney(this.clip.duration-1,{after:"play"}))):"duration-change"===e?(this.elements.totalTime.innerHTML=this.timeFormat(this.clip.duration),this.settings.loopEndMillisecond=this.clip.duration,this.elements.pointerEventPanel.innerHTML="",this.millisecondChange(this.clip.runTimeInfo.currentMillisecond)):this.options.currentScript&&("volume-change"===e?(this.options.volume=t,this.options.currentScript.dataset.volume=t):"speed-change"===e?(this.options.speed=t,this.options.currentScript.dataset.speed=t):"mute-change"===e?t?(this.options.muted=!0,this.options.currentScript.dataset.muted=""):(this.options.muted=!1,delete this.options.currentScript.dataset.muted):"loop-change"===e?t?(this.options.loop=!0,this.options.currentScript.dataset.loop=""):(this.options.loop=!1,delete this.options.currentScript.dataset.loop):"scale-change"===e?t?(this.options.scaleToFit=!0,this.options.currentScript.dataset.scaleToFit=""):(this.options.scaleToFit=!1,delete this.options.currentScript.dataset.scaleToFit):"show-volume-change"===e?t?(this.options.showVolume=!0,this.options.currentScript.dataset.showVolume=""):(this.options.showVolume=!1,delete this.options.currentScript.dataset.showVolume):"show-preview-change"===e&&(t?(this.options.preview=!0,this.options.currentScript.dataset.preview=""):(this.options.preview=!1,delete this.options.currentScript.dataset.preview)))}},{key:"subscribeToDurationChange",value:function(){this.clip.subscribeToDurationChange(this.subscribeToDurationChangeCallback.bind(this))}},{key:"subscribeToDurationChangeCallback",value:function(){this.eventBroadcast("duration-change")}},{key:"subscribeToTimer",value:function(){this.clip.subscribe(this.id,this.millisecondChange.bind(this))}},{key:"handleDragStart",value:function(){this.settings.needsUpdate=!0,this.settings.journey=le.startJourney(this.clip)}},{key:"timeFormat",value:function(e){if("ss"===this.options.timeFormat){var t=e/1e3/60/60,n=t%1*60,o=n%1*60,s=("0"+parseInt(t)).slice(-2),i=("0"+parseInt(n)).slice(-2),a=("0"+parseInt(o)).slice(-2);return"".concat("00"===s?"":s+":").concat(i,":").concat(a)}return e}},{key:"handleDrag",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];isFinite(e)||(e=0);var n=this.clip.duration,o=this.settings.journey,s=this.elements,i=s.loopBar,a=s.totalBar,l=s.runningBar,r=s.currentTime,c=e+i.offsetLeft,p=Math.round(n*c/a.offsetWidth);r.innerHTML=this.timeFormat(p),l.style.width=e/i.offsetWidth*100+"%",o.station(p),this.options.onMillisecondChange&&t&&this.options.onMillisecondChange(p)}},{key:"handleDragEnd",value:function(){this.settings.journey.destination()}},{key:"createProgressDrag",value:function(e){this.handleDragStart(),this.handleDrag(e),this.handleDragEnd()}},{key:"addEventListeners",value:function(){var e;(e=this).listeners.onCursorMoveLoopEnd=function(t){t.preventDefault();var n=(t.clientX||((t.touches||[])[0]||{}).clientX)-e.elements.totalBar.getBoundingClientRect().left;n<0?n=0:n>e.elements.totalBar.offsetWidth&&(n=e.elements.totalBar.offsetWidth),e.elements.runningBar.offsetWidth>=e.elements.loopBar.offsetWidth&&(e.elements.runningBar.style.width=e.elements.loopBar.offsetWidth+"px"),e.settings.loopLastPositionXPxls-n<0?e.elements.loopBar.style.width=Math.abs(e.settings.loopLastPositionXPxls-n)+"px":(e.elements.loopBar.style.left=n+"px",e.settings.loopLastPositionXPxls=n),e.settings.loopEndMillisecond=Math.round(e.clip.duration*((parseFloat(e.elements.loopBar.style.left)||0)+parseFloat(e.elements.loopBar.style.width))/e.elements.totalBar.offsetWidth),e.settings.loopEndMilliseconde.settings.loopEndMillisecond&&(e.settings.loopStartMillisecond=e.settings.loopEndMillisecond,e.settings.loopJourney=!0),e.elements.loopEndTime.innerHTML=e.settings.loopEndMillisecond,e.elements.loopStartTime.innerHTML=e.settings.loopStartMillisecond},e.listeners.onMouseUpLoopEnd=function(t){if(e.elements.listenerHelper.style.pointerEvents="none",e.settings.resizeLoop=!1,t.preventDefault(),e.elements.runningBar.style.width=e.elements.runningBar.offsetWidth/e.elements.loopBar.offsetWidth*100+"%",e.elements.loopBar.style.left=e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth*100+"%",e.elements.loopBar.style.width=e.elements.loopBar.offsetWidth/e.elements.totalBar.offsetWidth*100+"%",e.settings.loopJourney&&(e.createProgressDrag(e.elements.runningBar.offsetWidth),e.settings.loopJourney=!1),C("mouseup",e.listeners.onMouseUpLoopEnd,!1),C("touchend",e.listeners.onMouseUpLoopEnd,!1),C("mousemove",e.listeners.onCursorMoveLoopEnd,!1),C("touchmove",e.listeners.onCursorMoveLoopEnd,!1),e.elements.loopBar.addEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.addEventListener("touchstart",e.listeners.onMouseDown,{passive:!0},!1),e.settings.playAfterResize){var n;if("idle"===e.clip.runTimeInfo.state)n=e.clip.speed>=0?e.settings.loopStartMillisecond+1:e.settings.loopEndMillisecond-1,e.settings.needsUpdate=!0,e.createJourney(n,{before:"pause",after:"play"});else if("completed"===e.clip.runTimeInfo.state){var o;o=e.clip.speed>=0?e.settings.loopStartMillisecond+1:e.settings.loopEndMillisecond-1,e.settings.needsUpdate=!0,e.createJourney(o,{before:"pause",after:"play"})}else e.clip.play();e.settings.playAfterResize=!1}},e.listeners.onMouseDownLoopEnd=function(t){e.elements.listenerHelper.style.pointerEvents="auto",e.settings.resizeLoop=!0,e.settings.needsUpdate=!0,"playing"===e.clip.runTimeInfo.state&&(e.clip.pause(),e.settings.playAfterResize=!0),t.preventDefault(),e.elements.runningBar.style.width=e.elements.runningBar.offsetWidth+"px",e.elements.loopBar.style.left=e.elements.loopBar.offsetLeft+"px",e.elements.loopBar.style.width=e.elements.loopBar.offsetWidth+"px",e.elements.loopBar.removeEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.removeEventListener("touchstart",e.listeners.onMouseDown,!1),e.listeners.onCursorMoveLoopEnd(t),S("mouseup",e.listeners.onMouseUpLoopEnd,!1),S("touchend",e.listeners.onMouseUpLoopEnd,!1),S("mousemove",e.listeners.onCursorMoveLoopEnd,!1),S("touchmove",e.listeners.onCursorMoveLoopEnd,!1)},e.elements.loopBarEnd.addEventListener("mousedown",e.listeners.onMouseDownLoopEnd,!1),e.elements.loopBarEnd.addEventListener("touchstart",e.listeners.onMouseDownLoopEnd,{passive:!1},!1),function(e){e.listeners.onCursorMove=function(t){t.preventDefault();var n=(t.clientX||((t.touches||[])[0]||{}).clientX)-e.elements.loopBar.getBoundingClientRect().left;n<0?n=0:n>e.elements.loopBar.offsetWidth&&(n=e.elements.loopBar.offsetWidth),e.handleDrag(n)},e.listeners.onMouseUp=function(){e.elements.listenerHelper.style.pointerEvents="none",P("mouseup",e.listeners.onMouseUp,!1),P("touchend",e.listeners.onMouseUp,!1),P("mousemove",e.listeners.onCursorMove,!1),P("touchmove",e.listeners.onCursorMove,!1),e.handleDragEnd(e.settings)},e.listeners.onMouseDown=function(t){e.elements.listenerHelper.style.pointerEvents="auto","playing"===e.clip.runTimeInfo.state&&(e.settings.playAfterResize=!0),e.handleDragStart(e.clip),e.listeners.onCursorMove(t),V("mouseup",e.listeners.onMouseUp,!1),V("touchend",e.listeners.onMouseUp,!1),V("mousemove",e.listeners.onCursorMove,!1),V("touchmove",e.listeners.onCursorMove,!1)},e.elements.loopBar.addEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.addEventListener("touchstart",e.listeners.onMouseDown,{passive:!1},!1)}(this),function(e){e.listeners.onCursorMoveLoopStart=function(t){t.preventDefault();var n=t.clientX||((t.touches||[])[0]||{}).clientX,o=e.elements.totalBar.getBoundingClientRect(),s=Math.round(n-o.left),i=Math.round(e.settings.loopEndMillisecond/e.clip.duration*e.elements.totalBar.offsetWidth);s<0?s=0:s>e.elements.totalBar.offsetWidth&&(s=e.elements.totalBar.offsetWidth);var a=e.clip.runTimeInfo.currentMillisecond/e.clip.duration*e.elements.totalBar.offsetWidth-s;e.elements.loopBar.style.left=s+"px",e.elements.loopBar.style.width=i-s+"px",e.elements.runningBar.style.width=a+"px",e.settings.loopLastPositionXPxls=s,e.settings.loopStartMillisecond=Math.round(e.clip.duration*e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth),e.settings.loopEndMilliseconde.clip.runTimeInfo.currentMillisecond&&(e.settings.loopJourney=!0)},e.listeners.onMouseUpLoopStart=function(t){var n;e.elements.listenerHelper.style.pointerEvents="none",e.settings.resizeLoop=!1,t.preventDefault(),e.settings.loopJourney&&(e.createProgressDrag(e.elements.runningBar.offsetWidth),e.settings.loopJourney=!1),e.elements.loopBar.style.left=e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth*100+"%",e.elements.loopBar.style.width=e.elements.loopBar.offsetWidth/e.elements.totalBar.offsetWidth*100+"%",e.settings.loopStartMillisecond=Math.round(e.clip.duration*e.elements.loopBar.offsetLeft/e.elements.totalBar.offsetWidth),e.elements.runningBar.style.width=e.elements.runningBar.offsetWidth/e.elements.loopBar.offsetWidth*100+"%",T("mouseup",e.listeners.onMouseUpLoopStart,!1),T("touchend",e.listeners.onMouseUpLoopStart,!1),T("mousemove",e.listeners.onCursorMoveLoopStart,!1),T("touchmove",e.listeners.onCursorMoveLoopStart,!1),e.elements.loopBar.addEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.addEventListener("touchstart",e.listeners.onMouseDown,{passive:!0},!1),e.settings.playAfterResize&&("idle"===e.clip.runTimeInfo.state?(n=e.clip.speed>=0?e.settings.loopStartMillisecond+1:e.settings.loopEndMillisecond-1,e.settings.needsUpdate=!0,e.createJourney(n,{before:"pause",after:"play"})):e.clip.play(),e.settings.playAfterResize=!1)},e.listeners.onMouseDownLoopStart=function(t){e.elements.listenerHelper.style.pointerEvents="auto",e.settings.resizeLoop=!0,t.preventDefault(),e.settings.needsUpdate=!0,"playing"===e.clip.runTimeInfo.state&&(e.clip.pause(),e.settings.playAfterResize=!0),e.elements.loopBar.removeEventListener("mousedown",e.listeners.onMouseDown,!1),e.elements.loopBar.removeEventListener("touchstart",e.listeners.onMouseDown,!1),e.listeners.onCursorMoveLoopStart(t),E("mouseup",e.listeners.onMouseUpLoopStart,!1),E("touchend",e.listeners.onMouseUpLoopStart,!1),E("mousemove",e.listeners.onCursorMoveLoopStart,!1),E("touchmove",e.listeners.onCursorMoveLoopStart,!1)},e.elements.loopBarStart.addEventListener("mousedown",e.listeners.onMouseDownLoopStart,!1),e.elements.loopBarStart.addEventListener("touchstart",e.listeners.onMouseDownLoopStart,{passive:!1},!1)}(this),function(e){e.listeners.editableLoopStartTime=function(){e.elements.editableLoopStartTime.value=e.elements.loopStartTime.innerHTML,e.elements.loopStartTime.replaceWith(e.elements.editableLoopStartTime),e.elements.editableLoopStartTime.focus()},e.listeners.editableLoopEndTime=function(){e.elements.editableLoopEndTime.value=e.elements.loopEndTime.innerHTML,e.elements.loopEndTime.replaceWith(e.elements.editableLoopEndTime),e.elements.editableLoopEndTime.focus()},e.elements.editableLoopEndTime.onkeydown=e.elements.editableLoopStartTime.onkeydown=function(t){t.preventDefault(),13===t.keyCode&&(e.elements.editableLoopStartTime.onfocusout(),e.elements.editableLoopEndTime.onfocusout()),8===t.keyCode&&(t.target.value=t.target.value.toString().substring(0,t.target.value.toString().length-1)),13===t.keyCode&&t.target.blur();var n=parseFloat((t.target.value||0).toString()+t.key);if(!(n>e.clip.duration))if(t.target.value=n,t.target===e.elements.editableLoopStartTime){var o=e.elements.totalBar.getBoundingClientRect(),s={preventDefault:function(){},clientX:e.elements.totalBar.offsetWidth/e.clip.duration*t.target.value+o.left};e.listeners.onMouseDownLoopStart(s),e.listeners.onCursorMoveLoopStart(s),e.listeners.onMouseUpLoopStart(s)}else if(t.target===e.elements.editableLoopEndTime){var i=e.elements.totalBar.getBoundingClientRect(),a={preventDefault:function(){},clientX:e.elements.totalBar.offsetWidth/e.clip.duration*t.target.value+i.left};e.listeners.onMouseDownLoopEnd(a),e.listeners.onCursorMoveLoopEnd(a),e.listeners.onMouseUpLoopEnd(a)}},e.elements.loopStartTime.onclick=e.listeners.editableLoopStartTime,e.elements.loopEndTime.onclick=e.listeners.editableLoopEndTime,e.elements.editableLoopStartTime.onfocusout=function(){e.elements.editableLoopStartTime.replaceWith(e.elements.loopStartTime)},e.elements.editableLoopEndTime.onfocusout=function(){e.elements.editableLoopEndTime.replaceWith(e.elements.loopEndTime)}}(this),M(this),function(e){e.elements.statusButton.onclick=function(t){return t.preventDefault(),"playing"===e.clip.runTimeInfo.state?e.clip.pause():"paused"!==e.clip.runTimeInfo.state&&"idle"!==e.clip.runTimeInfo.state&&"transitional"!==e.clip.runTimeInfo.state&&"armed"!==e.clip.runTimeInfo.state||e.clip.play(),!1}}(this),O(this),j(this),_(this),function(e){K("".concat(e.name,"-controls")).onmouseover=function(){e.settings.loopActivated&&(e.elements.loopBarStart.classList.remove("m-fadeOut"),e.elements.loopBarEnd.classList.remove("m-fadeOut"),e.elements.loopBarStart.classList.add("m-fadeIn"),e.elements.loopBarEnd.classList.add("m-fadeIn"))},K("".concat(e.name,"-controls")).onmouseout=function(t){var n=t.toElement||t.relatedTarget||t.target;Q(this,n)||n===this||e.settings.loopActivated&&(e.elements.loopBarStart.classList.add("m-fadeOut"),e.elements.loopBarEnd.classList.add("m-fadeOut"),e.elements.loopBarStart.classList.remove("m-fadeIn"),e.elements.loopBarEnd.classList.remove("m-fadeIn"))};var t=!1;K("".concat(e.name,"-controls")).ontouchstart=function(n){var o=n.toElement||n.relatedTarget||n.target;Q(e.elements.statusButton,o)||o===e.elements.statusButton||Q(e.elements.settingsButton,o)||o===e.elements.settingsButton||Q(e.elements.fullScreenButton,o)||o===e.elements.fullScreenButton||Q(e.elements.loopButton,o)||o===e.elements.loopButton||Q(e.elements.totalBar,o)||o===e.elements.totalBar||(e.elements.settings.showVolume&&(e.elements.volumeControl.className="".concat(e.name,"-volume-width-transition"),e.elements.volumeBar.className="".concat(e.name,"-volume-width-transition"),e.elements.volumeBarHelper.className="".concat(e.name,"-volume-width-transition")),e.elements.timeDisplay.className="".concat(e.name,"-time-width-transition"),e.elements.volumeCursor.className="".concat(e.name,"-volume-cursor-transition"),t=!0)},window.addEventListener("touchstart",(function(n){var o=n.toElement||n.relatedTarget||n.target;Q(K("".concat(e.name,"-controls")),o)||o===K("".concat(e.name,"-controls"))||t&&(e.elements.volumeControl.className="",e.elements.volumeBar.className="",e.elements.volumeBarHelper.className="",e.elements.timeDisplay.className="",e.elements.volumeCursor.className="")}))}(this),ee(this),function(e){e.elements.donkeyclipButton.addEventListener("click",(function(){var t=te(),n=window.open("https://donkeyclip.com?u=".concat(t)),o=e.clip.exportDefinition(),s=e.clipClass;window.addEventListener("message",(function(e){e.data===t&&n.postMessage(JSON.stringify({definition:o,clipClass:s,u:t}),"*")}),!1)}))}(this),function(e){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){var t=function(){e.options.preview&&(ne("".concat(e.name,"-hover-display")).classList.toggle("m-fadeIn"),ne("".concat(e.name,"-hover-display")).classList.toggle("m-fadeOut"),e.elements.loopBar.onmousemove=o)},n=function n(){e.options.preview&&(t(),e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=t,e.elements.loopBar.onmousemove=o,se("mouseup",n,!1),se("touchend",n,!1),se("mousemove",o,!1),se("touchmove",o,!1))};e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=t,e.elements.loopBar.onmousedown=function(){e.options.preview&&(e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=null,e.elements.loopBar.onmousemove=null,oe("mouseup",n,!1),oe("touchend",n,!1),oe("mousemove",o,!1),oe("touchmove",o,!1))},e.elements.loopBar.onmouseup=function(){e.options.preview&&(se("mouseup",n,!1),se("touchend",n,!1),se("mousemove",o,!1),se("touchmove",o,!1),e.elements.loopBar.onmouseover=e.elements.loopBar.onmouseout=t,e.elements.loopBar.onmousemove=o)};var o=function(t){var n=t.clientX,o=e.elements.loopBar.getBoundingClientRect();if(n-o.left+e.settings.loopLastPositionXPxls>e.settings.loopLastPositionXPxls+e.elements.loopBar.offsetWidth&&!e.settings.resizeLoop)ne("".concat(e.name,"-hover-millisecond")).innerHTML=e.timeFormat(e.settings.loopEndMillisecond);else if(n-o.left<0&&!e.settings.resizeLoop)ne("".concat(e.name,"-hover-millisecond")).innerHTML=e.timeFormat(e.settings.loopStartMillisecond);else{var s=n-o.left+e.settings.loopLastPositionXPxls;s<0&&(s=0);var i=ne("".concat(e.name,"-hover-display")).offsetWidth/2,a=ne("".concat(e.name,"-hover-display")).offsetWidth/2,l=s-a;s-i<0?l=0:s+i>e.elements.totalBar.offsetWidth&&(l=e.elements.totalBar.offsetWidth-a-i);var r=Math.round(s/e.elements.totalBar.offsetWidth*e.clip.duration);if(e.options.preview){var c=r/e.clip.duration;e.previewClip.onProgress(c,r)}ne("".concat(e.name,"-hover-millisecond")).innerHTML=e.timeFormat(r),ne("".concat(e.name,"-hover-display")).style.left=l+"px"}}}}(this),function(e){document.addEventListener("fullscreenchange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),document.addEventListener("webkitfullscreenchange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),document.addEventListener("mozfullscreenchange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),document.addEventListener("MSFullscreenChange",(function(){e.elements.mcPlayer.classList.toggle("full-screen"),e.clip.props.host.classList.toggle("full-screen"),e.options.preview&&e.setPreviewDimentions()})),ie("body")[0].addEventListener("click",(function(t){if(t.target.className==="".concat(e.name,"-speed-value")){var n=t.target.dataset.speedValue-0;e.clip.executionSpeed=t.target.dataset.speedValue,n=1==e.clip.speed?"Normal":e.clip.speed,e.elements.speedCurrent.innerHTML=n;var o=1/(e.options.speedValues.length-1),s=-1*(t.target.dataset.zone*o-1)*(16*(e.options.speedValues.length-1));ae("".concat(e.name,"-speed-cursor")).style.top=s+"px"}}))}(this)}},{key:"launchIntoFullscreen",value:function(e){this.options.preview&&this.setPreviewDimentions(),e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}},{key:"exitFullscreen",value:function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}},{key:"setTheme",value:function(){re(this.name+"-style")&&ce("head")[0].removeChild(re(this.name+"-style")),this.options.theme.replace(/\s\s+/g," "),this.options.theme.trim(),this.options.theme.includes("on-top")||this.options.theme.includes("position-bottom")||(this.options.theme+=" on-top");var e={};for(var t in this.options.theme.split(" ")){var n=b(this.options.theme.split(" ")[t],this.name);for(var o in n||{})e[o]=n[o]}var s=function(e,t,n){return"\n#".concat(t,", #").concat(t," *{\n font-family:'Ubuntu' !important;\n}\n#").concat(t," .background {\n background-color: ").concat(n.backgroundColor,";\n width:100%;\n height:").concat(e["background-height"],";;\n position:absolute;\n top:0px;\n left:0px;\n z-index:-2000;\n}\n\n#").concat(t," .full-screen #").concat(t,"-controls {\n position:fixed;\n left:0px;\n bottom:0px;\n}\n\n#").concat(t," .full-screen #").concat(t,"-settings-panel {\n position:fixed;\n bottom: 45px;\n}\n\n#").concat(t," .svg,#").concat(t," .svg *,#").concat(t," svg,#").concat(t," svg * {\n fill: ").concat(e["svg-color"],";\n}\n\n#").concat(t," .svg.arrow * {\n stroke: ").concat(e["svg-color"],";\n fill: transparent;\n}\n\n#").concat(t," .pointer-event-panel {\n height: ").concat(e["pointer-event-panel-height"],";\n display:flex;\n align-items:center;\n justify-content:center;\n}\n#").concat(t,"-pointer-event-panel{\n width:100%;\n position:absolute;\n z-index:100;\n}\n#").concat(t,"-listener-helper{\n width:100%;\n height:calc( 100% - 45px );\n position:absolute;\n z-index:110;\n}\n#").concat(t," .svg-selected svg{\n fill: ").concat(e["svg-selected-color"],";\n stroke: ").concat(e["svg-selected-color"],";\n}\n#").concat(t,"-hover-display{\n display: flex;\n visibility:hidden;\n opacity:0;\n background-color: black;\n position: absolute;\n bottom: 30px;\n left: 0px;\n align-items: flex-end;\n justify-content: center;\n}\n#").concat(t,"-hover-display-clip{\n width:100%;\n height:100%;\n overflow:hidden;\n position:relative;\n}\n#").concat(t,"-hover-display-border{\n border: ").concat(e["preview-border"],";\n position:absolute;\n width:calc(100% - 4px);\n height:calc(100% - 4px);\n z-index:2;\n}\n\n#").concat(t,"-hover-millisecond {\n font-weight:bold;\n padding:3px;\n height:18px;\n margin:0px;\n line-height:12px;\n font-size:10px;\n text-align: center;\n min-width:20px;\n max-width:100px;\n z-index:2;\n position:absolute;\n bottom:-25px;\n}\n#").concat(t,",\n#").concat(t," ::before,\n#").concat(t," :::after,\n#").concat(t," div,\n#").concat(t," p,\n#").concat(t," span,\n#").concat(t," ul,\n#").concat(t," li {\n font-weight: 400;\n line-height: 1.9 !important;\n color: ").concat(e.color,';\n font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;\n box-sizing:border-box;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n#').concat(t," {\n line-height: 1.9;\n font-size: 12px;\n overflow:hidden;\n height: calc(100% + ").concat(e["controls-position"],");\n width:100%;\n position: absolute;\n top: 0px;\n left: 0px;\n color: ").concat(e.color,";\n pointer-events:auto;\n}\n\n#").concat(t," .force-show-controls {\n opacity:1 !important;\n}\n\n").concat(n.theme.includes("position-bottom")?"\n #".concat(t,"-controls {\n opacity:1 !important;\n }\n "):"#".concat(t,":hover #").concat(t,"-controls {\n opacity:1 !important;\n}\n"),"\n\n#").concat(t,":hover {\n pointer-events:none;\n}\n\n#").concat(t,"-settings-speed-hide {\n text-align:right;\n}\n\n#").concat(t," .grad {\n pointer-events:none !important;\n background-image: linear-gradient(\n rgba(0,0,0,00.001),\n rgba(0,0,0,00.004),\n rgba(0,0,0,00.007),\n rgba(0,0,0,00.01),\n rgba(0,0,0,0.04),\n rgba(0,0,0,0.07),\n rgba(0,0,0,0.1),\n rgba(0,0,0,0.15),\n rgba(0,0,0,0.2),\n rgba(0,0,0,0.25),\n rgba(0,0,0,0.3),\n rgba(0,0,0,0.35),\n rgba(0,0,0,0.4),\n rgba(0,0,0,0.45),\n rgba(0,0,0,0.5),\n rgba(0,0,0,0.55),\n rgba(0,0,0,0.6),\n rgba(0,0,0,0.65),\n rgba(0,0,0,0.7),\n rgba(0,0,0,0.75),\n rgba(0,0,0,0.8),\n rgba(0,0,0,0.88)\n );\n position:absolute;\n width:100%;\n height:").concat(e["grad-height"],";\n left:0px;\n bottom:0px;\n z-index:-1;\n}\n\n#").concat(t," #").concat(t,"-controls {\n touch-action: none;\n background-color: ").concat(e["background-color"],";\n border: ").concat(e["controls-border"],";\n position: absolute;\n bottom: ").concat(e["controls-bottom"],";\n left: 0px;\n width: 100%;\n z-index:100;\n height: 44px;\n opacity:0;\n display:flex;\n border-radius: 6px;\n align-items:center;\n -webkit-transition: opacity 0.2s ease;\n -moz-transition: opacity 0.2s ease;\n transition: opacity 0.2s ease;\n}\n\n#").concat(t," #").concat(t,"-totalbar {\n width: calc(100% - 20px);\n height: 5px;\n margin: 0px 10px 0px 10px;\n background-color: ").concat(e["totalbar-color"],";\n position: absolute;\n top: 0px;\n left: 0px;\n}\n\n#").concat(t," #").concat(t,"-loopbar {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0px;\n left: 0px;\n background-color: ").concat(e["loopbar-color"],";\n}\n\n#").concat(t," .").concat(t,"-loop-boundaries::before {\n ").concat(e["loopbar-boundaries-style::before"],"\n\n}\n#").concat(t," .").concat(t,"-loop-boundaries {\n transform:translate(-50%,-37%);\n position:absolute;\n width:18px;\n background-color:").concat(e["loopbar-boundaries-color"],";\n height:18px;\n border-radius:10px;\n z-index:40;\n ").concat(e["loopbar-boundaries-style"],"\n}\n\n#").concat(t," .").concat(t,"-loop-boundaries::after {\n ").concat(e["loopbar-boundaries-style::after"],"\n\n}\n\n#").concat(t," #").concat(t,"-helperbar {\n position: absolute;\n height: 20px;\n top: -10px;\n left: 0px;\n right: 0px;\n z-index:2;\n}\n\n#").concat(t," #").concat(t,"-runningbar {\n position: relative;\n width: 0px;\n max-width:100%;\n height: 100%;\n background-color: ").concat(e["runningbar-color"],";\n}\n\n#").concat(t," #").concat(t,"-cursor {\n transform:translate(50%,-36%);\n right: 0px;\n overflow:hidden;\n top: 0px;\n width: 0px;\n height: 0px;\n position: absolute;\n background-color: ").concat(e["cursor-color"],";\n border-radius: 10px;\n z-index: 5;\n}\n\n#").concat(t," #").concat(t,"-cursor::before {\n ").concat(e["cursor-style::before"],"\n}\n\n#").concat(t," #").concat(t,"-cursor::after {\n ").concat(e["cursor-style::after"],"\n}\n\n#").concat(t," #").concat(t,"-left-controls,#").concat(t," #").concat(t,"-right-controls {\n display: flex;\n align-items:center;\n height: 100%;\n padding: 5px 5px 0px;\n}\n#").concat(t," #").concat(t,"-right-controls {\n position:absolute;\n right:0px;\n}\n\n\n#").concat(t," #").concat(t,"-left-controls > div,#").concat(t," #").concat(t,"-right-controls > div {\n display: inline-flex;\n align-items:center;\n margin:0 10px 0 10px;\n overflow:hidden;\n}\n\n\n#").concat(t," #").concat(t,"-time-display span {\n display: table-cell;\n vertical-align: middle;\n}\n\n#").concat(t," #").concat(t,"-status-btn {\n opacity: ").concat(e["button-opacity"],";\n}\n#").concat(t," #").concat(t,"-status-btn svg{\n width:20px;\n height:18px;\n}\n#").concat(t," #").concat(t,"-volume {\n opacity: ").concat(e["button-opacity"],";\n position: relative;\n}\n#").concat(t," #").concat(t,"-volume-btn {\n width: 20px;\n height: 15px;\n}\n\n#").concat(t," #").concat(t,"-volumebar {\n width: 0px;\n height: 3px;\n background-color: ").concat(e["loopbar-color"],";\n -webkit-transition: left 0.1s ease;\n -moz-transition: left 0.1s ease;\n transition: left 0.1s ease;\n position:relative;\n left:5px;\n}\n\n#").concat(t," #").concat(t,"-volumebar-helper {\n position: absolute;\n width: 0px;\n height: 15px;\n bottom: 0px;\n z-index: 10;\n left: 25px;\n}\n\n#").concat(t," #").concat(t,"-volumebar-active {\n position: relative;\n width: 0%;\n height: 100%;\n background-color: ").concat(e.color,";\n position:relative;\n bottom:0px;\n}\n\n#").concat(t," #").concat(t,"-volume-cursor {\n transform:translate(50%,-36%);\n right: 0px;\n top: 0px;\n width: 0px;\n height: 0px;\n position: absolute;\n background-color: ").concat(e.color,";\n border-radius: 10px;\n z-index: 5;\n}\n\n#").concat(t," .").concat(t,"-loopbar-time {\n width:auto;\n height:12px;\n background-color:").concat(e["background-color"],";\n line-height:10px;\n font-size:10px;\n}\n\n#").concat(t," #").concat(t,"-loop-time {\n margin: 7px;\n}\n\n#").concat(t," #").concat(t,"-dc-btn {\n background-repeat: no-repeat;\n background-size: 100% 100%;\n width: 20px;\n height: 15px;\n margin: 7px 10px 5px 0px;\n transform: scale(1.5,1.5);\n}\n\n#").concat(t," #").concat(t,"-loop-btn {\n opacity: ").concat(e["button-opacity"],";\n display:flex;\n align-items:center;\n}\n\n\n#").concat(t," #").concat(t,"-settings-btn {\n overflow:hidden;\n opacity: ").concat(e["button-opacity"],";\n}\n\n#").concat(t," #").concat(t,"-full-screen-btn {\n opacity: ").concat(e["button-opacity"],";\n}\n\n#").concat(t," .").concat(t,"-speed-btn {\n opacity: ").concat(e["button-opacity"],";\n height: 14px;\n}\n\n#").concat(t," #").concat(t,"-settings-panel {\n touch-action: none;\n box-sizing: border-box;\n position: absolute;\n z-index:102;\n background-color: ").concat(e["settings-background-color"],";\n bottom: ").concat(e["settings-panel-bottom"],";\n border: ").concat(e.border,";\n right: 8px;\n width: 167px;\n padding: 5px;\n margin: 0px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," .").concat(t,"-hide {\n display:none !important;\n}\n\n#").concat(t," #").concat(t,"-speed-value-bar {\n position: relative;\n width: 5px;\n background-color: ").concat(e["speedbar-color"],";\n display: inline-block;\n box-sizing: border-box;\n height: ").concat(16*n.speedValues.length,"px;\n float: left;\n margin-right:15px;\n}\n\n#").concat(t," #").concat(t,"-speed-value-helperbar {\n position: absolute;\n width: 25px;\n height: ").concat(16*n.speedValues.length,"px;\n float: left;\n left: 18px;\n z-index:10;\n}\n\n\n#").concat(t," #").concat(t,"-speed-value-bar:hover,\n#").concat(t," #").concat(t,"-speed-value-helperbar {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-volumebar:hover,\n#").concat(t," #").concat(t,"-volumebar-helper:hover,\n#").concat(t," #").concat(t,"-volume-btn:hover,\n#").concat(t," #").concat(t,"-volumebar:active,\n#").concat(t," #").concat(t,"-volumebar-helper:active,\n#").concat(t," #").concat(t,"-volume-btn:active {\n cursor:pointer;\n}\n\n#").concat(t," #").concat(t,"-speed-cursor {\n position: absolute;\n background-color: ").concat(e["speedbar-cursor-color"],";\n top: 0px;\n left: 0px;\n}\n\n#").concat(t," #").concat(t,"-speed-cursor div {\n position: absolute;\n background-color: ").concat(e["speedbar-cursor-color"],";\n left: -2.5px;\n top: -4px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n}\n\n#").concat(t," #").concat(t,"-time-separator{\n margin:0 3px;\n}\n#").concat(t," #").concat(t,"-speed-cursor:hover {\n cursor: pointer;\n}\n\n#").concat(t," .").concat(t,"-speed-value-step {\n width: 16px;\n background-color: ").concat(e["speedbar-color"],";\n display: inline-block;\n box-sizing: border-box;\n height: 2px;\n margin-top: 7px;\n margin-bottom: 7px;\n float: left;\n}\n\n#").concat(t," #").concat(t,"-speed-value {\n display: inline-block;\n box-sizing: border-box;\n height: ").concat(16*n.speedValues.length,"px;\n text-align: left;\n}\n\n#").concat(t," .").concat(t,"-speed-value {\n box-sizing: border-box;\n height: 16px;\n font-size: 12px;\n}\n\n#").concat(t," #").concat(t,"-indicator {\n font-size: 8px !important;\n position: absolute;\n bottom: -3px;\n color: ").concat(e.color,";\n}\n\n\n#").concat(t," #").concat(t,"-speed-settings li.no-hover { \n height: ").concat(16*n.speedValues.length+10-2,"px !important; \n}\n\n#").concat(t," #").concat(t,"-settings-panel.").concat(t,"-settings-speed-panel {\n overflow: hidden;\n width: 92px;\n position:absolute;\n z-index:120;\n /*height: ").concat(16*n.speedValues.length+32+20,"px;*/\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-settings-panel.").concat(t,"-settings-speed-panel .").concat(t,"-speed-btn {\n float: left;\n}\n\n#").concat(t," .").concat(t,"-settings-speed-panel ul:first-child {\n text-align: right;\n}\n\n#").concat(t," #").concat(t,"-speed-current {\n float: right;\n padding-right: 10px\n}\n\n#").concat(t," #").concat(t,"-settings-panel .").concat(t,"-speed-btn {\n float: right;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul {\n width: 100%;\n margin: 0px;\n padding: 0px;\n overflow: hidden;\n}\n\n#").concat(t," #").concat(t,"-settings-panel.").concat(t,"-settings-speed-panel ul li {\n min-width: 70px;\n display: flex;\n height: 32px;\n align-items: center;\n justify-content:center;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li.no-hover:hover {\n background-color: transparent;\n cursor: default;\n}\n\n#").concat(t," div.").concat(t,"-speed-value:hover {\n background-color: ").concat(e["hover-color"],";\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li {\n /*position: relative;\n width: 100%;\n min-width: 154px;*/\n list-style-type: none;\n margin: 0px;\n padding: 5px;\n display: flex;\n height:32px;\n align-items:center;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li label {\n margin: 0px;\n}\n\n#").concat(t," .switch {\n position: relative;\n display: inline-block;\n width: 32px;\n height: 18px;\n}\n\n#").concat(t," .switch input {\n display: none;\n}\n\n#").concat(t," .settings-switch {\n position: absolute;\n right: 24px;\n}\n\n#").concat(t," .settings-switch::after {\n clear: both;\n}\n\n#").concat(t," .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ").concat(e["slider-off-color"],";\n -webkit-transition: .4s;\n transition: .4s;\n}\n\n#").concat(t,' .slider:before {\n position: absolute;\n content: "";\n height: 16px;\n width: 16px;\n left: 1px;\n bottom: 1px;\n background-color: white;\n -webkit-transition: .4s;\n transition: .4s;\n}\n\n#').concat(t," input:checked+.slider {\n background-color: ").concat(e["slider-on-color"],";\n}\n\n#").concat(t," input:focus+.slider {\n box-shadow: 0 0 1px ").concat(e["slider-on-color"],";\n}\n\n#").concat(t," input:checked+.slider:before {\n -webkit-transform: translateX(16px);\n -ms-transform: translateX(16px);\n transform: translateX(16px);\n}\n\n\n/* Rounded sliders */\n\n#").concat(t," .slider.round {\n border-radius: 34px;\n}\n\n#").concat(t," .slider.round:before {\n border-radius: 50%;\n}\n\n\n#").concat(t," .m-fadeOut {\n visibility: hidden !important;\n opacity: 0 !important;\n}\n\n#").concat(t," .m-fadeIn {\n visibility: visible !important;\n opacity: 1 !important;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li:hover {\n background-color: ").concat(e["hover-color"],";\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-settings-panel ul li label:hover {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-loopbar:hover {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-status-btn:hover {\n cursor: pointer;\n}\n\n#").concat(t," #").concat(t,"-controls:active #").concat(t,"-cursor,\n#").concat(t," #").concat(t,"-controls:hover #").concat(t,"-cursor {\n width: 16px;\n height: 16px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-volume .").concat(t,"-volume-cursor-transition {\n width: 12px;\n height: 12px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-volume .").concat(t,"-volume-width-transition\n {\n width: 50px;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-time-display.").concat(t,"-time-width-transition {\n position:relative;\n left: 10px;\n -webkit-transition: left 0.3s ease;\n -moz-transition: left 0.3s ease;\n transition: left 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-settings-speed:hover .").concat(t,"-speed-btn {\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-status-btn:hover {\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-loop-btn:hover,\n#").concat(t," #").concat(t,"-dc-btn:hover\n {\n cursor: pointer;\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n#").concat(t," #").concat(t,"-settings-btn:hover {\n cursor: pointer;\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n\n#").concat(t," #").concat(t,"-full-screen-btn:hover {\n cursor: pointer;\n opacity: 1;\n -webkit-transition: all 0.3s ease;\n -moz-transition: all 0.3s ease;\n transition: all 0.3s ease;\n}\n").concat(e["theme-style"],"\n")}(e,this.name,this.options),i=pe("style");i.id=this.name+"-style",i.styleSheet?i.styleSheet.cssText=s:i.appendChild(document.createTextNode(s)),ce("head")[0].appendChild(i),this.eventBroadcast("theme-change",this.options.theme)}},{key:"setSpeed",value:function(){var e,t=this;e=1==this.clip.speed?"Normal":this.clip.speed,this.elements.speedCurrent.innerHTML=e;var n=-1*(function(){for(var e=0;et.clip.speed)return e+Math.abs((t.clip.speed-t.options.speedValues[e])/(t.options.speedValues[e]-t.options.speedValues[e+1]))}()*(1/(this.options.speedValues.length-1))-1)*(this.options.speedValues.length-1)*16;re("".concat(this.name,"-speed-cursor")).style.top=n+"px"}},{key:"calculateSpeed",value:function(e,t,n){var o=Math.floor(n/e);if(o===t.length-1)return t[o].toFixed(1);var s=(n/e%1*Math.abs(t[o]-t[o+1])+t[o]).toFixed(1);return 0==s?"0.0":s}},{key:"createPreviewDisplay",value:function(){this.previewClip=this.clip.paste(re("".concat(this.name,"-hover-display-clip")));var e=re("".concat(this.name,"-hover-display"));window.previewClip=this.previewClip,e.style.position="absolute",e.style.background=this.options.backgroundColor,e.style.zIndex=1,this.setPreviewDimentions()}},{key:"setPreviewDimentions",value:function(){var e=this.clip.props.host,t=this.previewClip.ownClip.props.host,n=e.offsetWidth,o=e.offsetHeight,s=n*this.previewScale;s>300&&(s=300,this.previewScale=s/n);var i=n*this.previewScale,a=o*this.previewScale,l=de({width:this.clip.props.containerParams.width,height:this.clip.props.containerParams.height},{width:i,height:a},"cover"===this.options.scaleToFit);this.previewClip.ownClip.rootElement.style.transform="scale(".concat(l.scale),this.previewClip.ownClip.rootElement.style.left=l.position.left+"px",this.previewClip.ownClip.rootElement.style.top=l.position.top+"px",re("".concat(this.name,"-hover-display")).style.width=i+"px",re("".concat(this.name,"-hover-display")).style.height=a+"px",t.style.boxSizing="border-box"}}])&&s(t.prototype,n),o&&s(t,o),e}()})); /***/ }), -/* 4 */ +/* 3 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(Promise) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } @@ -1046,22 +1083,30 @@ process.umask = function() { return 0; }; }(this, function (t) { "use strict"; - function n(t, n) { + function n(t) { + return t && "object" == _typeof(t) && "default" in t ? t : { + default: t + }; + } + + var e = n(t); + + function o(t, n) { if (!(t instanceof n)) throw new TypeError("Cannot call a class as a function"); } - function e(t, n) { + function r(t, n) { for (var e = 0; e < n.length; e++) { var o = n[e]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } - function o(t, n, o) { - return n && e(t.prototype, n), o && e(t, o), t; + function i(t, n, e) { + return n && r(t.prototype, n), e && r(t, e), t; } - function r(t, n, e) { + function a(t, n, e) { return n in t ? Object.defineProperty(t, n, { value: e, enumerable: !0, @@ -1070,7 +1115,7 @@ process.umask = function() { return 0; }; }) : t[n] = e, t; } - function i(t, n) { + function s(t, n) { var e = Object.keys(t); if (Object.getOwnPropertySymbols) { @@ -1083,7 +1128,20 @@ process.umask = function() { return 0; }; return e; } - function a(t, n) { + function p(t) { + for (var n = 1; n < arguments.length; n++) { + var e = null != arguments[n] ? arguments[n] : {}; + n % 2 ? s(Object(e), !0).forEach(function (n) { + a(t, n, e[n]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : s(Object(e)).forEach(function (n) { + Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n)); + }); + } + + return t; + } + + function u(t, n) { if ("function" != typeof n && null !== n) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(n && n.prototype, { constructor: { @@ -1091,82 +1149,81 @@ process.umask = function() { return 0; }; writable: !0, configurable: !0 } - }), n && p(t, n); + }), n && c(t, n); } - function s(t) { - return (s = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { + function l(t) { + return (l = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } - function p(t, n) { - return (p = Object.setPrototypeOf || function (t, n) { + function c(t, n) { + return (c = Object.setPrototypeOf || function (t, n) { return t.__proto__ = n, t; })(t, n); } - function u() { - if ("undefined" == typeof Reflect || !Reflect.construct) return !1; - if (Reflect.construct.sham) return !1; - if ("function" == typeof Proxy) return !0; - - try { - return Date.prototype.toString.call(Reflect.construct(Date, [], function () {})), !0; - } catch (t) { - return !1; - } - } - - function l(t, n) { + function f(t, n) { return !n || "object" != _typeof(n) && "function" != typeof n ? function (t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t; }(t) : n; } - function c(t) { + function y(t) { + var n = function () { + if ("undefined" == typeof Reflect || !Reflect.construct) return !1; + if (Reflect.construct.sham) return !1; + if ("function" == typeof Proxy) return !0; + + try { + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0; + } catch (t) { + return !1; + } + }(); + return function () { - var n, - e = s(t); + var e, + o = l(t); - if (u()) { - var o = s(this).constructor; - n = Reflect.construct(e, arguments, o); - } else n = e.apply(this, arguments); + if (n) { + var r = l(this).constructor; + e = Reflect.construct(o, arguments, r); + } else e = o.apply(this, arguments); - return l(this, n); + return f(this, e); }; } - t = t && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; - var f = {}, - y = { + var d = {}, + g = { duration: 1e3, round: 0 }, - d = ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "scaleZ", "skew", "skewX", "skewY", "perspective"], - g = { + h = ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "scaleZ", "skew", "skewX", "skewY", "perspective"], + m = { CSS: {} }; - function m(t, n, e) { + function b(t, n, e) { return Math.min(Math.max(t, n), e); } - function h(t, n) { + function v(t, n) { return t.indexOf(n) > -1; } - var b = { + var x = { arr: function arr(t) { return Array.isArray(t); }, obj: function obj(t) { - return h(Object.prototype.toString.call(t), "Object"); + return v(Object.prototype.toString.call(t), "Object"); }, pth: function pth(t) { - return b.obj(t) && t.hasOwnProperty("totalLength"); + return x.obj(t) && t.hasOwnProperty("totalLength"); }, svg: function svg(t) { return t instanceof SVGElement; @@ -1175,7 +1232,7 @@ process.umask = function() { return 0; }; return t instanceof HTMLInputElement; }, dom: function dom(t) { - return t.nodeType || b.svg(t); + return t.nodeType || x.svg(t); }, str: function str(t) { return "string" == typeof t; @@ -1196,13 +1253,13 @@ process.umask = function() { return 0; }; return /^hsl/.test(t); }, col: function col(t) { - return b.hex(t) || b.rgb(t) || b.hsl(t); + return x.hex(t) || x.rgb(t) || x.hsl(t); }, key: function key(t) { - return !f.hasOwnProperty(t) && !y.hasOwnProperty(t) && "targets" !== t && "keyframes" !== t; + return !d.hasOwnProperty(t) && !g.hasOwnProperty(t) && "targets" !== t && "keyframes" !== t; } }, - v = { + w = { linear: function linear() { return function (t) { return t; @@ -1210,7 +1267,7 @@ process.umask = function() { return 0; }; } }; - function x(t, n) { + function P(t, n) { for (var e = t.length, o = arguments.length >= 2 ? arguments[1] : void 0, r = [], i = 0; i < e; i++) { if (i in t) { var a = t[i]; @@ -1221,14 +1278,14 @@ process.umask = function() { return 0; }; return r; } - function w(t) { + function O(t) { return t.reduce(function (t, n) { - return t.concat(b.arr(n) ? w(n) : n); + return t.concat(x.arr(n) ? O(n) : n); }, []); } - function P(t) { - return b.arr(t) ? t : (b.str(t) && (t = function (t) { + function k(t) { + return x.arr(t) ? t : (x.str(t) && (t = function (t) { try { return document.querySelectorAll(t); } catch (t) { @@ -1237,13 +1294,13 @@ process.umask = function() { return 0; }; }(t) || t), t instanceof NodeList || t instanceof HTMLCollection ? [].slice.call(t) : [t]); } - function O(t, n) { + function S(t, n) { return t.some(function (t) { return t === n; }); } - function k(t) { + function M(t) { var n = {}; for (var e in t) { @@ -1253,8 +1310,8 @@ process.umask = function() { return 0; }; return n; } - function S(t, n) { - var e = k(t); + function j(t, n) { + var e = M(t); for (var o in t) { e[o] = n.hasOwnProperty(o) ? n[o] : t[o]; @@ -1263,24 +1320,24 @@ process.umask = function() { return 0; }; return e; } - function M(t, n) { - var e = k(t); + function C(t, n) { + var e = M(t); for (var o in n) { - e[o] = b.und(t[o]) ? n[o] : t[o]; + e[o] = x.und(t[o]) ? n[o] : t[o]; } return e; } - function j(t) { - return b.rgb(t) ? (e = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n = t)) ? "rgba(" + e[1] + ",1)" : n : b.hex(t) ? function (t) { + function R(t) { + return x.rgb(t) ? (e = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n = t)) ? "rgba(" + e[1] + ",1)" : n : x.hex(t) ? function (t) { var n = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (t, n, e, o) { return n + n + e + e + o + o; }), e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n); return "rgba(" + parseInt(e[1], 16) + "," + parseInt(e[2], 16) + "," + parseInt(e[3], 16) + ",1)"; - }(t) : b.hsl(t) ? function (t) { + }(t) : x.hsl(t) ? function (t) { var n, e, o, @@ -1304,46 +1361,46 @@ process.umask = function() { return 0; }; var n, e; } - function C(t) { + function I(t) { var n = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t); if (n) return n[1]; } - function R(t, n) { - return b.fnc(t) ? t(n.target, n.id, n.total) : t; + function T(t, n) { + return x.fnc(t) ? t(n.target, n.id, n.total) : t; } - function I(t, n) { + function E(t, n) { return t.getAttribute(n); } - function E(t, n, e) { - if (O([e, "deg", "rad", "turn"], C(n))) return n; - var o = g.CSS[n + e]; - if (!b.und(o)) return o; + function B(t, n, e) { + if (S([e, "deg", "rad", "turn"], I(n))) return n; + var o = m.CSS[n + e]; + if (!x.und(o)) return o; var r = document.createElement(t.tagName), i = t.parentNode && t.parentNode !== document ? t.parentNode : document.body; i.appendChild(r), r.style.position = "absolute", r.style.width = 100 + e; var a = 100 / r.offsetWidth; i.removeChild(r); var s = a * parseFloat(n); - return g.CSS[n + e] = s, s; + return m.CSS[n + e] = s, s; } - function T(t, n, e) { + function L(t, n, e) { if (n in t.style) { var o = n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), r = t.style[n] || getComputedStyle(t).getPropertyValue(o) || "0"; - return e ? E(t, r, e) : r; + return e ? B(t, r, e) : r; } } - function B(t, n) { - return b.dom(t) && !b.inp(t) && (I(t, n) || b.svg(t) && t[n]) ? "attribute" : b.dom(t) && O(d, n) ? "transform" : b.dom(t) && "transform" !== n && T(t, n) ? "css" : null != t[n] ? "object" : void 0; + function A(t, n) { + return x.dom(t) && !x.inp(t) && (E(t, n) || x.svg(t) && t[n]) ? "attribute" : x.dom(t) && S(h, n) ? "transform" : x.dom(t) && "transform" !== n && L(t, n) ? "css" : null != t[n] ? "object" : void 0; } - function L(t) { - if (b.dom(t)) { + function X(t) { + if (x.dom(t)) { for (var n, e = t.style.transform || "", o = /(\w+)\(([^)]*)\)/g, r = new Map(); n = o.exec(e);) { r.set(n[1], n[2]); } @@ -1352,34 +1409,34 @@ process.umask = function() { return 0; }; } } - function A(t, n, e, o) { - var r = h(n, "scale") ? 1 : 0 + function (t) { - return h(t, "translate") || "perspective" === t ? "px" : h(t, "rotate") || h(t, "skew") ? "deg" : void 0; + function Y(t, n, e, o) { + var r = v(n, "scale") ? 1 : 0 + function (t) { + return v(t, "translate") || "perspective" === t ? "px" : v(t, "rotate") || v(t, "skew") ? "deg" : void 0; }(n), - i = L(t).get(n) || r; - return e && (e.transforms.list.set(n, i), e.transforms.last = n), o ? E(t, i, o) : i; + i = X(t).get(n) || r; + return e && (e.transforms.list.set(n, i), e.transforms.last = n), o ? B(t, i, o) : i; } - function X(t, n, e, o) { - switch (B(t, n)) { + function V(t, n, e, o) { + switch (A(t, n)) { case "transform": - return A(t, n, o, e); + return Y(t, n, o, e); case "css": - return T(t, n, e); + return L(t, n, e); case "attribute": - return I(t, n); + return E(t, n); default: return t[n] || 0; } } - function Y(t, n) { + function W(t, n) { var e = /^(\*=|\+=|-=)/.exec(t); if (!e) return t; - var o = C(t) || 0, + var o = I(t) || 0, r = parseFloat(n), i = parseFloat(t.replace(e[0], "")); @@ -1395,27 +1452,27 @@ process.umask = function() { return 0; }; } } - function V(t, n) { - if (b.col(t)) return j(t); + function G(t, n) { + if (x.col(t)) return R(t); if (/\s/g.test(t)) return t; - var e = C(t), + var e = I(t), o = e ? t.substr(0, t.length - e.length) : t; return n ? o + n : o; } - function W(t, n) { + function N(t, n) { var e = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g, - o = V(b.pth(t) ? t.totalLength : t, n) + ""; + o = G(x.pth(t) ? t.totalLength : t, n) + ""; return { original: o, numbers: o.match(e) ? o.match(e).map(Number) : [0], - strings: b.str(t) || n ? o.split(e) : [] + strings: x.str(t) || n ? o.split(e) : [] }; } - function G(t) { + function z(t) { var n = function (t) { - return x(t ? w(b.arr(t) ? t.map(P) : P(t)) : [], function (t, n, e) { + return P(t ? O(x.arr(t) ? t.map(k) : k(t)) : [], function (t, n, e) { return e.indexOf(t) === n; }); }(t); @@ -1426,28 +1483,28 @@ process.umask = function() { return 0; }; id: e, total: n.length, transforms: { - list: L(t) + list: X(t) } }; }); } - function N(t, n) { - var e = k(n); + function Z(t, n) { + var e = M(n); - if (b.arr(t)) { + if (x.arr(t)) { var o = t.length; - 2 === o && !b.obj(t[0]) ? t = { + 2 === o && !x.obj(t[0]) ? t = { value: t - } : b.fnc(n.duration) || (e.duration = n.duration / o); + } : x.fnc(n.duration) || (e.duration = n.duration / o); } - return (b.arr(t) ? t : [t]).map(function (t, n) { - return b.obj(t) && !b.pth(t) ? t : { + return (x.arr(t) ? t : [t]).map(function (t, n) { + return x.obj(t) && !x.pth(t) ? t : { value: t }; }).map(function (t) { - return M(t, e); + return C(t, e); }); } @@ -1458,28 +1515,28 @@ process.umask = function() { return 0; }; var e = {}; for (var o in t) { - var r = R(t[o], n); - b.arr(r) && 1 === (r = r.map(function (t) { - return R(t, n); + var r = T(t[o], n); + x.arr(r) && 1 === (r = r.map(function (t) { + return T(t, n); })).length && (r = r[0]), e[o] = r; } return e.duration = parseFloat(e.duration), e; }(o, n), i = r.value, - a = b.arr(i) ? i[1] : i, - s = C(a), - p = X(n.target, t.name, s, n), + a = x.arr(i) ? i[1] : i, + s = I(a), + p = V(n.target, t.name, s, n), u = e ? e.to.original : p, - l = b.arr(i) ? i[0] : u, - c = C(l) || C(p), + l = x.arr(i) ? i[0] : u, + c = I(l) || I(p), f = s || c; - return b.und(a) && (a = u), r.from = W(l, f), r.to = W(Y(a, l), f), r.start = e ? e.end : 0, r.end = r.start + r.duration, r.isPath = !1, r.isColor = b.col(r.from.original), r.isColor && (r.round = 1), e = r, r; + return x.und(a) && (a = u), r.from = N(l, f), r.to = N(W(a, l), f), r.start = e ? e.end : 0, r.end = r.start + r.duration, r.isPath = !1, r.isColor = x.col(r.from.original), r.isColor && (r.round = 1), e = r, r; }); } - var z = { + var _ = { css: function css(t, n, e) { return t.style[n] = e; }, @@ -1499,25 +1556,26 @@ process.umask = function() { return 0; }; } }; - function Z(t, n) { - G(t).forEach(function (t) { + function F(t, n) { + z(t).forEach(function (t) { for (var e in n) { - var o = R(n[e], t), + var o = T(n[e], t), r = t.target, - i = C(o), - a = X(r, e, i, t), - s = Y(V(o, i || C(a)), a), - p = B(r, e); - z[p](r, e, s, t.transforms, !0); + i = I(o), + a = V(r, e, i, t), + s = W(G(o, i || I(a)), a), + p = A(r, e); + + _[p](r, e, s, t.transforms, !0); } }); } - function _(t, n) { - return x(w(t.map(function (t) { + function $(t, n) { + return P(O(t.map(function (t) { return n.map(function (n) { return function (t, n) { - var e = B(t.target, n.name); + var e = A(t.target, n.name); if (e) { var o = D(n, t), @@ -1533,29 +1591,29 @@ process.umask = function() { return 0; }; }(t, n); }); })), function (t) { - return !b.und(t); + return !x.und(t); }); } - var F = 0; + var K = 0; - function $(t) { - var n = S(f, t), - e = S(y, t), + function H(t) { + var n = j(d, t), + e = j(g, t), o = function (t, n) { var e = []; for (var o in n) { - b.key(o) && e.push({ + x.key(o) && e.push({ name: o, - tweens: N(n[o], t) + tweens: Z(n[o], t) }); } return e; }(e, t), - r = G(t.targets), - i = _(r, o), + r = z(t.targets), + i = $(r, o), a = function (t, n) { var e = t.length, o = {}; @@ -1563,9 +1621,9 @@ process.umask = function() { return 0; }; return t.duration; })) : n.duration, o; }(i, e), - s = F; + s = K; - return F++, M(n, { + return K++, C(n, { id: s, children: [], animatables: r, @@ -1574,7 +1632,7 @@ process.umask = function() { return 0; }; }); } - function K(t) { + function q(t) { void 0 === t && (t = {}); var n, e = 0, @@ -1587,8 +1645,7 @@ process.umask = function() { return 0; }; return t.finished = n, n; } - var i = $(t); - r(i); + var i = H(t); function a(t, n) { n && n.seek(t); @@ -1597,7 +1654,7 @@ process.umask = function() { return 0; }; function s(t) { var s = i.duration, p = t; - i.progress = m(p / s * 100, 0, 100), i.reversePlayback = p < i.currentTime, n && function (t) { + i.progress = b(p / s * 100, 0, 100), i.reversePlayback = p < i.currentTime, n && function (t) { if (i.reversePlayback) for (var o = e; o--;) { a(t, n[o]); } else for (var r = 0; r < e; r++) { @@ -1610,23 +1667,23 @@ process.umask = function() { return 0; }; s = r.tweens, p = s.length - 1, u = s[p]; - p && (u = x(s, function (n) { + p && (u = P(s, function (n) { return t < n.end; })[0] || u); - for (var l = m(t - u.start, 0, u.duration) / u.duration, c = u.to.strings, f = u.round, y = [], d = u.to.numbers.length, g = void 0, h = 0; h < d; h++) { - var b = void 0, + for (var l = b(t - u.start, 0, u.duration) / u.duration, c = u.to.strings, f = u.round, y = [], d = u.to.numbers.length, g = void 0, h = 0; h < d; h++) { + var m = void 0, v = u.to.numbers[h], - w = u.from.numbers[h] || 0; - b = w + l * (v - w), f && (u.isColor && h > 2 || (b = Math.round(b * f) / f)), y.push(b); + x = u.from.numbers[h] || 0; + m = x + l * (v - x), f && (u.isColor && h > 2 || (m = Math.round(m * f) / f)), y.push(m); } - var P = c.length; + var w = c.length; - if (P) { + if (w) { g = c[0]; - for (var O = 0; O < P; O++) { + for (var O = 0; O < w; O++) { c[O]; var k = c[O + 1], S = y[O]; @@ -1634,84 +1691,84 @@ process.umask = function() { return 0; }; } } else g = y[0]; - z[r.type](a.target, r.property, g, a.transforms), r.currentValue = g, n++; + _[r.type](a.target, r.property, g, a.transforms), r.currentValue = g, n++; } - }(p), i.currentTime = m(p, 0, s), t >= s && (i.paused = !0, i.completed || (i.completed = !0, !i.passThrough && "Promise" in window && (o(), r(i)))); + }(p), i.currentTime = b(p, 0, s), t >= s && (i.paused = !0, i.completed || (i.completed = !0, !i.passThrough && "Promise" in window && (o(), r(i)))); } - return i.reset = function () { + return r(i), i.reset = function () { i.passThrough = !1, i.currentTime = 0, i.progress = 0, i.paused = !0, i.began = !1, i.completed = !1, i.reversePlayback = !1, n = i.children; for (var t = e = n.length; t--;) { i.children[t].reset(); } }, i.set = function (t, n) { - return Z(t, n), i; + return F(t, n), i; }, i.seek = function (t) { s(t); }, i.reset(), i; } - function H(t, n) { + function U(t, n) { return Math.sqrt(Math.pow(n.x - t.x, 2) + Math.pow(n.y - t.y, 2)); } - function q(t) { + function J(t) { for (var n, e = t.points, o = 0, r = 0; r < e.numberOfItems; r++) { var i = e.getItem(r); - r > 0 && (o += H(n, i)), n = i; + r > 0 && (o += U(n, i)), n = i; } return o; } - function U(t) { + function Q(t) { if (t.getTotalLength) return t.getTotalLength(); switch (t.tagName.toLowerCase()) { case "circle": return function (t) { - return 2 * Math.PI * I(t, "r"); + return 2 * Math.PI * E(t, "r"); }(t); case "rect": return function (t) { - return 2 * I(t, "width") + 2 * I(t, "height"); + return 2 * E(t, "width") + 2 * E(t, "height"); }(t); case "line": return function (t) { - return H({ - x: I(t, "x1"), - y: I(t, "y1") + return U({ + x: E(t, "x1"), + y: E(t, "y1") }, { - x: I(t, "x2"), - y: I(t, "y2") + x: E(t, "x2"), + y: E(t, "y2") }); }(t); case "polyline": - return q(t); + return J(t); case "polygon": return function (t) { var n = t.points; - return q(t) + H(n.getItem(n.numberOfItems - 1), n.getItem(0)); + return J(t) + U(n.getItem(n.numberOfItems - 1), n.getItem(0)); }(t); } } - function J(t, n) { + function tt(t, n) { var e = n || {}, o = e.el || function (t) { - for (var n = t.parentNode; b.svg(n) && b.svg(n.parentNode);) { + for (var n = t.parentNode; x.svg(n) && x.svg(n.parentNode);) { n = n.parentNode; } return n; }(t), r = o.getBoundingClientRect(), - i = I(o, "viewBox"), + i = E(o, "viewBox"), a = r.width, s = r.height, p = e.viewBox || (i ? i.split(" ") : [0, 0, a, s]); @@ -1728,17 +1785,17 @@ process.umask = function() { return 0; }; }; } - K.version = "3.1.0", K.get = X, K.set = Z, K.convertPx = E, K.penner = v, K.path = function (t) { + q.version = "3.1.0", q.get = V, q.set = F, q.convertPx = B, q.penner = w, q.path = function (t) { return { el: t, - svg: J(t), - totalLength: U(t), + svg: tt(t), + totalLength: Q(t), deltaCorrections: { x: 4, y: 5 } }; - }, K.getPathProgress = function (t, n, e) { + }, q.getPathProgress = function (t, n, e) { function o(e) { void 0 === e && (e = 0); var o = n * t.totalLength, @@ -1746,7 +1803,7 @@ process.umask = function() { return 0; }; return t.el.getPointAtLength(r); } - var r = J(t.el, t.svg), + var r = tt(t.el, t.svg), i = o(), a = o(-1), s = o(1); @@ -1756,92 +1813,79 @@ process.umask = function() { return 0; }; angle: 180 * Math.atan2(s.y - a.y, s.x - a.x) / Math.PI }; }; - var Q = K, - tt = { + var nt = q, + et = { transform: ["translateX", "translateY", "translateZ", "rotate", "rotateX", "rotateY", "rotateZ", "scale", "scaleX", "scaleY", "scaleZ", "skewX", "skewY", "perspective"] }; - var nt = ["cm", "mm", "in", "px", "pt", "pc", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax", "%"], - et = ["deg", "rad", "grad", "turn"], - ot = "measurement", - rt = "color"; + var ot = ["cm", "mm", "in", "px", "pt", "pc", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax", "%"], + rt = ["deg", "rad", "grad", "turn"], + it = "measurement", + at = "color"; return { npm_name: "@kissmybutton/motorcortex-anime", - version: "2.1.12", + version: "2.1.13", incidents: [{ exportable: function (t) { - a(s, t); - var e = c(s); + u(e, t); + var n = y(e); - function s() { - return n(this, s), e.apply(this, arguments); + function e() { + return o(this, e), n.apply(this, arguments); } - return o(s, [{ + return i(e, [{ key: "onGetContext", value: function value() { var t = {}; - if (Object.prototype.hasOwnProperty.call(tt, this.attributeKey)) for (var n = tt[this.attributeKey], e = 0; e < n.length; e++) { - Object.prototype.hasOwnProperty.call(this.targetValue, n[e]) && (t[n[e]] = [this.getInitialValue()[n[e]], this.targetValue[n[e]]]); - } else t[this.attributeKey] = [this.getInitialValue(), this.targetValue]; - this.target = Q(function (t) { - for (var n = 1; n < arguments.length; n++) { - var e = null != arguments[n] ? arguments[n] : {}; - n % 2 ? i(Object(e), !0).forEach(function (n) { - r(t, n, e[n]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : i(Object(e)).forEach(function (n) { - Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n)); - }); - } - - return t; - }({ + if (Object.prototype.hasOwnProperty.call(et, this.attributeKey)) for (var n = et[this.attributeKey], e = 0; e < n.length; e++) { + Object.prototype.hasOwnProperty.call(this.targetValue, n[e]) && (t[n[e]] = [this.initialValue[n[e]], this.targetValue[n[e]]]); + } else t[this.attributeKey] = [this.initialValue, this.targetValue]; + this.target = nt(p(p({ autoplay: !1, duration: this.props.duration, easing: "linear", targets: this.element - }, (this.attrs || {}).attrs || {}, {}, t)); + }, (this.attrs || {}).attrs || {}), t)); } }, { key: "getScratchValue", value: function value() { - if ("transform" === this.attributeKey) { - for (var t = {}, n = tt[this.attributeKey], e = function (t, n) { - var e = t.getComputedStyle(n).transform; - if ("" === e || "none" === e) return {}; - var o, - r, - i, - a, - s, - p, - u, - l, - c = e.split("(")[1].split(")")[0].split(","); - return o = c, r = Math.atan2(o[1], o[0]), i = Math.pow(o[0], 2) + Math.pow(o[1], 2), a = Math.pow(o[2], 2) + Math.pow(o[3], 2), s = Math.sqrt(i), p = (o[0] * o[3] - o[2] * o[1]) / s, u = Math.atan2(o[0] * o[2] + o[1] * o[3], i), l = Math.atan2(o[1] * o[3] + o[0] * o[2], a), { - rotate: r / (Math.PI / 180) + "deg", - scaleX: s, - scaleY: p, - skewX: (1 === i ? u / (Math.PI / 180) : 0) + "deg", - skewY: (1 === a ? l / (Math.PI / 180) : 0) + "deg", - translateX: o[4] + "px", - translateY: o[5] + "px" - }; - }(this.context.window, this.element), o = 0; o < n.length; o++) { - Object.prototype.hasOwnProperty.call(e, n[o]) ? t[n[o]] = e[n[o]] : t[n[o]] = Q.get(this.element, n[o]); - } - - return t; + if ("transform" !== this.attributeKey) return nt.get(this.element, this.attributeKey); + + for (var t = {}, n = et[this.attributeKey], e = function (t, n) { + var e = t.getComputedStyle(n).transform; + if ("" === e || "none" === e) return {}; + var o, + r, + i, + a, + s, + p, + u, + l, + c = e.split("(")[1].split(")")[0].split(","); + return o = c, r = Math.atan2(o[1], o[0]), i = Math.pow(o[0], 2) + Math.pow(o[1], 2), a = Math.pow(o[2], 2) + Math.pow(o[3], 2), s = Math.sqrt(i), p = (o[0] * o[3] - o[2] * o[1]) / s, u = Math.atan2(o[0] * o[2] + o[1] * o[3], i), l = Math.atan2(o[1] * o[3] + o[0] * o[2], a), { + rotate: r / (Math.PI / 180) + "deg", + scaleX: s, + scaleY: p, + skewX: (1 === i ? u / (Math.PI / 180) : 0) + "deg", + skewY: (1 === a ? l / (Math.PI / 180) : 0) + "deg", + translateX: o[4] + "px", + translateY: o[5] + "px" + }; + }(this.context.window, this.element), o = 0; o < n.length; o++) { + t[n[o]] = Object.prototype.hasOwnProperty.call(e, n[o]) ? e[n[o]] : nt.get(this.element, n[o]); } - return Q.get(this.element, this.attributeKey); + return t; } }, { key: "onProgress", value: function value(t) { return this.target.seek(this.target.duration * t); } - }]), s; - }(t.Effect), + }]), e; + }(e.default.Effect), name: "Anime", attributesValidationRules: { animatedAttrs: { @@ -1849,11 +1893,11 @@ process.umask = function() { return 0; }; props: { background: { optional: !0, - type: rt + type: at }, backgroundColor: { optional: !0, - type: rt + type: at }, backgroundPosition: { optional: !0, @@ -1873,53 +1917,53 @@ process.umask = function() { return 0; }; }, borderBottomColor: { optional: !0, - type: rt + type: at }, borderBottomLeftRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderBottomRightRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderBottomWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderColor: { optional: !0, - type: rt + type: at }, borderEndEndRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderEndStartRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderImageOutset: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, borderImageSlice: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, borderImageWidth: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, borderLeft: { @@ -1928,17 +1972,17 @@ process.umask = function() { return 0; }; }, borderLeftColor: { optional: !0, - type: rt + type: at }, borderLeftWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderRight: { optional: !0, @@ -1946,22 +1990,22 @@ process.umask = function() { return 0; }; }, borderRightColor: { optional: !0, - type: rt + type: at }, borderRightWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderStartEndRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderStartStartRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderTop: { optional: !0, @@ -1969,32 +2013,32 @@ process.umask = function() { return 0; }; }, borderTopColor: { optional: !0, - type: rt + type: at }, borderTopLeftRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderTopRightRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderTopWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, borderWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, bottom: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, boxShadow: { optional: !0, @@ -2002,11 +2046,11 @@ process.umask = function() { return 0; }; }, caretColor: { optional: !0, - type: rt + type: at }, color: { optional: !0, - type: rt + type: at }, columnCount: { optional: !0, @@ -2016,8 +2060,8 @@ process.umask = function() { return 0; }; }, columnGap: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, columnRule: { optional: !0, @@ -2025,12 +2069,12 @@ process.umask = function() { return 0; }; }, columnRuleColor: { optional: !0, - type: rt + type: at }, columnRuleWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, columns: { optional: !0, @@ -2040,8 +2084,8 @@ process.umask = function() { return 0; }; }, columnWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, flex: { optional: !0, @@ -2051,8 +2095,8 @@ process.umask = function() { return 0; }; }, flexBasis: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, flexGrow: { optional: !0, @@ -2072,18 +2116,18 @@ process.umask = function() { return 0; }; }, fontSize: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, fontSizeAdjust: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, fontStretch: { optional: !0, - type: ot, + type: it, units: ["%"] }, fontWeight: { @@ -2092,85 +2136,85 @@ process.umask = function() { return 0; }; }, gap: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, gridColumnGap: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, gridGap: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, gridRowGap: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, gridTemplateColumns: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, gridTemplateRows: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, height: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, inset: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, insetBlock: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, insetBlockEnd: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, insetBlockStart: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, insetInline: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, insetInlineEnd: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, insetInlineStart: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, left: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, letterSpacing: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, lineClamp: { optional: !0, @@ -2180,8 +2224,8 @@ process.umask = function() { return 0; }; }, lineHeight: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, margin: { @@ -2190,28 +2234,28 @@ process.umask = function() { return 0; }; }, marginBottom: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, marginLeft: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, marginRight: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, marginTop: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, maskBorder: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, maskPosition: { @@ -2224,14 +2268,14 @@ process.umask = function() { return 0; }; }, maxHeight: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, maxWidth: { optional: !0, - type: ot, - units: nt, + type: it, + units: ot, min: 0 }, objectPosition: { @@ -2240,8 +2284,8 @@ process.umask = function() { return 0; }; }, offset: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, offsetAnchor: { optional: !0, @@ -2249,8 +2293,8 @@ process.umask = function() { return 0; }; }, offsetDistance: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, offsetPath: { optional: !0, @@ -2262,8 +2306,8 @@ process.umask = function() { return 0; }; }, offsetRotate: { optional: !0, - type: ot, - units: et + type: it, + units: rt }, opacity: { optional: !0, @@ -2282,72 +2326,72 @@ process.umask = function() { return 0; }; }, outlineColor: { optional: !0, - type: rt + type: at }, outlineOffset: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, outlineRadius: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, outlineRadiusBottomleft: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, outlineRadiusBottomright: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, outlineRadiusTopleft: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, outlineRadiusTopright: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, outlineWidth: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, padding: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, paddingBottom: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, paddingLeft: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, paddingRight: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, paddingTop: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, perspective: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, perspectiveOrigin: { optional: !0, @@ -2355,18 +2399,18 @@ process.umask = function() { return 0; }; }, right: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, rotate: { optional: !0, - type: ot, - units: et + type: it, + units: rt }, rowGap: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scale: { optional: !0, @@ -2375,117 +2419,117 @@ process.umask = function() { return 0; }; }, scrollbarColor: { optional: !0, - type: rt + type: at }, scrollMargin: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginBlock: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginBlockEnd: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginBlockStart: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginBottom: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginInline: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginInlineEnd: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginInlineStart: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginLeft: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginRight: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollMarginTop: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPadding: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingBlock: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingBlockEnd: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingBlockStart: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingBottom: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingInline: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingInlineEnd: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingInlineStart: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingLeft: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingRight: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollPaddingTop: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, scrollSnapCoordinate: { optional: !0, @@ -2493,8 +2537,8 @@ process.umask = function() { return 0; }; }, scrollSnapDestination: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, shapeImageThreshold: { optional: !0, @@ -2502,8 +2546,8 @@ process.umask = function() { return 0; }; }, shapeMargin: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, shapeOutside: { optional: !0, @@ -2519,12 +2563,12 @@ process.umask = function() { return 0; }; }, textDecorationColor: { optional: !0, - type: rt + type: at }, textDecorationThickness: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, textEmphasis: { optional: !0, @@ -2532,16 +2576,16 @@ process.umask = function() { return 0; }; }, textEmphasisColor: { optional: !0, - type: rt + type: at }, textFillColor: { optional: !0, - type: rt + type: at }, textIndent: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, textShadow: { optional: !0, @@ -2553,55 +2597,55 @@ process.umask = function() { return 0; }; }, textStrokeColor: { optional: !0, - type: rt + type: at }, textUnderlineOffset: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, top: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, transform: { optional: !0, type: "object", props: { translateX: { - type: ot, - units: nt, + type: it, + units: ot, optional: !0 }, translateY: { - type: ot, - units: nt, + type: it, + units: ot, optional: !0 }, translateZ: { - type: ot, - units: nt, + type: it, + units: ot, optional: !0 }, rotate: { - type: ot, - units: et, + type: it, + units: rt, optional: !0 }, rotateX: { - type: ot, - units: et, + type: it, + units: rt, optional: !0 }, rotateY: { - type: ot, - units: et, + type: it, + units: rt, optional: !0 }, rotateZ: { - type: ot, - units: et, + type: it, + units: rt, optional: !0 }, scale: { @@ -2625,18 +2669,18 @@ process.umask = function() { return 0; }; optional: !0 }, skewX: { - type: ot, - units: et, + type: it, + units: rt, optional: !0 }, skewY: { - type: ot, - units: et, + type: it, + units: rt, optional: !0 }, perspective: { - type: ot, - units: nt, + type: it, + units: ot, optional: !0 } } @@ -2655,13 +2699,13 @@ process.umask = function() { return 0; }; }, width: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, wordSpacing: { optional: !0, - type: ot, - units: nt + type: it, + units: ot }, zIndex: { optional: !0, @@ -2670,7 +2714,7 @@ process.umask = function() { return 0; }; }, zoom: { optional: !0, - type: ot, + type: it, units: ["%"], min: 0 } @@ -2685,19 +2729,19 @@ process.umask = function() { return 0; }; type: "string" }, width: { - type: ot, - units: nt + type: it, + units: ot }, wordSpacing: { - type: ot, - units: nt + type: it, + units: ot }, zIndex: { type: "number", integer: !0 }, zoom: { - type: ot, + type: it, units: ["%"], min: 0 } @@ -2705,19 +2749,19 @@ process.umask = function() { return 0; }; } }, { exportable: function (t) { - a(r, t); - var e = c(r); + u(e, t); + var n = y(e); - function r() { - return n(this, r), e.apply(this, arguments); + function e() { + return o(this, e), n.apply(this, arguments); } - return o(r, [{ + return i(e, [{ key: "onGetContext", value: function value() { this.pixelsAccuracy = this.attrs.pixelsAccuracy || 4, this.calculatedPoints = []; var t = this.context.getElements(this.targetValue.pathElement)[0]; - this.path = Q.path(t), this.isPathTargetInsideSVG = this.element instanceof SVGElement; + this.path = nt.path(t), this.isPathTargetInsideSVG = this.element instanceof SVGElement; } }, { key: "onProgress", @@ -2725,13 +2769,13 @@ process.umask = function() { return 0; }; var n, e = Math.round(this.path.totalLength / this.pixelsAccuracy * t) * this.pixelsAccuracy; if (null !== this.calculatedPoints[e] && void 0 !== this.calculatedPoints[e]) n = this.calculatedPoints[e];else { - var o = Q.getPathProgress(this.path, e / this.path.totalLength, this.isPathTargetInsideSVG); + var o = nt.getPathProgress(this.path, e / this.path.totalLength, this.isPathTargetInsideSVG); n = "\n translateX(".concat(o.x, "px)\n translateY(").concat(o.y, "px)\n rotate(").concat(o.angle, "deg)\n "), this.calculatedPoints[e] = n; } this.element.style.transform = n; } - }]), r; - }(t.Effect), + }]), e; + }(e.default.Effect), name: "MotionPath", attributesValidationRules: { animatedAttrs: { @@ -2749,22 +2793,22 @@ process.umask = function() { return 0; }; } } }], - compositeAttributes: tt + compositeAttributes: et }; }); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(8))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(7))) /***/ }), -/* 5 */ +/* 4 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _kissmybutton_motorcortex_player__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var _kissmybutton_motorcortex_player__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var _kissmybutton_motorcortex_player__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_kissmybutton_motorcortex_player__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _kissmybutton_motorcortex___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); /* harmony import */ var _kissmybutton_motorcortex___WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_kissmybutton_motorcortex___WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _dist_motorcortex_anime_umd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); +/* harmony import */ var _dist_motorcortex_anime_umd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); /* harmony import */ var _dist_motorcortex_anime_umd__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dist_motorcortex_anime_umd__WEBPACK_IMPORTED_MODULE_2__); @@ -2892,13 +2936,13 @@ new _kissmybutton_motorcortex_player__WEBPACK_IMPORTED_MODULE_0___default.a({ }); /***/ }), -/* 6 */ +/* 5 */ /***/ (function(module, exports) { /***/ }), -/* 7 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, @@ -3204,10 +3248,10 @@ var substr = 'ab'.substr(-1) === 'b' } ; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(2))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(1))) /***/ }), -/* 8 */ +/* 7 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, global) {/*! @@ -4384,7 +4428,33 @@ return Promise$1; //# sourceMappingURL=es6-promise.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(2), __webpack_require__(1))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(1), __webpack_require__(8))) + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + /***/ }) /******/ ]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 29102187..0864c060 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@babel/preset-env": "7.13.15", "@commitlint/cli": "12.1.1", "@commitlint/config-conventional": "12.1.1", - "@kissmybutton/motorcortex": "6.4.0", + "@kissmybutton/motorcortex": "6.4.1", "@kissmybutton/motorcortex-player": "1.9.0", "@rollup/plugin-json": "4.1.0", "@semantic-release/changelog": "5.0.1", @@ -26,7 +26,7 @@ "@semantic-release/npm": "7.1.1", "babel-eslint": "10.1.0", "babel-loader": "8.2.2", - "browserslist": "4.16.3", + "browserslist": "^4.16.4", "caniuse-lite": "1.0.30001208", "commitizen": "4.2.3", "concurrently": "6.0.1", @@ -57,16 +57,11 @@ "rollup-plugin-commonjs": "10.1.0", "rollup-plugin-node-resolve": "5.2.0", "rollup-plugin-terser": "7.0.2", - "sass-loader": "8.0.2", "semantic-release": "17.4.2", - "shelljs": "0.8.4", "stylelint": "13.12.0", "stylelint-config-prettier": "8.0.2", "stylelint-config-recommended": "4.0.0", - "stylelint-config-recommended-scss": "4.2.0", - "stylelint-config-sass-guidelines": "8.0.0", "stylelint-config-standard": "21.0.0", - "stylelint-scss": "3.19.0", "webpack": "4.46.0", "webpack-cli": "4.6.0", "webpack-dev-server": "3.11.2", @@ -76,7 +71,7 @@ "node": ">=10" }, "peerDependencies": { - "@kissmybutton/motorcortex": "^6.3.0" + "@kissmybutton/motorcortex": "^6.4.1" } }, "node_modules/@babel/cli": { @@ -2236,9 +2231,9 @@ } }, "node_modules/@kissmybutton/motorcortex": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@kissmybutton/motorcortex/-/motorcortex-6.4.0.tgz", - "integrity": "sha512-9N+vqbkDicLknr4fs580cjWD/+Ak2tQIs0mtR1xiAzvwSka8zFkDh2WkRqIQOXWbfka7U02YChz92bcwyGN3yQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@kissmybutton/motorcortex/-/motorcortex-6.4.1.tgz", + "integrity": "sha512-doTWeBwwgDszuBzBItIziJTlvlCjCiWwMAIZIusl7UZZGQtaF+1DqdhtMYBTqdGfKm+l8IbM/Rqylh9XTRvcHQ==", "dev": true, "dependencies": { "bezier-easing": "2.1.0", @@ -4534,15 +4529,16 @@ } }, "node_modules/browserslist": { - "version": "4.16.3", + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.4.tgz", + "integrity": "sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==", "dev": true, - "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001181", - "colorette": "^1.2.1", - "electron-to-chromium": "^1.3.649", + "caniuse-lite": "^1.0.30001208", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.712", "escalade": "^3.1.1", - "node-releases": "^1.1.70" + "node-releases": "^1.1.71" }, "bin": { "browserslist": "cli.js" @@ -6664,9 +6660,10 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.3.690", - "dev": true, - "license": "ISC" + "version": "1.3.712", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.712.tgz", + "integrity": "sha512-3kRVibBeCM4vsgoHHGKHmPocLqtFAGTrebXxxtgKs87hNUzXrX2NuS3jnBys7IozCnw7viQlozxKkmty2KNfrw==", + "dev": true }, "node_modules/elliptic": { "version": "6.5.3", @@ -9434,14 +9431,6 @@ "node": ">=6" } }, - "node_modules/interpret": { - "version": "1.4.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/into-stream": { "version": "5.1.1", "dev": true, @@ -21731,18 +21720,6 @@ "node": ">=4" } }, - "node_modules/postcss-sorting": { - "version": "5.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.14", - "postcss": "^7.0.17" - }, - "engines": { - "node": ">=8.7.0" - } - }, "node_modules/postcss-syntax": { "version": "0.36.2", "dev": true, @@ -22227,16 +22204,6 @@ "node": ">=0.10" } }, - "node_modules/rechoir": { - "version": "0.6.2", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/redent": { "version": "3.0.0", "dev": true, @@ -22838,50 +22805,6 @@ "dev": true, "license": "MIT" }, - "node_modules/sass-loader": { - "version": "8.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "clone-deep": "^4.0.1", - "loader-utils": "^1.2.3", - "neo-async": "^2.6.1", - "schema-utils": "^2.6.1", - "semver": "^6.3.0" - }, - "engines": { - "node": ">= 8.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "fibers": ">= 3.1.0", - "node-sass": "^4.0.0", - "sass": "^1.3.0", - "webpack": "^4.36.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "fibers": { - "optional": true - }, - "node-sass": { - "optional": true - }, - "sass": { - "optional": true - } - } - }, - "node_modules/sass-loader/node_modules/semver": { - "version": "6.3.0", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -23547,22 +23470,6 @@ "node": ">=8" } }, - "node_modules/shelljs": { - "version": "0.8.4", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/signal-exit": { "version": "3.0.3", "dev": true, @@ -24434,41 +24341,6 @@ "stylelint": "^13.12.0" } }, - "node_modules/stylelint-config-recommended-scss": { - "version": "4.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "stylelint-config-recommended": "^3.0.0" - }, - "peerDependencies": { - "stylelint": "^10.1.0 || ^11.0.0 || ^12.0.0 || ^13.0.0", - "stylelint-scss": "^3.0.0" - } - }, - "node_modules/stylelint-config-recommended-scss/node_modules/stylelint-config-recommended": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "peerDependencies": { - "stylelint": ">=10.1.0" - } - }, - "node_modules/stylelint-config-sass-guidelines": { - "version": "8.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "stylelint-order": "^4.0.0", - "stylelint-scss": "^3.18.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "stylelint": "^13.7.0" - } - }, "node_modules/stylelint-config-standard": { "version": "21.0.0", "dev": true, @@ -24480,37 +24352,6 @@ "stylelint": "^13.12.0" } }, - "node_modules/stylelint-order": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.15", - "postcss": "^7.0.26", - "postcss-sorting": "^5.0.1" - }, - "peerDependencies": { - "stylelint": "^10.0.1 || ^11.0.0 || ^12.0.0 || ^13.0.0" - } - }, - "node_modules/stylelint-scss": { - "version": "3.19.0", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.15", - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "stylelint": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0" - } - }, "node_modules/stylelint/node_modules/ansi-regex": { "version": "5.0.0", "dev": true, @@ -28788,9 +28629,9 @@ } }, "@kissmybutton/motorcortex": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@kissmybutton/motorcortex/-/motorcortex-6.4.0.tgz", - "integrity": "sha512-9N+vqbkDicLknr4fs580cjWD/+Ak2tQIs0mtR1xiAzvwSka8zFkDh2WkRqIQOXWbfka7U02YChz92bcwyGN3yQ==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@kissmybutton/motorcortex/-/motorcortex-6.4.1.tgz", + "integrity": "sha512-doTWeBwwgDszuBzBItIziJTlvlCjCiWwMAIZIusl7UZZGQtaF+1DqdhtMYBTqdGfKm+l8IbM/Rqylh9XTRvcHQ==", "dev": true, "requires": { "bezier-easing": "2.1.0", @@ -30414,14 +30255,16 @@ } }, "browserslist": { - "version": "4.16.3", + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.4.tgz", + "integrity": "sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001181", - "colorette": "^1.2.1", - "electron-to-chromium": "^1.3.649", + "caniuse-lite": "^1.0.30001208", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.712", "escalade": "^3.1.1", - "node-releases": "^1.1.70" + "node-releases": "^1.1.71" } }, "buffer": { @@ -31879,7 +31722,9 @@ } }, "electron-to-chromium": { - "version": "1.3.690", + "version": "1.3.712", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.712.tgz", + "integrity": "sha512-3kRVibBeCM4vsgoHHGKHmPocLqtFAGTrebXxxtgKs87hNUzXrX2NuS3jnBys7IozCnw7viQlozxKkmty2KNfrw==", "dev": true }, "elliptic": { @@ -33763,10 +33608,6 @@ "ipaddr.js": "^1.9.0" } }, - "interpret": { - "version": "1.4.0", - "dev": true - }, "into-stream": { "version": "5.1.1", "dev": true, @@ -42392,14 +42233,6 @@ "util-deprecate": "^1.0.2" } }, - "postcss-sorting": { - "version": "5.0.1", - "dev": true, - "requires": { - "lodash": "^4.17.14", - "postcss": "^7.0.17" - } - }, "postcss-syntax": { "version": "0.36.2", "dev": true, @@ -42723,13 +42556,6 @@ "readable-stream": "^2.0.2" } }, - "rechoir": { - "version": "0.6.2", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, "redent": { "version": "3.0.0", "dev": true, @@ -43136,23 +42962,6 @@ "version": "2.1.2", "dev": true }, - "sass-loader": { - "version": "8.0.2", - "dev": true, - "requires": { - "clone-deep": "^4.0.1", - "loader-utils": "^1.2.3", - "neo-async": "^2.6.1", - "schema-utils": "^2.6.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "dev": true - } - } - }, "schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -43597,15 +43406,6 @@ "version": "3.0.0", "dev": true }, - "shelljs": { - "version": "0.8.4", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, "signal-exit": { "version": "3.0.3", "dev": true @@ -44474,28 +44274,6 @@ "dev": true, "requires": {} }, - "stylelint-config-recommended-scss": { - "version": "4.2.0", - "dev": true, - "requires": { - "stylelint-config-recommended": "^3.0.0" - }, - "dependencies": { - "stylelint-config-recommended": { - "version": "3.0.0", - "dev": true, - "requires": {} - } - } - }, - "stylelint-config-sass-guidelines": { - "version": "8.0.0", - "dev": true, - "requires": { - "stylelint-order": "^4.0.0", - "stylelint-scss": "^3.18.0" - } - }, "stylelint-config-standard": { "version": "21.0.0", "dev": true, @@ -44503,26 +44281,6 @@ "stylelint-config-recommended": "^4.0.0" } }, - "stylelint-order": { - "version": "4.0.0", - "dev": true, - "requires": { - "lodash": "^4.17.15", - "postcss": "^7.0.26", - "postcss-sorting": "^5.0.1" - } - }, - "stylelint-scss": { - "version": "3.19.0", - "dev": true, - "requires": { - "lodash": "^4.17.15", - "postcss-media-query-parser": "^0.2.3", - "postcss-resolve-nested-selector": "^0.1.1", - "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.1.0" - } - }, "sugarss": { "version": "2.0.0", "dev": true, diff --git a/package.json b/package.json index 4b8c1492..e037afa1 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "update-force:packages": "./node_modules/npm-check-updates/bin/ncu -u && npm i", "update:packages": "npm update --save/--save-dev", "concurrently": "concurrently -c \"cyan.bold,magenta.bold\" --names \"JS,Styles\"", - "lint:styles": "stylelint --allow-empty-input \"src/**.css\" \"src/**/*.scss\" --config .stylelintrc.json", + "lint:styles": "stylelint --allow-empty-input \"src/**.css\" --config .stylelintrc.json", "lint:js": "eslint -c .eslintrc src/**/*.js", "lint": "npm run concurrently \"npm:lint:js\" \"npm:lint:styles\"", "lint:fix": "npm run concurrently \"npm:lint:js -- --fix\" \"npm:lint:styles -- --fix\"", @@ -38,11 +38,12 @@ "animation" ], "lint-staged": { - "*.json": [ + "*.{json,md,yml,yaml}": [ "prettier --write" ], - "*.{css,scss}": [ - "stylelint \"src/**.css\" \"src/**/*.scss\" --config .stylelintrc.json --fix" + "*.css": [ + "prettier --write", + "stylelint \"src/**.css\" --config .stylelintrc.json --fix" ], "*.{js,jsx}": [ "prettier --write", @@ -71,7 +72,7 @@ "mc-animejs-core": "3.1.5" }, "peerDependencies": { - "@kissmybutton/motorcortex": "^6.3.0" + "@kissmybutton/motorcortex": "^6.4.1" }, "devDependencies": { "@babel/cli": "7.13.14", @@ -79,7 +80,7 @@ "@babel/preset-env": "7.13.15", "@commitlint/cli": "12.1.1", "@commitlint/config-conventional": "12.1.1", - "@kissmybutton/motorcortex": "6.4.0", + "@kissmybutton/motorcortex": "6.4.1", "@kissmybutton/motorcortex-player": "1.9.0", "@rollup/plugin-json": "4.1.0", "@semantic-release/changelog": "5.0.1", @@ -88,7 +89,7 @@ "@semantic-release/npm": "7.1.1", "babel-eslint": "10.1.0", "babel-loader": "8.2.2", - "browserslist": "4.16.3", + "browserslist": "^4.16.4", "caniuse-lite": "1.0.30001208", "commitizen": "4.2.3", "concurrently": "6.0.1", @@ -119,16 +120,11 @@ "rollup-plugin-commonjs": "10.1.0", "rollup-plugin-node-resolve": "5.2.0", "rollup-plugin-terser": "7.0.2", - "sass-loader": "8.0.2", "semantic-release": "17.4.2", - "shelljs": "0.8.4", "stylelint": "13.12.0", "stylelint-config-prettier": "8.0.2", "stylelint-config-recommended": "4.0.0", - "stylelint-config-recommended-scss": "4.2.0", - "stylelint-config-sass-guidelines": "8.0.0", "stylelint-config-standard": "21.0.0", - "stylelint-scss": "3.19.0", "webpack": "4.46.0", "webpack-cli": "4.6.0", "webpack-dev-server": "3.11.2",