diff --git a/bower.json b/bower.json index da4fede..6832636 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "planout", "main": "dist/planout.js", - "version": "3.0.0", + "version": "3.0.2", "homepage": "https://www.github.com/HubSpot/PlanOut.js", "author": "Guy Aridor ", "description": "A JavaScript port of Facebook's PlanOut Experimentation Framework", diff --git a/dist/planout.js b/dist/planout.js index 1d85d2f..128e332 100644 --- a/dist/planout.js +++ b/dist/planout.js @@ -1643,7 +1643,7 @@ return /******/ (function(modules) { // webpackBootstrap _classCallCheck(this, Interpreter); - this._serialization = serialization; + this._serialization = (0, _utils2.deepCopy)(serialization); if (!environment) { this._env = new _assignment2.default(experimentSalt); } else { diff --git a/dist/planout.min.js b/dist/planout.min.js index 90c03b3..5e870f7 100644 --- a/dist/planout.min.js +++ b/dist/planout.min.js @@ -1,8 +1,8 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.planout=e():t.planout=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(1),u=i(o),a=r(13),s=i(a),f=r(3),l=i(f),c=r(15),h=i(c),p=r(16),g=n(p),y=r(2),v=i(y),m=r(17),d=i(m);e.default={Namespace:g,Assignment:v.default,Interpreter:s.default,Experiment:u.default,ExperimentSetup:d.default,Ops:{Random:l.default,Core:h.default}},t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r=0}},{key:"setName",value:function(t){var e=/\s+/g;this.name=t.replace(e,"-"),this._assignment&&(this._assignment.experimentSalt=this.getSalt())}},{key:"__asBlob",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={name:this.getName(),time:(new Date).getTime()/1e3,salt:this.getSalt(),inputs:this.inputs,params:this._assignment.getParams()};return(0,s.extend)(e,t),e}},{key:"setAutoExposureLogging",value:function(t){this._autoExposureLog=t}},{key:"getParams",value:function(){return this.requireAssignment(),this.requireExposureLogging(),this._assignment.getParams()}},{key:"get",value:function(t,e){return this.requireAssignment(),this.requireExposureLogging(t),this._assignment.get(t,e)}},{key:"toString",value:function(){return this.requireAssignment(),this.requireExposureLogging(),JSON.stringify(this.__asBlob())}},{key:"logExposure",value:function(t){this.inExperiment()&&(this._exposureLogged=!0,this.logEvent("exposure",t))}},{key:"shouldLogExposure",value:function(t){return!(void 0!==t&&!this.shouldFetchExperimentParameter(t))&&(this._autoExposureLog&&!this.previouslyLogged())}},{key:"logEvent",value:function(t,e){if(this.inExperiment()){var r;r=e?{event:t,extra_data:(0,s.shallowCopy)(e)}:{event:t},this.log(this.__asBlob(r))}}},{key:"configureLogger",value:function(){throw"IMPLEMENT configureLogger"}},{key:"log",value:function(t){throw"IMPLEMENT log"}},{key:"previouslyLogged",value:function(){throw"IMPLEMENT previouslyLogged"}}]),t}();e.default=f,t.exports=e.default},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments[2],n=this.compatZeroToOneCalculation(r);return n*(e-t)+t}},{key:"getHash",value:function(t){var e;if(this.args.full_salt)e=this.getArgString("full_salt")+".";else{var r=this.getArgString("salt");e=this.mapper.get("experimentSalt")+"."+r+this.mapper.get("saltSeparator")}var n=this.getUnit(t).map(function(t){return String(t)}).join("."),i=e+n,o=(0,l.default)(i);return this.compatHashCalculation(o)}}]),e}(s.PlanOutOpSimple),p=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.getUniform(t,e)}}]),e}(t)},g=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"compatRandomIntegerCalculation",value:function(t,e){return(this.getHash()+t)%(e-t+1)}},{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.compatRandomIntegerCalculation(t,e)}}]),e}(t)},y=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p");if(t<0||t>1)throw"Invalid probability";return this.getUniform(0,1)<=t?1:0}}]),e}(t)},v=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p"),e=this.getArgList("choices");if(t<0||t>1)throw"Invalid probability";if(0==e.length)return[];for(var r=[],n=0;n0;o--){var u=this.compatSampleIndexCalculation(o),a=t[o];if(t[o]=t[u],t[u]=a,i&&n===o)return t.slice(o,r)}return t.slice(0,e)}},{key:"simpleExecute",value:function(){var t=(0,c.shallowCopy)(this.getArgList("choices")),e=0;return e=void 0!==this.args.draws?this.getArgNumber("draws"):t.length,this.sample(t,e)}}]),e}(t)};e.default={PlanOutOpRandom:h,SampleBuilder:_,Sample:_(h),WeightedChoiceBuilder:d,WeightedChoice:d(h),UniformChoiceBuilder:m,UniformChoice:m(h),BernoulliFilterBuilder:v,BernoulliFilter:v(h),BernoulliTrialBuilder:y,BernoulliTrial:y(h),RandomIntegerBuilder:g,RandomInteger:g(h),RandomFloatBuilder:p,RandomFloat:p(h)},t.exports=e.default},function(t,e,r){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.PlanOutOpUnary=e.PlanOutOpBinary=e.PlanOutOpCommutative=e.PlanOutOpSimple=e.PlanOutOp=void 0;var u=function(){function t(t,e){for(var r=0;r=0&&u=0&&e<=P},S=function(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)},j=!{toString:null}.propertyIsEnumerable("toString"),T=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(t,e,r,n){return k(t)||(t=M(t)),("number"!=typeof r||n)&&(r=0),t.indexOf(e)>=0},M=function(t){for(var e=l(t),r=e.length,n=Array(r),i=0;i>5]|=128<<24-o%32,r[(o+64>>>9<<4)+15]=o;for(var h=0;h>>31}var O=(a<<5|a>>>27)+c+(u[d]>>>0)+(d<20?(s&f|~s&l)+1518500249:d<40?(s^f^l)+1859775393:d<60?(s&f|s&l|f&l)-1894007588:(s^f^l)-899497514);c=l,l=f,f=s<<30|s>>>2,s=a,a=O}a+=p,s+=g,f+=y,l+=v,c+=m}return[a,s,f,l,c]},a=function(t,e){var r=n.wordsToBytes(u(t));return e&&e.asBytes?r:e&&e.asString?o.bytesToString(r):n.bytesToHex(r)};a._blocksize=16,a._digestsize=20,t.exports=a}()}).call(e,r(7).Buffer)},function(t,e,r){(function(t,n){/*! +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.planout=e():t.planout=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(1),u=i(o),a=r(13),s=i(a),f=r(3),l=i(f),c=r(15),h=i(c),p=r(16),g=n(p),y=r(2),v=i(y),m=r(17),d=i(m);e.default={Namespace:g,Assignment:v.default,Interpreter:s.default,Experiment:u.default,ExperimentSetup:d.default,Ops:{Random:l.default,Core:h.default}},t.exports=e.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r=0}},{key:"setName",value:function(t){var e=/\s+/g;this.name=t.replace(e,"-"),this._assignment&&(this._assignment.experimentSalt=this.getSalt())}},{key:"__asBlob",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={name:this.getName(),time:(new Date).getTime()/1e3,salt:this.getSalt(),inputs:this.inputs,params:this._assignment.getParams()};return(0,s.extend)(e,t),e}},{key:"setAutoExposureLogging",value:function(t){this._autoExposureLog=t}},{key:"getParams",value:function(){return this.requireAssignment(),this.requireExposureLogging(),this._assignment.getParams()}},{key:"get",value:function(t,e){return this.requireAssignment(),this.requireExposureLogging(t),this._assignment.get(t,e)}},{key:"toString",value:function(){return this.requireAssignment(),this.requireExposureLogging(),JSON.stringify(this.__asBlob())}},{key:"logExposure",value:function(t){this.inExperiment()&&(this._exposureLogged=!0,this.logEvent("exposure",t))}},{key:"shouldLogExposure",value:function(t){return!(void 0!==t&&!this.shouldFetchExperimentParameter(t))&&(this._autoExposureLog&&!this.previouslyLogged())}},{key:"logEvent",value:function(t,e){if(this.inExperiment()){var r;r=e?{event:t,extra_data:(0,s.shallowCopy)(e)}:{event:t},this.log(this.__asBlob(r))}}},{key:"configureLogger",value:function(){throw"IMPLEMENT configureLogger"}},{key:"log",value:function(t){throw"IMPLEMENT log"}},{key:"previouslyLogged",value:function(){throw"IMPLEMENT previouslyLogged"}}]),t}();e.default=f,t.exports=e.default},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments[2],n=this.compatZeroToOneCalculation(r);return n*(e-t)+t}},{key:"getHash",value:function(t){var e;if(this.args.full_salt)e=this.getArgString("full_salt")+".";else{var r=this.getArgString("salt");e=this.mapper.get("experimentSalt")+"."+r+this.mapper.get("saltSeparator")}var n=this.getUnit(t).map(function(t){return String(t)}).join("."),i=e+n,o=(0,l.default)(i);return this.compatHashCalculation(o)}}]),e}(s.PlanOutOpSimple),p=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.getUniform(t,e)}}]),e}(t)},g=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"compatRandomIntegerCalculation",value:function(t,e){return(this.getHash()+t)%(e-t+1)}},{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.compatRandomIntegerCalculation(t,e)}}]),e}(t)},y=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p");if(t<0||t>1)throw"Invalid probability";return this.getUniform(0,1)<=t?1:0}}]),e}(t)},v=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p"),e=this.getArgList("choices");if(t<0||t>1)throw"Invalid probability";if(0==e.length)return[];for(var r=[],n=0;n0;o--){var u=this.compatSampleIndexCalculation(o),a=t[o];if(t[o]=t[u],t[u]=a,i&&n===o)return t.slice(o,r)}return t.slice(0,e)}},{key:"simpleExecute",value:function(){var t=(0,c.shallowCopy)(this.getArgList("choices")),e=0;return e=void 0!==this.args.draws?this.getArgNumber("draws"):t.length,this.sample(t,e)}}]),e}(t)};e.default={PlanOutOpRandom:h,SampleBuilder:_,Sample:_(h),WeightedChoiceBuilder:d,WeightedChoice:d(h),UniformChoiceBuilder:m,UniformChoice:m(h),BernoulliFilterBuilder:v,BernoulliFilter:v(h),BernoulliTrialBuilder:y,BernoulliTrial:y(h),RandomIntegerBuilder:g,RandomInteger:g(h),RandomFloatBuilder:p,RandomFloat:p(h)},t.exports=e.default},function(t,e,r){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.PlanOutOpUnary=e.PlanOutOpBinary=e.PlanOutOpCommutative=e.PlanOutOpSimple=e.PlanOutOp=void 0;var u=function(){function t(t,e){for(var r=0;r=0&&u=0&&e<=P},S=function(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)},j=!{toString:null}.propertyIsEnumerable("toString"),T=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(t,e,r,n){return k(t)||(t=M(t)),("number"!=typeof r||n)&&(r=0),t.indexOf(e)>=0},M=function(t){for(var e=l(t),r=e.length,n=Array(r),i=0;i>5]|=128<<24-o%32,r[(o+64>>>9<<4)+15]=o;for(var h=0;h>>31}var O=(a<<5|a>>>27)+c+(u[d]>>>0)+(d<20?(s&f|~s&l)+1518500249:d<40?(s^f^l)+1859775393:d<60?(s&f|s&l|f&l)-1894007588:(s^f^l)-899497514);c=l,l=f,f=s<<30|s>>>2,s=a,a=O}a+=p,s+=g,f+=y,l+=v,c+=m}return[a,s,f,l,c]},a=function(t,e){var r=n.wordsToBytes(u(t));return e&&e.asBytes?r:e&&e.asString?o.bytesToString(r):n.bytesToHex(r)};a._blocksize=16,a._digestsize=20,t.exports=a}()}).call(e,r(7).Buffer)},function(t,e,r){(function(t){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,r){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(e){return+e!=e&&(e=0),t.alloc(+e)}function m(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(i)return H(e).length;r=(""+r).toLowerCase(),i=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function O(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:b(e,r,n,i,o);if("number"==typeof r)return r&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):b(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function o(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}var f;if(i){var l=-1;for(f=r;fa&&(r=a-s),f=r;f>=0;f--){for(var c=!0,h=0;hi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u239?4:o>223?3:o>191?2:1;if(i+a<=r){var s,f,l,c;switch(a){case 1:o<128&&(u=o);break;case 2:s=t[i+1],128===(192&s)&&(c=(31&o)<<6|63&s,c>127&&(u=c));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(c=(15&o)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:s=t[i+1],f=t[i+2],l=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&l)&&(c=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(u=c))}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=a}return T(n)}function T(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function I(e,r,n,i,o,u){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||re.length)throw new RangeError("Index out of range")}function U(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function Y(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||Y(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return i||Y(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function F(t){if(t=G(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],u=0;u55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function Z(t){return X.toByteArray(F(t))}function J(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function V(t){return t!==t}var X=r(8),Q=r(9),$=r(10);e.Buffer=t,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,r){return a(null,t,e,r)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,r){return f(null,t,e,r)},t.allocUnsafe=function(t){return l(null,t)},t.allocUnsafeSlow=function(t){return l(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,u=Math.min(n,i);o0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e,r,n,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var u=o-i,a=n-r,s=Math.min(u,a),f=this.slice(i,o),l=e.slice(r,n),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(i*=256);)n+=this[t+--e]*i;return n},t.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),Q.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),Q.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),Q.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),Q.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;I(this,t,e,r,i,0)}var o=1,u=0;for(this[e]=255&t;++u=0&&(u*=256);)this[e+o]=t/u&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):U(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):U(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):N(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):N(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):U(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):U(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):N(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r|=0,n||I(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):N(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--o)e[o+r]=this[o+n];else if(u<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var u;if("number"==typeof e)for(u=r;u0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function i(t){var e,n,i,o,u,a,s=t.length;u=r(t),a=new l(3*s/4-u),i=u>0?s-4:s;var c=0;for(e=0,n=0;e>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===u?(o=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,a[c++]=255&o):1===u&&(o=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function o(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function u(t,e,r){for(var n,i=[],u=e;ul?l:f+a));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=n,e.toByteArray=i,e.fromByteArray=a;for(var s=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=c.length;h>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=h,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=n;l>0;u=256*u+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===s)return u?NaN:(p?-1:1)*(1/0);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var u,a,s,f=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+c>=1?h/s:h*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(e*s-1)*Math.pow(2,i),u+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(u=u<0;t[r+p]=255&u,p+=g,u/=256,f-=8);t[r+p-g]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){!function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n>>6-2*i);return r}};t.exports=r}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:"global_salt",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];i(this,t),this._serialization=e,o?this._env=o:this._env=new a.default(r),this.experimentSalt=this._experimentSalt=r,this._evaluated=!1,this._inExperiment=!1,this._inputs=(0,f.shallowCopy)(n)}return o(t,[{key:"inExperiment",value:function(){return this._inExperiment}},{key:"setEnv",value:function(t){return this._env=(0,f.deepCopy)(t),this}},{key:"has",value:function(t){return this._env[t]}},{key:"get",value:function(t,e){var r=this._inputs[t];null!==r&&void 0!==r||(r=e);var n=this._env.get(t);return void 0!==n&&null!==n?n:r}},{key:"getParams",value:function(){if(!this._evaluated){try{this.evaluate(this._serialization)}catch(t){t instanceof s.StopPlanOutException&&(this._inExperiment=t.inExperiment)}this._evaluated=!0}return this._env.getParams()}},{key:"set",value:function(t,e){return this._env.set(t,e),this}},{key:"getSaltSeparator",value:function(){return this._env.saltSeparator}},{key:"setOverrides",value:function(t){return this._env.setOverrides(t),this}},{key:"getOverrides",value:function(){return this._env.getOverrides()}},{key:"hasOverride",value:function(t){var e=this.getOverrides();return e&&void 0!==e[t]}},{key:"registerCustomOperators",value:function(t){(0,s.registerOperators)(t)}},{key:"evaluate",value:function(t){if((0,f.isObject)(t)&&t.op)return(0,s.operatorInstance)(t).execute(this);if((0,f.isArray)(t)){var e=this;return(0,f.map)(t,function(t){return e.evaluate(t)})}return t}}]),t}();e.default=l,t.exports=e.default},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.registerOperators=e.StopPlanOutException=e.operatorInstance=e.isOperator=e.initFactory=e.operators=void 0;var o=r(15),u=n(o),a=r(3),s=n(a),f=r(5),l=function(){return{literal:u.Literal,get:u.Get,set:u.Set,seq:u.Seq,return:u.Return,index:u.Index,array:u.Arr,equals:u.Equals,and:u.And,or:u.Or,">":u.GreaterThan,"<":u.LessThan,">=":u.GreaterThanOrEqualTo,"<=":u.LessThanOrEqualTo,"%":u.Mod,"/":u.Divide,not:u.Not,round:u.Round,negative:u.Negative,min:u.Min,max:u.Max,length:u.Length,coalesce:u.Coalesce,map:u.Map,cond:u.Cond,product:u.Product,sum:u.Sum,randomFloat:s.RandomFloat,randomInteger:s.RandomInteger,bernoulliTrial:s.BernoulliTrial,bernoulliFilter:s.BernoulliFilter,uniformChoice:s.UniformChoice,weightedChoice:s.WeightedChoice,sample:s.Sample}},c=l(),h=function(t){return(0,f.isObject)(t)&&t.op},p=function(t){var e=t.op;if(!c[e])throw"Unknown Operator "+e;return new c[e](t)},g=function(t){(0,f.forEach)(t,function(t,e){if(c[e])throw e+" already is defined";c[e]=t})},y=function t(e){i(this,t),this.inExperiment=e};e.operators=c,e.initFactory=l,e.isOperator=h,e.operatorInstance=p,e.StopPlanOutException=y,e.registerOperators=g},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Return=e.Length=e.Max=e.Min=e.Negative=e.Not=e.Round=e.Divide=e.Mod=e.GreaterThanOrEqualTo=e.LessThanOrEqualTo=e.LessThan=e.GreaterThan=e.Equals=e.Sum=e.Product=e.Or=e.And=e.Cond=e.Index=e.Coalesce=e.Map=e.Arr=e.Set=e.Seq=e.Get=e.Literal=void 0;var u=function(){function t(t,e){for(var r=0;r=0&&ee}}]),e}(a.PlanOutOpBinary),P=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t=e}}]),e}(a.PlanOutOpBinary),S=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t%e}}]),e}(a.PlanOutOpBinary),j=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return parseFloat(t)/parseFloat(e)}}]),e}(a.PlanOutOpBinary),T=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return Math.round(t)}}]),e}(a.PlanOutOpUnary),R=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"!"}},{key:"unaryExecute",value:function(t){return!t}}]),e}(a.PlanOutOpUnary),M=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"-"}},{key:"unaryExecute",value:function(t){return 0-t}}]),e}(a.PlanOutOpUnary),B=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.min.apply(null,t)}}]),e}(a.PlanOutOpCommutative),L=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.max.apply(null,t)}}]),e}(a.PlanOutOpCommutative),C=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return t.length}}]),e}(a.PlanOutOpUnary),I=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"simpleExecute",value:function(){var t=(0,f.deepCopy)(this.args);return delete t.op,delete t.salt,t}}]),e}(a.PlanOutOpSimple);e.Literal=l,e.Get=c,e.Seq=h,e.Set=g,e.Arr=y,e.Map=I,e.Coalesce=v,e.Index=m,e.Cond=d,e.And=_,e.Or=O,e.Product=b,e.Sum=E,e.Equals=x,e.GreaterThan=w,e.LessThan=P,e.LessThanOrEqualTo=A,e.GreaterThanOrEqualTo=k,e.Mod=S,e.Divide=j,e.Round=T,e.Not=R,e.Negative=M,e.Min=B,e.Max=L,e.Length=C,e.Return=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleNamespace=e.Namespace=void 0;var a=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var u=i.get;if(void 0!==u)return u.call(n)},s=function(){function t(t,e){for(var r=0;r=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),u.alloc(+t)}function m(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function O(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function o(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}var f;if(i){var l=-1;for(f=r;fa&&(r=a-s),f=r;f>=0;f--){for(var c=!0,h=0;hi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u239?4:o>223?3:o>191?2:1;if(i+a<=r){var s,f,l,c;switch(a){case 1:o<128&&(u=o);break;case 2:s=t[i+1],128===(192&s)&&(c=(31&o)<<6|63&s,c>127&&(u=c));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(c=(15&o)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:s=t[i+1],f=t[i+2],l=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&l)&&(c=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(u=c))}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=a}return T(n)}function T(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function U(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function Y(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||Y(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return i||Y(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,r,n,52,8),r+8}function F(t){if(t=G(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],u=0;u55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function Z(t){return X.toByteArray(F(t))}function J(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function V(t){return t!==t}var X=r(8),Q=r(9),$=r(10);e.Buffer=u,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return a(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return f(null,t,e,r)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,s=Math.min(o,a),f=this.slice(n,i),l=t.slice(e,r),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;u.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),Q.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),Q.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),Q.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),Q.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;I(this,t,e,r,i,0)}var o=1,u=0;for(this[e]=255&t;++u=0&&(u*=256);)this[e+o]=t/u&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):U(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):U(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function i(t){var e,n,i,o,u,a,s=t.length;u=r(t),a=new l(3*s/4-u),i=u>0?s-4:s;var c=0;for(e=0,n=0;e>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===u?(o=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,a[c++]=255&o):1===u&&(o=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function o(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function u(t,e,r){for(var n,i=[],u=e;ul?l:f+a));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=n,e.toByteArray=i,e.fromByteArray=a;for(var s=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=c.length;h>1,l=-7,c=r?i-1:0,h=r?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=h,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=n;l>0;u=256*u+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===s)return u?NaN:(p?-1:1)*(1/0);u+=Math.pow(2,n),o-=f}return(p?-1:1)*u*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var u,a,s,f=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+c>=1?h/s:h*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(e*s-1)*Math.pow(2,i),u+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(u=u<0;t[r+p]=255&u,p+=g,u/=256,f-=8);t[r+p-g]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){!function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n>>6-2*i);return r}};t.exports=r}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:"global_salt",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];i(this,t),this._serialization=(0,f.deepCopy)(e),o?this._env=o:this._env=new a.default(r),this.experimentSalt=this._experimentSalt=r,this._evaluated=!1,this._inExperiment=!1,this._inputs=(0,f.shallowCopy)(n)}return o(t,[{key:"inExperiment",value:function(){return this._inExperiment}},{key:"setEnv",value:function(t){return this._env=(0,f.deepCopy)(t),this}},{key:"has",value:function(t){return this._env[t]}},{key:"get",value:function(t,e){var r=this._inputs[t];null!==r&&void 0!==r||(r=e);var n=this._env.get(t);return void 0!==n&&null!==n?n:r}},{key:"getParams",value:function(){if(!this._evaluated){try{this.evaluate(this._serialization)}catch(t){t instanceof s.StopPlanOutException&&(this._inExperiment=t.inExperiment)}this._evaluated=!0}return this._env.getParams()}},{key:"set",value:function(t,e){return this._env.set(t,e),this}},{key:"getSaltSeparator",value:function(){return this._env.saltSeparator}},{key:"setOverrides",value:function(t){return this._env.setOverrides(t),this}},{key:"getOverrides",value:function(){return this._env.getOverrides()}},{key:"hasOverride",value:function(t){var e=this.getOverrides();return e&&void 0!==e[t]}},{key:"registerCustomOperators",value:function(t){(0,s.registerOperators)(t)}},{key:"evaluate",value:function(t){if((0,f.isObject)(t)&&t.op)return(0,s.operatorInstance)(t).execute(this);if((0,f.isArray)(t)){var e=this;return(0,f.map)(t,function(t){return e.evaluate(t)})}return t}}]),t}();e.default=l,t.exports=e.default},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.registerOperators=e.StopPlanOutException=e.operatorInstance=e.isOperator=e.initFactory=e.operators=void 0;var o=r(15),u=n(o),a=r(3),s=n(a),f=r(5),l=function(){return{literal:u.Literal,get:u.Get,set:u.Set,seq:u.Seq,return:u.Return,index:u.Index,array:u.Arr,equals:u.Equals,and:u.And,or:u.Or,">":u.GreaterThan,"<":u.LessThan,">=":u.GreaterThanOrEqualTo,"<=":u.LessThanOrEqualTo,"%":u.Mod,"/":u.Divide,not:u.Not,round:u.Round,negative:u.Negative,min:u.Min,max:u.Max,length:u.Length,coalesce:u.Coalesce,map:u.Map,cond:u.Cond,product:u.Product,sum:u.Sum,randomFloat:s.RandomFloat,randomInteger:s.RandomInteger,bernoulliTrial:s.BernoulliTrial,bernoulliFilter:s.BernoulliFilter,uniformChoice:s.UniformChoice,weightedChoice:s.WeightedChoice,sample:s.Sample}},c=l(),h=function(t){return(0,f.isObject)(t)&&t.op},p=function(t){var e=t.op;if(!c[e])throw"Unknown Operator "+e;return new c[e](t)},g=function(t){(0,f.forEach)(t,function(t,e){if(c[e])throw e+" already is defined";c[e]=t})},y=function t(e){i(this,t),this.inExperiment=e};e.operators=c,e.initFactory=l,e.isOperator=h,e.operatorInstance=p,e.StopPlanOutException=y,e.registerOperators=g},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Return=e.Length=e.Max=e.Min=e.Negative=e.Not=e.Round=e.Divide=e.Mod=e.GreaterThanOrEqualTo=e.LessThanOrEqualTo=e.LessThan=e.GreaterThan=e.Equals=e.Sum=e.Product=e.Or=e.And=e.Cond=e.Index=e.Coalesce=e.Map=e.Arr=e.Set=e.Seq=e.Get=e.Literal=void 0;var u=function(){function t(t,e){for(var r=0;r=0&&ee}}]),e}(a.PlanOutOpBinary),P=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t=e}}]),e}(a.PlanOutOpBinary),S=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t%e}}]),e}(a.PlanOutOpBinary),j=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return parseFloat(t)/parseFloat(e)}}]),e}(a.PlanOutOpBinary),T=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return Math.round(t)}}]),e}(a.PlanOutOpUnary),R=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"!"}},{key:"unaryExecute",value:function(t){return!t}}]),e}(a.PlanOutOpUnary),M=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"-"}},{key:"unaryExecute",value:function(t){return 0-t}}]),e}(a.PlanOutOpUnary),B=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.min.apply(null,t)}}]),e}(a.PlanOutOpCommutative),L=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.max.apply(null,t)}}]),e}(a.PlanOutOpCommutative),C=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return t.length}}]),e}(a.PlanOutOpUnary),I=function(t){function e(){return n(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"simpleExecute",value:function(){var t=(0,f.deepCopy)(this.args);return delete t.op,delete t.salt,t}}]),e}(a.PlanOutOpSimple);e.Literal=l,e.Get=c,e.Seq=h,e.Set=g,e.Arr=y,e.Map=I,e.Coalesce=v,e.Index=m,e.Cond=d,e.And=_,e.Or=O,e.Product=b,e.Sum=E,e.Equals=x,e.GreaterThan=w,e.LessThan=P,e.LessThanOrEqualTo=A,e.GreaterThanOrEqualTo=k,e.Mod=S,e.Divide=j,e.Round=T,e.Not=R,e.Negative=M,e.Min=B,e.Max=L,e.Length=C,e.Return=p},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleNamespace=e.Namespace=void 0;var a=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var u=i.get;if(void 0!==u)return u.call(n)},s=function(){function t(t,e){for(var r=0;r=0}},{key:"setName",value:function(t){var e=/\s+/g;this.name=t.replace(e,"-"),this._assignment&&(this._assignment.experimentSalt=this.getSalt())}},{key:"__asBlob",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={name:this.getName(),time:(new Date).getTime()/1e3,salt:this.getSalt(),inputs:this.inputs,params:this._assignment.getParams()};return(0,s.extend)(e,t),e}},{key:"setAutoExposureLogging",value:function(t){this._autoExposureLog=t}},{key:"getParams",value:function(){return this.requireAssignment(),this.requireExposureLogging(),this._assignment.getParams()}},{key:"get",value:function(t,e){return this.requireAssignment(),this.requireExposureLogging(t),this._assignment.get(t,e)}},{key:"toString",value:function(){return this.requireAssignment(),this.requireExposureLogging(),JSON.stringify(this.__asBlob())}},{key:"logExposure",value:function(t){this.inExperiment()&&(this._exposureLogged=!0,this.logEvent("exposure",t))}},{key:"shouldLogExposure",value:function(t){return!(void 0!==t&&!this.shouldFetchExperimentParameter(t))&&(this._autoExposureLog&&!this.previouslyLogged())}},{key:"logEvent",value:function(t,e){if(this.inExperiment()){var n;n=e?{event:t,extra_data:(0,s.shallowCopy)(e)}:{event:t},this.log(this.__asBlob(n))}}},{key:"configureLogger",value:function(){throw"IMPLEMENT configureLogger"}},{key:"log",value:function(t){throw"IMPLEMENT log"}},{key:"previouslyLogged",value:function(){throw"IMPLEMENT previouslyLogged"}}]),t}();e.default=f,t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments[2],r=this.compatZeroToOneCalculation(n);return r*(e-t)+t}},{key:"getHash",value:function(t){var e;if(this.args.full_salt)e=this.getArgString("full_salt")+".";else{var n=this.getArgString("salt");e=this.mapper.get("experimentSalt")+"."+n+this.mapper.get("saltSeparator")}var r=this.getUnit(t).map(function(t){return String(t)}).join("."),i=e+r,o=(0,l.default)(i);return this.compatHashCalculation(o)}}]),e}(s.PlanOutOpSimple),p=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.getUniform(t,e)}}]),e}(t)},g=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"compatRandomIntegerCalculation",value:function(t,e){return(this.getHash()+t)%(e-t+1)}},{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.compatRandomIntegerCalculation(t,e)}}]),e}(t)},y=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p");if(t<0||t>1)throw"Invalid probability";return this.getUniform(0,1)<=t?1:0}}]),e}(t)},v=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p"),e=this.getArgList("choices");if(t<0||t>1)throw"Invalid probability";if(0==e.length)return[];for(var n=[],r=0;r0;o--){var u=this.compatSampleIndexCalculation(o),a=t[o];if(t[o]=t[u],t[u]=a,i&&r===o)return t.slice(o,n)}return t.slice(0,e)}},{key:"simpleExecute",value:function(){var t=(0,c.shallowCopy)(this.getArgList("choices")),e=0;return e=void 0!==this.args.draws?this.getArgNumber("draws"):t.length,this.sample(t,e)}}]),e}(t)};e.default={PlanOutOpRandom:h,SampleBuilder:_,Sample:_(h),WeightedChoiceBuilder:d,WeightedChoice:d(h),UniformChoiceBuilder:m,UniformChoice:m(h),BernoulliFilterBuilder:v,BernoulliFilter:v(h),BernoulliTrialBuilder:y,BernoulliTrial:y(h),RandomIntegerBuilder:g,RandomInteger:g(h),RandomFloatBuilder:p,RandomFloat:p(h)},t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.PlanOutOpUnary=e.PlanOutOpBinary=e.PlanOutOpCommutative=e.PlanOutOpSimple=e.PlanOutOp=void 0;var u=function(){function t(t,e){for(var n=0;n=0&&u=0&&e<=P},k=function(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)},T=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(t,e,n,r){return S(t)||(t=N(t)),("number"!=typeof n||r)&&(n=0),t.indexOf(e)>=0},N=function(t){for(var e=l(t),n=e.length,r=Array(n),i=0;i>5]|=128<<24-o%32,n[(o+64>>>9<<4)+15]=o;for(var h=0;h>>31}var b=(a<<5|a>>>27)+c+(u[d]>>>0)+(d<20?(s&f|~s&l)+1518500249:d<40?(s^f^l)+1859775393:d<60?(s&f|s&l|f&l)-1894007588:(s^f^l)-899497514);c=l,l=f,f=s<<30|s>>>2,s=a,a=b}a+=p,s+=g,f+=y,l+=v,c+=m}return[a,s,f,l,c]},a=function(t,e){var n=r.wordsToBytes(u(t));return e&&e.asBytes?n:e&&e.asString?o.bytesToString(n):r.bytesToHex(n)};a._blocksize=16,a._digestsize=20,t.exports=a}()}).call(e,n(7).Buffer)},function(t,e,n){(function(t,r){/*! +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.planout=e():t.planout=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),u=i(o),a=n(13),s=i(a),f=n(18),l=i(f),c=n(15),h=i(c),p=n(16),g=r(p),y=n(2),v=i(y),d=n(17),m=i(d);e.default={Namespace:g,Assignment:v.default,Interpreter:s.default,Experiment:u.default,ExperimentSetup:m.default,Ops:{Random:l.default,Core:h.default}},t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n=0}},{key:"setName",value:function(t){var e=/\s+/g;this.name=t.replace(e,"-"),this._assignment&&(this._assignment.experimentSalt=this.getSalt())}},{key:"__asBlob",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={name:this.getName(),time:(new Date).getTime()/1e3,salt:this.getSalt(),inputs:this.inputs,params:this._assignment.getParams()};return(0,s.extend)(e,t),e}},{key:"setAutoExposureLogging",value:function(t){this._autoExposureLog=t}},{key:"getParams",value:function(){return this.requireAssignment(),this.requireExposureLogging(),this._assignment.getParams()}},{key:"get",value:function(t,e){return this.requireAssignment(),this.requireExposureLogging(t),this._assignment.get(t,e)}},{key:"toString",value:function(){return this.requireAssignment(),this.requireExposureLogging(),JSON.stringify(this.__asBlob())}},{key:"logExposure",value:function(t){this.inExperiment()&&(this._exposureLogged=!0,this.logEvent("exposure",t))}},{key:"shouldLogExposure",value:function(t){return!(void 0!==t&&!this.shouldFetchExperimentParameter(t))&&(this._autoExposureLog&&!this.previouslyLogged())}},{key:"logEvent",value:function(t,e){if(this.inExperiment()){var n;n=e?{event:t,extra_data:(0,s.shallowCopy)(e)}:{event:t},this.log(this.__asBlob(n))}}},{key:"configureLogger",value:function(){throw"IMPLEMENT configureLogger"}},{key:"log",value:function(t){throw"IMPLEMENT log"}},{key:"previouslyLogged",value:function(){throw"IMPLEMENT previouslyLogged"}}]),t}();e.default=f,t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments[2],r=this.compatZeroToOneCalculation(n);return r*(e-t)+t}},{key:"getHash",value:function(t){var e;if(this.args.full_salt)e=this.getArgString("full_salt")+".";else{var n=this.getArgString("salt");e=this.mapper.get("experimentSalt")+"."+n+this.mapper.get("saltSeparator")}var r=this.getUnit(t).map(function(t){return String(t)}).join("."),i=e+r,o=(0,l.default)(i);return this.compatHashCalculation(o)}}]),e}(s.PlanOutOpSimple),p=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.getUniform(t,e)}}]),e}(t)},g=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"compatRandomIntegerCalculation",value:function(t,e){return(this.getHash()+t)%(e-t+1)}},{key:"simpleExecute",value:function(){var t=this.getArgNumber("min"),e=this.getArgNumber("max");return this.compatRandomIntegerCalculation(t,e)}}]),e}(t)},y=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p");if(t<0||t>1)throw"Invalid probability";return this.getUniform(0,1)<=t?1:0}}]),e}(t)},v=function(t){return function(t){function e(){return i(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return u(e,t),a(e,[{key:"simpleExecute",value:function(){var t=this.getArgNumber("p"),e=this.getArgList("choices");if(t<0||t>1)throw"Invalid probability";if(0==e.length)return[];for(var n=[],r=0;r0;o--){var u=this.compatSampleIndexCalculation(o),a=t[o];if(t[o]=t[u],t[u]=a,i&&r===o)return t.slice(o,n)}return t.slice(0,e)}},{key:"simpleExecute",value:function(){var t=(0,c.shallowCopy)(this.getArgList("choices")),e=0;return e=void 0!==this.args.draws?this.getArgNumber("draws"):t.length,this.sample(t,e)}}]),e}(t)};e.default={PlanOutOpRandom:h,SampleBuilder:_,Sample:_(h),WeightedChoiceBuilder:m,WeightedChoice:m(h),UniformChoiceBuilder:d,UniformChoice:d(h),BernoulliFilterBuilder:v,BernoulliFilter:v(h),BernoulliTrialBuilder:y,BernoulliTrial:y(h),RandomIntegerBuilder:g,RandomInteger:g(h),RandomFloatBuilder:p,RandomFloat:p(h)},t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.PlanOutOpUnary=e.PlanOutOpBinary=e.PlanOutOpCommutative=e.PlanOutOpSimple=e.PlanOutOp=void 0;var u=function(){function t(t,e){for(var n=0;n=0&&u=0&&e<=P},k=function(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)},T=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],R=function(t,e,n,r){return S(t)||(t=N(t)),("number"!=typeof n||r)&&(n=0),t.indexOf(e)>=0},N=function(t){for(var e=l(t),n=e.length,r=Array(n),i=0;i>5]|=128<<24-o%32,n[(o+64>>>9<<4)+15]=o;for(var h=0;h>>31}var b=(a<<5|a>>>27)+c+(u[m]>>>0)+(m<20?(s&f|~s&l)+1518500249:m<40?(s^f^l)+1859775393:m<60?(s&f|s&l|f&l)-1894007588:(s^f^l)-899497514);c=l,l=f,f=s<<30|s>>>2,s=a,a=b}a+=p,s+=g,f+=y,l+=v,c+=d}return[a,s,f,l,c]},a=function(t,e){var n=r.wordsToBytes(u(t));return e&&e.asBytes?n:e&&e.asString?o.bytesToString(n):r.bytesToHex(n)};a._blocksize=16,a._digestsize=20,t.exports=a}()}).call(e,n(7).Buffer)},function(t,e,n){(function(t){/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -"use strict";function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,n){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(e){return+e!=e&&(e=0),t.alloc(+e)}function m(e,n){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(i)return H(e).length;n=(""+n).toLowerCase(),i=!0}}function d(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:O(e,n,r,i,o);if("number"==typeof n)return n&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):O(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function O(t,e,n,r,i){function o(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,n/=2}var f;if(i){var l=-1;for(f=n;fa&&(n=a-s),f=n;f>=0;f--){for(var c=!0,h=0;hi&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u239?4:o>223?3:o>191?2:1;if(i+a<=n){var s,f,l,c;switch(a){case 1:o<128&&(u=o);break;case 2:s=t[i+1],128===(192&s)&&(c=(31&o)<<6|63&s,c>127&&(u=c));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(c=(15&o)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:s=t[i+1],f=t[i+2],l=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&l)&&(c=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(u=c))}}null===u?(u=65533,a=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=a}return j(r)}function j(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function C(e,n,r,i,o,u){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>o||ne.length)throw new RangeError("Index out of range")}function I(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function U(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,r,i){return i||D(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,n,r,23,4),n+4}function Y(t,e,n,r,i){return i||D(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,n,r,52,8),n+8}function q(t){if(t=G(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],u=0;u55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function V(t){return J.toByteArray(q(t))}function Z(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function K(t){return t!==t}var J=n(8),X=n(9),Q=n(10);e.Buffer=t,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,n){return a(null,t,e,n)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,n){return f(null,t,e,n)},t.allocUnsafe=function(t){return l(null,t)},t.allocUnsafeSlow=function(t){return l(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,i=n.length,o=0,u=Math.min(r,i);o0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},t.prototype.compare=function(e,n,r,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var u=o-i,a=r-n,s=Math.min(u,a),f=this.slice(i,o),l=e.slice(n,r),c=0;ci)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return P(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n0&&(i*=256);)r+=this[t+--e]*i;return r},t.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,o=0;++o=i&&(r-=Math.pow(2,8*e)),r},t.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),X.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),X.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),X.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),X.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;C(this,t,e,n,i,0)}var o=1,u=0;for(this[e]=255&t;++u=0&&(u*=256);)this[e+o]=t/u&255;return e+n},t.prototype.writeUInt8=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},t.prototype.writeUInt16LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):I(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):I(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):U(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):U(this,e,n,!1),n+4},t.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},t.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+n},t.prototype.writeInt8=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1},t.prototype.writeInt16LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):I(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):I(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):U(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,r){return e=+e,n|=0,r||C(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):U(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return Y(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return Y(this,t,e,!1,n)},t.prototype.copy=function(e,n,r,i){if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n=0;--o)e[o+n]=this[o+r];else if(u<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var u;if("number"==typeof e)for(u=n;u0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,o,u,a,s=t.length;u=n(t),a=new l(3*s/4-u),i=u>0?s-4:s;var c=0;for(e=0,r=0;e>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===u?(o=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,a[c++]=255&o):1===u&&(o=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function o(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function u(t,e,n){for(var r,i=[],u=e;ul?l:f+a));return 1===r?(e=t[n-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=a;for(var s=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=c.length;h>1,l=-7,c=n?i-1:0,h=n?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=h,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=r;l>0;u=256*u+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===s)return u?NaN:(p?-1:1)*(1/0);u+=Math.pow(2,r),o-=f}return(p?-1:1)*u*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var u,a,s,f=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,g=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+c>=1?h/s:h*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(e*s-1)*Math.pow(2,i),u+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[n+p]=255&a,p+=g,a/=256,i-=8);for(u=u<0;t[n+p]=255&u,p+=g,u/=256,f-=8);t[n+p-g]|=128*y}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){!function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};t.exports=n}()},function(t,e){var n={utf8:{stringToBytes:function(t){return n.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(n.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:"global_salt",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];i(this,t),this._serialization=e,o?this._env=o:this._env=new a.default(n),this.experimentSalt=this._experimentSalt=n,this._evaluated=!1,this._inExperiment=!1,this._inputs=(0,f.shallowCopy)(r)}return o(t,[{key:"inExperiment",value:function(){return this._inExperiment}},{key:"setEnv",value:function(t){return this._env=(0,f.deepCopy)(t),this}},{key:"has",value:function(t){return this._env[t]}},{key:"get",value:function(t,e){var n=this._inputs[t];null!==n&&void 0!==n||(n=e);var r=this._env.get(t);return void 0!==r&&null!==r?r:n}},{key:"getParams",value:function(){if(!this._evaluated){try{this.evaluate(this._serialization)}catch(t){t instanceof s.StopPlanOutException&&(this._inExperiment=t.inExperiment)}this._evaluated=!0}return this._env.getParams()}},{key:"set",value:function(t,e){return this._env.set(t,e),this}},{key:"getSaltSeparator",value:function(){return this._env.saltSeparator}},{key:"setOverrides",value:function(t){return this._env.setOverrides(t),this}},{key:"getOverrides",value:function(){return this._env.getOverrides()}},{key:"hasOverride",value:function(t){var e=this.getOverrides();return e&&void 0!==e[t]}},{key:"registerCustomOperators",value:function(t){(0,s.registerOperators)(t)}},{key:"evaluate",value:function(t){if((0,f.isObject)(t)&&t.op)return(0,s.operatorInstance)(t).execute(this);if((0,f.isArray)(t)){var e=this;return(0,f.map)(t,function(t){return e.evaluate(t)})}return t}}]),t}();e.default=l,t.exports=e.default},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.registerOperators=e.StopPlanOutException=e.operatorInstance=e.isOperator=e.initFactory=e.operators=void 0;var o=n(15),u=r(o),a=n(3),s=r(a),f=n(5),l=function(){return{literal:u.Literal,get:u.Get,set:u.Set,seq:u.Seq,return:u.Return,index:u.Index,array:u.Arr,equals:u.Equals,and:u.And,or:u.Or,">":u.GreaterThan,"<":u.LessThan,">=":u.GreaterThanOrEqualTo,"<=":u.LessThanOrEqualTo,"%":u.Mod,"/":u.Divide,not:u.Not,round:u.Round,negative:u.Negative,min:u.Min,max:u.Max,length:u.Length,coalesce:u.Coalesce,map:u.Map,cond:u.Cond,product:u.Product,sum:u.Sum,randomFloat:s.RandomFloat,randomInteger:s.RandomInteger,bernoulliTrial:s.BernoulliTrial,bernoulliFilter:s.BernoulliFilter,uniformChoice:s.UniformChoice,weightedChoice:s.WeightedChoice,sample:s.Sample}},c=l(),h=function(t){return(0,f.isObject)(t)&&t.op},p=function(t){var e=t.op;if(!c[e])throw"Unknown Operator "+e;return new c[e](t)},g=function(t){(0,f.forEach)(t,function(t,e){if(c[e])throw e+" already is defined";c[e]=t})},y=function t(e){i(this,t),this.inExperiment=e};e.operators=c,e.initFactory=l,e.isOperator=h,e.operatorInstance=p,e.StopPlanOutException=y,e.registerOperators=g},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Return=e.Length=e.Max=e.Min=e.Negative=e.Not=e.Round=e.Divide=e.Mod=e.GreaterThanOrEqualTo=e.LessThanOrEqualTo=e.LessThan=e.GreaterThan=e.Equals=e.Sum=e.Product=e.Or=e.And=e.Cond=e.Index=e.Coalesce=e.Map=e.Arr=e.Set=e.Seq=e.Get=e.Literal=void 0;var u=function(){function t(t,e){for(var n=0;n=0&&ee}}]),e}(a.PlanOutOpBinary),P=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t=e}}]),e}(a.PlanOutOpBinary),k=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t%e}}]),e}(a.PlanOutOpBinary),T=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return parseFloat(t)/parseFloat(e)}}]),e}(a.PlanOutOpBinary),j=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return Math.round(t)}}]),e}(a.PlanOutOpUnary),R=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"!"}},{key:"unaryExecute",value:function(t){return!t}}]),e}(a.PlanOutOpUnary),N=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"-"}},{key:"unaryExecute",value:function(t){return 0-t}}]),e}(a.PlanOutOpUnary),B=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.min.apply(null,t)}}]),e}(a.PlanOutOpCommutative),L=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.max.apply(null,t)}}]),e}(a.PlanOutOpCommutative),M=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return t.length}}]),e}(a.PlanOutOpUnary),C=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"simpleExecute",value:function(){var t=(0,f.deepCopy)(this.args);return delete t.op,delete t.salt,t}}]),e}(a.PlanOutOpSimple);e.Literal=l,e.Get=c,e.Seq=h,e.Set=g,e.Arr=y,e.Map=C,e.Coalesce=v,e.Index=m,e.Cond=d,e.And=_,e.Or=b,e.Product=O,e.Sum=w,e.Equals=E,e.GreaterThan=x,e.LessThan=P,e.LessThanOrEqualTo=A,e.GreaterThanOrEqualTo=S,e.Mod=k,e.Divide=T,e.Round=j,e.Not=R,e.Negative=N,e.Min=B,e.Max=L,e.Length=M,e.Return=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleNamespace=e.Namespace=void 0;var a=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;if(void 0!==u)return u.call(r)},s=function(){function t(t,e){for(var n=0;n15&&N(M,E,t),a=!1):l.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1,f=n(f,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(M=0);if((a="number"==typeof t)&&0*t==0){if(l.s=1/t<0?(t=-t,-1):1,t===~~t){for(o=0,u=t;u>=10;u/=10,o++);return l.e=o,l.c=[t],void(M=0)}f=t+""}else{if(!d.test(f=t+""))return m(l,f,a);l.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1}}for((o=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(o<0&&(o=u),o+=+f.slice(u+1),f=f.substring(0,u)):o<0&&(o=f.length),u=0;48===f.charCodeAt(u);u++);for(s=f.length;48===f.charCodeAt(--s););if(f=f.slice(u,s+1))if(s=f.length,a&&z&&s>15&&N(M,E,l.s*t),o=o-u-1,o>G)l.c=l.e=null;else if(o=0&&(s=V,V=0,t=t.replace(".",""),g=new e(r),l=g.pow(t.length-y),V=s,g.c=c(p(a(l.c),l.e),10,n),g.e=g.c.length),h=c(t,r,n),u=s=h.length;0==h[--s];h.pop());if(!h[0])return"0";if(y<0?--u:(l.c=h,l.e=u,l.s=i,l=L(l,g,v,m,n),h=l.c,f=l.r,u=l.e),o=u+v+1,y=h[o],s=n/2,f=f||o<0||null!=h[o+1],f=m<4?(null!=y||f)&&(0==m||m==(l.s<0?3:2)):y>s||y==s&&(4==m||f||6==m&&1&h[o-1]||m==(l.s<0?8:7)),o<1||!h[0])t=f?p("1",-v):"0";else{if(h.length=o,f)for(--n;++h[--o]>n;)h[o]=0,o||(++u,h.unshift(1));for(s=h.length;!h[--s];);for(y=0,t="";y<=s;t+=x.charAt(h[y++]));t=p(t,u)}return t}function r(t,n,r,i){var o,u,s,f,l;if(r=null!=r&&H(r,0,8,i,w)?0|r:D,!t.c)return t.toString();if(o=t.c[0],s=t.e,null==n)l=a(t.c),l=19==i||24==i&&s<=F?h(l,s):p(l,s);else if(t=B(new e(t),n,r),u=t.e,l=a(t.c),f=l.length,19==i||24==i&&(n<=u||u<=F)){for(;ff){if(--n>0)for(l+=".";n--;l+="0");}else if(n+=u-f,n>0)for(u+1==f&&(l+=".");n--;l+="0");return t.s<0&&o?"-"+l:l}function i(t,n){var r,i,o=0;for(l(t[0])&&(t=t[0]),r=new e(t[0]);++on||t!=g(t))&&N(r,(i||"decimal places")+(tn?" out of range":" not an integer"),t),!0}function R(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*A-1)>G?t.c=t.e=null:n=10;a/=10,i++);if(o=e-i,o<0)o+=A,u=e,s=c[f=0],l=s/h[i-u-1]%10|0;else if(f=_((o+1)/A),f>=c.length){if(!r)break t;for(;c.length<=f;c.push(0));s=l=0,i=1,o%=A,u=o-A+1}else{for(s=a=c[f],i=1;a>=10;a/=10,i++);o%=A,u=o-A+i,l=u<0?0:s/h[i-u-1]%10|0}if(r=r||e<0||null!=c[f+1]||(u<0?s:s%h[i-u-1]),r=n<4?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?u>0?s/h[i-u]:0:c[f-1])%10&1||n==(t.s<0?8:7)),e<1||!c[0])return c.length=0,r?(e-=t.e+1,c[0]=h[e%A],t.e=-e||0):c[0]=t.e=0,t;if(0==o?(c.length=f,a=1,f--):(c.length=f+1,a=h[A-o],c[f]=u>0?b(s/h[i-u]%h[u])*a:0),r)for(;;){if(0==f){for(o=1,u=c[0];u>=10;u/=10,o++);for(u=c[0]+=a,a=1;u>=10;u/=10,a++);o!=a&&(t.e++,c[0]==P&&(c[0]=1));break}if(c[f]+=a,c[f]!=P)break;c[f--]=0,a=1}for(o=c.length;0===c[--o];c.pop());}t.e>G?t.c=t.e=null:t.en)return null!=(t=i[n++])};return u(e="DECIMAL_PLACES")&&H(t,0,j,2,e)&&(U=0|t),r[e]=U,u(e="ROUNDING_MODE")&&H(t,0,8,2,e)&&(D=0|t),r[e]=D,u(e="EXPONENTIAL_AT")&&(l(t)?H(t[0],-j,0,2,e)&&H(t[1],0,j,2,e)&&(F=0|t[0],Y=0|t[1]):H(t,-j,j,2,e)&&(F=-(Y=0|(t<0?-t:t)))),r[e]=[F,Y],u(e="RANGE")&&(l(t)?H(t[0],-j,-1,2,e)&&H(t[1],1,j,2,e)&&(q=0|t[0],G=0|t[1]):H(t,-j,j,2,e)&&(0|t?q=-(G=0|(t<0?-t:t)):z&&N(2,e+" cannot be zero",t))),r[e]=[q,G],u(e="ERRORS")&&(t===!!t||1===t||0===t?(M=0,H=(z=!!t)?y:f):z&&N(2,e+O,t)),r[e]=z,u(e="CRYPTO")&&(t===!!t||1===t||0===t?(W=!(!t||!v||"object"!=typeof v),t&&!W&&z&&N(2,"crypto unavailable",v)):z&&N(2,e+O,t)),r[e]=W,u(e="MODULO_MODE")&&H(t,0,9,2,e)&&($=0|t),r[e]=$,u(e="POW_PRECISION")&&H(t,0,j,2,e)&&(V=0|t),r[e]=V,u(e="FORMAT")&&("object"==typeof t?Z=t:z&&N(2,e+" not an object",t)),r[e]=Z,r},e.max=function(){return i(arguments,C.lt)},e.min=function(){return i(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return b(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,i,o,u,a,s=0,f=[],l=new e(I);if(t=null!=t&&H(t,0,j,14)?0|t:U,u=_(t/A),W)if(v&&v.getRandomValues){for(r=v.getRandomValues(new Uint32Array(u*=2));s>>11),a>=9e15?(i=v.getRandomValues(new Uint32Array(2)),r[s]=i[0],r[s+1]=i[1]):(f.push(a%1e14),s+=2);s=u/2}else if(v&&v.randomBytes){for(r=v.randomBytes(u*=7);s=9e15?v.randomBytes(7).copy(r,s):(f.push(a%1e14),s+=7);s=u/7}else z&&N(14,"crypto unavailable",v);if(!s)for(;s=10;a/=10,s++);sr?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function r(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;t.shift());}return function(i,o,a,s,f){var l,c,h,p,g,y,v,m,d,_,O,w,E,x,S,k,T,j=i.s==o.s?1:-1,R=i.c,N=o.c;if(!(R&&R[0]&&N&&N[0]))return new e(i.s&&o.s&&(R?!N||R[0]!=N[0]:N)?R&&0==R[0]||!N?0*j:j/0:NaN);for(m=new e(j),d=m.c=[],c=i.e-o.e,j=a+c+1,f||(f=P,c=u(i.e/A)-u(o.e/A),j=j/A|0),h=0;N[h]==(R[h]||0);h++);if(N[h]>(R[h]||0)&&c--,j<0)d.push(1),p=!0;else{for(x=R.length,k=N.length,h=0,j+=2,g=b(f/(N[0]+1)),g>1&&(N=t(N,g,f),R=t(R,g,f),k=N.length,x=R.length),E=k,_=R.slice(0,k),O=_.length;O=f/2&&S++;do{if(g=0,l=n(N,_,k,O),l<0){if(w=_[0],k!=O&&(w=w*f+(_[1]||0)),g=b(w/S),g>1)for(g>=f&&(g=f-1),y=t(N,g,f),v=y.length,O=_.length;1==n(y,_,v,O);)g--,r(y,k=10;j/=10,h++);B(m,a+(m.e=h+c*A-1)+1,s,p)}else m.e=c,m.r=+p;return m}}(),m=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(u,a,s,f){var l,c=s?a:a.replace(o,"");if(i.test(c))u.s=isNaN(c)?null:c<0?-1:1;else{if(!s&&(c=c.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,f&&f!=l?t:e}),f&&(l=f,c=c.replace(n,"$1").replace(r,"0.$1")),a!=c))return new e(c,l);z&&N(M,"not a"+(f?" base "+f:"")+" number",a),u.s=null}u.c=u.e=null,M=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return B(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return M=1,s(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-u(this.e/A))*A,e=n[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},C.dividedBy=C.div=function(t,n){return M=3,L(this,new e(t,n),U,D)},C.dividedToIntegerBy=C.divToInt=function(t,n){return M=4,L(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return M=5,0===s(this,new e(t,n))},C.floor=function(){return B(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return M=6,s(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return M=7,1===(n=s(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&u(this.e/A)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return M=8,s(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return M=9,(n=s(this,new e(t,n)))===-1||0===n},C.minus=C.sub=function(t,n){var r,i,o,a,s=this,f=s.s;if(M=10,t=new e(t,n),n=t.s,!f||!n)return new e(NaN);if(f!=n)return t.s=-n,s.plus(t);var l=s.e/A,c=t.e/A,h=s.c,p=t.c;if(!l||!c){if(!h||!p)return h?(t.s=-n,t):new e(p?s:NaN);if(!h[0]||!p[0])return p[0]?(t.s=-n,t):new e(h[0]?s:3==D?-0:0)}if(l=u(l),c=u(c),h=h.slice(),f=l-c){for((a=f<0)?(f=-f,o=h):(c=l,o=p),o.reverse(),n=f;n--;o.push(0));o.reverse()}else for(i=(a=(f=h.length)<(n=p.length))?f:n,f=n=0;n0)for(;n--;h[r++]=0);for(n=P-1;i>f;){if(h[--i]0?(s=a,r=l):(o=-o,r=f),r.reverse();o--;r.push(0));r.reverse()}for(o=f.length,n=l.length,o-n<0&&(r=l,l=f,f=r,n=o),o=0;n;)o=(f[--n]=f[n]+l[n]+o)/P|0,f[n]%=P;return o&&(f.unshift(o),++s),R(t,f,s)},C.precision=C.sd=function(t){var e,n,r=this,i=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(z&&N(13,"argument"+O,t),t!=!!t&&(t=null)),!i)return null;if(n=i.length-1,e=n*A+1,n=i[n]){for(;n%10==0;n/=10,e--);for(n=i[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},C.round=function(t,n){var r=new e(this);return(null==t||H(t,0,j,15))&&B(r,~~t+this.e+1,null!=n&&H(n,0,8,15,w)?0|n:D),r},C.shift=function(t){var n=this;return H(t,-S,S,16,"argument")?n.times("1e"+g(t)):new e(n.c&&n.c[0]&&(t<-S||t>S)?n.s*(t<0?0:1/0):n)},C.squareRoot=C.sqrt=function(){var t,n,r,i,o,s=this,f=s.c,l=s.s,c=s.e,h=U+4,p=new e("0.5");if(1!==l||!f||!f[0])return new e(!l||l<0&&(!f||f[0])?NaN:f?s:1/0);if(l=Math.sqrt(+s),0==l||l==1/0?(n=a(f),(n.length+c)%2==0&&(n+="0"),l=Math.sqrt(n),c=u((c+1)/2)-(c<0||c%2),l==1/0?n="1e"+c:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+c),r=new e(n)):r=new e(l+""),r.c[0])for(c=r.e,l=c+h,l<3&&(l=0);;)if(o=r,r=p.times(o.plus(L(s,o,h,1))),a(o.c).slice(0,l)===(n=a(r.c)).slice(0,l)){if(r.e=0;){for(r=0,g=O[o]%d,y=O[o]/d|0,s=l,a=o+s;a>o;)c=b[--s]%d,h=b[s]/d|0,f=y*c+h*g,c=g*c+f%d*d+v[a]+r,r=(c/m|0)+(f/d|0)+y*h,v[a--]=c%m;v[a]=r}return r?++i:v.shift(),R(t,v,i)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&H(t,1,j,18,"precision")?0|t:null,n=null!=n&&H(n,0,8,18,w)?0|n:D,t?B(r,t,n):r},C.toExponential=function(t,e){return r(this,null!=t&&H(t,0,j,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return r(this,null!=t&&H(t,0,j,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=r(this,null!=t&&H(t,0,j,21)?~~t+this.e+1:null,e,21);if(this.c){var i,o=n.split("."),u=+Z.groupSize,a=+Z.secondaryGroupSize,s=Z.groupSeparator,f=o[0],l=o[1],c=this.s<0,h=c?f.slice(1):f,p=h.length;if(a&&(i=u,u=a,a=i,p-=i),u>0&&p>0){for(i=p%u||u,f=h.substr(0,i);i0&&(f+=s+h.slice(i)),c&&(f="-"+f)}n=l?f+Z.decimalSeparator+((a=+Z.fractionGroupSize)?l.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+Z.fractionGroupSeparator):l):f}return n},C.toFraction=function(t){var n,r,i,o,u,s,f,l,c,h=z,p=this,g=p.c,y=new e(I),v=r=new e(I),m=f=new e(I);if(null!=t&&(z=!1,s=new e(t),z=h,(h=s.isInt())&&!s.lt(I)||(z&&N(22,"max denominator "+(h?"out of range":"not an integer"),t),t=!h&&s.c&&B(s,s.e+1,1).gte(I)?s:null)),!g)return p.toString();for(c=a(g),o=y.e=c.length-p.e-1,y.c[0]=k[(u=o%A)<0?A+u:u],t=!t||s.cmp(y)>0?o>0?y:v:s,u=G,G=1/0,s=new e(c),f.c[0]=0;l=L(s,y,0,1),i=r.plus(l.times(m)),1!=i.cmp(t);)r=m,m=i,v=f.plus(l.times(i=v)),f=i,y=s.minus(l.times(i=y)),s=i;return i=L(t.minus(r),m,0,1),f=f.plus(i.times(v)),r=r.plus(i.times(m)),f.s=v.s=p.s,o*=2,n=L(v,m,o,D).minus(p).abs().cmp(L(f,r,o,D).minus(p).abs())<1?[v.toString(),m.toString()]:[f.toString(),r.toString()],G=u,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:NaN)},C.toPower=C.pow=function(t){var n,r,i=b(t<0?-t:+t),o=this;if(!H(t,-S,S,23,"exponent")&&(!isFinite(t)||i>S&&(t/=0)||parseFloat(t)!=t&&!(t=NaN)))return new e(Math.pow(+o,t));for(n=V?_(V/A+2):0,r=new e(I);;){if(i%2){if(r=r.times(o),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(i=b(i/2),!i)break;o=o.times(o),n&&o.c&&o.c.length>n&&(o.c.length=n)}return t<0&&(r=I.div(r)),n?B(r,V,D):r},C.toPrecision=function(t,e){return r(this,null!=t&&H(t,1,j,24,"precision")?0|t:null,e,24)},C.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(e=a(r.c),e=null!=t&&H(t,2,64,25,"base")?n(p(e,o),0|t,10,i):o<=F||o>=Y?h(e,o):p(e,o),i<0&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return B(new e(this),this.e+1,1)},C.valueOf=C.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function u(t){var e=0|t;return t>0||t===e?e:e-1}function a(t){for(var e,n,r=1,i=t.length,o=t[0]+"";rf^n?1:-1;for(a=(s=i.length)<(f=o.length)?s:f,u=0;uo[u]^n?1:-1;return s==f?0:s>f^n?1:-1}function f(t,e,n){return(t=g(t))>=e&&t<=n}function l(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,i,o=[0],u=0,a=t.length;un-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function h(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function p(t,e){var n,r;if(e<0){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else e=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),u.alloc(+t)}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function _(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:O(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):O(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function O(t,e,n,r,i){function o(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,n/=2}var f;if(i){var l=-1;for(f=n;fa&&(n=a-s),f=n;f>=0;f--){for(var c=!0,h=0;hi&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u239?4:o>223?3:o>191?2:1;if(i+a<=n){var s,f,l,c;switch(a){case 1:o<128&&(u=o);break;case 2:s=t[i+1],128===(192&s)&&(c=(31&o)<<6|63&s,c>127&&(u=c));break;case 3:s=t[i+1],f=t[i+2],128===(192&s)&&128===(192&f)&&(c=(15&o)<<12|(63&s)<<6|63&f,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:s=t[i+1],f=t[i+2],l=t[i+3],128===(192&s)&&128===(192&f)&&128===(192&l)&&(c=(15&o)<<18|(63&s)<<12|(63&f)<<6|63&l,c>65535&&c<1114112&&(u=c))}}null===u?(u=65533,a=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=a}return j(r)}function j(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",r=0;rr)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function U(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function D(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,r,i){return i||D(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,n,r,23,4),n+4}function Y(t,e,n,r,i){return i||D(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,n,r,52,8),n+8}function q(t){if(t=G(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],u=0;u55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(t){for(var e=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function V(t){return J.toByteArray(q(t))}function Z(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function K(t){return t!==t}var J=n(8),X=n(9),Q=n(10);e.Buffer=u,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),e.kMaxLength=i(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return a(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return f(null,t,e,n)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,a=n-e,s=Math.min(o,a),f=this.slice(r,i),l=t.slice(e,n),c=0;ci)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return P(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;u.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,o=0;++o=i&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},u.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),X.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),X.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),X.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),X.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;C(this,t,e,n,i,0)}var o=1,u=0;for(this[e]=255&t;++u=0&&(u*=256);)this[e+o]=t/u&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return Y(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return Y(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,o,u,a,s=t.length;u=n(t),a=new l(3*s/4-u),i=u>0?s-4:s;var c=0;for(e=0,r=0;e>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===u?(o=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,a[c++]=255&o):1===u&&(o=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}function o(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function u(t,e,n){for(var r,i=[],u=e;ul?l:f+a));return 1===r?(e=t[n-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=a;for(var s=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=c.length;h>1,l=-7,c=n?i-1:0,h=n?-1:1,p=t[e+c];for(c+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=h,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=r;l>0;u=256*u+t[e+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===s)return u?NaN:(p?-1:1)*(1/0);u+=Math.pow(2,r),o-=f}return(p?-1:1)*u*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var u,a,s,f=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,g=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=l):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+c>=1?h/s:h*Math.pow(2,1-c),e*s>=2&&(u++,s/=2),u+c>=l?(a=0,u=l):u+c>=1?(a=(e*s-1)*Math.pow(2,i),u+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[n+p]=255&a,p+=g,a/=256,i-=8);for(u=u<0;t[n+p]=255&u,p+=g,u/=256,f-=8);t[n+p-g]|=128*y}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){!function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};t.exports=n}()},function(t,e){var n={utf8:{stringToBytes:function(t){return n.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(n.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:"global_salt",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];i(this,t),this._serialization=(0,f.deepCopy)(e),o?this._env=o:this._env=new a.default(n),this.experimentSalt=this._experimentSalt=n,this._evaluated=!1,this._inExperiment=!1,this._inputs=(0,f.shallowCopy)(r)}return o(t,[{key:"inExperiment",value:function(){return this._inExperiment}},{key:"setEnv",value:function(t){return this._env=(0,f.deepCopy)(t),this}},{key:"has",value:function(t){return this._env[t]}},{key:"get",value:function(t,e){var n=this._inputs[t];null!==n&&void 0!==n||(n=e);var r=this._env.get(t);return void 0!==r&&null!==r?r:n}},{key:"getParams",value:function(){if(!this._evaluated){try{this.evaluate(this._serialization)}catch(t){t instanceof s.StopPlanOutException&&(this._inExperiment=t.inExperiment)}this._evaluated=!0}return this._env.getParams()}},{key:"set",value:function(t,e){return this._env.set(t,e),this}},{key:"getSaltSeparator",value:function(){return this._env.saltSeparator}},{key:"setOverrides",value:function(t){return this._env.setOverrides(t),this}},{key:"getOverrides",value:function(){return this._env.getOverrides()}},{key:"hasOverride",value:function(t){var e=this.getOverrides();return e&&void 0!==e[t]}},{key:"registerCustomOperators",value:function(t){(0,s.registerOperators)(t)}},{key:"evaluate",value:function(t){if((0,f.isObject)(t)&&t.op)return(0,s.operatorInstance)(t).execute(this);if((0,f.isArray)(t)){var e=this;return(0,f.map)(t,function(t){return e.evaluate(t)})}return t}}]),t}();e.default=l,t.exports=e.default},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.registerOperators=e.StopPlanOutException=e.operatorInstance=e.isOperator=e.initFactory=e.operators=void 0;var o=n(15),u=r(o),a=n(3),s=r(a),f=n(5),l=function(){return{literal:u.Literal,get:u.Get,set:u.Set,seq:u.Seq,return:u.Return,index:u.Index,array:u.Arr,equals:u.Equals,and:u.And,or:u.Or,">":u.GreaterThan,"<":u.LessThan,">=":u.GreaterThanOrEqualTo,"<=":u.LessThanOrEqualTo,"%":u.Mod,"/":u.Divide,not:u.Not,round:u.Round,negative:u.Negative,min:u.Min,max:u.Max,length:u.Length,coalesce:u.Coalesce,map:u.Map,cond:u.Cond,product:u.Product,sum:u.Sum,randomFloat:s.RandomFloat,randomInteger:s.RandomInteger,bernoulliTrial:s.BernoulliTrial,bernoulliFilter:s.BernoulliFilter,uniformChoice:s.UniformChoice,weightedChoice:s.WeightedChoice,sample:s.Sample}},c=l(),h=function(t){return(0,f.isObject)(t)&&t.op},p=function(t){var e=t.op;if(!c[e])throw"Unknown Operator "+e;return new c[e](t)},g=function(t){(0,f.forEach)(t,function(t,e){if(c[e])throw e+" already is defined";c[e]=t})},y=function t(e){i(this,t),this.inExperiment=e};e.operators=c,e.initFactory=l,e.isOperator=h,e.operatorInstance=p,e.StopPlanOutException=y,e.registerOperators=g},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.Return=e.Length=e.Max=e.Min=e.Negative=e.Not=e.Round=e.Divide=e.Mod=e.GreaterThanOrEqualTo=e.LessThanOrEqualTo=e.LessThan=e.GreaterThan=e.Equals=e.Sum=e.Product=e.Or=e.And=e.Cond=e.Index=e.Coalesce=e.Map=e.Arr=e.Set=e.Seq=e.Get=e.Literal=void 0;var u=function(){function t(t,e){for(var n=0;n=0&&ee}}]),e}(a.PlanOutOpBinary),P=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t=e}}]),e}(a.PlanOutOpBinary),k=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return t%e}}]),e}(a.PlanOutOpBinary),T=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"binaryExecute",value:function(t,e){return parseFloat(t)/parseFloat(e)}}]),e}(a.PlanOutOpBinary),j=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return Math.round(t)}}]),e}(a.PlanOutOpUnary),R=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"!"}},{key:"unaryExecute",value:function(t){return!t}}]),e}(a.PlanOutOpUnary),N=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"getUnaryString",value:function(){return"-"}},{key:"unaryExecute",value:function(t){return 0-t}}]),e}(a.PlanOutOpUnary),B=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.min.apply(null,t)}}]),e}(a.PlanOutOpCommutative),L=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"commutativeExecute",value:function(t){return Math.max.apply(null,t)}}]),e}(a.PlanOutOpCommutative),M=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"unaryExecute",value:function(t){return t.length}}]),e}(a.PlanOutOpUnary),C=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),u(e,[{key:"simpleExecute",value:function(){var t=(0,f.deepCopy)(this.args);return delete t.op,delete t.salt,t}}]),e}(a.PlanOutOpSimple);e.Literal=l,e.Get=c,e.Seq=h,e.Set=g,e.Arr=y,e.Map=C,e.Coalesce=v,e.Index=d,e.Cond=m,e.And=_,e.Or=b,e.Product=O,e.Sum=w,e.Equals=E,e.GreaterThan=x,e.LessThan=P,e.LessThanOrEqualTo=A,e.GreaterThanOrEqualTo=S,e.Mod=k,e.Divide=T,e.Round=j,e.Not=R,e.Negative=N,e.Min=B,e.Max=L,e.Length=M,e.Return=p},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleNamespace=e.Namespace=void 0;var a=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;if(void 0!==u)return u.call(r)},s=function(){function t(t,e){for(var n=0;n15&&N(M,E,t),a=!1):l.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1,f=n(f,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(M=0);if((a="number"==typeof t)&&0*t==0){if(l.s=1/t<0?(t=-t,-1):1,t===~~t){for(o=0,u=t;u>=10;u/=10,o++);return l.e=o,l.c=[t],void(M=0)}f=t+""}else{if(!m.test(f=t+""))return d(l,f,a);l.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1}}for((o=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(o<0&&(o=u),o+=+f.slice(u+1),f=f.substring(0,u)):o<0&&(o=f.length),u=0;48===f.charCodeAt(u);u++);for(s=f.length;48===f.charCodeAt(--s););if(f=f.slice(u,s+1))if(s=f.length,a&&z&&s>15&&N(M,E,l.s*t),o=o-u-1,o>G)l.c=l.e=null;else if(o=0&&(s=V,V=0,t=t.replace(".",""),g=new e(r),l=g.pow(t.length-y),V=s,g.c=c(p(a(l.c),l.e),10,n),g.e=g.c.length),h=c(t,r,n),u=s=h.length;0==h[--s];h.pop());if(!h[0])return"0";if(y<0?--u:(l.c=h,l.e=u,l.s=i,l=L(l,g,v,d,n),h=l.c,f=l.r,u=l.e),o=u+v+1,y=h[o],s=n/2,f=f||o<0||null!=h[o+1],f=d<4?(null!=y||f)&&(0==d||d==(l.s<0?3:2)):y>s||y==s&&(4==d||f||6==d&&1&h[o-1]||d==(l.s<0?8:7)),o<1||!h[0])t=f?p("1",-v):"0";else{if(h.length=o,f)for(--n;++h[--o]>n;)h[o]=0,o||(++u,h.unshift(1));for(s=h.length;!h[--s];);for(y=0,t="";y<=s;t+=x.charAt(h[y++]));t=p(t,u)}return t}function r(t,n,r,i){var o,u,s,f,l;if(r=null!=r&&H(r,0,8,i,w)?0|r:D,!t.c)return t.toString();if(o=t.c[0],s=t.e,null==n)l=a(t.c),l=19==i||24==i&&s<=F?h(l,s):p(l,s);else if(t=B(new e(t),n,r),u=t.e,l=a(t.c),f=l.length,19==i||24==i&&(n<=u||u<=F)){for(;ff){if(--n>0)for(l+=".";n--;l+="0");}else if(n+=u-f,n>0)for(u+1==f&&(l+=".");n--;l+="0");return t.s<0&&o?"-"+l:l}function i(t,n){var r,i,o=0;for(l(t[0])&&(t=t[0]),r=new e(t[0]);++on||t!=g(t))&&N(r,(i||"decimal places")+(tn?" out of range":" not an integer"),t),!0}function R(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*A-1)>G?t.c=t.e=null:n=10;a/=10,i++);if(o=e-i,o<0)o+=A,u=e,s=c[f=0],l=s/h[i-u-1]%10|0;else if(f=_((o+1)/A),f>=c.length){if(!r)break t;for(;c.length<=f;c.push(0));s=l=0,i=1,o%=A,u=o-A+1}else{for(s=a=c[f],i=1;a>=10;a/=10,i++);o%=A,u=o-A+i,l=u<0?0:s/h[i-u-1]%10|0}if(r=r||e<0||null!=c[f+1]||(u<0?s:s%h[i-u-1]),r=n<4?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?u>0?s/h[i-u]:0:c[f-1])%10&1||n==(t.s<0?8:7)),e<1||!c[0])return c.length=0,r?(e-=t.e+1,c[0]=h[e%A],t.e=-e||0):c[0]=t.e=0,t;if(0==o?(c.length=f,a=1,f--):(c.length=f+1,a=h[A-o],c[f]=u>0?b(s/h[i-u]%h[u])*a:0),r)for(;;){if(0==f){for(o=1,u=c[0];u>=10;u/=10,o++);for(u=c[0]+=a,a=1;u>=10;u/=10,a++);o!=a&&(t.e++,c[0]==P&&(c[0]=1));break}if(c[f]+=a,c[f]!=P)break;c[f--]=0,a=1}for(o=c.length;0===c[--o];c.pop());}t.e>G?t.c=t.e=null:t.en)return null!=(t=i[n++])};return u(e="DECIMAL_PLACES")&&H(t,0,j,2,e)&&(U=0|t),r[e]=U,u(e="ROUNDING_MODE")&&H(t,0,8,2,e)&&(D=0|t),r[e]=D,u(e="EXPONENTIAL_AT")&&(l(t)?H(t[0],-j,0,2,e)&&H(t[1],0,j,2,e)&&(F=0|t[0],Y=0|t[1]):H(t,-j,j,2,e)&&(F=-(Y=0|(t<0?-t:t)))),r[e]=[F,Y],u(e="RANGE")&&(l(t)?H(t[0],-j,-1,2,e)&&H(t[1],1,j,2,e)&&(q=0|t[0],G=0|t[1]):H(t,-j,j,2,e)&&(0|t?q=-(G=0|(t<0?-t:t)):z&&N(2,e+" cannot be zero",t))),r[e]=[q,G],u(e="ERRORS")&&(t===!!t||1===t||0===t?(M=0,H=(z=!!t)?y:f):z&&N(2,e+O,t)),r[e]=z,u(e="CRYPTO")&&(t===!!t||1===t||0===t?(W=!(!t||!v||"object"!=typeof v),t&&!W&&z&&N(2,"crypto unavailable",v)):z&&N(2,e+O,t)),r[e]=W,u(e="MODULO_MODE")&&H(t,0,9,2,e)&&($=0|t),r[e]=$,u(e="POW_PRECISION")&&H(t,0,j,2,e)&&(V=0|t),r[e]=V,u(e="FORMAT")&&("object"==typeof t?Z=t:z&&N(2,e+" not an object",t)),r[e]=Z,r},e.max=function(){return i(arguments,C.lt)},e.min=function(){return i(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return b(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,i,o,u,a,s=0,f=[],l=new e(I);if(t=null!=t&&H(t,0,j,14)?0|t:U,u=_(t/A),W)if(v&&v.getRandomValues){for(r=v.getRandomValues(new Uint32Array(u*=2));s>>11),a>=9e15?(i=v.getRandomValues(new Uint32Array(2)),r[s]=i[0],r[s+1]=i[1]):(f.push(a%1e14),s+=2);s=u/2}else if(v&&v.randomBytes){for(r=v.randomBytes(u*=7);s=9e15?v.randomBytes(7).copy(r,s):(f.push(a%1e14),s+=7);s=u/7}else z&&N(14,"crypto unavailable",v);if(!s)for(;s=10;a/=10,s++);sr?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function r(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;t.shift());}return function(i,o,a,s,f){var l,c,h,p,g,y,v,d,m,_,O,w,E,x,S,k,T,j=i.s==o.s?1:-1,R=i.c,N=o.c;if(!(R&&R[0]&&N&&N[0]))return new e(i.s&&o.s&&(R?!N||R[0]!=N[0]:N)?R&&0==R[0]||!N?0*j:j/0:NaN);for(d=new e(j),m=d.c=[],c=i.e-o.e,j=a+c+1,f||(f=P,c=u(i.e/A)-u(o.e/A),j=j/A|0),h=0;N[h]==(R[h]||0);h++);if(N[h]>(R[h]||0)&&c--,j<0)m.push(1),p=!0;else{for(x=R.length,k=N.length,h=0,j+=2,g=b(f/(N[0]+1)),g>1&&(N=t(N,g,f),R=t(R,g,f),k=N.length,x=R.length),E=k,_=R.slice(0,k),O=_.length;O=f/2&&S++;do{if(g=0,l=n(N,_,k,O),l<0){if(w=_[0],k!=O&&(w=w*f+(_[1]||0)),g=b(w/S),g>1)for(g>=f&&(g=f-1),y=t(N,g,f),v=y.length,O=_.length;1==n(y,_,v,O);)g--,r(y,k=10;j/=10,h++);B(d,a+(d.e=h+c*A-1)+1,s,p)}else d.e=c,d.r=+p;return d}}(),d=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(u,a,s,f){var l,c=s?a:a.replace(o,"");if(i.test(c))u.s=isNaN(c)?null:c<0?-1:1;else{if(!s&&(c=c.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,f&&f!=l?t:e}),f&&(l=f,c=c.replace(n,"$1").replace(r,"0.$1")),a!=c))return new e(c,l);z&&N(M,"not a"+(f?" base "+f:"")+" number",a),u.s=null}u.c=u.e=null,M=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return B(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return M=1,s(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-u(this.e/A))*A,e=n[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},C.dividedBy=C.div=function(t,n){return M=3,L(this,new e(t,n),U,D)},C.dividedToIntegerBy=C.divToInt=function(t,n){return M=4,L(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return M=5,0===s(this,new e(t,n))},C.floor=function(){return B(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return M=6,s(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return M=7,1===(n=s(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&u(this.e/A)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return M=8,s(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return M=9,(n=s(this,new e(t,n)))===-1||0===n},C.minus=C.sub=function(t,n){var r,i,o,a,s=this,f=s.s;if(M=10,t=new e(t,n),n=t.s,!f||!n)return new e(NaN);if(f!=n)return t.s=-n,s.plus(t);var l=s.e/A,c=t.e/A,h=s.c,p=t.c;if(!l||!c){if(!h||!p)return h?(t.s=-n,t):new e(p?s:NaN);if(!h[0]||!p[0])return p[0]?(t.s=-n,t):new e(h[0]?s:3==D?-0:0)}if(l=u(l),c=u(c),h=h.slice(),f=l-c){for((a=f<0)?(f=-f,o=h):(c=l,o=p),o.reverse(),n=f;n--;o.push(0));o.reverse()}else for(i=(a=(f=h.length)<(n=p.length))?f:n,f=n=0;n0)for(;n--;h[r++]=0);for(n=P-1;i>f;){if(h[--i]0?(s=a,r=l):(o=-o,r=f),r.reverse();o--;r.push(0));r.reverse()}for(o=f.length,n=l.length,o-n<0&&(r=l,l=f,f=r,n=o),o=0;n;)o=(f[--n]=f[n]+l[n]+o)/P|0,f[n]%=P;return o&&(f.unshift(o),++s),R(t,f,s)},C.precision=C.sd=function(t){var e,n,r=this,i=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(z&&N(13,"argument"+O,t),t!=!!t&&(t=null)),!i)return null;if(n=i.length-1,e=n*A+1,n=i[n]){for(;n%10==0;n/=10,e--);for(n=i[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},C.round=function(t,n){var r=new e(this);return(null==t||H(t,0,j,15))&&B(r,~~t+this.e+1,null!=n&&H(n,0,8,15,w)?0|n:D),r},C.shift=function(t){var n=this;return H(t,-S,S,16,"argument")?n.times("1e"+g(t)):new e(n.c&&n.c[0]&&(t<-S||t>S)?n.s*(t<0?0:1/0):n)},C.squareRoot=C.sqrt=function(){var t,n,r,i,o,s=this,f=s.c,l=s.s,c=s.e,h=U+4,p=new e("0.5");if(1!==l||!f||!f[0])return new e(!l||l<0&&(!f||f[0])?NaN:f?s:1/0);if(l=Math.sqrt(+s),0==l||l==1/0?(n=a(f),(n.length+c)%2==0&&(n+="0"),l=Math.sqrt(n),c=u((c+1)/2)-(c<0||c%2),l==1/0?n="1e"+c:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+c),r=new e(n)):r=new e(l+""),r.c[0])for(c=r.e,l=c+h,l<3&&(l=0);;)if(o=r,r=p.times(o.plus(L(s,o,h,1))),a(o.c).slice(0,l)===(n=a(r.c)).slice(0,l)){if(r.e=0;){for(r=0,g=O[o]%m,y=O[o]/m|0,s=l,a=o+s;a>o;)c=b[--s]%m,h=b[s]/m|0,f=y*c+h*g,c=g*c+f%m*m+v[a]+r,r=(c/d|0)+(f/m|0)+y*h,v[a--]=c%d;v[a]=r}return r?++i:v.shift(),R(t,v,i)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&H(t,1,j,18,"precision")?0|t:null,n=null!=n&&H(n,0,8,18,w)?0|n:D,t?B(r,t,n):r},C.toExponential=function(t,e){return r(this,null!=t&&H(t,0,j,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return r(this,null!=t&&H(t,0,j,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=r(this,null!=t&&H(t,0,j,21)?~~t+this.e+1:null,e,21);if(this.c){var i,o=n.split("."),u=+Z.groupSize,a=+Z.secondaryGroupSize,s=Z.groupSeparator,f=o[0],l=o[1],c=this.s<0,h=c?f.slice(1):f,p=h.length;if(a&&(i=u,u=a,a=i,p-=i),u>0&&p>0){for(i=p%u||u,f=h.substr(0,i);i0&&(f+=s+h.slice(i)),c&&(f="-"+f)}n=l?f+Z.decimalSeparator+((a=+Z.fractionGroupSize)?l.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+Z.fractionGroupSeparator):l):f}return n},C.toFraction=function(t){var n,r,i,o,u,s,f,l,c,h=z,p=this,g=p.c,y=new e(I),v=r=new e(I),d=f=new e(I);if(null!=t&&(z=!1,s=new e(t),z=h,(h=s.isInt())&&!s.lt(I)||(z&&N(22,"max denominator "+(h?"out of range":"not an integer"),t),t=!h&&s.c&&B(s,s.e+1,1).gte(I)?s:null)),!g)return p.toString();for(c=a(g),o=y.e=c.length-p.e-1,y.c[0]=k[(u=o%A)<0?A+u:u],t=!t||s.cmp(y)>0?o>0?y:v:s,u=G,G=1/0,s=new e(c),f.c[0]=0;l=L(s,y,0,1),i=r.plus(l.times(d)),1!=i.cmp(t);)r=d,d=i,v=f.plus(l.times(i=v)),f=i,y=s.minus(l.times(i=y)),s=i;return i=L(t.minus(r),d,0,1),f=f.plus(i.times(v)),r=r.plus(i.times(d)),f.s=v.s=p.s,o*=2,n=L(v,d,o,D).minus(p).abs().cmp(L(f,r,o,D).minus(p).abs())<1?[v.toString(),d.toString()]:[f.toString(),r.toString()],G=u,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:NaN)},C.toPower=C.pow=function(t){var n,r,i=b(t<0?-t:+t),o=this;if(!H(t,-S,S,23,"exponent")&&(!isFinite(t)||i>S&&(t/=0)||parseFloat(t)!=t&&!(t=NaN)))return new e(Math.pow(+o,t));for(n=V?_(V/A+2):0,r=new e(I);;){if(i%2){if(r=r.times(o),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(i=b(i/2),!i)break;o=o.times(o),n&&o.c&&o.c.length>n&&(o.c.length=n)}return t<0&&(r=I.div(r)),n?B(r,V,D):r},C.toPrecision=function(t,e){return r(this,null!=t&&H(t,1,j,24,"precision")?0|t:null,e,24)},C.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(e=a(r.c),e=null!=t&&H(t,2,64,25,"base")?n(p(e,o),0|t,10,i):o<=F||o>=Y?h(e,o):p(e,o),i<0&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return B(new e(this),this.e+1,1)},C.valueOf=C.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function u(t){var e=0|t;return t>0||t===e?e:e-1}function a(t){for(var e,n,r=1,i=t.length,o=t[0]+"";rf^n?1:-1;for(a=(s=i.length)<(f=o.length)?s:f,u=0;uo[u]^n?1:-1;return s==f?0:s>f^n?1:-1}function f(t,e,n){return(t=g(t))>=e&&t<=n}function l(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,i,o=[0],u=0,a=t.length;un-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function h(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function p(t,e){var n,r;if(e<0){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else e