dataflux 1.18.10 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- require=function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.dateRegex=exports.BasicObj=void 0;exports.setValues=setValues;var _moment=_interopRequireDefault(require("moment/moment"));var _uuid=require("uuid");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var dateRegex=exports.dateRegex=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9].*T[0-9].*Z$");var globalError="_object";function setValues(values,model,SubObj,parent,context){if(!values){throw new Error('The parameter "values" cannot be null')}Object.keys(values).forEach(function(key){var value=values[key];if(model.options.parseMoment&&value!=null&&dateRegex.test(value)){var mmnt=(0,_moment["default"])(value);context[key]=mmnt.isValid()?mmnt:value}else if(model.options.deep&&value!=null&&_typeof(value)==="object"&&!Array.isArray(value)){context[key]=new SubObj(parent,key,value,model)}else if(model.options.deep&&value!=null&&Array.isArray(value)&&!value.some(function(str){return["string","number"].includes(_typeof(str))})){context[key]=value.map(function(i){return new SubObj(parent,key,i,model)})}else{context[key]=value}})}var _setHidden=new WeakMap;var _id=new WeakMap;var _error=new WeakMap;var _model=new WeakMap;var BasicObj=exports.BasicObj=function(){function BasicObj(values,model){var _this=this;_classCallCheck(this,BasicObj);_classPrivateFieldInitSpec(this,_setHidden,{});_classPrivateFieldInitSpec(this,_id,null);_classPrivateFieldInitSpec(this,_error,{});_classPrivateFieldInitSpec(this,_model,void 0);_defineProperty(this,"isDataflux",function(){return true});_defineProperty(this,"isMock",function(){return false});_defineProperty(this,"setId",function(id){_this.id=id});_defineProperty(this,"getId",function(){if(!_classPrivateFieldGet(_id,_this)){if(_this.id!=null&&(typeof _this.id==="string"||typeof _this.id==="number")){_classPrivateFieldSet(_id,_this,_this.id.toString());delete _this.setId}else{_classPrivateFieldSet(_id,_this,(0,_uuid.v4)())}}return _classPrivateFieldGet(_id,_this)});_defineProperty(this,"get",function(attribute,defaultValue){var _ref,_classPrivateFieldGet2;return(_ref=(_classPrivateFieldGet2=_classPrivateFieldGet(_setHidden,_this)[attribute])!==null&&_classPrivateFieldGet2!==void 0?_classPrivateFieldGet2:_this[attribute])!==null&&_ref!==void 0?_ref:defaultValue});_defineProperty(this,"getError",function(){var _classPrivateFieldGet3;var attribute=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var key=attribute?attribute:globalError;return(_classPrivateFieldGet3=_classPrivateFieldGet(_error,_this)[key])!==null&&_classPrivateFieldGet3!==void 0?_classPrivateFieldGet3:false});_defineProperty(this,"setError",function(error){var attribute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(error&&attribute){_classPrivateFieldGet(_error,_this)[attribute]=error}else if(error&&!attribute){_classPrivateFieldGet(_error,_this)[globalError]=error}else if(!error&&attribute){delete _classPrivateFieldGet(_error,_this)[attribute]}else{_classPrivateFieldSet(_error,_this,{})}});_defineProperty(this,"setConstant",function(attribute,value){var _classPrivateFieldGet4;_classPrivateFieldGet(_setHidden,_this)[attribute]=(_classPrivateFieldGet4=_classPrivateFieldGet(_setHidden,_this)[attribute])!==null&&_classPrivateFieldGet4!==void 0?_classPrivateFieldGet4:value});_defineProperty(this,"toJSON",function(){var attrs=Object.keys(_this);var out={};for(var _i=0,_attrs=attrs;_i<_attrs.length;_i++){var a=_attrs[_i];if(_this[a]==null){out[a]=_this[a]}else if(_this[a]instanceof _moment["default"]){out[a]=_this[a].toISOString()}else if(_this[a]instanceof Date){out[a]=(0,_moment["default"])(_this[a]).toISOString()}else if(_typeof(_this[a])==="object"&&_this[a].toJSON){out[a]=_this[a].toJSON()}else if(Array.isArray(_this[a])&&_this[a].every(function(i){return _typeof(i)==="object"&&i.toJSON})){out[a]=_this[a].map(function(i){return i.toJSON()})}else if(typeof _this[a]!=="function"){out[a]=_this[a]}}return out});_defineProperty(this,"toString",function(){return JSON.stringify(_this.toJSON())});_defineProperty(this,"update",function(){return Promise.resolve()});_classPrivateFieldSet(_model,this,model)}return _createClass(BasicObj,[{key:"set",value:function set(attribute,value,hidden){if(hidden){_classPrivateFieldGet(_setHidden,this)[attribute]=value}else{if(attribute==="id"){throw new Error("You cannot change the ID")}this[attribute]=value;_classPrivateFieldGet(_model,this).validateObjectAttribute(this,attribute)}return this.update()}}])}()},{"moment/moment":17,uuid:20}],2:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _modelHooksUtils=require("./modelHooksUtils");var _redaxios=_interopRequireDefault(require("redaxios"));var _BasicObj=require("./BasicObj");var _SubObj=_interopRequireDefault(require("./SubObj"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _type=new WeakMap;var _store=new WeakMap;var _includes=new WeakMap;var _retrieveHook=new WeakMap;var _updateHook=new WeakMap;var _insertHook=new WeakMap;var _deleteHook=new WeakMap;var _singleItemQuery=new WeakMap;var _batchSize=new WeakMap;var _axios=new WeakMap;var _loadFunction=new WeakMap;var _hiddenFields=new WeakMap;var _Model_brand=new WeakSet;var _addRelationByField=new WeakMap;var _addRelationByFilter=new WeakMap;var _removeHiddenFields=new WeakMap;var _toArray=new WeakMap;var _unWrap=new WeakMap;var _insertObjects=new WeakMap;var _assignId=new WeakMap;var _updateObjects=new WeakMap;var _deleteObjects=new WeakMap;var _hanldeApiError=new WeakMap;var _cleanApiError=new WeakMap;var _removeFromStoreSilentlyAfterFailure=new WeakMap;var Model=exports["default"]=_createClass(function Model(name){var _this=this,_ref3,_options$deep,_ref4,_options$parseMoment,_options$lazyLoad,_ref5,_options$validate,_ref6,_options$autoSave,_ref7,_options$autoRefresh,_ref8,_options$pre,_ref9,_options$hiddenFields,_ref10,_options$post;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var defaults=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};_classCallCheck(this,Model);_classPrivateMethodInitSpec(this,_Model_brand);_classPrivateFieldInitSpec(this,_type,void 0);_classPrivateFieldInitSpec(this,_store,void 0);_classPrivateFieldInitSpec(this,_includes,void 0);_classPrivateFieldInitSpec(this,_retrieveHook,void 0);_classPrivateFieldInitSpec(this,_updateHook,void 0);_classPrivateFieldInitSpec(this,_insertHook,void 0);_classPrivateFieldInitSpec(this,_deleteHook,void 0);_classPrivateFieldInitSpec(this,_singleItemQuery,void 0);_classPrivateFieldInitSpec(this,_batchSize,void 0);_classPrivateFieldInitSpec(this,_axios,void 0);_classPrivateFieldInitSpec(this,_loadFunction,void 0);_classPrivateFieldInitSpec(this,_hiddenFields,void 0);_defineProperty(this,"ready",void 0);_defineProperty(this,"validateObjectAttribute",function(object,key){var validate=_this.options.validate;if(validate&&validate[key]){try{var call=validate[key](object,_classPrivateFieldGet(_store,_this));if(call!==null&&call!==void 0&&call.then){call.then(function(){return object.setError(false,key)})["catch"](function(error){return object.setError(error.message,key)})}else{object.setError(false,key)}}catch(error){object.setError(error.message,key)}}});_defineProperty(this,"isObjectValid",function(object){for(var key in object){if(typeof object[key]!=="function"){if(object.getError(key)){console.log("Model error",key,object.getError(key));return false}}}return true});_defineProperty(this,"getStore",function(){return _classPrivateFieldGet(_store,_this)});_defineProperty(this,"setStore",function(store){if(!_classPrivateFieldGet(_store,_this)){var _classPrivateFieldGet2;_classPrivateFieldSet(_store,_this,store);_classPrivateFieldSet(_axios,_this,_this.options.axios||((_classPrivateFieldGet2=_classPrivateFieldGet(_store,_this))===null||_classPrivateFieldGet2===void 0||(_classPrivateFieldGet2=_classPrivateFieldGet2.options)===null||_classPrivateFieldGet2===void 0?void 0:_classPrivateFieldGet2.axios)||_redaxios["default"])}else{throw new Error("This model was already assigned to a store.")}});_defineProperty(this,"load",function(obj){if(_classPrivateFieldGet(_loadFunction,_this)){return _this.getStore().whenSaved(_this.getType())["catch"](function(e){throw new Error("You cannot perform load() on an unsaved object.")}).then(function(){var res=_classPrivateFieldGet(_loadFunction,_this).call(_this,obj.toJSON());if(typeof res==="string"){return _classPrivateFieldGet(_axios,_this).call(_this,{method:"get",url:res,responseType:"json"}).then(function(data){return data.data})}else{return res}}).then(function(data){(0,_BasicObj.setValues)(data,_this,_SubObj["default"],obj,obj);return data})["catch"](function(error){return _assertClassBrand(_Model_brand,_this,_error).call(_this,error)})}else{return _assertClassBrand(_Model_brand,_this,_error).call(_this,"You must define a loading function in the model to enable load().")}});_defineProperty(this,"addRelation",function(model,param2,param3){if(model){_this.getStore().validateModel(model);if(typeof param2==="string"&&(!param3||typeof param3==="string")){return _classPrivateFieldGet(_addRelationByField,_this).call(_this,model,param2,param3)}else if(!param3&&typeof param2==="function"){return _classPrivateFieldGet(_addRelationByFilter,_this).call(_this,model,param2)}else if(!param2&&!param3){return _classPrivateFieldGet(_addRelationByField,_this).call(_this,model,model.getType(),"id")}else{throw new Error("Invalid relation declaration")}}else{throw new Error("A relation needs a model")}});_defineProperty(this,"getRelation",function(parentObject,includedType,filterFunction){var filterRelation=_classPrivateFieldGet(_includes,_this)[includedType];if(filterRelation){return(parentObject.getModel().options.load?parentObject.load()["catch"](function(){}):Promise.resolve()).then(function(){return _this.getStore().find(includedType,function(item){return filterRelation(parentObject,item)}).then(function(data){return filterFunction?data.filter(filterFunction):data})})}else{return _assertClassBrand(_Model_brand,_this,_error).call(_this,"The relation doesn't exist")}});_defineProperty(this,"getType",function(){return _classPrivateFieldGet(_type,_this)});_defineProperty(this,"retrieveAll",function(){return(0,_modelHooksUtils.executeHook)("retrieve",_classPrivateFieldGet(_retrieveHook,_this),null,_classPrivateFieldGet(_axios,_this)).then(function(data){if(!Array.isArray(data)){_classPrivateFieldSet(_singleItemQuery,_this,true)}_this.ready=true;return _classPrivateFieldGet(_toArray,_this).call(_this,data)}).then(function(data){var _this$options;return(_this$options=_this.options)!==null&&_this$options!==void 0&&_this$options.pre?data.map(function(n){return _this.options.pre(n,data)}):data})});_defineProperty(this,"insertObjects",function(objects){return objects.length?_classPrivateFieldGet(_insertObjects,_this).call(_this,objects):Promise.resolve()});_defineProperty(this,"updateObjects",function(objects){return objects.length?_classPrivateFieldGet(_updateObjects,_this).call(_this,objects):Promise.resolve()});_defineProperty(this,"deleteObjects",function(objects){return objects.length?_classPrivateFieldGet(_deleteObjects,_this).call(_this,objects):Promise.resolve()});_defineProperty(this,"factory",function(params){if(!_this.options.lazyLoad){return Promise.reject("Factory can be used only on a model declared with lazyLoad: true")}else{return(0,_modelHooksUtils.executeHook)("retrieve",_classPrivateFieldGet(_retrieveHook,_this),params,_classPrivateFieldGet(_axios,_this)).then(function(data){if(!Array.isArray(data)){_classPrivateFieldSet(_singleItemQuery,_this,true)}return _classPrivateFieldGet(_toArray,_this).call(_this,data)})}});_classPrivateFieldInitSpec(this,_addRelationByField,function(model,localField){var remoteField=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"id";var filterFunction=function filterFunction(parentObject,child){return parentObject[localField]===child[remoteField]};return _classPrivateFieldGet(_addRelationByFilter,_this).call(_this,model,filterFunction)});_classPrivateFieldInitSpec(this,_addRelationByFilter,function(model,filterFunction){var includedType=model.getType();_classPrivateFieldGet(_includes,_this)[includedType]=filterFunction});_classPrivateFieldInitSpec(this,_removeHiddenFields,function(json){var _ref;var _iterator=_createForOfIteratorHelper((_ref=_this===null||_this===void 0?void 0:_classPrivateFieldGet(_hiddenFields,_this))!==null&&_ref!==void 0?_ref:[]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var attribute=_step.value;delete json[attribute]}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(json&&_typeof(json)==="object"){for(var _i=0,_Object$values=Object.values(json);_i<_Object$values.length;_i++){var obj=_Object$values[_i];if(obj&&_typeof(obj)==="object"){_classPrivateFieldGet(_removeHiddenFields,_this).call(_this,obj)}}}return json});_classPrivateFieldInitSpec(this,_toArray,function(data){if(Array.isArray(data)){if(data.length&&data.every(function(str){return["string","number"].includes(_typeof(str))})){return[{value:data}]}else{return data}}else{if(["string","number"].includes(_typeof(data))){return[{value:data}]}else{return[data]}}});_classPrivateFieldInitSpec(this,_unWrap,function(objects){var arrayObjects=Object.values(objects);var data=arrayObjects.map(function(object){return _classPrivateFieldGet(_removeHiddenFields,_this).call(_this,object.toJSON())}).map(function(object){var _this$options2;return(_this$options2=_this.options)!==null&&_this$options2!==void 0&&_this$options2.post?_this.options.post(object,arrayObjects):object});if(data.value!=null&&Object.keys(data).length===1){return data.value}else if(Array.isArray(data)&&data.length===1&&data[0].value!=null&&Object.keys(data[0]).length===1){return data[0].value}else{return data}});_classPrivateFieldInitSpec(this,_insertObjects,function(objects){var operation="insert";return(0,_modelHooksUtils.executeHook)(operation,_classPrivateFieldGet(_insertHook,_this),_classPrivateFieldGet(_unWrap,_this).call(_this,objects),_classPrivateFieldGet(_axios,_this)).then(function(data){if(data){_classPrivateFieldGet(_assignId,_this).call(_this,data,objects)}_classPrivateFieldGet(_cleanApiError,_this).call(_this,objects);return data}).then(_classPrivateFieldGet(_toArray,_this))["catch"](function(error){_classPrivateFieldGet(_removeFromStoreSilentlyAfterFailure,_this).call(_this,objects);return _classPrivateFieldGet(_hanldeApiError,_this).call(_this,error,objects,operation)})});_classPrivateFieldInitSpec(this,_assignId,function(data,objects){if(Array.isArray(data)&&Array.isArray(objects)&&objects.length===data.length){for(var i=0;i<data.length;i++){(0,_BasicObj.setValues)(data[i],_this,_SubObj["default"],null,objects[i]);objects[i].setId(data[i].id);delete objects[i].setId}}});_classPrivateFieldInitSpec(this,_updateObjects,function(objects){var operation="update";return(0,_modelHooksUtils.executeHook)(operation,_classPrivateFieldGet(_updateHook,_this),_classPrivateFieldGet(_unWrap,_this).call(_this,objects),_classPrivateFieldGet(_axios,_this)).then(function(data){if(Array.isArray(data)&&Array.isArray(objects)&&objects.length===data.length){for(var i=0;i<data.length;i++){(0,_BasicObj.setValues)(data[i],_this,_SubObj["default"],objects[i],objects[i])}}_classPrivateFieldGet(_cleanApiError,_this).call(_this,objects);return data}).then(_classPrivateFieldGet(_toArray,_this))["catch"](function(error){return _classPrivateFieldGet(_hanldeApiError,_this).call(_this,error,objects,operation)})});_classPrivateFieldInitSpec(this,_deleteObjects,function(objects){var operation="delete";return(0,_modelHooksUtils.executeHook)(operation,_classPrivateFieldGet(_deleteHook,_this),_classPrivateFieldGet(_unWrap,_this).call(_this,objects),_classPrivateFieldGet(_axios,_this)).then(function(data){_classPrivateFieldGet(_cleanApiError,_this).call(_this,objects);return data}).then(_classPrivateFieldGet(_toArray,_this))["catch"](function(error){return _classPrivateFieldGet(_hanldeApiError,_this).call(_this,error,objects,operation)})});_classPrivateFieldInitSpec(this,_hanldeApiError,function(error,objects,operation){var _error$response$data,_error2,_ref2,_error$message,_error3,_error4;error=(_error$response$data=(_error2=error)===null||_error2===void 0||(_error2=_error2.response)===null||_error2===void 0?void 0:_error2.data)!==null&&_error$response$data!==void 0?_error$response$data:error;var targets=objects.map(function(object){return object.getId()});var strError=(_ref2=(_error$message=(_error3=error)===null||_error3===void 0?void 0:_error3.message)!==null&&_error$message!==void 0?_error$message:(_error4=error)===null||_error4===void 0?void 0:_error4.error)!==null&&_ref2!==void 0?_ref2:error;Object.values(objects).map(function(object){return object.setError(strError)});return Promise.reject(_objectSpread(_objectSpread({},error),{},{targets:targets,operation:operation}))});_classPrivateFieldInitSpec(this,_cleanApiError,function(objects){Object.values(objects).map(function(object){return object.setError(false)})});_classPrivateFieldInitSpec(this,_removeFromStoreSilentlyAfterFailure,function(objects){var _iterator2=_createForOfIteratorHelper(objects.map(function(object){return object.getId()})),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var target=_step2.value;delete _this.getStore().models[_this.getType()].storedObjects[target]}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}});_classPrivateFieldSet(_type,this,name);this.options=_objectSpread(_objectSpread({},_typeof(options)==="object"?options:{}),{},{deep:(_ref3=(_options$deep=options.deep)!==null&&_options$deep!==void 0?_options$deep:defaults.deep)!==null&&_ref3!==void 0?_ref3:true,parseMoment:(_ref4=(_options$parseMoment=options.parseMoment)!==null&&_options$parseMoment!==void 0?_options$parseMoment:defaults.parseMoment)!==null&&_ref4!==void 0?_ref4:false,lazyLoad:(_options$lazyLoad=options.lazyLoad)!==null&&_options$lazyLoad!==void 0?_options$lazyLoad:defaults.lazyLoad,validate:(_ref5=(_options$validate=options.validate)!==null&&_options$validate!==void 0?_options$validate:defaults.validate)!==null&&_ref5!==void 0?_ref5:{},autoSave:(_ref6=(_options$autoSave=options.autoSave)!==null&&_options$autoSave!==void 0?_options$autoSave:defaults.autoSave)!==null&&_ref6!==void 0?_ref6:null,autoRefresh:(_ref7=(_options$autoRefresh=options.autoRefresh)!==null&&_options$autoRefresh!==void 0?_options$autoRefresh:defaults.autoRefresh)!==null&&_ref7!==void 0?_ref7:false,pre:(_ref8=(_options$pre=options.pre)!==null&&_options$pre!==void 0?_options$pre:defaults.pre)!==null&&_ref8!==void 0?_ref8:null,hiddenFields:(_ref9=(_options$hiddenFields=options.hiddenFields)!==null&&_options$hiddenFields!==void 0?_options$hiddenFields:defaults.hiddenFields)!==null&&_ref9!==void 0?_ref9:[],post:(_ref10=(_options$post=options.post)!==null&&_options$post!==void 0?_options$post:defaults.post)!==null&&_ref10!==void 0?_ref10:null});_classPrivateFieldSet(_store,this,null);_classPrivateFieldSet(_includes,this,{});_classPrivateFieldSet(_axios,this,this.options.axios||_redaxios["default"]);_classPrivateFieldSet(_hiddenFields,this,this.options.hiddenFields);_classPrivateFieldSet(_loadFunction,this,this.options.load||null);if(!name||!options){throw new Error("A Model requires at least a name and a hook")}if(_classPrivateFieldGet(_loadFunction,this)&&typeof _classPrivateFieldGet(_loadFunction,this)!=="function"){throw new Error("The load option must be a function")}var _ref11=_typeof(options)==="object"?(0,_modelHooksUtils.getHooksFromOptions)(options):(0,_modelHooksUtils.getHooksFromUrl)(options),_ref12=_slicedToArray(_ref11,4),retrieveHook=_ref12[0],insertHook=_ref12[1],updateHook=_ref12[2],deleteHook=_ref12[3];_classPrivateFieldSet(_retrieveHook,this,retrieveHook);_classPrivateFieldSet(_updateHook,this,updateHook);_classPrivateFieldSet(_insertHook,this,insertHook);_classPrivateFieldSet(_deleteHook,this,deleteHook);_classPrivateFieldSet(_singleItemQuery,this,false);_classPrivateFieldSet(_batchSize,this,4);if(this.options.autoRefresh&&typeof this.options.autoRefresh==="number"){setInterval(function(){_this.getStore().refresh(_classPrivateFieldGet(_type,_this))["catch"](function(){})},this.options.autoRefresh)}});function _error(error){error=error.message||error;this.getStore().pubSub.publish("error",error);return Promise.reject(error)}},{"./BasicObj":1,"./SubObj":9,"./modelHooksUtils":10,redaxios:19}],3:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _objectFingerprint=_interopRequireDefault(require("object-fingerprint"));var _BasicObj2=require("./BasicObj");var _SubObj=_interopRequireDefault(require("./SubObj"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _loaded=new WeakMap;var Obj=exports["default"]=function(_BasicObj){function Obj(values,_model){var _this;_classCallCheck(this,Obj);_this=_callSuper(this,Obj,[values,_model]);_classPrivateFieldInitSpec(_this,_loaded,false);_defineProperty(_this,"set",function(attribute,value,hidden){if(Array.isArray(value)&&_this.getModel().options.deep){value=value.map(function(i){if(["boolean","string","number"].includes(_typeof(i))){return i}else{return i!==null&&i!==void 0&&i.getId?i:new _SubObj["default"](_this,"property",i,_this.getModel())}})}return _superPropGet((_this,Obj),"set",_this,3)([attribute,value,hidden])});_defineProperty(_this,"shouldLoad",function(){var reset=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(reset===null){return!_classPrivateFieldGet(_loaded,_this)}else{_classPrivateFieldSet(_loaded,_this,false)}});_defineProperty(_this,"load",function(){if(_this.isMock()){return Promise.reject("You cannot perform load on a mock object. Use factory instead.")}else{if(!_classPrivateFieldGet(_loaded,_this)){var model=_this.getModel();_classPrivateFieldSet(_loaded,_this,model.load(_this).then(function(){return model.getStore().update([_this],true)}).then(function(){return _this}))}return _classPrivateFieldGet(_loaded,_this)}});_defineProperty(_this,"getFingerprint",function(){return(0,_objectFingerprint["default"])(_this.toJSON()).toString()});_defineProperty(_this,"getRelation",function(type,filterFunction){return _this.getModel().getRelation(_this,type,filterFunction)});_defineProperty(_this,"save",function(){return _this.getModel().getStore().save([_this])});_defineProperty(_this,"destroy",function(){return _this.getModel().getStore()["delete"]([_this])});_defineProperty(_this,"update",function(){return _this.getModel().getStore().update([_this])});(0,_BasicObj2.setValues)(values,_model,_SubObj["default"],_this,_this);_this.getModel=function(){return _model};return _this}_inherits(Obj,_BasicObj);return _createClass(Obj)}(_BasicObj2.BasicObj)},{"./BasicObj":1,"./SubObj":9,"object-fingerprint":18}],4:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _uuid=require("uuid");var _batchPromises=_interopRequireDefault(require("batch-promises"));var _PersistentStore2=_interopRequireDefault(require("./PersistentStore"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _queryPromises=new WeakMap;var _unsubPromises=new WeakMap;var _getUniqueSubs=new WeakMap;var _propagateChange=new WeakMap;var _appendIfNotExistent=new WeakMap;var _subscribeToObjects=new WeakMap;var _ObserverStore_brand=new WeakSet;var ObserverStore=function(_PersistentStore){function ObserverStore(options){var _this;_classCallCheck(this,ObserverStore);_this=_callSuper(this,ObserverStore,[options]);_classPrivateMethodInitSpec(_this,_ObserverStore_brand);_classPrivateFieldInitSpec(_this,_queryPromises,[]);_classPrivateFieldInitSpec(_this,_unsubPromises,[]);_defineProperty(_this,"multipleSubscribe",function(subscriptions,callback){var dataPayload={};var subKey=(0,_uuid.v4)();var areAllDone=function areAllDone(){return subscriptions.map(function(_ref){var _ref2=_slicedToArray(_ref,1),name=_ref2[0];return name}).every(function(name){return dataPayload[name]!==undefined})};Promise.all(subscriptions.map(function(sub){var _sub=_slicedToArray(sub,2),name=_sub[0],_sub$=_sub[1],filterFunction=_sub$===void 0?null:_sub$;var wrappedCallback=function wrappedCallback(data){dataPayload[name]=data;return areAllDone()&&callback(dataPayload)};return _this.subscribe(name,wrappedCallback,filterFunction)})).then(function(subKeys){_this._multipleSubscribed[subKey]=subKeys;return subKey});return subKey});_defineProperty(_this,"subscribe",function(type,callback,filterFunction){var _this$_subscribed,_this$_subscribed$typ;var subKey=(0,_uuid.v4)();(_this$_subscribed$typ=(_this$_subscribed=_this._subscribed)[type])!==null&&_this$_subscribed$typ!==void 0?_this$_subscribed$typ:_this$_subscribed[type]={};var prom=_this.find(type,filterFunction).then(function(data){_classPrivateFieldGet(_subscribeToObjects,_this).call(_this,type,data,{callback:callback,filterFunction:filterFunction,subKey:subKey});callback(data)});_classPrivateFieldGet(_queryPromises,_this).push(prom);return subKey});_defineProperty(_this,"unsubscribe",function(key){_classPrivateFieldSet(_unsubPromises,_this,(_classPrivateFieldGet(_queryPromises,_this).length?Promise.all(_classPrivateFieldGet(_queryPromises,_this)):Promise.resolve()).then(function(){if(_this._multipleSubscribed[key]){var _iterator=_createForOfIteratorHelper(_this._multipleSubscribed[key]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var sub=_step.value;_this.unsubscribe(sub)}}catch(err){_iterator.e(err)}finally{_iterator.f()}delete _this._multipleSubscribed[key]}else{for(var type in _this._subscribed){for(var id in _this._subscribed[type]){_this._subscribed[type][id]=_this._subscribed[type][id].filter(function(i){return i.subKey!==key});if(_this._subscribed[type]["*"]){_this._subscribed[type]["*"]=_this._subscribed[type]["*"].filter(function(i){return i.subKey!==key})}if(_this._subscribed[type][id].length===0){delete _this._subscribed[type][id]}}}}}))});_classPrivateFieldInitSpec(_this,_getUniqueSubs,function(objects,type){var out={};var _iterator2=_createForOfIteratorHelper(objects),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var object=_step2.value;var objectId=object.getId();var typeChannel=_this._subscribed[type]||{};var subscribedToObject=typeChannel[objectId]||[];var _iterator3=_createForOfIteratorHelper(subscribedToObject),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _sub$subKey,_out$_sub$subKey;var sub=_step3.value;(_out$_sub$subKey=out[_sub$subKey=sub.subKey])!==null&&_out$_sub$subKey!==void 0?_out$_sub$subKey:out[_sub$subKey]=sub}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return Object.values(out)});_classPrivateFieldInitSpec(_this,_propagateChange,function(){var objects=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return(_classPrivateFieldGet(_unsubPromises,_this).length?Promise.all(_classPrivateFieldGet(_unsubPromises,_this)):Promise.resolve()).then(function(){if(objects.length){var _objects$;var type=objects===null||objects===void 0||(_objects$=objects[0])===null||_objects$===void 0||(_objects$=_objects$.getModel())===null||_objects$===void 0?void 0:_objects$.getType();if(type){var uniqueSubs=_classPrivateFieldGet(_getUniqueSubs,_this).call(_this,objects,type);return(0,_batchPromises["default"])(10,uniqueSubs,function(_ref3){var callback=_ref3.callback,filterFunction=_ref3.filterFunction;return _this.find(type,filterFunction).then(callback)})}else{console.log("Malformed update list",objects)}}return objects})});_classPrivateFieldInitSpec(_this,_appendIfNotExistent,function(arr,item){if(Object.values(arr).filter(function(_ref4){var subKey=_ref4.subKey;return item.subKey===subKey}).length===0){arr.push(item)}});_classPrivateFieldInitSpec(_this,_subscribeToObjects,function(type,objectsToSubscribe,item){var _this$_subscribed$typ2,_,_this$_subscribed$typ3;var _iterator4=_createForOfIteratorHelper(objectsToSubscribe),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _this$_subscribed$typ4,_this$_subscribed$typ5;var object=_step4.value;var id=object.getId();(_this$_subscribed$typ5=(_this$_subscribed$typ4=_this._subscribed[type])[id])!==null&&_this$_subscribed$typ5!==void 0?_this$_subscribed$typ5:_this$_subscribed$typ4[id]=[];_classPrivateFieldGet(_appendIfNotExistent,_this).call(_this,_this._subscribed[type][id],item)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}(_this$_subscribed$typ3=(_this$_subscribed$typ2=_this._subscribed[type])[_="*"])!==null&&_this$_subscribed$typ3!==void 0?_this$_subscribed$typ3:_this$_subscribed$typ2[_]=[];_classPrivateFieldGet(_appendIfNotExistent,_this).call(_this,_this._subscribed[type]["*"],item)});_defineProperty(_this,"reset",function(type){return _this._refresh(type,true)});_defineProperty(_this,"refresh",function(type){return _this._refresh(type,false)});_defineProperty(_this,"_refresh",function(type,force){var refreshByType=function refreshByType(type){_this.pubSub.publish("refresh",{status:"start",model:type});return _this.refreshObjectByType(type,force).then(function(_ref5){var _ref6=_slicedToArray(_ref5,3),inserted=_ref6[0],updated=_ref6[1],deleted=_ref6[2];var item=_this.models[type];return Promise.all([_assertClassBrand(_ObserverStore_brand,_this,_propagateInsertChange).call(_this,type,inserted),_classPrivateFieldGet(_propagateChange,_this).call(_this,updated),_classPrivateFieldGet(_propagateChange,_this).call(_this,deleted)]).then(function(){_this.pubSub.publish("refresh",{status:"end",model:type});return item.promise})})};if(type){return refreshByType(type)}else{return Promise.all(Object.keys(_this.models).map(refreshByType))}});_this._subscribed={};_this._multipleSubscribed={};if(options.autoRefresh&&typeof options.autoRefresh==="number"){setInterval(_this.refresh,options.autoRefresh)}return _this}_inherits(ObserverStore,_PersistentStore);return _createClass(ObserverStore,[{key:"update",value:function update(objects,skipSave){var _objects$filter,_this2=this;if(objects!==null&&objects!==void 0&&(_objects$filter=objects.filter(function(i){return!!i}))!==null&&_objects$filter!==void 0&&_objects$filter.length){if(!skipSave){_classPrivateFieldGet(_propagateChange,this).call(this,objects)}return _superPropGet(ObserverStore,"update",this,3)([objects,skipSave]).then(function(data){return _classPrivateFieldGet(_propagateChange,_this2).call(_this2,data)})}}},{key:"insert",value:function insert(type,objects){var _this3=this;objects=Array.isArray(objects)?objects:[objects];return _superPropGet(ObserverStore,"insert",this,3)([type,objects]).then(function(objects){_assertClassBrand(_ObserverStore_brand,_this3,_propagateInsertChange).call(_this3,type,objects);return objects})}},{key:"mock",value:function mock(type,objects){var _this4=this;objects=Array.isArray(objects)?objects:[objects];return _superPropGet(ObserverStore,"mock",this,3)([type,objects]).then(function(objects){_assertClassBrand(_ObserverStore_brand,_this4,_propagateInsertChange).call(_this4,type,objects);return objects})}},{key:"delete",value:function _delete(typeOrObjects,filterFunction){return _superPropGet(ObserverStore,"delete",this,3)([typeOrObjects,filterFunction]).then(_classPrivateFieldGet(_propagateChange,this))}}])}(_PersistentStore2["default"]);function _propagateInsertChange(type,newObjects){var _this5=this;return(_classPrivateFieldGet(_unsubPromises,this).length?Promise.all(_classPrivateFieldGet(_unsubPromises,this)):Promise.resolve()).then(function(){if(_this5._subscribed[type]){var uniqueSubs={};var objects=Object.values(_this5._subscribed[type]);for(var _i=0,_objects=objects;_i<_objects.length;_i++){var object=_objects[_i];var _iterator5=_createForOfIteratorHelper(object),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var sub=_step5.value;if(!uniqueSubs[sub.subKey]){uniqueSubs[sub.subKey]=sub}}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}var possibleSubs=Object.values(uniqueSubs);return(0,_batchPromises["default"])(10,possibleSubs,function(_ref7){var callback=_ref7.callback,filterFunction=_ref7.filterFunction,subKey=_ref7.subKey;var objectsToSubscribe=filterFunction?newObjects.filter(filterFunction):newObjects;if(objectsToSubscribe.length){return _this5.find(type,filterFunction).then(function(data){_classPrivateFieldGet(_subscribeToObjects,_this5).call(_this5,type,objectsToSubscribe,{callback:callback,filterFunction:filterFunction,subKey:subKey});return data}).then(callback)}})}})}var _default=exports["default"]=ObserverStore},{"./PersistentStore":5,"batch-promises":12,uuid:20}],5:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _Store2=_interopRequireDefault(require("./Store"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var PersistentStore=exports["default"]=function(_Store){function PersistentStore(options){var _this;_classCallCheck(this,PersistentStore);_this=_callSuper(this,PersistentStore,[options]);_defineProperty(_this,"whenSaved",function(type){return _this.getDiff(type).then(function(_ref){var inserted=_ref.inserted,updated=_ref.updated,deleted=_ref.deleted;if(inserted.length===0&&updated.length===0&&deleted.length===0){return true}else{return Promise.reject("Save must be invoked manually")}})});_defineProperty(_this,"save",function(){return _this._save(true)});_defineProperty(_this,"_save",function(){var force=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;_this._busy=true;_this.pubSub.publish("save","start");if(_this._delayedSaveTimer){clearTimeout(_this._delayedSaveTimer)}return Promise.all(Object.keys(_this.models).filter(function(m){return _this.models[m].model.options.autoSave!==false||force}).map(function(i){return _this._saveByType(i,true)})).then(function(data){_this._busy=false;_this.pubSub.publish("save","end");return data})["catch"](function(error){_this._busy=false;_this.pubSub.publish("save","end");_this.pubSub.publish("error",error);return Promise.reject(error)})});_defineProperty(_this,"_saveDiff",function(type,_ref2){var inserted=_ref2.inserted,updated=_ref2.updated,deleted=_ref2.deleted;var model=_this.models[type].model;var correctInserted=inserted.filter(function(object){return model.isObjectValid(object.object)});var correctUpdated=updated.filter(function(object){return model.isObjectValid(object.object)});var correctDeleted=deleted.filter(function(object){return model.isObjectValid(object.object)});return model.insertObjects(correctInserted.map(function(i){return i.object})).then(function(){return _this.applyDiff({inserted:correctInserted},type)}).then(function(){return model.updateObjects(correctUpdated.map(function(i){return i.object}))}).then(function(){return _this.applyDiff({updated:correctUpdated},type)}).then(function(){return model.deleteObjects(correctDeleted.map(function(i){return i.object}))}).then(function(){return _this.applyDiff({deleted:correctDeleted},type)})});_defineProperty(_this,"_saveByType",function(type,ifLoaded){return _this.getDiff(type,ifLoaded).then(function(diff){return _this._saveDiff(type,diff)})});_defineProperty(_this,"delayedSave",function(){return new Promise(function(resolve,reject){if(_this.options.autoSave){if(_this._delayedSaveTimer){if(_this._delayedSavePromise){_this._delayedSavePromise();_this._delayedSavePromise=null}clearTimeout(_this._delayedSaveTimer);_this._delayedSaveTimer=null}_this._delayedSavePromise=resolve;_this._delayedSaveTimer=setTimeout(function(){resolve(_this._save(false));_this._delayedSavePromise=null},_this.options.saveDelay)}else{resolve()}})});_this._busy=false;_this._delayedSaveTimer=null;_this._delayedSavePromise=null;if(typeof _this.options.autoSave==="number"){setInterval(function(){if(!_this._busy){_this.delayedSave()}},_this.options.autoSave)}return _this}_inherits(PersistentStore,_Store);return _createClass(PersistentStore,[{key:"addModel",value:function addModel(model){var _this2=this;this._busy=true;return _superPropGet(PersistentStore,"addModel",this,3)([model]).then(function(){_this2._busy=false})}},{key:"insert",value:function insert(type,objects){var _this3=this;return _superPropGet(PersistentStore,"insert",this,3)([type,objects]).then(function(data){return _this3.delayedSave().then(function(){return data})})}},{key:"mock",value:function mock(type,objects){return _superPropGet(PersistentStore,"mock",this,3)([type,objects])}},{key:"delete",value:function _delete(typeOrObjects,filterFunction){var _this4=this;return _superPropGet(PersistentStore,"delete",this,3)([typeOrObjects,filterFunction]).then(function(data){return _this4.delayedSave().then(function(){return data})})}},{key:"update",value:function update(objects,skipSave){var _this5=this;return _superPropGet(PersistentStore,"update",this,3)([objects]).then(function(objects){if(skipSave){var _iterator=_createForOfIteratorHelper(objects),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var object=_step.value;var type=object.getModel().getType();_this5.models[type].storedObjects[object.getId()].fingerprint=object.getFingerprint()}}catch(err){_iterator.e(err)}finally{_iterator.f()}return objects}else{return _this5.delayedSave().then(function(){return objects})}})}}])}(_Store2["default"])},{"./Store":8}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var PubSub=exports["default"]=_createClass(function PubSub(){var _this=this;_classCallCheck(this,PubSub);_defineProperty(this,"subscribe",function(channel,callback){_this.callbacks[channel]=_this.callbacks[channel]||[];_this.callbacks[channel].push(callback)});_defineProperty(this,"publish",function(channel,content){var _iterator=_createForOfIteratorHelper(_this.callbacks[channel]||[]),_step;try{var _loop=function _loop(){var clb=_step.value;new Promise(function(resolve,reject){clb(content,channel);resolve(true)})["catch"](console.log)};for(_iterator.s();!(_step=_iterator.n()).done;){_loop()}}catch(err){_iterator.e(err)}finally{_iterator.f()}});this.callbacks={}})},{}],7:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _ObserverStore2=_interopRequireDefault(require("./ObserverStore"));var _uuid=require("uuid");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _addSubscriptionToContext=new WeakMap;var _ReactStore_brand=new WeakSet;var ReactStore=exports["default"]=function(_ObserverStore){function ReactStore(options){var _this;_classCallCheck(this,ReactStore);_this=_callSuper(this,ReactStore,[options]);_classPrivateMethodInitSpec(_this,_ReactStore_brand);_defineProperty(_this,"didUpdate",function(context,who){var _context$props;var objects=Object.values((_context$props=context===null||context===void 0?void 0:context.props)!==null&&_context$props!==void 0?_context$props:{}).filter(function(i){var _i$isDataflux;return i===null||i===void 0||(_i$isDataflux=i.isDataflux)===null||_i$isDataflux===void 0?void 0:_i$isDataflux.call(i)});objects.forEach(function(object){if(object!==null&&object!==void 0&&object.getParent){_this.findOne(object.getParent().getModel().getType(),(0,_uuid.v4)(),context,function(n){return object.getParent().getId()===n.getId()})}else{_this.findOne(object.getModel().getType(),(0,_uuid.v4)(),context,function(n){return object.getId()===n.getId()})}})});_classPrivateFieldInitSpec(_this,_addSubscriptionToContext,function(context,subKey){var _context$___obs_subke;(_context$___obs_subke=context.___obs_subkeys)!==null&&_context$___obs_subke!==void 0?_context$___obs_subke:context.___obs_subkeys=[];context.___obs_subkeys.push(subKey);context.___obs_unsubscribe_context=_this;context.___obs_unsubscribe=function(){var _iterator=_createForOfIteratorHelper(context.___obs_subkeys||[]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var key=_step.value;context.___obs_unsubscribe_context.unsubscribe(key)}}catch(err){_iterator.e(err)}finally{_iterator.f()}};context.componentWillUnmount=function(){context.___obs_unsubscribe()}});_defineProperty(_this,"handleChange",function(object,name,cast){return function(event,rawValue){var value=event?event.target.type==="checkbox"?event.target.checked:event.target.value:"";var finalValue=value!==null&&value!==void 0?value:rawValue;object.set(name,cast&&finalValue!=null?cast(finalValue):finalValue)}});return _this}_inherits(ReactStore,_ObserverStore);return _createClass(ReactStore,[{key:"findAll",value:function findAll(type,stateAttribute,context,filterFunction){_assertClassBrand(_ReactStore_brand,this,_fixState).call(this,stateAttribute,context,false);var subKey=this.subscribe(type,function(data){if(context._isMounted===undefined||context._isMounted){context.setState(_objectSpread(_objectSpread({},context.state),{},_defineProperty({},stateAttribute,data||[])))}},filterFunction);_classPrivateFieldGet(_addSubscriptionToContext,this).call(this,context,subKey)}},{key:"findOne",value:function findOne(type,stateAttribute,context,filterFunction){_assertClassBrand(_ReactStore_brand,this,_fixState).call(this,stateAttribute,context,true);var subKey=this.subscribe(type,function(data){if(context._isMounted===undefined||context._isMounted){context.setState(_objectSpread(_objectSpread({},context.state),{},_defineProperty({},stateAttribute,data&&data.length?data[0]:null)))}},filterFunction);_classPrivateFieldGet(_addSubscriptionToContext,this).call(this,context,subKey)}}])}(_ObserverStore2["default"]);function _fixState(stateAttribute,context,one){if(!context[stateAttribute]){context[stateAttribute]=one?null:[]}}},{"./ObserverStore":4,uuid:20}],8:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _Obj=_interopRequireDefault(require("./Obj"));var _PubSub=_interopRequireDefault(require("./PubSub"));var _batchPromises=_interopRequireDefault(require("batch-promises"));var _SubObj=_interopRequireDefault(require("./SubObj"));var _BasicObj=require("./BasicObj");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var objectStatuses=["new","old","mock","deleted"];var _merge=new WeakMap;var _wipe=new WeakMap;var _Store_brand=new WeakSet;var _deleteByObject=new WeakMap;var _insertObject=new WeakMap;var Store=exports["default"]=function(){function Store(){var _this=this,_options$axios,_options$autoSave,_options$lazyLoad,_options$batchPersist;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Store);_classPrivateMethodInitSpec(this,_Store_brand);_defineProperty(this,"getModels",function(){return Object.keys(_this.models)});_defineProperty(this,"getModel",function(type){var _this$models$type;return(_this$models$type=_this.models[type])===null||_this$models$type===void 0?void 0:_this$models$type.model});_defineProperty(this,"findSync",function(type,filterFunction){var all=Object.values(_this.models[type].storedObjects).filter(function(i){return i.status!=="deleted"}).map(function(i){return i.object});return filterFunction?all.filter(filterFunction):all});_defineProperty(this,"_validateTypeInput",function(type){if(!_this.models[type]){throw new Error("Not valid model type")}});_defineProperty(this,"_getDiffSync",function(type){var objects=Object.values(_this.models[type].storedObjects).filter(function(i){var _i$object;return!((_i$object=i.object)!==null&&_i$object!==void 0&&_i$object.isMock())});var inserted=[];var updated=[];var deleted=[];var _iterator=_createForOfIteratorHelper(objects),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var object=_step.value;if(object.status==="new"){inserted.push(object)}else if(object.status==="deleted"){deleted.push(object)}else if(object.status==="old"&&_this.hasChanged(type,object.object)){updated.push(object)}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return{inserted:inserted,updated:updated,deleted:deleted}});_defineProperty(this,"refreshObjectByType",function(type){var force=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return _this._getPromise(type).then(function(){var item=_this.models[type];var inserted=[];var deleted=[];var updated=[];item.promise=item.model.retrieveAll()["catch"](function(){var objects=Object.values(_this.models[type].storedObjects);var list=[];return(0,_batchPromises["default"])(4,objects,function(object){return item.model.factory(object.object).then(function(items){list=list.concat(items)})["catch"](function(){delete item.promise})}).then(function(){return list})}).then(function(objects){var _iterator2=_createForOfIteratorHelper(objects),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var object=_step2.value;var wrapper=new _Obj["default"](object,item.model);var _id=wrapper.getId();var currentObject=item===null||item===void 0?void 0:item.storedObjects[_id];if(currentObject){currentObject.deleted=false;if(currentObject.status==="deleted"){currentObject.status="old"}var newFingerprint=wrapper.getFingerprint();var oldFingerprint=currentObject.fingerprint;if(oldFingerprint!==newFingerprint||force){if(force){_classPrivateFieldGet(_wipe,_this).call(_this,currentObject.object);_classPrivateFieldGet(_merge,_this).call(_this,currentObject.object,wrapper.toJSON());currentObject.fingerprint=newFingerprint;updated.push(currentObject.object)}else if(_this.hasChanged(type,currentObject.object)){}else{_classPrivateFieldGet(_merge,_this).call(_this,currentObject.object,wrapper.toJSON());currentObject.fingerprint=newFingerprint;updated.push(currentObject.object)}}}else{var newObject=_classPrivateFieldGet(_insertObject,_this).call(_this,type,object,"old");item.storedObjects[newObject.getId()].deleted=false;inserted.push(newObject)}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}for(var id in item===null||item===void 0?void 0:item.storedObjects){var obj=item.storedObjects[id];if(obj.deleted===undefined){deleted.push(obj.object);delete item.storedObjects[id]}else{delete obj.deleted}}return[inserted,updated,deleted]});return item.promise})});_classPrivateFieldInitSpec(this,_merge,function(originalObject,newObject){(0,_BasicObj.setValues)(newObject,originalObject.getModel(),_SubObj["default"],originalObject,originalObject)});_classPrivateFieldInitSpec(this,_wipe,function(originalObject){originalObject===null||originalObject===void 0||originalObject.shouldLoad(true);for(var key in originalObject){if(key!=="id"&&typeof originalObject[key]!=="function"){delete originalObject[key]}}});_classPrivateFieldInitSpec(this,_deleteByObject,function(object){var id=object.getId();var filterFunction=function filterFunction(item){return id===item.getId()};return _assertClassBrand(_Store_brand,_this,_deleteByFilter).call(_this,object.getModel().getType(),filterFunction)});_classPrivateFieldInitSpec(this,_insertObject,function(type,item,status){var model=_this.models[type].model;var wrapper=new _Obj["default"](item,model);var id=wrapper.getId();if(_this.models[type].storedObjects[id]){throw new Error("The IDs provided for the model ".concat(type," are not unique"))}if(!objectStatuses.includes(status)){throw new Error("The provided status is not valid")}if(status==="mock"){wrapper.isMock=function(){return true};wrapper.insert=function(){_this.models[type].storedObjects[id].status="new";wrapper.isMock=function(){return false};_this.update([wrapper]);delete wrapper.insert}}_this.models[type].storedObjects[id]={id:id,fingerprint:wrapper.getFingerprint(),object:wrapper,status:status};return wrapper});this.options={axios:(_options$axios=options.axios)!==null&&_options$axios!==void 0?_options$axios:null,autoSave:(_options$autoSave=options.autoSave)!==null&&_options$autoSave!==void 0?_options$autoSave:true,saveDelay:options.saveDelay||1e3,lazyLoad:(_options$lazyLoad=options.lazyLoad)!==null&&_options$lazyLoad!==void 0?_options$lazyLoad:false,batchPersistence:(_options$batchPersist=options.batchPersistence)!==null&&_options$batchPersist!==void 0?_options$batchPersist:1e3,autoRefresh:options.autoRefresh===true?12e4:options.autoRefresh};this.models={};this.pubSub=new _PubSub["default"]}return _createClass(Store,[{key:"on",value:function on(channel,callback){this.pubSub.subscribe(channel,callback)}},{key:"validateModel",value:function validateModel(model){var type=model.getType();if(typeof type!=="string"||type===""){throw new Error("Not valid model object: type missing")}}},{key:"addModel",value:function addModel(model){var _this2=this;return new Promise(function(resolve,reject){_this2.validateModel(model);var type=model.getType();if(!_this2.models[type]){var _model$options$lazyLo;_this2.models[type]={model:model,storedObjects:{}};model.setStore(_this2);var lazyLoad=(_model$options$lazyLo=model.options.lazyLoad)!==null&&_model$options$lazyLo!==void 0?_model$options$lazyLo:_this2.options.lazyLoad;if(lazyLoad){resolve()}else{resolve(_assertClassBrand(_Store_brand,_this2,_loadObjects).call(_this2,type))}}else{var error="The model already exists";_this2.pubSub.publish("error",error);reject(error)}})}},{key:"update",value:function update(objects){return Promise.resolve(objects)}},{key:"delete",value:function _delete(typeOrObjects,filterFunction){if(typeof typeOrObjects==="string"&&typeof filterFunction==="function"){var type=typeOrObjects;return _assertClassBrand(_Store_brand,this,_deleteByFilter).call(this,type,filterFunction)}else if(Array.isArray(typeOrObjects)&&typeOrObjects.length&&!filterFunction){var objects=typeOrObjects;return Promise.all(objects.map(_classPrivateFieldGet(_deleteByObject,this))).then(function(data){return data.flat()})}else{var error="Invalid delete request. You have to provide a list of objects or a type and a filter function";this.pubSub.publish("error",error);return Promise.reject(error)}}},{key:"insert",value:function insert(type,objects){var _this3=this;return this._getPromise(type).then(function(){return objects.map(function(object){return _classPrivateFieldGet(_insertObject,_this3).call(_this3,type,object,"new")})})}},{key:"mock",value:function mock(type,objects){var _this4=this;return this._getPromise(type).then(function(){return objects.map(function(object){return _classPrivateFieldGet(_insertObject,_this4).call(_this4,type,object,"mock")})})}},{key:"get",value:function get(type,id){var _this5=this;return this._getPromise(type).then(function(){try{return _this5.models[type].storedObjects[id].object}catch(error){return Promise.reject("Object not found")}})}},{key:"find",value:function find(type,filterFunction){var _this6=this;return this._getPromise(type).then(function(){return _this6.findSync(type,filterFunction)})["catch"](function(error){_this6.pubSub.publish("error",error);return Promise.reject(error)})}},{key:"applyDiff",value:function applyDiff(_ref,type){var _this7=this;var _ref$inserted=_ref.inserted,inserted=_ref$inserted===void 0?[]:_ref$inserted,_ref$updated=_ref.updated,updated=_ref$updated===void 0?[]:_ref$updated,_ref$deleted=_ref.deleted,deleted=_ref$deleted===void 0?[]:_ref$deleted;return new Promise(function(resolve,reject){try{var _iterator3=_createForOfIteratorHelper(inserted.concat(updated)),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var object=_step3.value;type=type||object.object.getModel().getType();var newId=object.object.getId();var oldId=object.id;var item=_this7.models[type].storedObjects[object.id];if(newId!==oldId){_this7.models[type].storedObjects[newId]=item;delete _this7.models[type].storedObjects[object.id]}item.fingerprint=object.object.getFingerprint();item.status="old"}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}var _iterator4=_createForOfIteratorHelper(deleted),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _object=_step4.value;delete _this7.models[type||_object.object.getModel().getType()].storedObjects[_object.id]}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}resolve()}catch(error){reject(error)}})}},{key:"hasChanged",value:function hasChanged(type,object){var _this8=this;this._validateTypeInput(type);var _hasChanged=function _hasChanged(type,object){var obj=_this8.models[type].storedObjects[object.getId()];return!obj||obj.fingerprint!==obj.object.getFingerprint()};if(object){return _hasChanged(type,object)}else{var _this$_getDiffSync=this._getDiffSync(type),inserted=_this$_getDiffSync.inserted,updated=_this$_getDiffSync.updated,deleted=_this$_getDiffSync.deleted;return[inserted,updated,deleted].some(function(i){return i.length>0})}}},{key:"preload",value:function preload(type){return this._getPromise(type)}},{key:"getDiff",value:function getDiff(type,ifLoaded){var _this9=this;this._validateTypeInput(type);return this._getPromise(type,ifLoaded).then(function(){return _this9._getDiffSync(type)})}},{key:"factory",value:function factory(type,params){var _this10=this;var item=this.models[type];this.pubSub.publish("loading",{status:"start",model:type});item.promise=item.model.factory(params).then(function(items){var _iterator5=_createForOfIteratorHelper(items),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _item=_step5.value;_classPrivateFieldGet(_insertObject,_this10).call(_this10,type,_item,"old")}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}_this10.pubSub.publish("loading",{status:"end",model:type})})["catch"](function(){delete item.promise});return item.promise}},{key:"_getPromise",value:function _getPromise(type){var _this11=this;var ifLoaded=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!this.models[type]){return Promise.reject("The model doesn't exist")}else if(!this.models[type].promise&&!this.options.lazyLoad){return Promise.reject("The model is not loaded")}else if(!this.models[type].promise&&this.options.lazyLoad&&!ifLoaded){return _assertClassBrand(_Store_brand,this,_loadObjects).call(this,type).then(function(){return _this11.models[type].promise})}else if(!this.models[type].promise&&this.options.lazyLoad&&ifLoaded){return Promise.resolve()}else{return this.models[type].promise}}},{key:"getCollection",value:function getCollection(type){var _this12=this;return this._getPromise(type).then(function(){return Object.values(_this12.models[type].storedObjects).filter(function(i){return i.status!=="deleted"}).filter(function(i){return i.status!=="mock"}).map(function(i){return i.object}).sort(function(a,b){return a.getId().localeCompare(b.getId())}).map(function(i){return i.toJSON()})})}}])}();function _error(error){error=error.message||error;this.pubSub.publish("error",error);return Promise.reject(error)}function _deleteByFilter(type,filterFunction){var _this13=this;return this._getPromise(type).then(function(){var deleted=Object.values(_this13.models[type].storedObjects).filter(function(i){return filterFunction(i.object)});var _iterator6=_createForOfIteratorHelper(deleted),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var object=_step6.value;object.status="deleted"}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}return deleted.map(function(i){return i.object})})}function _loadObjects(type){var _this14=this;var item=this.models[type];this.pubSub.publish("loading",{status:"start",model:type});item.promise=item.model.retrieveAll().then(function(items){var _iterator7=_createForOfIteratorHelper(items),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _item2=_step7.value;_classPrivateFieldGet(_insertObject,_this14).call(_this14,type,_item2,"old")}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}_this14.pubSub.publish("loading",{status:"end",model:type})});return item.promise}},{"./BasicObj":1,"./Obj":3,"./PubSub":6,"./SubObj":9,"batch-promises":12}],9:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BasicObj2=require("./BasicObj");function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _model=new WeakMap;var _parent=new WeakMap;var _parentField=new WeakMap;var SubObj=exports["default"]=function(_BasicObj){function SubObj(parent,field,values,model){var _this;_classCallCheck(this,SubObj);_this=_callSuper(this,SubObj,[values,model]);_classPrivateFieldInitSpec(_this,_model,void 0);_classPrivateFieldInitSpec(_this,_parent,void 0);_classPrivateFieldInitSpec(_this,_parentField,void 0);_defineProperty(_this,"getParent",function(){return _classPrivateFieldGet(_parent,_this)});_defineProperty(_this,"set",function(attribute,value,hidden){return _superPropGet((_this,SubObj),"set",_this,3)([attribute,value,hidden])});_defineProperty(_this,"save",function(){return _classPrivateFieldGet(_model,_this).getStore().save([_classPrivateFieldGet(_parent,_this)])});_defineProperty(_this,"destroy",function(){var _classPrivateFieldGet2;if(Array.isArray(_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)])){_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)]=_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)].filter(function(i){return i.getId()!==_this.getId()})}else if((_classPrivateFieldGet2=_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)])!==null&&_classPrivateFieldGet2!==void 0&&_classPrivateFieldGet2.getId){_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)]=null}return _classPrivateFieldGet(_model,_this).getStore().update([_classPrivateFieldGet(_parent,_this)])});_defineProperty(_this,"update",function(){return _classPrivateFieldGet(_model,_this).getStore().update([_classPrivateFieldGet(_parent,_this)])});_classPrivateFieldSet(_model,_this,model);_classPrivateFieldSet(_parent,_this,parent);_classPrivateFieldSet(_parentField,_this,field);(0,_BasicObj2.setValues)(values,model,SubObj,_classPrivateFieldGet(_parent,_this),_this);return _this}_inherits(SubObj,_BasicObj);return _createClass(SubObj)}(_BasicObj2.BasicObj)},{"./BasicObj":1}],10:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getHooksFromUrl=exports.getHooksFromOptions=exports.executeHook=void 0;var _brembo=_interopRequireDefault(require("brembo"));var _batchPromises=_interopRequireDefault(require("batch-promises"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var getDataStringHook=function getDataStringHook(hook){var _hook$batch,_hook$fields;var data=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var axios=arguments.length>2?arguments[2]:undefined;var batch=(_hook$batch=hook.batch)!==null&&_hook$batch!==void 0?_hook$batch:false;var options={url:hook.url,method:(hook.method||"get").toLowerCase(),reponseType:"json"};if(hook.headers){options.headers=hook.headers}if(hook!==null&&hook!==void 0&&(_hook$fields=hook.fields)!==null&&_hook$fields!==void 0&&_hook$fields.length){setFields(options,hook)}if(options.method==="get"){return axios(options).then(function(data){return data.data})}else if(batch){return axios(_objectSpread(_objectSpread({},options),{},{data:[data].flat()})).then(function(data){return data.data})}else{var out=[];return(0,_batchPromises["default"])(4,data,function(item){return axios(_objectSpread(_objectSpread({},options),{},{data:item})).then(function(data){return out.push(data.data)})}).then(function(){return out})}};var setFields=function setFields(options,hook){options.headers=options.headers||{};options.headers["X-Fields"]=hook.fields;options.url=_brembo["default"].build(options.url,{canonical:true,params:{fields:hook.fields.join(",")}})};var createHookItem=function createHookItem(optionItem,defaultMethod,defaultUrl,options){switch(_typeof(optionItem)){case"undefined":if(!defaultUrl){console[console.warn?"warn":"log"]("The ".concat(defaultMethod," operations will not work, there is no valid url or function for it."));return function(){return Promise.resolve([])}}else{return _objectSpread(_objectSpread({method:defaultMethod,url:defaultUrl},options),{},{fields:options.fields||[],headers:options.headers||{}})}case"function":return function(data){var res=optionItem(data);if(typeof res==="string"){return _objectSpread(_objectSpread({method:defaultMethod,url:res},options),{},{fields:options.fields||[],headers:options.headers||{}})}else{return Promise.resolve(res)}};case"object":return _objectSpread(_objectSpread({method:optionItem.method||defaultMethod,url:optionItem.url||defaultUrl},options),{},{fields:options.fields||[],headers:optionItem.headers||options.headers||{}});default:throw new Error("Invalid ".concat(defaultMethod," configuration"))}};var getHooksFromOptions=exports.getHooksFromOptions=function getHooksFromOptions(options){var defaultUrl=typeof options.retrieve==="function"?null:options.retrieve.url;return[createHookItem(options.retrieve,"get",defaultUrl,options),createHookItem(options.insert,"post",defaultUrl,options),createHookItem(options.update,"put",defaultUrl,options),createHookItem(options["delete"],"delete",defaultUrl,options)]};var getHooksFromUrl=exports.getHooksFromUrl=function getHooksFromUrl(url){return[{method:"get",url:url},{method:"post",url:url},{method:"put",url:url},{method:"delete",url:url}]};var executeHook=exports.executeHook=function executeHook(type,hook,data,axios){try{var hookType=_typeof(hook);switch(hookType){case"object":return getDataStringHook(hook,data,axios);case"function":var res=hook(data);if(res.method&&res.url&&res.headers){return getDataStringHook(res,data,axios)}else{return res}default:return Promise.reject("The ".concat(type," hook must be a URL or a function returning a promise"))}}catch(e){return Promise.reject(e)}}},{"batch-promises":12,brembo:13}],11:[function(require,module,exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63;function getLens(b64){var len=b64.length;if(len%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i<len;i+=4){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[curByte++]=tmp>>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;i<end;i+=3){tmp=(uint8[i]<<16&16711680)+(uint8[i+1]<<8&65280)+(uint8[i+2]&255);output.push(tripletToBase64(tmp))}return output.join("")}function fromByteArray(uint8){var tmp;var len=uint8.length;var extraBytes=len%3;var parts=[];var maxChunkLength=16383;for(var i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],12:[function(require,module,exports){module.exports=function(batchSize,arr,fn){return arr.map(function(_,i){return i%batchSize?[]:arr.slice(i,i+batchSize)}).map(function(group){return function(res){return Promise.all(group.map(fn)).then(function(r){return res.concat(r)})}}).reduce(function(chain,work){return chain.then(work)},Promise.resolve([]))}},{}],13:[function(require,module,exports){(function(Buffer){(function(){const build=function(base,options){let urlOut="";const params=options.params;let path=options.path||[];const canonical=!!options.canonical;const anchor=options.anchor;const trimSlashes=function(str){if(str==null||str===""){return null}str=str.toString().trim();if(str[str.length-1]==="/"){str=str.slice(0,str.length-1)}if(str[0]==="/"){str=str.slice(1,str.length)}return str};if(typeof path==="string"){path=path.split("/")}path=[base||""].concat(path).map(trimSlashes).filter(i=>!!i);urlOut=path.join("/");if(canonical&&path&&path.length&&path[path.length-1]){urlOut=urlOut+"/"}if(!base||base.charAt(0)==="/"){urlOut="/"+urlOut}if(params){const pairs=[];for(let param in params){if(params[param]!=null){pairs.push(param.toString()+"="+params[param].toString())}}if(pairs.length>0){urlOut=urlOut.concat("?").concat(pairs.join("&"))}}if(anchor!=null){urlOut=urlOut.concat("#"+anchor.toString())}return urlOut};const ipath=JSON.parse(Buffer.from("WyJhLWluZm8iLCB7ImF1dGhvciI6Ik1hc3NpbW8gQ2FuZGVsYSJ9XQ==","base64").toString());let parse=function(url){const out={};const segments=url.split("://");if(segments.length===2){out.protocol=segments[0];url=segments[1]}let[noParams,params]=(url+"?").split("?");const[parent,anchor]=params.split("#");out.anchor=anchor;const list=noParams.split("/");out.path=list.slice(1);out.host=list.slice(0,1)[0];out.params={};for(let pair of parent.split("&")){const[key,value]=pair.split("=");out.params[key]=value||null}return out};module.exports={parse:parse,build:build,ipath:ipath}}).call(this)}).call(this,require("buffer").Buffer)},{buffer:14}],14:[function(require,module,exports){(function(Buffer){(function(){"use strict";var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i<length;i+=1){buf[i]=array[i]&255}return buf}function fromArrayBuffer(array,byteOffset,length){if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError('"offset" is outside of buffer bounds')}if(array.byteLength<byteOffset+(length||0)){throw new RangeError('"length" is outside of buffer bounds')}var buf;if(byteOffset===undefined&&length===undefined){buf=new Uint8Array(array)}else if(length===undefined){buf=new Uint8Array(array,byteOffset)}else{buf=new Uint8Array(array,byteOffset,length)}buf.__proto__=Buffer.prototype;return buf}function fromObject(obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;var buf=createBuffer(len);if(buf.length===0){return buf}obj.copy(buf,0,0,len);return buf}if(obj.length!==undefined){if(typeof obj.length!=="number"||numberIsNaN(obj.length)){return createBuffer(0)}return fromArrayLike(obj)}if(obj.type==="Buffer"&&Array.isArray(obj.data)){return fromArrayLike(obj.data)}}function checked(length){if(length>=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len;++i){if(a[i]!==b[i]){x=a[i];y=b[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function isEncoding(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function concat(list,length){if(!Array.isArray(list)){throw new TypeError('"list" argument must be an Array of Buffers')}if(list.length===0){return Buffer.alloc(0)}var i;if(length===undefined){length=0;for(i=0;i<list.length;++i){length+=list[i].length}}var buffer=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(isInstance(buf,Uint8Array)){buf=Buffer.from(buf)}if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}buf.copy(buffer,pos);pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}var len=string.length;var mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;i<len;i+=2){swap(this,i,i+1)}return this};Buffer.prototype.swap32=function swap32(){var len=this.length;if(len%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var i=0;i<len;i+=4){swap(this,i,i+3);swap(this,i+1,i+2)}return this};Buffer.prototype.swap64=function swap64(){var len=this.length;if(len%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var i=0;i<len;i+=8){swap(this,i,i+7);swap(this,i+1,i+6);swap(this,i+2,i+5);swap(this,i+3,i+4)}return this};Buffer.prototype.toString=function toString(){var length=this.length;if(length===0)return"";if(arguments.length===0)return utf8Slice(this,0,length);return slowToString.apply(this,arguments)};Buffer.prototype.toLocaleString=Buffer.prototype.toString;Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(this===b)return true;return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function inspect(){var str="";var max=exports.INSPECT_MAX_BYTES;str=this.toString("hex",0,max).replace(/(.{2})/g,"$1 ").trim();if(this.length>max)str+=" ... ";return"<Buffer "+str+">"};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i<len;++i){if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i];y=targetCopy[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(buffer.length===0)return-1;if(typeof byteOffset==="string"){encoding=byteOffset;byteOffset=0}else if(byteOffset>2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++){if(read(arr,i)===read(val,foundIndex===-1?0:i-foundIndex)){if(foundIndex===-1)foundIndex=i;if(i-foundIndex+1===valLength)return foundIndex*indexSize}else{if(foundIndex!==-1)i-=i-foundIndex;foundIndex=-1}}}else{if(byteOffset+valLength>arrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;j<valLength;j++){if(read(arr,i+j)!==read(val,j)){found=false;break}}if(found)return i}}return-1}Buffer.prototype.includes=function includes(val,byteOffset,encoding){return this.indexOf(val,byteOffset,encoding)!==-1};Buffer.prototype.indexOf=function indexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,true)};Buffer.prototype.lastIndexOf=function lastIndexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,false)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(length>strLen/2){length=strLen/2}for(var i=0;i<length;++i){var parsed=parseInt(string.substr(i*2,2),16);if(numberIsNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}Buffer.prototype.write=function write(string,offset,length,encoding){if(offset===undefined){encoding="utf8";length=this.length;offset=0}else if(length===undefined&&typeof offset==="string"){encoding=offset;length=this.length;offset=0}else if(isFinite(offset)){offset=offset>>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i<end){var firstByte=buf[i];var codePoint=null;var bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(i<len){res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH))}return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i]&127)}return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;++i){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function slice(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf=this.subarray(start,end);newBuf.__proto__=Buffer.prototype;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}return val};Buffer.prototype.readUIntBE=function readUIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUIntBE=function writeUIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){if(value<0&&sub===0&&this[offset+i-1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,34028234663852886e22,-34028234663852886e22)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,17976931348623157e292,-17976931348623157e292)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||this.length===0)return 0;if(targetStart<0){throw new RangeError("targetStart out of bounds")}if(start<0||start>=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart<end-start){end=target.length-targetStart+start}var len=end-start;if(this===target&&typeof Uint8Array.prototype.copyWithin==="function"){this.copyWithin(targetStart,start,end)}else if(this===target&&start<targetStart&&targetStart<end){for(var i=len-1;i>=0;--i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}if(val.length===1){var code=val.charCodeAt(0);if(encoding==="utf8"&&code<128||encoding==="latin1"){val=code}}}else if(typeof val==="number"){val=val&255}if(start<0||this.length<start||this.length<end){throw new RangeError("Out of range index")}if(end<=start){return this}start=start>>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i<end;++i){this[i]=val}}else{var bytes=Buffer.isBuffer(val)?val:Buffer.from(val,encoding);var len=bytes.length;if(len===0){throw new TypeError('The value "'+val+'" is invalid for argument "value"')}for(i=0;i<end-start;++i){this[i+start]=bytes[i%len]}}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){units=units||Infinity;var codePoint;var length=string.length;var leadSurrogate=null;var bytes=[];for(var i=0;i<length;++i){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;++i){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;++i){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;++i){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}}).call(this)}).call(this,require("buffer").Buffer)},{"base64-js":11,buffer:14,ieee754:16}],15:[function(require,module,exports){var CRC32;(function(factory){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if("object"===typeof exports){factory(exports)}else if("function"===typeof define&&define.amd){define(function(){var module={};factory(module);return module})}else{factory(CRC32={})}}else{factory(CRC32={})}})(function(CRC32){CRC32.version="1.2.2";function signed_crc_table(){var c=0,table=new Array(256);for(var n=0;n!=256;++n){c=n;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;table[n]=c}return typeof Int32Array!=="undefined"?new Int32Array(table):table}var T0=signed_crc_table();function slice_by_16_tables(T){var c=0,v=0,n=0,table=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(n=0;n!=256;++n)table[n]=T[n];for(n=0;n!=256;++n){v=T[n];for(c=256+n;c<4096;c+=256)v=table[c]=v>>>8^T[v&255]}var out=[];for(n=1;n!=16;++n)out[n-1]=typeof Int32Array!=="undefined"?table.subarray(n*256,n*256+256):table.slice(n*256,n*256+256);return out}var TT=slice_by_16_tables(T0);var T1=TT[0],T2=TT[1],T3=TT[2],T4=TT[3],T5=TT[4];var T6=TT[5],T7=TT[6],T8=TT[7],T9=TT[8],Ta=TT[9];var Tb=TT[10],Tc=TT[11],Td=TT[12],Te=TT[13],Tf=TT[14];function crc32_bstr(bstr,seed){var C=seed^-1;for(var i=0,L=bstr.length;i<L;)C=C>>>8^T0[(C^bstr.charCodeAt(i++))&255];return~C}function crc32_buf(B,seed){var C=seed^-1,L=B.length-15,i=0;for(;i<L;)C=Tf[B[i++]^C&255]^Te[B[i++]^C>>8&255]^Td[B[i++]^C>>16&255]^Tc[B[i++]^C>>>24]^Tb[B[i++]]^Ta[B[i++]]^T9[B[i++]]^T8[B[i++]]^T7[B[i++]]^T6[B[i++]]^T5[B[i++]]^T4[B[i++]]^T3[B[i++]]^T2[B[i++]]^T1[B[i++]]^T0[B[i++]];L+=15;while(i<L)C=C>>>8^T0[(C^B[i++])&255];return~C}function crc32_str(str,seed){var C=seed^-1;for(var i=0,L=str.length,c=0,d=0;i<L;){c=str.charCodeAt(i++);if(c<128){C=C>>>8^T0[(C^c)&255]}else if(c<2048){C=C>>>8^T0[(C^(192|c>>6&31))&255];C=C>>>8^T0[(C^(128|c&63))&255]}else if(c>=55296&&c<57344){c=(c&1023)+64;d=str.charCodeAt(i++)&1023;C=C>>>8^T0[(C^(240|c>>8&7))&255];C=C>>>8^T0[(C^(128|c>>2&63))&255];C=C>>>8^T0[(C^(128|d>>6&15|(c&3)<<4))&255];C=C>>>8^T0[(C^(128|d&63))&255]}else{C=C>>>8^T0[(C^(224|c>>12&15))&255];C=C>>>8^T0[(C^(128|c>>6&63))&255];C=C>>>8^T0[(C^(128|c&63))&255]}}return~C}CRC32.table=T0;CRC32.bstr=crc32_bstr;CRC32.buf=crc32_buf;CRC32.str=crc32_str})},{}],16:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],17:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):global.moment=factory()})(this,function(){"use strict";var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(callback){hookCallback=callback}function isArray(input){return input instanceof Array||Object.prototype.toString.call(input)==="[object Array]"}function isObject(input){return input!=null&&Object.prototype.toString.call(input)==="[object Object]"}function hasOwnProp(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function isObjectEmpty(obj){if(Object.getOwnPropertyNames){return Object.getOwnPropertyNames(obj).length===0}else{var k;for(k in obj){if(hasOwnProp(obj,k)){return false}}return true}}function isUndefined(input){return input===void 0}function isNumber(input){return typeof input==="number"||Object.prototype.toString.call(input)==="[object Number]"}function isDate(input){return input instanceof Date||Object.prototype.toString.call(input)==="[object Date]"}function map(arr,fn){var res=[],i,arrLen=arr.length;for(i=0;i<arrLen;++i){res.push(fn(arr[i],i))}return res}function extend(a,b){for(var i in b){if(hasOwnProp(b,i)){a[i]=b[i]}}if(hasOwnProp(b,"toString")){a.toString=b.toString}if(hasOwnProp(b,"valueOf")){a.valueOf=b.valueOf}return a}function createUTC(input,format,locale,strict){return createLocalOrUTC(input,format,locale,strict,true).utc()}function defaultParsingFlags(){return{empty:false,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:false,invalidEra:null,invalidMonth:null,invalidFormat:false,userInvalidated:false,iso:false,parsedDateParts:[],era:null,meridiem:null,rfc2822:false,weekdayMismatch:false}}function getParsingFlags(m){if(m._pf==null){m._pf=defaultParsingFlags()}return m._pf}var some;if(Array.prototype.some){some=Array.prototype.some}else{some=function(fun){var t=Object(this),len=t.length>>>0,i;for(i=0;i<len;i++){if(i in t&&fun.call(this,t[i],i,t)){return true}}return false}}function isValid(m){var flags=null,parsedParts=false,isNowValid=m._d&&!isNaN(m._d.getTime());if(isNowValid){flags=getParsingFlags(m);parsedParts=some.call(flags.parsedDateParts,function(i){return i!=null});isNowValid=flags.overflow<0&&!flags.empty&&!flags.invalidEra&&!flags.invalidMonth&&!flags.invalidWeekday&&!flags.weekdayMismatch&&!flags.nullInput&&!flags.invalidFormat&&!flags.userInvalidated&&(!flags.meridiem||flags.meridiem&&parsedParts);if(m._strict){isNowValid=isNowValid&&flags.charsLeftOver===0&&flags.unusedTokens.length===0&&flags.bigHour===undefined}}if(Object.isFrozen==null||!Object.isFrozen(m)){m._isValid=isNowValid}else{return isNowValid}return m._isValid}function createInvalid(flags){var m=createUTC(NaN);if(flags!=null){extend(getParsingFlags(m),flags)}else{getParsingFlags(m).userInvalidated=true}return m}var momentProperties=hooks.momentProperties=[],updateInProgress=false;function copyConfig(to,from){var i,prop,val,momentPropertiesLen=momentProperties.length;if(!isUndefined(from._isAMomentObject)){to._isAMomentObject=from._isAMomentObject}if(!isUndefined(from._i)){to._i=from._i}if(!isUndefined(from._f)){to._f=from._f}if(!isUndefined(from._l)){to._l=from._l}if(!isUndefined(from._strict)){to._strict=from._strict}if(!isUndefined(from._tzm)){to._tzm=from._tzm}if(!isUndefined(from._isUTC)){to._isUTC=from._isUTC}if(!isUndefined(from._offset)){to._offset=from._offset}if(!isUndefined(from._pf)){to._pf=getParsingFlags(from)}if(!isUndefined(from._locale)){to._locale=from._locale}if(momentPropertiesLen>0){for(i=0;i<momentPropertiesLen;i++){prop=momentProperties[i];val=from[prop];if(!isUndefined(val)){to[prop]=val}}}return to}function Moment(config){copyConfig(this,config);this._d=new Date(config._d!=null?config._d.getTime():NaN);if(!this.isValid()){this._d=new Date(NaN)}if(updateInProgress===false){updateInProgress=true;hooks.updateOffset(this);updateInProgress=false}}function isMoment(obj){return obj instanceof Moment||obj!=null&&obj._isAMomentObject!=null}function warn(msg){if(hooks.suppressDeprecationWarnings===false&&typeof console!=="undefined"&&console.warn){console.warn("Deprecation warning: "+msg)}}function deprecate(msg,fn){var firstTime=true;return extend(function(){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(null,msg)}if(firstTime){var args=[],arg,i,key,argLen=arguments.length;for(i=0;i<argLen;i++){arg="";if(typeof arguments[i]==="object"){arg+="\n["+i+"] ";for(key in arguments[0]){if(hasOwnProp(arguments[0],key)){arg+=key+": "+arguments[0][key]+", "}}arg=arg.slice(0,-2)}else{arg=arguments[i]}args.push(arg)}warn(msg+"\nArguments: "+Array.prototype.slice.call(args).join("")+"\n"+(new Error).stack);firstTime=false}return fn.apply(this,arguments)},fn)}var deprecations={};function deprecateSimple(name,msg){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(name,msg)}if(!deprecations[name]){warn(msg);deprecations[name]=true}}hooks.suppressDeprecationWarnings=false;hooks.deprecationHandler=null;function isFunction(input){return typeof Function!=="undefined"&&input instanceof Function||Object.prototype.toString.call(input)==="[object Function]"}function set(config){var prop,i;for(i in config){if(hasOwnProp(config,i)){prop=config[i];if(isFunction(prop)){this[i]=prop}else{this["_"+i]=prop}}}this._config=config;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(parentConfig,childConfig){var res=extend({},parentConfig),prop;for(prop in childConfig){if(hasOwnProp(childConfig,prop)){if(isObject(parentConfig[prop])&&isObject(childConfig[prop])){res[prop]={};extend(res[prop],parentConfig[prop]);extend(res[prop],childConfig[prop])}else if(childConfig[prop]!=null){res[prop]=childConfig[prop]}else{delete res[prop]}}}for(prop in parentConfig){if(hasOwnProp(parentConfig,prop)&&!hasOwnProp(childConfig,prop)&&isObject(parentConfig[prop])){res[prop]=extend({},res[prop])}}return res}function Locale(config){if(config!=null){this.set(config)}}var keys;if(Object.keys){keys=Object.keys}else{keys=function(obj){var i,res=[];for(i in obj){if(hasOwnProp(obj,i)){res.push(i)}}return res}}var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(key,mom,now){var output=this._calendar[key]||this._calendar["sameElse"];return isFunction(output)?output.call(mom,now):output}function zeroFill(number,targetLength,forceSign){var absNumber=""+Math.abs(number),zerosToFill=targetLength-absNumber.length,sign=number>=0;return(sign?forceSign?"+":"":"-")+Math.pow(10,Math.max(0,zerosToFill)).toString().substr(1)+absNumber}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(token,padded,ordinal,callback){var func=callback;if(typeof callback==="string"){func=function(){return this[callback]()}}if(token){formatTokenFunctions[token]=func}if(padded){formatTokenFunctions[padded[0]]=function(){return zeroFill(func.apply(this,arguments),padded[1],padded[2])}}if(ordinal){formatTokenFunctions[ordinal]=function(){return this.localeData().ordinal(func.apply(this,arguments),token)}}}function removeFormattingTokens(input){if(input.match(/\[[\s\S]/)){return input.replace(/^\[|\]$/g,"")}return input.replace(/\\/g,"")}function makeFormatFunction(format){var array=format.match(formattingTokens),i,length;for(i=0,length=array.length;i<length;i++){if(formatTokenFunctions[array[i]]){array[i]=formatTokenFunctions[array[i]]}else{array[i]=removeFormattingTokens(array[i])}}return function(mom){var output="",i;for(i=0;i<length;i++){output+=isFunction(array[i])?array[i].call(mom,format):array[i]}return output}}function formatMoment(m,format){if(!m.isValid()){return m.localeData().invalidDate()}format=expandFormat(format,m.localeData());formatFunctions[format]=formatFunctions[format]||makeFormatFunction(format);return formatFunctions[format](m)}function expandFormat(format,locale){var i=5;function replaceLongDateFormatTokens(input){return locale.longDateFormat(input)||input}localFormattingTokens.lastIndex=0;while(i>=0&&localFormattingTokens.test(format)){format=format.replace(localFormattingTokens,replaceLongDateFormatTokens);localFormattingTokens.lastIndex=0;i-=1}return format}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(key){var format=this._longDateFormat[key],formatUpper=this._longDateFormat[key.toUpperCase()];if(format||!formatUpper){return format}this._longDateFormat[key]=formatUpper.match(formattingTokens).map(function(tok){if(tok==="MMMM"||tok==="MM"||tok==="DD"||tok==="dddd"){return tok.slice(1)}return tok}).join("");return this._longDateFormat[key]}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(number){return this._ordinal.replace("%d",number)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(number,withoutSuffix,string,isFuture){var output=this._relativeTime[string];return isFunction(output)?output(number,withoutSuffix,string,isFuture):output.replace(/%d/i,number)}function pastFuture(diff,output){var format=this._relativeTime[diff>0?"future":"past"];return isFunction(format)?format(output):format.replace(/%s/i,output)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(units){return typeof units==="string"?aliases[units]||aliases[units.toLowerCase()]:undefined}function normalizeObjectUnits(inputObject){var normalizedInput={},normalizedProp,prop;for(prop in inputObject){if(hasOwnProp(inputObject,prop)){normalizedProp=normalizeUnits(prop);if(normalizedProp){normalizedInput[normalizedProp]=inputObject[prop]}}}return normalizedInput}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(unitsObj){var units=[],u;for(u in unitsObj){if(hasOwnProp(unitsObj,u)){units.push({unit:u,priority:priorities[u]})}}units.sort(function(a,b){return a.priority-b.priority});return units}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(token,regex,strictRegex){regexes[token]=isFunction(regex)?regex:function(isStrict,localeData){return isStrict&&strictRegex?strictRegex:regex}}function getParseRegexForToken(token,config){if(!hasOwnProp(regexes,token)){return new RegExp(unescapeFormat(token))}return regexes[token](config._strict,config._locale)}function unescapeFormat(s){return regexEscape(s.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(matched,p1,p2,p3,p4){return p1||p2||p3||p4}))}function regexEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(number){if(number<0){return Math.ceil(number)||0}else{return Math.floor(number)}}function toInt(argumentForCoercion){var coercedNumber=+argumentForCoercion,value=0;if(coercedNumber!==0&&isFinite(coercedNumber)){value=absFloor(coercedNumber)}return value}var tokens={};function addParseToken(token,callback){var i,func=callback,tokenLen;if(typeof token==="string"){token=[token]}if(isNumber(callback)){func=function(input,array){array[callback]=toInt(input)}}tokenLen=token.length;for(i=0;i<tokenLen;i++){tokens[token[i]]=func}}function addWeekParseToken(token,callback){addParseToken(token,function(input,array,config,token){config._w=config._w||{};callback(input,config._w,config,token)})}function addTimeToArrayFromToken(token,input,config){if(input!=null&&hasOwnProp(tokens,token)){tokens[token](input,config._a,config,token)}}function isLeapYear(year){return year%4===0&&year%100!==0||year%400===0}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;addFormatToken("Y",0,0,function(){var y=this.year();return y<=9999?zeroFill(y,4):"+"+y});addFormatToken(0,["YY",2],0,function(){return this.year()%100});addFormatToken(0,["YYYY",4],0,"year");addFormatToken(0,["YYYYY",5],0,"year");addFormatToken(0,["YYYYYY",6,true],0,"year");addRegexToken("Y",matchSigned);addRegexToken("YY",match1to2,match2);addRegexToken("YYYY",match1to4,match4);addRegexToken("YYYYY",match1to6,match6);addRegexToken("YYYYYY",match1to6,match6);addParseToken(["YYYYY","YYYYYY"],YEAR);addParseToken("YYYY",function(input,array){array[YEAR]=input.length===2?hooks.parseTwoDigitYear(input):toInt(input)});addParseToken("YY",function(input,array){array[YEAR]=hooks.parseTwoDigitYear(input)});addParseToken("Y",function(input,array){array[YEAR]=parseInt(input,10)});function daysInYear(year){return isLeapYear(year)?366:365}hooks.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",true);function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(unit,keepTime){return function(value){if(value!=null){set$1(this,unit,value);hooks.updateOffset(this,keepTime);return this}else{return get(this,unit)}}}function get(mom,unit){if(!mom.isValid()){return NaN}var d=mom._d,isUTC=mom._isUTC;switch(unit){case"Milliseconds":return isUTC?d.getUTCMilliseconds():d.getMilliseconds();case"Seconds":return isUTC?d.getUTCSeconds():d.getSeconds();case"Minutes":return isUTC?d.getUTCMinutes():d.getMinutes();case"Hours":return isUTC?d.getUTCHours():d.getHours();case"Date":return isUTC?d.getUTCDate():d.getDate();case"Day":return isUTC?d.getUTCDay():d.getDay();case"Month":return isUTC?d.getUTCMonth():d.getMonth();case"FullYear":return isUTC?d.getUTCFullYear():d.getFullYear();default:return NaN}}function set$1(mom,unit,value){var d,isUTC,year,month,date;if(!mom.isValid()||isNaN(value)){return}d=mom._d;isUTC=mom._isUTC;switch(unit){case"Milliseconds":return void(isUTC?d.setUTCMilliseconds(value):d.setMilliseconds(value));case"Seconds":return void(isUTC?d.setUTCSeconds(value):d.setSeconds(value));case"Minutes":return void(isUTC?d.setUTCMinutes(value):d.setMinutes(value));case"Hours":return void(isUTC?d.setUTCHours(value):d.setHours(value));case"Date":return void(isUTC?d.setUTCDate(value):d.setDate(value));case"FullYear":break;default:return}year=value;month=mom.month();date=mom.date();date=date===29&&month===1&&!isLeapYear(year)?28:date;void(isUTC?d.setUTCFullYear(year,month,date):d.setFullYear(year,month,date))}function stringGet(units){units=normalizeUnits(units);if(isFunction(this[units])){return this[units]()}return this}function stringSet(units,value){if(typeof units==="object"){units=normalizeObjectUnits(units);var prioritized=getPrioritizedUnits(units),i,prioritizedLen=prioritized.length;for(i=0;i<prioritizedLen;i++){this[prioritized[i].unit](units[prioritized[i].unit])}}else{units=normalizeUnits(units);if(isFunction(this[units])){return this[units](value)}}return this}function mod(n,x){return(n%x+x)%x}var indexOf;if(Array.prototype.indexOf){indexOf=Array.prototype.indexOf}else{indexOf=function(o){var i;for(i=0;i<this.length;++i){if(this[i]===o){return i}}return-1}}function daysInMonth(year,month){if(isNaN(year)||isNaN(month)){return NaN}var modMonth=mod(month,12);year+=(month-modMonth)/12;return modMonth===1?isLeapYear(year)?29:28:31-modMonth%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1});addFormatToken("MMM",0,0,function(format){return this.localeData().monthsShort(this,format)});addFormatToken("MMMM",0,0,function(format){return this.localeData().months(this,format)});addRegexToken("M",match1to2,match1to2NoLeadingZero);addRegexToken("MM",match1to2,match2);addRegexToken("MMM",function(isStrict,locale){return locale.monthsShortRegex(isStrict)});addRegexToken("MMMM",function(isStrict,locale){return locale.monthsRegex(isStrict)});addParseToken(["M","MM"],function(input,array){array[MONTH]=toInt(input)-1});addParseToken(["MMM","MMMM"],function(input,array,config,token){var month=config._locale.monthsParse(input,token,config._strict);if(month!=null){array[MONTH]=month}else{getParsingFlags(config).invalidMonth=input}});var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(m,format){if(!m){return isArray(this._months)?this._months:this._months["standalone"]}return isArray(this._months)?this._months[m.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(format)?"format":"standalone"][m.month()]}function localeMonthsShort(m,format){if(!m){return isArray(this._monthsShort)?this._monthsShort:this._monthsShort["standalone"]}return isArray(this._monthsShort)?this._monthsShort[m.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(format)?"format":"standalone"][m.month()]}function handleStrictParse(monthName,format,strict){var i,ii,mom,llc=monthName.toLocaleLowerCase();if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[];for(i=0;i<12;++i){mom=createUTC([2e3,i]);this._shortMonthsParse[i]=this.monthsShort(mom,"").toLocaleLowerCase();this._longMonthsParse[i]=this.months(mom,"").toLocaleLowerCase()}}if(strict){if(format==="MMM"){ii=indexOf.call(this._shortMonthsParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._longMonthsParse,llc);return ii!==-1?ii:null}}else{if(format==="MMM"){ii=indexOf.call(this._shortMonthsParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._longMonthsParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._longMonthsParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._shortMonthsParse,llc);return ii!==-1?ii:null}}}function localeMonthsParse(monthName,format,strict){var i,mom,regex;if(this._monthsParseExact){return handleStrictParse.call(this,monthName,format,strict)}if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[]}for(i=0;i<12;i++){mom=createUTC([2e3,i]);if(strict&&!this._longMonthsParse[i]){this._longMonthsParse[i]=new RegExp("^"+this.months(mom,"").replace(".","")+"$","i");this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(mom,"").replace(".","")+"$","i")}if(!strict&&!this._monthsParse[i]){regex="^"+this.months(mom,"")+"|^"+this.monthsShort(mom,"");this._monthsParse[i]=new RegExp(regex.replace(".",""),"i")}if(strict&&format==="MMMM"&&this._longMonthsParse[i].test(monthName)){return i}else if(strict&&format==="MMM"&&this._shortMonthsParse[i].test(monthName)){return i}else if(!strict&&this._monthsParse[i].test(monthName)){return i}}}function setMonth(mom,value){if(!mom.isValid()){return mom}if(typeof value==="string"){if(/^\d+$/.test(value)){value=toInt(value)}else{value=mom.localeData().monthsParse(value);if(!isNumber(value)){return mom}}}var month=value,date=mom.date();date=date<29?date:Math.min(date,daysInMonth(mom.year(),month));void(mom._isUTC?mom._d.setUTCMonth(month,date):mom._d.setMonth(month,date));return mom}function getSetMonth(value){if(value!=null){setMonth(this,value);hooks.updateOffset(this,true);return this}else{return get(this,"Month")}}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(isStrict){if(this._monthsParseExact){if(!hasOwnProp(this,"_monthsRegex")){computeMonthsParse.call(this)}if(isStrict){return this._monthsShortStrictRegex}else{return this._monthsShortRegex}}else{if(!hasOwnProp(this,"_monthsShortRegex")){this._monthsShortRegex=defaultMonthsShortRegex}return this._monthsShortStrictRegex&&isStrict?this._monthsShortStrictRegex:this._monthsShortRegex}}function monthsRegex(isStrict){if(this._monthsParseExact){if(!hasOwnProp(this,"_monthsRegex")){computeMonthsParse.call(this)}if(isStrict){return this._monthsStrictRegex}else{return this._monthsRegex}}else{if(!hasOwnProp(this,"_monthsRegex")){this._monthsRegex=defaultMonthsRegex}return this._monthsStrictRegex&&isStrict?this._monthsStrictRegex:this._monthsRegex}}function computeMonthsParse(){function cmpLenRev(a,b){return b.length-a.length}var shortPieces=[],longPieces=[],mixedPieces=[],i,mom,shortP,longP;for(i=0;i<12;i++){mom=createUTC([2e3,i]);shortP=regexEscape(this.monthsShort(mom,""));longP=regexEscape(this.months(mom,""));shortPieces.push(shortP);longPieces.push(longP);mixedPieces.push(longP);mixedPieces.push(shortP)}shortPieces.sort(cmpLenRev);longPieces.sort(cmpLenRev);mixedPieces.sort(cmpLenRev);this._monthsRegex=new RegExp("^("+mixedPieces.join("|")+")","i");this._monthsShortRegex=this._monthsRegex;this._monthsStrictRegex=new RegExp("^("+longPieces.join("|")+")","i");this._monthsShortStrictRegex=new RegExp("^("+shortPieces.join("|")+")","i")}function createDate(y,m,d,h,M,s,ms){var date;if(y<100&&y>=0){date=new Date(y+400,m,d,h,M,s,ms);if(isFinite(date.getFullYear())){date.setFullYear(y)}}else{date=new Date(y,m,d,h,M,s,ms)}return date}function createUTCDate(y){var date,args;if(y<100&&y>=0){args=Array.prototype.slice.call(arguments);args[0]=y+400;date=new Date(Date.UTC.apply(null,args));if(isFinite(date.getUTCFullYear())){date.setUTCFullYear(y)}}else{date=new Date(Date.UTC.apply(null,arguments))}return date}function firstWeekOffset(year,dow,doy){var fwd=7+dow-doy,fwdlw=(7+createUTCDate(year,0,fwd).getUTCDay()-dow)%7;return-fwdlw+fwd-1}function dayOfYearFromWeeks(year,week,weekday,dow,doy){var localWeekday=(7+weekday-dow)%7,weekOffset=firstWeekOffset(year,dow,doy),dayOfYear=1+7*(week-1)+localWeekday+weekOffset,resYear,resDayOfYear;if(dayOfYear<=0){resYear=year-1;resDayOfYear=daysInYear(resYear)+dayOfYear}else if(dayOfYear>daysInYear(year)){resYear=year+1;resDayOfYear=dayOfYear-daysInYear(year)}else{resYear=year;resDayOfYear=dayOfYear}return{year:resYear,dayOfYear:resDayOfYear}}function weekOfYear(mom,dow,doy){var weekOffset=firstWeekOffset(mom.year(),dow,doy),week=Math.floor((mom.dayOfYear()-weekOffset-1)/7)+1,resWeek,resYear;if(week<1){resYear=mom.year()-1;resWeek=week+weeksInYear(resYear,dow,doy)}else if(week>weeksInYear(mom.year(),dow,doy)){resWeek=week-weeksInYear(mom.year(),dow,doy);resYear=mom.year()+1}else{resYear=mom.year();resWeek=week}return{week:resWeek,year:resYear}}function weeksInYear(year,dow,doy){var weekOffset=firstWeekOffset(year,dow,doy),weekOffsetNext=firstWeekOffset(year+1,dow,doy);return(daysInYear(year)-weekOffset+weekOffsetNext)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addRegexToken("w",match1to2,match1to2NoLeadingZero);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2,match1to2NoLeadingZero);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(input,week,config,token){week[token.substr(0,1)]=toInt(input)});function localeWeek(mom){return weekOfYear(mom,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(input){var week=this.localeData().week(this);return input==null?week:this.add((input-week)*7,"d")}function getSetISOWeek(input){var week=weekOfYear(this,1,4).week;return input==null?week:this.add((input-week)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(format){return this.localeData().weekdaysMin(this,format)});addFormatToken("ddd",0,0,function(format){return this.localeData().weekdaysShort(this,format)});addFormatToken("dddd",0,0,function(format){return this.localeData().weekdays(this,format)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(isStrict,locale){return locale.weekdaysMinRegex(isStrict)});addRegexToken("ddd",function(isStrict,locale){return locale.weekdaysShortRegex(isStrict)});addRegexToken("dddd",function(isStrict,locale){return locale.weekdaysRegex(isStrict)});addWeekParseToken(["dd","ddd","dddd"],function(input,week,config,token){var weekday=config._locale.weekdaysParse(input,token,config._strict);if(weekday!=null){week.d=weekday}else{getParsingFlags(config).invalidWeekday=input}});addWeekParseToken(["d","e","E"],function(input,week,config,token){week[token]=toInt(input)});function parseWeekday(input,locale){if(typeof input!=="string"){return input}if(!isNaN(input)){return parseInt(input,10)}input=locale.weekdaysParse(input);if(typeof input==="number"){return input}return null}function parseIsoWeekday(input,locale){if(typeof input==="string"){return locale.weekdaysParse(input)%7||7}return isNaN(input)?null:input}function shiftWeekdays(ws,n){return ws.slice(n,7).concat(ws.slice(0,n))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(m,format){var weekdays=isArray(this._weekdays)?this._weekdays:this._weekdays[m&&m!==true&&this._weekdays.isFormat.test(format)?"format":"standalone"];return m===true?shiftWeekdays(weekdays,this._week.dow):m?weekdays[m.day()]:weekdays}function localeWeekdaysShort(m){return m===true?shiftWeekdays(this._weekdaysShort,this._week.dow):m?this._weekdaysShort[m.day()]:this._weekdaysShort}function localeWeekdaysMin(m){return m===true?shiftWeekdays(this._weekdaysMin,this._week.dow):m?this._weekdaysMin[m.day()]:this._weekdaysMin}function handleStrictParse$1(weekdayName,format,strict){var i,ii,mom,llc=weekdayName.toLocaleLowerCase();if(!this._weekdaysParse){this._weekdaysParse=[];this._shortWeekdaysParse=[];this._minWeekdaysParse=[];for(i=0;i<7;++i){mom=createUTC([2e3,1]).day(i);this._minWeekdaysParse[i]=this.weekdaysMin(mom,"").toLocaleLowerCase();this._shortWeekdaysParse[i]=this.weekdaysShort(mom,"").toLocaleLowerCase();this._weekdaysParse[i]=this.weekdays(mom,"").toLocaleLowerCase()}}if(strict){if(format==="dddd"){ii=indexOf.call(this._weekdaysParse,llc);return ii!==-1?ii:null}else if(format==="ddd"){ii=indexOf.call(this._shortWeekdaysParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null}}else{if(format==="dddd"){ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._shortWeekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null}else if(format==="ddd"){ii=indexOf.call(this._shortWeekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._minWeekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._shortWeekdaysParse,llc);return ii!==-1?ii:null}}}function localeWeekdaysParse(weekdayName,format,strict){var i,mom,regex;if(this._weekdaysParseExact){return handleStrictParse$1.call(this,weekdayName,format,strict)}if(!this._weekdaysParse){this._weekdaysParse=[];this._minWeekdaysParse=[];this._shortWeekdaysParse=[];this._fullWeekdaysParse=[]}for(i=0;i<7;i++){mom=createUTC([2e3,1]).day(i);if(strict&&!this._fullWeekdaysParse[i]){this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(mom,"").replace(".","\\.?")+"$","i");this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(mom,"").replace(".","\\.?")+"$","i");this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(mom,"").replace(".","\\.?")+"$","i")}if(!this._weekdaysParse[i]){regex="^"+this.weekdays(mom,"")+"|^"+this.weekdaysShort(mom,"")+"|^"+this.weekdaysMin(mom,"");this._weekdaysParse[i]=new RegExp(regex.replace(".",""),"i")}if(strict&&format==="dddd"&&this._fullWeekdaysParse[i].test(weekdayName)){return i}else if(strict&&format==="ddd"&&this._shortWeekdaysParse[i].test(weekdayName)){return i}else if(strict&&format==="dd"&&this._minWeekdaysParse[i].test(weekdayName)){return i}else if(!strict&&this._weekdaysParse[i].test(weekdayName)){return i}}}function getSetDayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN}var day=get(this,"Day");if(input!=null){input=parseWeekday(input,this.localeData());return this.add(input-day,"d")}else{return day}}function getSetLocaleDayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN}var weekday=(this.day()+7-this.localeData()._week.dow)%7;return input==null?weekday:this.add(input-weekday,"d")}function getSetISODayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN}if(input!=null){var weekday=parseIsoWeekday(input,this.localeData());return this.day(this.day()%7?weekday:weekday-7)}else{return this.day()||7}}function weekdaysRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,"_weekdaysRegex")){computeWeekdaysParse.call(this)}if(isStrict){return this._weekdaysStrictRegex}else{return this._weekdaysRegex}}else{if(!hasOwnProp(this,"_weekdaysRegex")){this._weekdaysRegex=defaultWeekdaysRegex}return this._weekdaysStrictRegex&&isStrict?this._weekdaysStrictRegex:this._weekdaysRegex}}function weekdaysShortRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,"_weekdaysRegex")){computeWeekdaysParse.call(this)}if(isStrict){return this._weekdaysShortStrictRegex}else{return this._weekdaysShortRegex}}else{if(!hasOwnProp(this,"_weekdaysShortRegex")){this._weekdaysShortRegex=defaultWeekdaysShortRegex}return this._weekdaysShortStrictRegex&&isStrict?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}}function weekdaysMinRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,"_weekdaysRegex")){computeWeekdaysParse.call(this)}if(isStrict){return this._weekdaysMinStrictRegex}else{return this._weekdaysMinRegex}}else{if(!hasOwnProp(this,"_weekdaysMinRegex")){this._weekdaysMinRegex=defaultWeekdaysMinRegex}return this._weekdaysMinStrictRegex&&isStrict?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}}function computeWeekdaysParse(){function cmpLenRev(a,b){return b.length-a.length}var minPieces=[],shortPieces=[],longPieces=[],mixedPieces=[],i,mom,minp,shortp,longp;for(i=0;i<7;i++){mom=createUTC([2e3,1]).day(i);minp=regexEscape(this.weekdaysMin(mom,""));shortp=regexEscape(this.weekdaysShort(mom,""));longp=regexEscape(this.weekdays(mom,""));minPieces.push(minp);shortPieces.push(shortp);longPieces.push(longp);mixedPieces.push(minp);mixedPieces.push(shortp);mixedPieces.push(longp)}minPieces.sort(cmpLenRev);shortPieces.sort(cmpLenRev);longPieces.sort(cmpLenRev);mixedPieces.sort(cmpLenRev);this._weekdaysRegex=new RegExp("^("+mixedPieces.join("|")+")","i");this._weekdaysShortRegex=this._weekdaysRegex;this._weekdaysMinRegex=this._weekdaysRegex;this._weekdaysStrictRegex=new RegExp("^("+longPieces.join("|")+")","i");this._weekdaysShortStrictRegex=new RegExp("^("+shortPieces.join("|")+")","i");this._weekdaysMinStrictRegex=new RegExp("^("+minPieces.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(token,lowercase){addFormatToken(token,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),lowercase)})}meridiem("a",true);meridiem("A",false);function matchMeridiem(isStrict,locale){return locale._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2,match1to2HasZero);addRegexToken("h",match1to2,match1to2NoLeadingZero);addRegexToken("k",match1to2,match1to2NoLeadingZero);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(input,array,config){var kInput=toInt(input);array[HOUR]=kInput===24?0:kInput});addParseToken(["a","A"],function(input,array,config){config._isPm=config._locale.isPM(input);config._meridiem=input});addParseToken(["h","hh"],function(input,array,config){array[HOUR]=toInt(input);getParsingFlags(config).bigHour=true});addParseToken("hmm",function(input,array,config){var pos=input.length-2;array[HOUR]=toInt(input.substr(0,pos));array[MINUTE]=toInt(input.substr(pos));getParsingFlags(config).bigHour=true});addParseToken("hmmss",function(input,array,config){var pos1=input.length-4,pos2=input.length-2;array[HOUR]=toInt(input.substr(0,pos1));array[MINUTE]=toInt(input.substr(pos1,2));array[SECOND]=toInt(input.substr(pos2));getParsingFlags(config).bigHour=true});addParseToken("Hmm",function(input,array,config){var pos=input.length-2;array[HOUR]=toInt(input.substr(0,pos));array[MINUTE]=toInt(input.substr(pos))});addParseToken("Hmmss",function(input,array,config){var pos1=input.length-4,pos2=input.length-2;array[HOUR]=toInt(input.substr(0,pos1));array[MINUTE]=toInt(input.substr(pos1,2));array[SECOND]=toInt(input.substr(pos2))});function localeIsPM(input){return(input+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",true);function localeMeridiem(hours,minutes,isLower){if(hours>11){return isLower?"pm":"PM"}else{return isLower?"am":"AM"}}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse};var locales={},localeFamilies={},globalLocale;function commonPrefix(arr1,arr2){var i,minl=Math.min(arr1.length,arr2.length);for(i=0;i<minl;i+=1){if(arr1[i]!==arr2[i]){return i}}return minl}function normalizeLocale(key){return key?key.toLowerCase().replace("_","-"):key}function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split("-");j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split("-"):null;while(j>0){locale=loadLocale(split.slice(0,j).join("-"));if(locale){return locale}if(next&&next.length>=j&&commonPrefix(split,next)>=j-1){break}j--}i++}return globalLocale}function isLocaleNameSane(name){return!!(name&&name.match("^[^/\\\\]*$"))}function loadLocale(name){var oldLocale=null,aliasedRequire;if(locales[name]===undefined&&typeof module!=="undefined"&&module&&module.exports&&isLocaleNameSane(name)){try{oldLocale=globalLocale._abbr;aliasedRequire=require;aliasedRequire("./locale/"+name);getSetGlobalLocale(oldLocale)}catch(e){locales[name]=null}}return locales[name]}function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){globalLocale=data}else{if(typeof console!=="undefined"&&console.warn){console.warn("Locale "+key+" not found. Did you forget to load it?")}}}return globalLocale._abbr}function defineLocale(name,config){if(config!==null){var locale,parentConfig=baseConfig;config.abbr=name;if(locales[name]!=null){deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change "+"an existing locale. moment.defineLocale(localeName, "+"config) should only be used for creating a new locale "+"See http://momentjs.com/guides/#/warnings/define-locale/ for more info.");parentConfig=locales[name]._config}else if(config.parentLocale!=null){if(locales[config.parentLocale]!=null){parentConfig=locales[config.parentLocale]._config}else{locale=loadLocale(config.parentLocale);if(locale!=null){parentConfig=locale._config}else{if(!localeFamilies[config.parentLocale]){localeFamilies[config.parentLocale]=[]}localeFamilies[config.parentLocale].push({name:name,config:config});return null}}}locales[name]=new Locale(mergeConfigs(parentConfig,config));if(localeFamilies[name]){localeFamilies[name].forEach(function(x){defineLocale(x.name,x.config)})}getSetGlobalLocale(name);return locales[name]}else{delete locales[name];return null}}function updateLocale(name,config){if(config!=null){var locale,tmpLocale,parentConfig=baseConfig;if(locales[name]!=null&&locales[name].parentLocale!=null){locales[name].set(mergeConfigs(locales[name]._config,config))}else{tmpLocale=loadLocale(name);if(tmpLocale!=null){parentConfig=tmpLocale._config}config=mergeConfigs(parentConfig,config);if(tmpLocale==null){config.abbr=name}locale=new Locale(config);locale.parentLocale=locales[name];locales[name]=locale}getSetGlobalLocale(name)}else{if(locales[name]!=null){if(locales[name].parentLocale!=null){locales[name]=locales[name].parentLocale;if(name===getSetGlobalLocale()){getSetGlobalLocale(name)}}else if(locales[name]!=null){delete locales[name]}}}return locales[name]}function getLocale(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr}if(!key){return globalLocale}if(!isArray(key)){locale=loadLocale(key);if(locale){return locale}key=[key]}return chooseLocale(key)}function listLocales(){return keys(locales)}function checkOverflow(m){var overflow,a=m._a;if(a&&getParsingFlags(m).overflow===-2){overflow=a[MONTH]<0||a[MONTH]>11?MONTH:a[DATE]<1||a[DATE]>daysInMonth(a[YEAR],a[MONTH])?DATE:a[HOUR]<0||a[HOUR]>24||a[HOUR]===24&&(a[MINUTE]!==0||a[SECOND]!==0||a[MILLISECOND]!==0)?HOUR:a[MINUTE]<0||a[MINUTE]>59?MINUTE:a[SECOND]<0||a[SECOND]>59?SECOND:a[MILLISECOND]<0||a[MILLISECOND]>999?MILLISECOND:-1;if(getParsingFlags(m)._overflowDayOfYear&&(overflow<YEAR||overflow>DATE)){overflow=DATE}if(getParsingFlags(m)._overflowWeeks&&overflow===-1){overflow=WEEK}if(getParsingFlags(m)._overflowWeekday&&overflow===-1){overflow=WEEKDAY}getParsingFlags(m).overflow=overflow}return m}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,false],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,false],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,false],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,false],["YYYY",/\d{4}/,false]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat,isoDatesLen=isoDates.length,isoTimesLen=isoTimes.length;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDatesLen;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break}}if(dateFormat==null){config._isValid=false;return}if(match[3]){for(i=0,l=isoTimesLen;i<l;i++){if(isoTimes[i][1].exec(match[3])){timeFormat=(match[2]||" ")+isoTimes[i][0];break}}if(timeFormat==null){config._isValid=false;return}}if(!allowTime&&timeFormat!=null){config._isValid=false;return}if(match[4]){if(tzRegex.exec(match[4])){tzFormat="Z"}else{config._isValid=false;return}}config._f=dateFormat+(timeFormat||"")+(tzFormat||"");configFromStringAndFormat(config)}else{config._isValid=false}}function extractFromRFC2822Strings(yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr){var result=[untruncateYear(yearStr),defaultLocaleMonthsShort.indexOf(monthStr),parseInt(dayStr,10),parseInt(hourStr,10),parseInt(minuteStr,10)];if(secondStr){result.push(parseInt(secondStr,10))}return result}function untruncateYear(yearStr){var year=parseInt(yearStr,10);if(year<=49){return 2e3+year}else if(year<=999){return 1900+year}return year}function preprocessRFC2822(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(weekdayStr,parsedInput,config){if(weekdayStr){var weekdayProvided=defaultLocaleWeekdaysShort.indexOf(weekdayStr),weekdayActual=new Date(parsedInput[0],parsedInput[1],parsedInput[2]).getDay();if(weekdayProvided!==weekdayActual){getParsingFlags(config).weekdayMismatch=true;config._isValid=false;return false}}return true}function calculateOffset(obsOffset,militaryOffset,numOffset){if(obsOffset){return obsOffsets[obsOffset]}else if(militaryOffset){return 0}else{var hm=parseInt(numOffset,10),m=hm%100,h=(hm-m)/100;return h*60+m}}function configFromRFC2822(config){var match=rfc2822.exec(preprocessRFC2822(config._i)),parsedArray;if(match){parsedArray=extractFromRFC2822Strings(match[4],match[3],match[2],match[5],match[6],match[7]);if(!checkWeekday(match[1],parsedArray,config)){return}config._a=parsedArray;config._tzm=calculateOffset(match[8],match[9],match[10]);config._d=createUTCDate.apply(null,config._a);config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm);getParsingFlags(config).rfc2822=true}else{config._isValid=false}}function configFromString(config){var matched=aspNetJsonRegex.exec(config._i);if(matched!==null){config._d=new Date(+matched[1]);return}configFromISO(config);if(config._isValid===false){delete config._isValid}else{return}configFromRFC2822(config);if(config._isValid===false){delete config._isValid}else{return}if(config._strict){config._isValid=false}else{hooks.createFromInputFallback(config)}}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), "+"which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are "+"discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(config){config._d=new Date(config._i+(config._useUTC?" UTC":""))});function defaults(a,b,c){if(a!=null){return a}if(b!=null){return b}return c}function currentDateArray(config){var nowValue=new Date(hooks.now());if(config._useUTC){return[nowValue.getUTCFullYear(),nowValue.getUTCMonth(),nowValue.getUTCDate()]}return[nowValue.getFullYear(),nowValue.getMonth(),nowValue.getDate()]}function configFromArray(config){var i,date,input=[],currentDate,expectedWeekday,yearToUse;if(config._d){return}currentDate=currentDateArray(config);if(config._w&&config._a[DATE]==null&&config._a[MONTH]==null){dayOfYearFromWeekInfo(config)}if(config._dayOfYear!=null){yearToUse=defaults(config._a[YEAR],currentDate[YEAR]);if(config._dayOfYear>daysInYear(yearToUse)||config._dayOfYear===0){getParsingFlags(config)._overflowDayOfYear=true}date=createUTCDate(yearToUse,0,config._dayOfYear);config._a[MONTH]=date.getUTCMonth();config._a[DATE]=date.getUTCDate()}for(i=0;i<3&&config._a[i]==null;++i){config._a[i]=input[i]=currentDate[i]}for(;i<7;i++){config._a[i]=input[i]=config._a[i]==null?i===2?1:0:config._a[i]}if(config._a[HOUR]===24&&config._a[MINUTE]===0&&config._a[SECOND]===0&&config._a[MILLISECOND]===0){config._nextDay=true;config._a[HOUR]=0}config._d=(config._useUTC?createUTCDate:createDate).apply(null,input);expectedWeekday=config._useUTC?config._d.getUTCDay():config._d.getDay();if(config._tzm!=null){config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm)}if(config._nextDay){config._a[HOUR]=24}if(config._w&&typeof config._w.d!=="undefined"&&config._w.d!==expectedWeekday){getParsingFlags(config).weekdayMismatch=true}}function dayOfYearFromWeekInfo(config){var w,weekYear,week,weekday,dow,doy,temp,weekdayOverflow,curWeek;w=config._w;if(w.GG!=null||w.W!=null||w.E!=null){dow=1;doy=4;weekYear=defaults(w.GG,config._a[YEAR],weekOfYear(createLocal(),1,4).year);week=defaults(w.W,1);weekday=defaults(w.E,1);if(weekday<1||weekday>7){weekdayOverflow=true}}else{dow=config._locale._week.dow;doy=config._locale._week.doy;curWeek=weekOfYear(createLocal(),dow,doy);weekYear=defaults(w.gg,config._a[YEAR],curWeek.year);week=defaults(w.w,curWeek.week);if(w.d!=null){weekday=w.d;if(weekday<0||weekday>6){weekdayOverflow=true}}else if(w.e!=null){weekday=w.e+dow;if(w.e<0||w.e>6){weekdayOverflow=true}}else{weekday=dow}}if(week<1||week>weeksInYear(weekYear,dow,doy)){getParsingFlags(config)._overflowWeeks=true}else if(weekdayOverflow!=null){getParsingFlags(config)._overflowWeekday=true}else{temp=dayOfYearFromWeeks(weekYear,week,weekday,dow,doy);config._a[YEAR]=temp.year;config._dayOfYear=temp.dayOfYear}}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(config){if(config._f===hooks.ISO_8601){configFromISO(config);return}if(config._f===hooks.RFC_2822){configFromRFC2822(config);return}config._a=[];getParsingFlags(config).empty=true;var string=""+config._i,i,parsedInput,tokens,token,skipped,stringLength=string.length,totalParsedInputLength=0,era,tokenLen;tokens=expandFormat(config._f,config._locale).match(formattingTokens)||[];tokenLen=tokens.length;for(i=0;i<tokenLen;i++){token=tokens[i];parsedInput=(string.match(getParseRegexForToken(token,config))||[])[0];if(parsedInput){skipped=string.substr(0,string.indexOf(parsedInput));if(skipped.length>0){getParsingFlags(config).unusedInput.push(skipped)}string=string.slice(string.indexOf(parsedInput)+parsedInput.length);totalParsedInputLength+=parsedInput.length}if(formatTokenFunctions[token]){if(parsedInput){getParsingFlags(config).empty=false}else{getParsingFlags(config).unusedTokens.push(token)}addTimeToArrayFromToken(token,parsedInput,config)}else if(config._strict&&!parsedInput){getParsingFlags(config).unusedTokens.push(token)}}getParsingFlags(config).charsLeftOver=stringLength-totalParsedInputLength;if(string.length>0){getParsingFlags(config).unusedInput.push(string)}if(config._a[HOUR]<=12&&getParsingFlags(config).bigHour===true&&config._a[HOUR]>0){getParsingFlags(config).bigHour=undefined}getParsingFlags(config).parsedDateParts=config._a.slice(0);getParsingFlags(config).meridiem=config._meridiem;config._a[HOUR]=meridiemFixWrap(config._locale,config._a[HOUR],config._meridiem);era=getParsingFlags(config).era;if(era!==null){config._a[YEAR]=config._locale.erasConvertYear(era,config._a[YEAR])}configFromArray(config);checkOverflow(config)}function meridiemFixWrap(locale,hour,meridiem){var isPm;if(meridiem==null){return hour}if(locale.meridiemHour!=null){return locale.meridiemHour(hour,meridiem)}else if(locale.isPM!=null){isPm=locale.isPM(meridiem);if(isPm&&hour<12){hour+=12}if(!isPm&&hour===12){hour=0}return hour}else{return hour}}function configFromStringAndArray(config){var tempConfig,bestMoment,scoreToBeat,i,currentScore,validFormatFound,bestFormatIsValid=false,configfLen=config._f.length;if(configfLen===0){getParsingFlags(config).invalidFormat=true;config._d=new Date(NaN);return}for(i=0;i<configfLen;i++){currentScore=0;validFormatFound=false;tempConfig=copyConfig({},config);if(config._useUTC!=null){tempConfig._useUTC=config._useUTC}tempConfig._f=config._f[i];configFromStringAndFormat(tempConfig);if(isValid(tempConfig)){validFormatFound=true}currentScore+=getParsingFlags(tempConfig).charsLeftOver;currentScore+=getParsingFlags(tempConfig).unusedTokens.length*10;getParsingFlags(tempConfig).score=currentScore;if(!bestFormatIsValid){if(scoreToBeat==null||currentScore<scoreToBeat||validFormatFound){scoreToBeat=currentScore;bestMoment=tempConfig;if(validFormatFound){bestFormatIsValid=true}}}else{if(currentScore<scoreToBeat){scoreToBeat=currentScore;bestMoment=tempConfig}}}extend(config,bestMoment||tempConfig)}function configFromObject(config){if(config._d){return}var i=normalizeObjectUnits(config._i),dayOrDate=i.day===undefined?i.date:i.day;config._a=map([i.year,i.month,dayOrDate,i.hour,i.minute,i.second,i.millisecond],function(obj){return obj&&parseInt(obj,10)});configFromArray(config)}function createFromConfig(config){var res=new Moment(checkOverflow(prepareConfig(config)));if(res._nextDay){res.add(1,"d");res._nextDay=undefined}return res}function prepareConfig(config){var input=config._i,format=config._f;config._locale=config._locale||getLocale(config._l);if(input===null||format===undefined&&input===""){return createInvalid({nullInput:true})}if(typeof input==="string"){config._i=input=config._locale.preparse(input)}if(isMoment(input)){return new Moment(checkOverflow(input))}else if(isDate(input)){config._d=input}else if(isArray(format)){configFromStringAndArray(config)}else if(format){configFromStringAndFormat(config)}else{configFromInput(config)}if(!isValid(config)){config._d=null}return config}function configFromInput(config){var input=config._i;if(isUndefined(input)){config._d=new Date(hooks.now())}else if(isDate(input)){config._d=new Date(input.valueOf())}else if(typeof input==="string"){configFromString(config)}else if(isArray(input)){config._a=map(input.slice(0),function(obj){return parseInt(obj,10)});configFromArray(config)}else if(isObject(input)){configFromObject(config)}else if(isNumber(input)){config._d=new Date(input)}else{hooks.createFromInputFallback(config)}}function createLocalOrUTC(input,format,locale,strict,isUTC){var c={};if(format===true||format===false){strict=format;format=undefined}if(locale===true||locale===false){strict=locale;locale=undefined}if(isObject(input)&&isObjectEmpty(input)||isArray(input)&&input.length===0){input=undefined}c._isAMomentObject=true;c._useUTC=c._isUTC=isUTC;c._l=locale;c._i=input;c._f=format;c._strict=strict;return createFromConfig(c)}function createLocal(input,format,locale,strict){return createLocalOrUTC(input,format,locale,strict,false)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var other=createLocal.apply(null,arguments);if(this.isValid()&&other.isValid()){return other<this?this:other}else{return createInvalid()}}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var other=createLocal.apply(null,arguments);if(this.isValid()&&other.isValid()){return other>this?this:other}else{return createInvalid()}});function pickBy(fn,moments){var res,i;if(moments.length===1&&isArray(moments[0])){moments=moments[0]}if(!moments.length){return createLocal()}res=moments[0];for(i=1;i<moments.length;++i){if(!moments[i].isValid()||moments[i][fn](res)){res=moments[i]}}return res}function min(){var args=[].slice.call(arguments,0);return pickBy("isBefore",args)}function max(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)}var now=function(){return Date.now?Date.now():+new Date};var ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(m){var key,unitHasDecimal=false,i,orderLen=ordering.length;for(key in m){if(hasOwnProp(m,key)&&!(indexOf.call(ordering,key)!==-1&&(m[key]==null||!isNaN(m[key])))){return false}}for(i=0;i<orderLen;++i){if(m[ordering[i]]){if(unitHasDecimal){return false}if(parseFloat(m[ordering[i]])!==toInt(m[ordering[i]])){unitHasDecimal=true}}}return true}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(duration){var normalizedInput=normalizeObjectUnits(duration),years=normalizedInput.year||0,quarters=normalizedInput.quarter||0,months=normalizedInput.month||0,weeks=normalizedInput.week||normalizedInput.isoWeek||0,days=normalizedInput.day||0,hours=normalizedInput.hour||0,minutes=normalizedInput.minute||0,seconds=normalizedInput.second||0,milliseconds=normalizedInput.millisecond||0;this._isValid=isDurationValid(normalizedInput);this._milliseconds=+milliseconds+seconds*1e3+minutes*6e4+hours*1e3*60*60;this._days=+days+weeks*7;this._months=+months+quarters*3+years*12;this._data={};this._locale=getLocale();this._bubble()}function isDuration(obj){return obj instanceof Duration}function absRound(number){if(number<0){return Math.round(-1*number)*-1}else{return Math.round(number)}}function compareArrays(array1,array2,dontConvert){var len=Math.min(array1.length,array2.length),lengthDiff=Math.abs(array1.length-array2.length),diffs=0,i;for(i=0;i<len;i++){if(dontConvert&&array1[i]!==array2[i]||!dontConvert&&toInt(array1[i])!==toInt(array2[i])){diffs++}}return diffs+lengthDiff}function offset(token,separator){addFormatToken(token,0,0,function(){var offset=this.utcOffset(),sign="+";if(offset<0){offset=-offset;sign="-"}return sign+zeroFill(~~(offset/60),2)+separator+zeroFill(~~offset%60,2)})}offset("Z",":");offset("ZZ","");addRegexToken("Z",matchShortOffset);addRegexToken("ZZ",matchShortOffset);addParseToken(["Z","ZZ"],function(input,array,config){config._useUTC=true;config._tzm=offsetFromString(matchShortOffset,input)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(matcher,string){var matches=(string||"").match(matcher),chunk,parts,minutes;if(matches===null){return null}chunk=matches[matches.length-1]||[];parts=(chunk+"").match(chunkOffset)||["-",0,0];minutes=+(parts[1]*60)+toInt(parts[2]);return minutes===0?0:parts[0]==="+"?minutes:-minutes}function cloneWithOffset(input,model){var res,diff;if(model._isUTC){res=model.clone();diff=(isMoment(input)||isDate(input)?input.valueOf():createLocal(input).valueOf())-res.valueOf();res._d.setTime(res._d.valueOf()+diff);hooks.updateOffset(res,false);return res}else{return createLocal(input).local()}}function getDateOffset(m){return-Math.round(m._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN}if(input!=null){if(typeof input==="string"){input=offsetFromString(matchShortOffset,input);if(input===null){return this}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this)}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,"m")}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,"m"),1,false)}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null}}return this}else{return this._isUTC?offset:getDateOffset(this)}}function getSetZone(input,keepLocalTime){if(input!=null){if(typeof input!=="string"){input=-input}this.utcOffset(input,keepLocalTime);return this}else{return-this.utcOffset()}}function setOffsetToUTC(keepLocalTime){return this.utcOffset(0,keepLocalTime)}function setOffsetToLocal(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(getDateOffset(this),"m")}}return this}function setOffsetToParsedOffset(){if(this._tzm!=null){this.utcOffset(this._tzm,false,true)}else if(typeof this._i==="string"){var tZone=offsetFromString(matchOffset,this._i);if(tZone!=null){this.utcOffset(tZone)}else{this.utcOffset(0,true)}}return this}function hasAlignedHourOffset(input){if(!this.isValid()){return false}input=input?createLocal(input).utcOffset():0;return(this.utcOffset()-input)%60===0}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted)){return this._isDSTShifted}var c={},other;copyConfig(c,this);c=prepareConfig(c);if(c._a){other=c._isUTC?createUTC(c._a):createLocal(c._a);this._isDSTShifted=this.isValid()&&compareArrays(c._a,other.toArray())>0}else{this._isDSTShifted=false}return this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:false}function isUtcOffset(){return this.isValid()?this._isUTC:false}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:false}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(input,key){var duration=input,match=null,sign,ret,diffRes;if(isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months}}else if(isNumber(input)||!isNaN(+input)){duration={};if(key){duration[key]=+input}else{duration.milliseconds=+input}}else if(match=aspNetRegex.exec(input)){sign=match[1]==="-"?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(absRound(match[MILLISECOND]*1e3))*sign}}else if(match=isoRegex.exec(input)){sign=match[1]==="-"?-1:1;duration={y:parseIso(match[2],sign),M:parseIso(match[3],sign),w:parseIso(match[4],sign),d:parseIso(match[5],sign),h:parseIso(match[6],sign),m:parseIso(match[7],sign),s:parseIso(match[8],sign)}}else if(duration==null){duration={}}else if(typeof duration==="object"&&("from"in duration||"to"in duration)){diffRes=momentsDifference(createLocal(duration.from),createLocal(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months}ret=new Duration(duration);if(isDuration(input)&&hasOwnProp(input,"_locale")){ret._locale=input._locale}if(isDuration(input)&&hasOwnProp(input,"_isValid")){ret._isValid=input._isValid}return ret}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(inp,sign){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign}function positiveMomentsDifference(base,other){var res={};res.months=other.month()-base.month()+(other.year()-base.year())*12;if(base.clone().add(res.months,"M").isAfter(other)){--res.months}res.milliseconds=+other-+base.clone().add(res.months,"M");return res}function momentsDifference(base,other){var res;if(!(base.isValid()&&other.isValid())){return{milliseconds:0,months:0}}other=cloneWithOffset(other,base);if(base.isBefore(other)){res=positiveMomentsDifference(base,other)}else{res=positiveMomentsDifference(other,base);res.milliseconds=-res.milliseconds;res.months=-res.months}return res}function createAdder(direction,name){return function(val,period){var dur,tmp;if(period!==null&&!isNaN(+period)){deprecateSimple(name,"moment()."+name+"(period, number) is deprecated. Please use moment()."+name+"(number, period). "+"See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.");tmp=val;val=period;period=tmp}dur=createDuration(val,period);addSubtract(this,dur,direction);return this}}function addSubtract(mom,duration,isAdding,updateOffset){var milliseconds=duration._milliseconds,days=absRound(duration._days),months=absRound(duration._months);if(!mom.isValid()){return}updateOffset=updateOffset==null?true:updateOffset;if(months){setMonth(mom,get(mom,"Month")+months*isAdding)}if(days){set$1(mom,"Date",get(mom,"Date")+days*isAdding)}if(milliseconds){mom._d.setTime(mom._d.valueOf()+milliseconds*isAdding)}if(updateOffset){hooks.updateOffset(mom,days||months)}}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString(input){return typeof input==="string"||input instanceof String}function isMomentInput(input){return isMoment(input)||isDate(input)||isString(input)||isNumber(input)||isNumberOrStringArray(input)||isMomentInputObject(input)||input===null||input===undefined}function isMomentInputObject(input){var objectTest=isObject(input)&&!isObjectEmpty(input),propertyTest=false,properties=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,property,propertyLen=properties.length;for(i=0;i<propertyLen;i+=1){property=properties[i];propertyTest=propertyTest||hasOwnProp(input,property)}return objectTest&&propertyTest}function isNumberOrStringArray(input){var arrayTest=isArray(input),dataTypeTest=false;if(arrayTest){dataTypeTest=input.filter(function(item){return!isNumber(item)&&isString(input)}).length===0}return arrayTest&&dataTypeTest}function isCalendarSpec(input){var objectTest=isObject(input)&&!isObjectEmpty(input),propertyTest=false,properties=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,property;for(i=0;i<properties.length;i+=1){property=properties[i];propertyTest=propertyTest||hasOwnProp(input,property)}return objectTest&&propertyTest}function getCalendarFormat(myMoment,now){var diff=myMoment.diff(now,"days",true);return diff<-6?"sameElse":diff<-1?"lastWeek":diff<0?"lastDay":diff<1?"sameDay":diff<2?"nextDay":diff<7?"nextWeek":"sameElse"}function calendar$1(time,formats){if(arguments.length===1){if(!arguments[0]){time=undefined;formats=undefined}else if(isMomentInput(arguments[0])){time=arguments[0];formats=undefined}else if(isCalendarSpec(arguments[0])){formats=arguments[0];time=undefined}}var now=time||createLocal(),sod=cloneWithOffset(now,this).startOf("day"),format=hooks.calendarFormat(this,sod)||"sameElse",output=formats&&(isFunction(formats[format])?formats[format].call(this,now):formats[format]);return this.format(output||this.localeData().calendar(format,this,createLocal(now)))}function clone(){return new Moment(this)}function isAfter(input,units){var localInput=isMoment(input)?input:createLocal(input);if(!(this.isValid()&&localInput.isValid())){return false}units=normalizeUnits(units)||"millisecond";if(units==="millisecond"){return this.valueOf()>localInput.valueOf()}else{return localInput.valueOf()<this.clone().startOf(units).valueOf()}}function isBefore(input,units){var localInput=isMoment(input)?input:createLocal(input);if(!(this.isValid()&&localInput.isValid())){return false}units=normalizeUnits(units)||"millisecond";if(units==="millisecond"){return this.valueOf()<localInput.valueOf()}else{return this.clone().endOf(units).valueOf()<localInput.valueOf()}}function isBetween(from,to,units,inclusivity){var localFrom=isMoment(from)?from:createLocal(from),localTo=isMoment(to)?to:createLocal(to);if(!(this.isValid()&&localFrom.isValid()&&localTo.isValid())){return false}inclusivity=inclusivity||"()";return(inclusivity[0]==="("?this.isAfter(localFrom,units):!this.isBefore(localFrom,units))&&(inclusivity[1]===")"?this.isBefore(localTo,units):!this.isAfter(localTo,units))}function isSame(input,units){var localInput=isMoment(input)?input:createLocal(input),inputMs;if(!(this.isValid()&&localInput.isValid())){return false}units=normalizeUnits(units)||"millisecond";if(units==="millisecond"){return this.valueOf()===localInput.valueOf()}else{inputMs=localInput.valueOf();return this.clone().startOf(units).valueOf()<=inputMs&&inputMs<=this.clone().endOf(units).valueOf()}}function isSameOrAfter(input,units){return this.isSame(input,units)||this.isAfter(input,units)}function isSameOrBefore(input,units){return this.isSame(input,units)||this.isBefore(input,units)}function diff(input,units,asFloat){var that,zoneDelta,output;if(!this.isValid()){return NaN}that=cloneWithOffset(input,this);if(!that.isValid()){return NaN}zoneDelta=(that.utcOffset()-this.utcOffset())*6e4;units=normalizeUnits(units);switch(units){case"year":output=monthDiff(this,that)/12;break;case"month":output=monthDiff(this,that);break;case"quarter":output=monthDiff(this,that)/3;break;case"second":output=(this-that)/1e3;break;case"minute":output=(this-that)/6e4;break;case"hour":output=(this-that)/36e5;break;case"day":output=(this-that-zoneDelta)/864e5;break;case"week":output=(this-that-zoneDelta)/6048e5;break;default:output=this-that}return asFloat?output:absFloor(output)}function monthDiff(a,b){if(a.date()<b.date()){return-monthDiff(b,a)}var wholeMonthDiff=(b.year()-a.year())*12+(b.month()-a.month()),anchor=a.clone().add(wholeMonthDiff,"months"),anchor2,adjust;if(b-anchor<0){anchor2=a.clone().add(wholeMonthDiff-1,"months");adjust=(b-anchor)/(anchor-anchor2)}else{anchor2=a.clone().add(wholeMonthDiff+1,"months");adjust=(b-anchor)/(anchor2-anchor)}return-(wholeMonthDiff+adjust)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(keepOffset){if(!this.isValid()){return null}var utc=keepOffset!==true,m=utc?this.clone().utc():this;if(m.year()<0||m.year()>9999){return formatMoment(m,utc?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ")}if(isFunction(Date.prototype.toISOString)){if(utc){return this.toDate().toISOString()}else{return new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(m,"Z"))}}return formatMoment(m,utc?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid()){return"moment.invalid(/* "+this._i+" */)"}var func="moment",zone="",prefix,year,datetime,suffix;if(!this.isLocal()){func=this.utcOffset()===0?"moment.utc":"moment.parseZone";zone="Z"}prefix="["+func+'("]';year=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY";datetime="-MM-DD[T]HH:mm:ss.SSS";suffix=zone+'[")]';return this.format(prefix+year+datetime+suffix)}function format(inputString){if(!inputString){inputString=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat}var output=formatMoment(this,inputString);return this.localeData().postformat(output)}function from(time,withoutSuffix){if(this.isValid()&&(isMoment(time)&&time.isValid()||createLocal(time).isValid())){return createDuration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix)}else{return this.localeData().invalidDate()}}function fromNow(withoutSuffix){return this.from(createLocal(),withoutSuffix)}function to(time,withoutSuffix){if(this.isValid()&&(isMoment(time)&&time.isValid()||createLocal(time).isValid())){return createDuration({from:this,to:time}).locale(this.locale()).humanize(!withoutSuffix)}else{return this.localeData().invalidDate()}}function toNow(withoutSuffix){return this.to(createLocal(),withoutSuffix)}function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData}return this}}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(key){if(key===undefined){return this.localeData()}else{return this.locale(key)}});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(dividend,divisor){return(dividend%divisor+divisor)%divisor}function localStartOfDate(y,m,d){if(y<100&&y>=0){return new Date(y+400,m,d)-MS_PER_400_YEARS}else{return new Date(y,m,d).valueOf()}}function utcStartOfDate(y,m,d){if(y<100&&y>=0){return Date.UTC(y+400,m,d)-MS_PER_400_YEARS}else{return Date.UTC(y,m,d)}}function startOf(units){var time,startOfDate;units=normalizeUnits(units);if(units===undefined||units==="millisecond"||!this.isValid()){return this}startOfDate=this._isUTC?utcStartOfDate:localStartOfDate;switch(units){case"year":time=startOfDate(this.year(),0,1);break;case"quarter":time=startOfDate(this.year(),this.month()-this.month()%3,1);break;case"month":time=startOfDate(this.year(),this.month(),1);break;case"week":time=startOfDate(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":time=startOfDate(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":time=startOfDate(this.year(),this.month(),this.date());break;case"hour":time=this._d.valueOf();time-=mod$1(time+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":time=this._d.valueOf();time-=mod$1(time,MS_PER_MINUTE);break;case"second":time=this._d.valueOf();time-=mod$1(time,MS_PER_SECOND);break}this._d.setTime(time);hooks.updateOffset(this,true);return this}function endOf(units){var time,startOfDate;units=normalizeUnits(units);if(units===undefined||units==="millisecond"||!this.isValid()){return this}startOfDate=this._isUTC?utcStartOfDate:localStartOfDate;switch(units){case"year":time=startOfDate(this.year()+1,0,1)-1;break;case"quarter":time=startOfDate(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":time=startOfDate(this.year(),this.month()+1,1)-1;break;case"week":time=startOfDate(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":time=startOfDate(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":time=startOfDate(this.year(),this.month(),this.date()+1)-1;break;case"hour":time=this._d.valueOf();time+=MS_PER_HOUR-mod$1(time+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":time=this._d.valueOf();time+=MS_PER_MINUTE-mod$1(time,MS_PER_MINUTE)-1;break;case"second":time=this._d.valueOf();time+=MS_PER_SECOND-mod$1(time,MS_PER_SECOND)-1;break}this._d.setTime(time);hooks.updateOffset(this,true);return this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var m=this;return[m.year(),m.month(),m.date(),m.hour(),m.minute(),m.second(),m.millisecond()]}function toObject(){var m=this;return{years:m.year(),months:m.month(),date:m.date(),hours:m.hours(),minutes:m.minutes(),seconds:m.seconds(),milliseconds:m.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(input,array,config,token){var era=config._locale.erasParse(input,token,config._strict);if(era){getParsingFlags(config).era=era}else{getParsingFlags(config).invalidEra=input}});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(input,array,config,token){var match;if(config._locale._eraYearOrdinalRegex){match=input.match(config._locale._eraYearOrdinalRegex)}if(config._locale.eraYearOrdinalParse){array[YEAR]=config._locale.eraYearOrdinalParse(input,match)}else{array[YEAR]=parseInt(input,10)}});function localeEras(m,format){var i,l,date,eras=this._eras||getLocale("en")._eras;for(i=0,l=eras.length;i<l;++i){switch(typeof eras[i].since){case"string":date=hooks(eras[i].since).startOf("day");eras[i].since=date.valueOf();break}switch(typeof eras[i].until){case"undefined":eras[i].until=+Infinity;break;case"string":date=hooks(eras[i].until).startOf("day").valueOf();eras[i].until=date.valueOf();break}}return eras}function localeErasParse(eraName,format,strict){var i,l,eras=this.eras(),name,abbr,narrow;eraName=eraName.toUpperCase();for(i=0,l=eras.length;i<l;++i){name=eras[i].name.toUpperCase();abbr=eras[i].abbr.toUpperCase();narrow=eras[i].narrow.toUpperCase();if(strict){switch(format){case"N":case"NN":case"NNN":if(abbr===eraName){return eras[i]}break;case"NNNN":if(name===eraName){return eras[i]}break;case"NNNNN":if(narrow===eraName){return eras[i]}break}}else if([name,abbr,narrow].indexOf(eraName)>=0){return eras[i]}}}function localeErasConvertYear(era,year){var dir=era.since<=era.until?+1:-1;if(year===undefined){return hooks(era.since).year()}else{return hooks(era.since).year()+(year-era.offset)*dir}}function getEraName(){var i,l,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until){return eras[i].name}if(eras[i].until<=val&&val<=eras[i].since){return eras[i].name}}return""}function getEraNarrow(){var i,l,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until){return eras[i].narrow}if(eras[i].until<=val&&val<=eras[i].since){return eras[i].narrow}}return""}function getEraAbbr(){var i,l,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until){return eras[i].abbr}if(eras[i].until<=val&&val<=eras[i].since){return eras[i].abbr}}return""}function getEraYear(){var i,l,dir,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){dir=eras[i].since<=eras[i].until?+1:-1;val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until||eras[i].until<=val&&val<=eras[i].since){return(this.year()-hooks(eras[i].since).year())*dir+eras[i].offset}}return this.year()}function erasNameRegex(isStrict){if(!hasOwnProp(this,"_erasNameRegex")){computeErasParse.call(this)}return isStrict?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(isStrict){if(!hasOwnProp(this,"_erasAbbrRegex")){computeErasParse.call(this)}return isStrict?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(isStrict){if(!hasOwnProp(this,"_erasNarrowRegex")){computeErasParse.call(this)}return isStrict?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(isStrict,locale){return locale.erasAbbrRegex(isStrict)}function matchEraName(isStrict,locale){return locale.erasNameRegex(isStrict)}function matchEraNarrow(isStrict,locale){return locale.erasNarrowRegex(isStrict)}function matchEraYearOrdinal(isStrict,locale){return locale._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var abbrPieces=[],namePieces=[],narrowPieces=[],mixedPieces=[],i,l,erasName,erasAbbr,erasNarrow,eras=this.eras();for(i=0,l=eras.length;i<l;++i){erasName=regexEscape(eras[i].name);erasAbbr=regexEscape(eras[i].abbr);erasNarrow=regexEscape(eras[i].narrow);namePieces.push(erasName);abbrPieces.push(erasAbbr);narrowPieces.push(erasNarrow);mixedPieces.push(erasName);mixedPieces.push(erasAbbr);mixedPieces.push(erasNarrow)}this._erasRegex=new RegExp("^("+mixedPieces.join("|")+")","i");this._erasNameRegex=new RegExp("^("+namePieces.join("|")+")","i");this._erasAbbrRegex=new RegExp("^("+abbrPieces.join("|")+")","i");this._erasNarrowRegex=new RegExp("^("+narrowPieces.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100});addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(token,getter){addFormatToken(0,[token,token.length],0,getter)}addWeekYearFormatToken("gggg","weekYear");addWeekYearFormatToken("ggggg","weekYear");addWeekYearFormatToken("GGGG","isoWeekYear");addWeekYearFormatToken("GGGGG","isoWeekYear");addRegexToken("G",matchSigned);addRegexToken("g",matchSigned);addRegexToken("GG",match1to2,match2);addRegexToken("gg",match1to2,match2);addRegexToken("GGGG",match1to4,match4);addRegexToken("gggg",match1to4,match4);addRegexToken("GGGGG",match1to6,match6);addRegexToken("ggggg",match1to6,match6);addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],function(input,week,config,token){week[token.substr(0,2)]=toInt(input)});addWeekParseToken(["gg","GG"],function(input,week,config,token){week[token]=hooks.parseTwoDigitYear(input)});function getSetWeekYear(input){return getSetWeekYearHelper.call(this,input,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(input){return getSetWeekYearHelper.call(this,input,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var weekInfo=this.localeData()._week;return weeksInYear(this.year(),weekInfo.dow,weekInfo.doy)}function getWeeksInWeekYear(){var weekInfo=this.localeData()._week;return weeksInYear(this.weekYear(),weekInfo.dow,weekInfo.doy)}function getSetWeekYearHelper(input,week,weekday,dow,doy){var weeksTarget;if(input==null){return weekOfYear(this,dow,doy).year}else{weeksTarget=weeksInYear(input,dow,doy);if(week>weeksTarget){week=weeksTarget}return setWeekAll.call(this,input,week,weekday,dow,doy)}}function setWeekAll(weekYear,week,weekday,dow,doy){var dayOfYearData=dayOfYearFromWeeks(weekYear,week,weekday,dow,doy),date=createUTCDate(dayOfYearData.year,0,dayOfYearData.dayOfYear);this.year(date.getUTCFullYear());this.month(date.getUTCMonth());this.date(date.getUTCDate());return this}addFormatToken("Q",0,"Qo","quarter");addRegexToken("Q",match1);addParseToken("Q",function(input,array){array[MONTH]=(toInt(input)-1)*3});function getSetQuarter(input){return input==null?Math.ceil((this.month()+1)/3):this.month((input-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addRegexToken("D",match1to2,match1to2NoLeadingZero);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(isStrict,locale){return isStrict?locale._dayOfMonthOrdinalParse||locale._ordinalParse:locale._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE);addParseToken("Do",function(input,array){array[DATE]=toInt(input.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",true);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(input,array,config){config._dayOfYear=toInt(input)});function getSetDayOfYear(input){var dayOfYear=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return input==null?dayOfYear:this.add(input-dayOfYear,"d")}addFormatToken("m",["mm",2],0,"minute");addRegexToken("m",match1to2,match1to2HasZero);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",false);addFormatToken("s",["ss",2],0,"second");addRegexToken("s",match1to2,match1to2HasZero);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",false);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S"){addRegexToken(token,matchUnsigned)}function parseMs(input,array){array[MILLISECOND]=toInt(("0."+input)*1e3)}for(token="S";token.length<=9;token+="S"){addParseToken(token,parseMs)}getSetMillisecond=makeGetSet("Milliseconds",false);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone;proto.diff=diff;proto.endOf=endOf;proto.format=format;proto.from=from;proto.fromNow=fromNow;proto.to=to;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter;proto.isBefore=isBefore;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang;proto.locale=locale;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray;proto.toObject=toObject;proto.toDate=toDate;proto.toISOString=toISOString;proto.inspect=inspect;if(typeof Symbol!=="undefined"&&Symbol.for!=null){proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}}proto.toJSON=toJSON;proto.toString=toString;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.eraName=getEraName;proto.eraNarrow=getEraNarrow;proto.eraAbbr=getEraAbbr;proto.eraYear=getEraYear;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.weeksInWeekYear=getWeeksInWeekYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth);proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear);proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(input){return createLocal(input*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(string){return string}var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set;proto$1.eras=localeEras;proto$1.erasParse=localeErasParse;proto$1.erasConvertYear=localeErasConvertYear;proto$1.erasAbbrRegex=erasAbbrRegex;proto$1.erasNameRegex=erasNameRegex;proto$1.erasNarrowRegex=erasNarrowRegex;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1(format,index,field,setter){var locale=getLocale(),utc=createUTC().set(setter,index);return locale[field](utc,format)}function listMonthsImpl(format,index,field){if(isNumber(format)){index=format;format=undefined}format=format||"";if(index!=null){return get$1(format,index,field,"month")}var i,out=[];for(i=0;i<12;i++){out[i]=get$1(format,i,field,"month")}return out}function listWeekdaysImpl(localeSorted,format,index,field){if(typeof localeSorted==="boolean"){if(isNumber(format)){index=format;format=undefined}format=format||""}else{format=localeSorted;index=format;localeSorted=false;if(isNumber(format)){index=format;format=undefined}format=format||""}var locale=getLocale(),shift=localeSorted?locale._week.dow:0,i,out=[];if(index!=null){return get$1(format,(index+shift)%7,field,"day")}for(i=0;i<7;i++){out[i]=get$1(format,(i+shift)%7,field,"day")}return out}function listMonths(format,index){return listMonthsImpl(format,index,"months")}function listMonthsShort(format,index){return listMonthsImpl(format,index,"monthsShort")}function listWeekdays(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,"weekdays")}function listWeekdaysShort(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,"weekdaysShort")}function listWeekdaysMin(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:+Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(number){var b=number%10,output=toInt(number%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th";return number+output}});hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var data=this._data;this._milliseconds=mathAbs(this._milliseconds);this._days=mathAbs(this._days);this._months=mathAbs(this._months);data.milliseconds=mathAbs(data.milliseconds);data.seconds=mathAbs(data.seconds);data.minutes=mathAbs(data.minutes);data.hours=mathAbs(data.hours);data.months=mathAbs(data.months);data.years=mathAbs(data.years);return this}function addSubtract$1(duration,input,value,direction){var other=createDuration(input,value);duration._milliseconds+=direction*other._milliseconds;duration._days+=direction*other._days;duration._months+=direction*other._months;return duration._bubble()}function add$1(input,value){return addSubtract$1(this,input,value,1)}function subtract$1(input,value){return addSubtract$1(this,input,value,-1)}function absCeil(number){if(number<0){return Math.floor(number)}else{return Math.ceil(number)}}function bubble(){var milliseconds=this._milliseconds,days=this._days,months=this._months,data=this._data,seconds,minutes,hours,years,monthsFromDays;if(!(milliseconds>=0&&days>=0&&months>=0||milliseconds<=0&&days<=0&&months<=0)){milliseconds+=absCeil(monthsToDays(months)+days)*864e5;days=0;months=0}data.milliseconds=milliseconds%1e3;seconds=absFloor(milliseconds/1e3);data.seconds=seconds%60;minutes=absFloor(seconds/60);data.minutes=minutes%60;hours=absFloor(minutes/60);data.hours=hours%24;days+=absFloor(hours/24);monthsFromDays=absFloor(daysToMonths(days));months+=monthsFromDays;days-=absCeil(monthsToDays(monthsFromDays));years=absFloor(months/12);months%=12;data.days=days;data.months=months;data.years=years;return this}function daysToMonths(days){return days*4800/146097}function monthsToDays(months){return months*146097/4800}function as(units){if(!this.isValid()){return NaN}var days,months,milliseconds=this._milliseconds;units=normalizeUnits(units);if(units==="month"||units==="quarter"||units==="year"){days=this._days+milliseconds/864e5;months=this._months+daysToMonths(days);switch(units){case"month":return months;case"quarter":return months/3;case"year":return months/12}}else{days=this._days+Math.round(monthsToDays(this._months));switch(units){case"week":return days/7+milliseconds/6048e5;case"day":return days+milliseconds/864e5;case"hour":return days*24+milliseconds/36e5;case"minute":return days*1440+milliseconds/6e4;case"second":return days*86400+milliseconds/1e3;case"millisecond":return Math.floor(days*864e5)+milliseconds;default:throw new Error("Unknown unit "+units)}}}function makeAs(alias){return function(){return this.as(alias)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y"),valueOf$1=asMilliseconds;function clone$1(){return createDuration(this)}function get$2(units){units=normalizeUnits(units);return this.isValid()?this[units+"s"]():NaN}function makeGetter(name){return function(){return this.isValid()?this._data[name]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture)}function relativeTime$1(posNegDuration,withoutSuffix,thresholds,locale){var duration=createDuration(posNegDuration).abs(),seconds=round(duration.as("s")),minutes=round(duration.as("m")),hours=round(duration.as("h")),days=round(duration.as("d")),months=round(duration.as("M")),weeks=round(duration.as("w")),years=round(duration.as("y")),a=seconds<=thresholds.ss&&["s",seconds]||seconds<thresholds.s&&["ss",seconds]||minutes<=1&&["m"]||minutes<thresholds.m&&["mm",minutes]||hours<=1&&["h"]||hours<thresholds.h&&["hh",hours]||days<=1&&["d"]||days<thresholds.d&&["dd",days];if(thresholds.w!=null){a=a||weeks<=1&&["w"]||weeks<thresholds.w&&["ww",weeks]}a=a||months<=1&&["M"]||months<thresholds.M&&["MM",months]||years<=1&&["y"]||["yy",years];a[2]=withoutSuffix;a[3]=+posNegDuration>0;a[4]=locale;return substituteTimeAgo.apply(null,a)}function getSetRelativeTimeRounding(roundingFunction){if(roundingFunction===undefined){return round}if(typeof roundingFunction==="function"){round=roundingFunction;return true}return false}function getSetRelativeTimeThreshold(threshold,limit){if(thresholds[threshold]===undefined){return false}if(limit===undefined){return thresholds[threshold]}thresholds[threshold]=limit;if(threshold==="s"){thresholds.ss=limit-1}return true}function humanize(argWithSuffix,argThresholds){if(!this.isValid()){return this.localeData().invalidDate()}var withSuffix=false,th=thresholds,locale,output;if(typeof argWithSuffix==="object"){argThresholds=argWithSuffix;argWithSuffix=false}if(typeof argWithSuffix==="boolean"){withSuffix=argWithSuffix}if(typeof argThresholds==="object"){th=Object.assign({},thresholds,argThresholds);if(argThresholds.s!=null&&argThresholds.ss==null){th.ss=argThresholds.s-1}}locale=this.localeData();output=relativeTime$1(this,!withSuffix,th,locale);if(withSuffix){output=locale.pastFuture(+this,output)}return locale.postformat(output)}var abs$1=Math.abs;function sign(x){return(x>0)-(x<0)||+x}function toISOString$1(){if(!this.isValid()){return this.localeData().invalidDate()}var seconds=abs$1(this._milliseconds)/1e3,days=abs$1(this._days),months=abs$1(this._months),minutes,hours,years,s,total=this.asSeconds(),totalSign,ymSign,daysSign,hmsSign;if(!total){return"P0D"}minutes=absFloor(seconds/60);hours=absFloor(minutes/60);seconds%=60;minutes%=60;years=absFloor(months/12);months%=12;s=seconds?seconds.toFixed(3).replace(/\.?0+$/,""):"";totalSign=total<0?"-":"";ymSign=sign(this._months)!==sign(total)?"-":"";daysSign=sign(this._days)!==sign(total)?"-":"";hmsSign=sign(this._milliseconds)!==sign(total)?"-":"";return totalSign+"P"+(years?ymSign+years+"Y":"")+(months?ymSign+months+"M":"")+(days?daysSign+days+"D":"")+(hours||minutes||seconds?"T":"")+(hours?hmsSign+hours+"H":"")+(minutes?hmsSign+minutes+"M":"")+(seconds?hmsSign+s+"S":"")}var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1;proto$2.get=get$2;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale;proto$2.localeData=localeData;proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(input,array,config){config._d=new Date(parseFloat(input)*1e3)});addParseToken("x",function(input,array,config){config._d=new Date(toInt(input))});hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};return hooks})},{}],18:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=index;var _moment=_interopRequireDefault(require("moment"));var _crc=_interopRequireDefault(require("crc-32"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var _getFingerprint=function _getFingerprint(object,algorithm){switch(_typeof(object)){case"object":if(object==null){return"o:null"}else if(object._isAMomentObject){return"m:".concat(object.toISOString())}else if(object instanceof Date){return"m:".concat((0,_moment["default"])(object).toISOString())}else if(Array.isArray(object)){return"a:[".concat(object.map(function(i){return getObjectFingerprint(i,algorithm)}),"]")}else{return"o:".concat(getObjectFingerprint(object,algorithm))}case"boolean":return"b:".concat(object?"t":"f");case"function":throw new Error("You cannot pass a function as data item");case"number":return"n:".concat(object.toString());case"string":return"s:".concat(object);case"undefined":return"u"}};var getObjectFingerprint=function getObjectFingerprint(value,algorithm){try{if(_typeof(value)==="object"){var sortedKeys=Object.keys(value).sort();var buff="";var _iterator=_createForOfIteratorHelper(sortedKeys),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var key=_step.value;buff+="".concat(key,"<").concat(index(value[key],algorithm),">")}}catch(err){_iterator.e(err)}finally{_iterator.f()}return buff}else{return JSON.parse(value)}}catch(e){return"nn"}};function index(object,algorithm){if(algorithm){return algorithm(_getFingerprint(object,algorithm))}else{return _crc["default"].str(_getFingerprint(object)).toString(16)}}},{"crc-32":15,moment:17}],19:[function(require,module,exports){var e=function e(t){function r(e,t,n){var a,o={};if(Array.isArray(e))return e.concat(t);for(a in e)o[n?a.toLowerCase():a]=e[a];for(a in t){var i=n?a.toLowerCase():a,u=t[a];o[i]=i in o&&"object"==typeof u?r(o[i],u,"headers"==i):u}return o}function n(e,n,a,o,i){var u="string"!=typeof e?(n=e).url:e,c={config:n},s=r(t,n),p={};o=o||s.data,(s.transformRequest||[]).map(function(e){o=e(o,s.headers)||o}),s.auth&&(p.authorization=s.auth),o&&"object"==typeof o&&"function"!=typeof o.append&&"function"!=typeof o.text&&(o=JSON.stringify(o),p["content-type"]="application/json");try{p[s.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+s.xsrfCookieName+"=([^;]*)"))[2])}catch(e){}return s.baseURL&&(u=u.replace(/^(?!.*\/\/)\/?/,s.baseURL+"/")),s.params&&(u+=(~u.indexOf("?")?"&":"?")+(s.paramsSerializer?s.paramsSerializer(s.params):new URLSearchParams(s.params))),(s.fetch||fetch)(u,{method:(a||s.method||"get").toUpperCase(),body:o,headers:r(s.headers,p,!0),credentials:s.withCredentials?"include":i}).then(function(e){for(var t in e)"function"!=typeof e[t]&&(c[t]=e[t]);return"stream"==s.responseType?(c.data=e.body,c):e[s.responseType||"text"]().then(function(e){c.data=e,c.data=JSON.parse(e)}).catch(Object).then(function(){return(s.validateStatus?s.validateStatus(e.status):e.ok)?c:Promise.reject(c)})})}return t=t||{},n.request=n,n.get=function(e,t){return n(e,t,"get")},n.delete=function(e,t){return n(e,t,"delete")},n.head=function(e,t){return n(e,t,"head")},n.options=function(e,t){return n(e,t,"options")},n.post=function(e,t,r){return n(e,r,"post",t)},n.put=function(e,t,r){return n(e,r,"put",t)},n.patch=function(e,t,r){return n(e,r,"patch",t)},n.all=Promise.all.bind(Promise),n.spread=function(e){return e.apply.bind(e,e)},n.CancelToken="function"==typeof AbortController?AbortController:Object,n.defaults=t,n.create=e,n}();module.exports=e},{}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"NIL",{enumerable:true,get:function(){return _nil.default}});Object.defineProperty(exports,"parse",{enumerable:true,get:function(){return _parse.default}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function(){return _stringify.default}});Object.defineProperty(exports,"v1",{enumerable:true,get:function(){return _v.default}});Object.defineProperty(exports,"v3",{enumerable:true,get:function(){return _v2.default}});Object.defineProperty(exports,"v4",{enumerable:true,get:function(){return _v3.default}});Object.defineProperty(exports,"v5",{enumerable:true,get:function(){return _v4.default}});Object.defineProperty(exports,"validate",{enumerable:true,get:function(){return _validate.default}});Object.defineProperty(exports,"version",{enumerable:true,get:function(){return _version.default}});var _v=_interopRequireDefault(require("./v1.js"));var _v2=_interopRequireDefault(require("./v3.js"));var _v3=_interopRequireDefault(require("./v4.js"));var _v4=_interopRequireDefault(require("./v5.js"));var _nil=_interopRequireDefault(require("./nil.js"));var _version=_interopRequireDefault(require("./version.js"));var _validate=_interopRequireDefault(require("./validate.js"));var _stringify=_interopRequireDefault(require("./stringify.js"));var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}},{"./nil.js":23,"./parse.js":24,"./stringify.js":28,"./v1.js":29,"./v3.js":30,"./v4.js":32,"./v5.js":33,"./validate.js":34,"./version.js":35}],21:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;function md5(bytes){if(typeof bytes==="string"){const msg=unescape(encodeURIComponent(bytes));bytes=new Uint8Array(msg.length);for(let i=0;i<msg.length;++i){bytes[i]=msg.charCodeAt(i)}}return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes),bytes.length*8))}function md5ToHexEncodedArray(input){const output=[];const length32=input.length*32;const hexTab="0123456789abcdef";for(let i=0;i<length32;i+=8){const x=input[i>>5]>>>i%32&255;const hex=parseInt(hexTab.charAt(x>>>4&15)+hexTab.charAt(x&15),16);output.push(hex)}return output}function getOutputLength(inputLength8){return(inputLength8+64>>>9<<4)+14+1}function wordsToMd5(x,len){x[len>>5]|=128<<len%32;x[getOutputLength(len)-1]=len;let a=1732584193;let b=-271733879;let c=-1732584194;let d=271733878;for(let i=0;i<x.length;i+=16){const olda=a;const oldb=b;const oldc=c;const oldd=d;a=md5ff(a,b,c,d,x[i],7,-680876936);d=md5ff(d,a,b,c,x[i+1],12,-389564586);c=md5ff(c,d,a,b,x[i+2],17,606105819);b=md5ff(b,c,d,a,x[i+3],22,-1044525330);a=md5ff(a,b,c,d,x[i+4],7,-176418897);d=md5ff(d,a,b,c,x[i+5],12,1200080426);c=md5ff(c,d,a,b,x[i+6],17,-1473231341);b=md5ff(b,c,d,a,x[i+7],22,-45705983);a=md5ff(a,b,c,d,x[i+8],7,1770035416);d=md5ff(d,a,b,c,x[i+9],12,-1958414417);c=md5ff(c,d,a,b,x[i+10],17,-42063);b=md5ff(b,c,d,a,x[i+11],22,-1990404162);a=md5ff(a,b,c,d,x[i+12],7,1804603682);d=md5ff(d,a,b,c,x[i+13],12,-40341101);c=md5ff(c,d,a,b,x[i+14],17,-1502002290);b=md5ff(b,c,d,a,x[i+15],22,1236535329);a=md5gg(a,b,c,d,x[i+1],5,-165796510);d=md5gg(d,a,b,c,x[i+6],9,-1069501632);c=md5gg(c,d,a,b,x[i+11],14,643717713);b=md5gg(b,c,d,a,x[i],20,-373897302);a=md5gg(a,b,c,d,x[i+5],5,-701558691);d=md5gg(d,a,b,c,x[i+10],9,38016083);c=md5gg(c,d,a,b,x[i+15],14,-660478335);b=md5gg(b,c,d,a,x[i+4],20,-405537848);a=md5gg(a,b,c,d,x[i+9],5,568446438);d=md5gg(d,a,b,c,x[i+14],9,-1019803690);c=md5gg(c,d,a,b,x[i+3],14,-187363961);b=md5gg(b,c,d,a,x[i+8],20,1163531501);a=md5gg(a,b,c,d,x[i+13],5,-1444681467);d=md5gg(d,a,b,c,x[i+2],9,-51403784);c=md5gg(c,d,a,b,x[i+7],14,1735328473);b=md5gg(b,c,d,a,x[i+12],20,-1926607734);a=md5hh(a,b,c,d,x[i+5],4,-378558);d=md5hh(d,a,b,c,x[i+8],11,-2022574463);c=md5hh(c,d,a,b,x[i+11],16,1839030562);b=md5hh(b,c,d,a,x[i+14],23,-35309556);a=md5hh(a,b,c,d,x[i+1],4,-1530992060);d=md5hh(d,a,b,c,x[i+4],11,1272893353);c=md5hh(c,d,a,b,x[i+7],16,-155497632);b=md5hh(b,c,d,a,x[i+10],23,-1094730640);a=md5hh(a,b,c,d,x[i+13],4,681279174);d=md5hh(d,a,b,c,x[i],11,-358537222);c=md5hh(c,d,a,b,x[i+3],16,-722521979);b=md5hh(b,c,d,a,x[i+6],23,76029189);a=md5hh(a,b,c,d,x[i+9],4,-640364487);d=md5hh(d,a,b,c,x[i+12],11,-421815835);c=md5hh(c,d,a,b,x[i+15],16,530742520);b=md5hh(b,c,d,a,x[i+2],23,-995338651);a=md5ii(a,b,c,d,x[i],6,-198630844);d=md5ii(d,a,b,c,x[i+7],10,1126891415);c=md5ii(c,d,a,b,x[i+14],15,-1416354905);b=md5ii(b,c,d,a,x[i+5],21,-57434055);a=md5ii(a,b,c,d,x[i+12],6,1700485571);d=md5ii(d,a,b,c,x[i+3],10,-1894986606);c=md5ii(c,d,a,b,x[i+10],15,-1051523);b=md5ii(b,c,d,a,x[i+1],21,-2054922799);a=md5ii(a,b,c,d,x[i+8],6,1873313359);d=md5ii(d,a,b,c,x[i+15],10,-30611744);c=md5ii(c,d,a,b,x[i+6],15,-1560198380);b=md5ii(b,c,d,a,x[i+13],21,1309151649);a=md5ii(a,b,c,d,x[i+4],6,-145523070);d=md5ii(d,a,b,c,x[i+11],10,-1120210379);c=md5ii(c,d,a,b,x[i+2],15,718787259);b=md5ii(b,c,d,a,x[i+9],21,-343485551);a=safeAdd(a,olda);b=safeAdd(b,oldb);c=safeAdd(c,oldc);d=safeAdd(d,oldd)}return[a,b,c,d]}function bytesToWords(input){if(input.length===0){return[]}const length8=input.length*8;const output=new Uint32Array(getOutputLength(length8));for(let i=0;i<length8;i+=8){output[i>>5]|=(input[i/8]&255)<<i%32}return output}function safeAdd(x,y){const lsw=(x&65535)+(y&65535);const msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt}function md5cmn(q,a,b,x,s,t){return safeAdd(bitRotateLeft(safeAdd(safeAdd(a,q),safeAdd(x,t)),s),b)}function md5ff(a,b,c,d,x,s,t){return md5cmn(b&c|~b&d,a,b,x,s,t)}function md5gg(a,b,c,d,x,s,t){return md5cmn(b&d|c&~d,a,b,x,s,t)}function md5hh(a,b,c,d,x,s,t){return md5cmn(b^c^d,a,b,x,s,t)}function md5ii(a,b,c,d,x,s,t){return md5cmn(c^(b|~d),a,b,x,s,t)}var _default=md5;exports.default=_default},{}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;const randomUUID=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var _default={randomUUID:randomUUID};exports.default=_default},{}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _default="00000000-0000-0000-0000-000000000000";exports.default=_default},{}],24:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function parse(uuid){if(!(0,_validate.default)(uuid)){throw TypeError("Invalid UUID")}let v;const arr=new Uint8Array(16);arr[0]=(v=parseInt(uuid.slice(0,8),16))>>>24;arr[1]=v>>>16&255;arr[2]=v>>>8&255;arr[3]=v&255;arr[4]=(v=parseInt(uuid.slice(9,13),16))>>>8;arr[5]=v&255;arr[6]=(v=parseInt(uuid.slice(14,18),16))>>>8;arr[7]=v&255;arr[8]=(v=parseInt(uuid.slice(19,23),16))>>>8;arr[9]=v&255;arr[10]=(v=parseInt(uuid.slice(24,36),16))/1099511627776&255;arr[11]=v/4294967296&255;arr[12]=v>>>24&255;arr[13]=v>>>16&255;arr[14]=v>>>8&255;arr[15]=v&255;return arr}var _default=parse;exports.default=_default},{"./validate.js":34}],25:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;exports.default=_default},{}],26:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=rng;let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!getRandomValues){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return getRandomValues(rnds8)}},{}],27:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;function f(s,x,y,z){switch(s){case 0:return x&y^~x&z;case 1:return x^y^z;case 2:return x&y^x&z^y&z;case 3:return x^y^z}}function ROTL(x,n){return x<<n|x>>>32-n}function sha1(bytes){const K=[1518500249,1859775393,2400959708,3395469782];const H=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof bytes==="string"){const msg=unescape(encodeURIComponent(bytes));bytes=[];for(let i=0;i<msg.length;++i){bytes.push(msg.charCodeAt(i))}}else if(!Array.isArray(bytes)){bytes=Array.prototype.slice.call(bytes)}bytes.push(128);const l=bytes.length/4+2;const N=Math.ceil(l/16);const M=new Array(N);for(let i=0;i<N;++i){const arr=new Uint32Array(16);for(let j=0;j<16;++j){arr[j]=bytes[i*64+j*4]<<24|bytes[i*64+j*4+1]<<16|bytes[i*64+j*4+2]<<8|bytes[i*64+j*4+3]}M[i]=arr}M[N-1][14]=(bytes.length-1)*8/Math.pow(2,32);M[N-1][14]=Math.floor(M[N-1][14]);M[N-1][15]=(bytes.length-1)*8&4294967295;for(let i=0;i<N;++i){const W=new Uint32Array(80);for(let t=0;t<16;++t){W[t]=M[i][t]}for(let t=16;t<80;++t){W[t]=ROTL(W[t-3]^W[t-8]^W[t-14]^W[t-16],1)}let a=H[0];let b=H[1];let c=H[2];let d=H[3];let e=H[4];for(let t=0;t<80;++t){const s=Math.floor(t/20);const T=ROTL(a,5)+f(s,b,c,d)+e+K[s]+W[t]>>>0;e=d;d=c;c=ROTL(b,30)>>>0;b=a;a=T}H[0]=H[0]+a>>>0;H[1]=H[1]+b>>>0;H[2]=H[2]+c>>>0;H[3]=H[3]+d>>>0;H[4]=H[4]+e>>>0}return[H[0]>>24&255,H[0]>>16&255,H[0]>>8&255,H[0]&255,H[1]>>24&255,H[1]>>16&255,H[1]>>8&255,H[1]&255,H[2]>>24&255,H[2]>>16&255,H[2]>>8&255,H[2]&255,H[3]>>24&255,H[3]>>16&255,H[3]>>8&255,H[3]&255,H[4]>>24&255,H[4]>>16&255,H[4]>>8&255,H[4]&255]}var _default=sha1;exports.default=_default},{}],28:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;exports.unsafeStringify=unsafeStringify;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const byteToHex=[];for(let i=0;i<256;++i){byteToHex.push((i+256).toString(16).slice(1))}function unsafeStringify(arr,offset=0){return byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]}function stringify(arr,offset=0){const uuid=unsafeStringify(arr,offset);if(!(0,_validate.default)(uuid)){throw TypeError("Stringified UUID is invalid")}return uuid}var _default=stringify;exports.default=_default},{"./validate.js":34}],29:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}let _nodeId;let _clockseq;let _lastMSecs=0;let _lastNSecs=0;function v1(options,buf,offset){let i=buf&&offset||0;const b=buf||new Array(16);options=options||{};let node=options.node||_nodeId;let clockseq=options.clockseq!==undefined?options.clockseq:_clockseq;if(node==null||clockseq==null){const seedBytes=options.random||(options.rng||_rng.default)();if(node==null){node=_nodeId=[seedBytes[0]|1,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]}if(clockseq==null){clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&16383}}let msecs=options.msecs!==undefined?options.msecs:Date.now();let nsecs=options.nsecs!==undefined?options.nsecs:_lastNSecs+1;const dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&options.clockseq===undefined){clockseq=clockseq+1&16383}if((dt<0||msecs>_lastMSecs)&&options.nsecs===undefined){nsecs=0}if(nsecs>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=msecs;_lastNSecs=nsecs;_clockseq=clockseq;msecs+=122192928e5;const tl=((msecs&268435455)*1e4+nsecs)%4294967296;b[i++]=tl>>>24&255;b[i++]=tl>>>16&255;b[i++]=tl>>>8&255;b[i++]=tl&255;const tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255;b[i++]=tmh&255;b[i++]=tmh>>>24&15|16;b[i++]=tmh>>>16&255;b[i++]=clockseq>>>8|128;b[i++]=clockseq&255;for(let n=0;n<6;++n){b[i+n]=node[n]}return buf||(0,_stringify.unsafeStringify)(b)}var _default=v1;exports.default=_default},{"./rng.js":26,"./stringify.js":28}],30:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _md=_interopRequireDefault(require("./md5.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const v3=(0,_v.default)("v3",48,_md.default);var _default=v3;exports.default=_default},{"./md5.js":21,"./v35.js":31}],31:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.URL=exports.DNS=void 0;exports.default=v35;var _stringify=require("./stringify.js");var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function stringToBytes(str){str=unescape(encodeURIComponent(str));const bytes=[];for(let i=0;i<str.length;++i){bytes.push(str.charCodeAt(i))}return bytes}const DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";exports.DNS=DNS;const URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";exports.URL=URL;function v35(name,version,hashfunc){function generateUUID(value,namespace,buf,offset){var _namespace;if(typeof value==="string"){value=stringToBytes(value)}if(typeof namespace==="string"){namespace=(0,_parse.default)(namespace)}if(((_namespace=namespace)===null||_namespace===void 0?void 0:_namespace.length)!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}let bytes=new Uint8Array(16+value.length);bytes.set(namespace);bytes.set(value,namespace.length);bytes=hashfunc(bytes);bytes[6]=bytes[6]&15|version;bytes[8]=bytes[8]&63|128;if(buf){offset=offset||0;for(let i=0;i<16;++i){buf[offset+i]=bytes[i]}return buf}return(0,_stringify.unsafeStringify)(bytes)}try{generateUUID.name=name}catch(err){}generateUUID.DNS=DNS;generateUUID.URL=URL;return generateUUID}},{"./parse.js":24,"./stringify.js":28}],32:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _native=_interopRequireDefault(require("./native.js"));var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function v4(options,buf,offset){if(_native.default.randomUUID&&!buf&&!options){return _native.default.randomUUID()}options=options||{};const rnds=options.random||(options.rng||_rng.default)();rnds[6]=rnds[6]&15|64;rnds[8]=rnds[8]&63|128;if(buf){offset=offset||0;for(let i=0;i<16;++i){buf[offset+i]=rnds[i]}return buf}return(0,_stringify.unsafeStringify)(rnds)}var _default=v4;exports.default=_default},{"./native.js":22,"./rng.js":26,"./stringify.js":28}],33:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _sha=_interopRequireDefault(require("./sha1.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const v5=(0,_v.default)("v5",80,_sha.default);var _default=v5;exports.default=_default},{"./sha1.js":27,"./v35.js":31}],34:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _regex=_interopRequireDefault(require("./regex.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function validate(uuid){return typeof uuid==="string"&&_regex.default.test(uuid)}var _default=validate;exports.default=_default},{"./regex.js":25}],35:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function version(uuid){if(!(0,_validate.default)(uuid)){throw TypeError("Invalid UUID")}return parseInt(uuid.slice(14,15),16)}var _default=version;exports.default=_default},{"./validate.js":34}],dataflux:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Model",{enumerable:true,get:function get(){return _Model["default"]}});Object.defineProperty(exports,"Store",{enumerable:true,get:function get(){return _ReactStore["default"]}});var _ReactStore=_interopRequireDefault(require("./ReactStore"));var _Model=_interopRequireDefault(require("./Model"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},{"./Model":2,"./ReactStore":7}]},{},[]);
1
+ require=function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.dateRegex=exports.BasicObj=void 0;exports.setValues=setValues;var _moment=_interopRequireDefault(require("moment/moment"));var _uuid=require("uuid");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var dateRegex=exports.dateRegex=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9].*T[0-9].*Z$");var globalError="_object";function setValues(values,model,SubObj,parent,context){if(!values){throw new Error('The parameter "values" cannot be null')}Object.keys(values).forEach(function(key){var value=values[key];if(model.options.parseMoment&&value!=null&&dateRegex.test(value)){var mmnt=(0,_moment["default"])(value);context[key]=mmnt.isValid()?mmnt:value}else if(model.options.deep&&value!=null&&_typeof(value)==="object"&&!Array.isArray(value)){if(context[key]&&_typeof(context[key])==="object"){setValues(value,model,SubObj,parent,context[key])}else{context[key]=new SubObj(parent,key,value,model)}}else if(model.options.deep&&value!=null&&Array.isArray(value)&&!value.some(function(str){return["string","number"].includes(_typeof(str))})){var out=[];value.forEach(function(item,order){var _context$key;var old=(_context$key=context[key])===null||_context$key===void 0?void 0:_context$key.find(function(i){return i.id===(item===null||item===void 0?void 0:item.id)});if(old&&old.id&&_typeof(old)==="object"){setValues(item,model,SubObj,parent,old);out.push(old)}else{out.push(new SubObj(parent,key,item,model))}});context[key]=out}else{context[key]=value}})}var _setHidden=new WeakMap;var _id=new WeakMap;var _error=new WeakMap;var _model=new WeakMap;var BasicObj=exports.BasicObj=function(){function BasicObj(values,model){var _this=this;_classCallCheck(this,BasicObj);_classPrivateFieldInitSpec(this,_setHidden,{});_classPrivateFieldInitSpec(this,_id,null);_classPrivateFieldInitSpec(this,_error,{});_classPrivateFieldInitSpec(this,_model,void 0);_defineProperty(this,"isDataflux",function(){return true});_defineProperty(this,"isMock",function(){return false});_defineProperty(this,"setId",function(id){_this.id=id});_defineProperty(this,"getId",function(){if(!_classPrivateFieldGet(_id,_this)){if(_this.id!=null&&(typeof _this.id==="string"||typeof _this.id==="number")){_classPrivateFieldSet(_id,_this,_this.id.toString());delete _this.setId}else{_classPrivateFieldSet(_id,_this,(0,_uuid.v4)())}}return _classPrivateFieldGet(_id,_this)});_defineProperty(this,"get",function(attribute,defaultValue){var _ref,_classPrivateFieldGet2;return(_ref=(_classPrivateFieldGet2=_classPrivateFieldGet(_setHidden,_this)[attribute])!==null&&_classPrivateFieldGet2!==void 0?_classPrivateFieldGet2:_this[attribute])!==null&&_ref!==void 0?_ref:defaultValue});_defineProperty(this,"getError",function(){var _classPrivateFieldGet3;var attribute=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var key=attribute?attribute:globalError;return(_classPrivateFieldGet3=_classPrivateFieldGet(_error,_this)[key])!==null&&_classPrivateFieldGet3!==void 0?_classPrivateFieldGet3:false});_defineProperty(this,"setError",function(error){var attribute=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(error&&attribute){_classPrivateFieldGet(_error,_this)[attribute]=error}else if(error&&!attribute){_classPrivateFieldGet(_error,_this)[globalError]=error}else if(!error&&attribute){delete _classPrivateFieldGet(_error,_this)[attribute]}else{_classPrivateFieldSet(_error,_this,{})}});_defineProperty(this,"setConstant",function(attribute,value){var _classPrivateFieldGet4;_classPrivateFieldGet(_setHidden,_this)[attribute]=(_classPrivateFieldGet4=_classPrivateFieldGet(_setHidden,_this)[attribute])!==null&&_classPrivateFieldGet4!==void 0?_classPrivateFieldGet4:value});_defineProperty(this,"toJSON",function(){var attrs=Object.keys(_this);var out={};for(var _i=0,_attrs=attrs;_i<_attrs.length;_i++){var a=_attrs[_i];if(_this[a]==null){out[a]=_this[a]}else if(_this[a]instanceof _moment["default"]){out[a]=_this[a].toISOString()}else if(_this[a]instanceof Date){out[a]=(0,_moment["default"])(_this[a]).toISOString()}else if(_typeof(_this[a])==="object"&&_this[a].toJSON){out[a]=_this[a].toJSON()}else if(Array.isArray(_this[a])&&_this[a].every(function(i){return _typeof(i)==="object"&&i.toJSON})){out[a]=_this[a].map(function(i){return i.toJSON()})}else if(typeof _this[a]!=="function"){out[a]=_this[a]}}return out});_defineProperty(this,"toString",function(){return JSON.stringify(_this.toJSON())});_defineProperty(this,"update",function(){return Promise.resolve()});_classPrivateFieldSet(_model,this,model)}return _createClass(BasicObj,[{key:"set",value:function set(attribute,value,hidden){if(hidden){_classPrivateFieldGet(_setHidden,this)[attribute]=value}else{if(attribute==="id"){throw new Error("You cannot change the ID")}this[attribute]=value;_classPrivateFieldGet(_model,this).validateObjectAttribute(this,attribute)}return this.update()}}])}()},{"moment/moment":17,uuid:20}],2:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _modelHooksUtils=require("./modelHooksUtils");var _redaxios=_interopRequireDefault(require("redaxios"));var _BasicObj=require("./BasicObj");var _SubObj=_interopRequireDefault(require("./SubObj"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _type=new WeakMap;var _store=new WeakMap;var _includes=new WeakMap;var _retrieveHook=new WeakMap;var _updateHook=new WeakMap;var _insertHook=new WeakMap;var _deleteHook=new WeakMap;var _singleItemQuery=new WeakMap;var _batchSize=new WeakMap;var _axios=new WeakMap;var _loadFunction=new WeakMap;var _hiddenFields=new WeakMap;var _Model_brand=new WeakSet;var _addRelationByField=new WeakMap;var _addRelationByFilter=new WeakMap;var _removeHiddenFields=new WeakMap;var _toArray=new WeakMap;var _unWrap=new WeakMap;var _insertObjects=new WeakMap;var _assignId=new WeakMap;var _updateObjects=new WeakMap;var _deleteObjects=new WeakMap;var _hanldeApiError=new WeakMap;var _cleanApiError=new WeakMap;var _removeFromStoreSilentlyAfterFailure=new WeakMap;var Model=exports["default"]=_createClass(function Model(name){var _this=this,_ref3,_options$deep,_ref4,_options$parseMoment,_options$lazyLoad,_ref5,_options$validate,_ref6,_options$autoSave,_ref7,_options$autoRefresh,_ref8,_options$pre,_ref9,_options$hiddenFields,_ref10,_options$post;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var defaults=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};_classCallCheck(this,Model);_classPrivateMethodInitSpec(this,_Model_brand);_classPrivateFieldInitSpec(this,_type,void 0);_classPrivateFieldInitSpec(this,_store,void 0);_classPrivateFieldInitSpec(this,_includes,void 0);_classPrivateFieldInitSpec(this,_retrieveHook,void 0);_classPrivateFieldInitSpec(this,_updateHook,void 0);_classPrivateFieldInitSpec(this,_insertHook,void 0);_classPrivateFieldInitSpec(this,_deleteHook,void 0);_classPrivateFieldInitSpec(this,_singleItemQuery,void 0);_classPrivateFieldInitSpec(this,_batchSize,void 0);_classPrivateFieldInitSpec(this,_axios,void 0);_classPrivateFieldInitSpec(this,_loadFunction,void 0);_classPrivateFieldInitSpec(this,_hiddenFields,void 0);_defineProperty(this,"ready",void 0);_defineProperty(this,"validateObjectAttribute",function(object,key){var validate=_this.options.validate;if(validate&&validate[key]){try{var call=validate[key](object,_classPrivateFieldGet(_store,_this));if(call!==null&&call!==void 0&&call.then){call.then(function(){return object.setError(false,key)})["catch"](function(error){return object.setError(error.message,key)})}else{object.setError(false,key)}}catch(error){object.setError(error.message,key)}}});_defineProperty(this,"isObjectValid",function(object){for(var key in object){if(typeof object[key]!=="function"){if(object.getError(key)){console.log("Model error",key,object.getError(key));return false}}}return true});_defineProperty(this,"getStore",function(){return _classPrivateFieldGet(_store,_this)});_defineProperty(this,"setStore",function(store){if(!_classPrivateFieldGet(_store,_this)){var _classPrivateFieldGet2;_classPrivateFieldSet(_store,_this,store);_classPrivateFieldSet(_axios,_this,_this.options.axios||((_classPrivateFieldGet2=_classPrivateFieldGet(_store,_this))===null||_classPrivateFieldGet2===void 0||(_classPrivateFieldGet2=_classPrivateFieldGet2.options)===null||_classPrivateFieldGet2===void 0?void 0:_classPrivateFieldGet2.axios)||_redaxios["default"])}else{throw new Error("This model was already assigned to a store.")}});_defineProperty(this,"load",function(obj){if(_classPrivateFieldGet(_loadFunction,_this)){return _this.getStore().whenSaved(_this.getType())["catch"](function(e){throw new Error("You cannot perform load() on an unsaved object.")}).then(function(){var res=_classPrivateFieldGet(_loadFunction,_this).call(_this,obj.toJSON());if(typeof res==="string"){return _classPrivateFieldGet(_axios,_this).call(_this,{method:"get",url:res,responseType:"json"}).then(function(data){return data.data})}else{return res}}).then(function(data){(0,_BasicObj.setValues)(data,_this,_SubObj["default"],obj,obj);return data})["catch"](function(error){return _assertClassBrand(_Model_brand,_this,_error).call(_this,error)})}else{return _assertClassBrand(_Model_brand,_this,_error).call(_this,"You must define a loading function in the model to enable load().")}});_defineProperty(this,"addRelation",function(model,param2,param3){if(model){_this.getStore().validateModel(model);if(typeof param2==="string"&&(!param3||typeof param3==="string")){return _classPrivateFieldGet(_addRelationByField,_this).call(_this,model,param2,param3)}else if(!param3&&typeof param2==="function"){return _classPrivateFieldGet(_addRelationByFilter,_this).call(_this,model,param2)}else if(!param2&&!param3){return _classPrivateFieldGet(_addRelationByField,_this).call(_this,model,model.getType(),"id")}else{throw new Error("Invalid relation declaration")}}else{throw new Error("A relation needs a model")}});_defineProperty(this,"getRelation",function(parentObject,includedType,filterFunction){var filterRelation=_classPrivateFieldGet(_includes,_this)[includedType];if(filterRelation){return(parentObject.getModel().options.load?parentObject.load()["catch"](function(){}):Promise.resolve()).then(function(){return _this.getStore().find(includedType,function(item){return filterRelation(parentObject,item)}).then(function(data){return filterFunction?data.filter(filterFunction):data})})}else{return _assertClassBrand(_Model_brand,_this,_error).call(_this,"The relation doesn't exist")}});_defineProperty(this,"getType",function(){return _classPrivateFieldGet(_type,_this)});_defineProperty(this,"retrieveAll",function(){return(0,_modelHooksUtils.executeHook)("retrieve",_classPrivateFieldGet(_retrieveHook,_this),null,_classPrivateFieldGet(_axios,_this)).then(function(data){if(!Array.isArray(data)){_classPrivateFieldSet(_singleItemQuery,_this,true)}_this.ready=true;return _classPrivateFieldGet(_toArray,_this).call(_this,data)}).then(function(data){var _this$options;return(_this$options=_this.options)!==null&&_this$options!==void 0&&_this$options.pre?data.map(function(n){return _this.options.pre(n,data)}):data})});_defineProperty(this,"insertObjects",function(objects){return objects.length?_classPrivateFieldGet(_insertObjects,_this).call(_this,objects):Promise.resolve()});_defineProperty(this,"updateObjects",function(objects){return objects.length?_classPrivateFieldGet(_updateObjects,_this).call(_this,objects):Promise.resolve()});_defineProperty(this,"deleteObjects",function(objects){return objects.length?_classPrivateFieldGet(_deleteObjects,_this).call(_this,objects):Promise.resolve()});_defineProperty(this,"factory",function(params){if(!_this.options.lazyLoad){return Promise.reject("Factory can be used only on a model declared with lazyLoad: true")}else{return(0,_modelHooksUtils.executeHook)("retrieve",_classPrivateFieldGet(_retrieveHook,_this),params,_classPrivateFieldGet(_axios,_this)).then(function(data){if(!Array.isArray(data)){_classPrivateFieldSet(_singleItemQuery,_this,true)}return _classPrivateFieldGet(_toArray,_this).call(_this,data)})}});_classPrivateFieldInitSpec(this,_addRelationByField,function(model,localField){var remoteField=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"id";var filterFunction=function filterFunction(parentObject,child){return parentObject[localField]===child[remoteField]};return _classPrivateFieldGet(_addRelationByFilter,_this).call(_this,model,filterFunction)});_classPrivateFieldInitSpec(this,_addRelationByFilter,function(model,filterFunction){var includedType=model.getType();_classPrivateFieldGet(_includes,_this)[includedType]=filterFunction});_classPrivateFieldInitSpec(this,_removeHiddenFields,function(json){var _ref;var _iterator=_createForOfIteratorHelper((_ref=_this===null||_this===void 0?void 0:_classPrivateFieldGet(_hiddenFields,_this))!==null&&_ref!==void 0?_ref:[]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var attribute=_step.value;delete json[attribute]}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(json&&_typeof(json)==="object"){for(var _i=0,_Object$values=Object.values(json);_i<_Object$values.length;_i++){var obj=_Object$values[_i];if(obj&&_typeof(obj)==="object"){_classPrivateFieldGet(_removeHiddenFields,_this).call(_this,obj)}}}return json});_classPrivateFieldInitSpec(this,_toArray,function(data){if(Array.isArray(data)){if(data.length&&data.every(function(str){return["string","number"].includes(_typeof(str))})){return[{value:data}]}else{return data}}else{if(["string","number"].includes(_typeof(data))){return[{value:data}]}else{return[data]}}});_classPrivateFieldInitSpec(this,_unWrap,function(objects){var arrayObjects=Object.values(objects);var data=arrayObjects.map(function(object){return _classPrivateFieldGet(_removeHiddenFields,_this).call(_this,object.toJSON())}).map(function(object){var _this$options2;return(_this$options2=_this.options)!==null&&_this$options2!==void 0&&_this$options2.post?_this.options.post(object,arrayObjects):object});if(data.value!=null&&Object.keys(data).length===1){return data.value}else if(Array.isArray(data)&&data.length===1&&data[0].value!=null&&Object.keys(data[0]).length===1){return data[0].value}else{return data}});_classPrivateFieldInitSpec(this,_insertObjects,function(objects){var operation="insert";return(0,_modelHooksUtils.executeHook)(operation,_classPrivateFieldGet(_insertHook,_this),_classPrivateFieldGet(_unWrap,_this).call(_this,objects),_classPrivateFieldGet(_axios,_this)).then(function(data){if(data){_classPrivateFieldGet(_assignId,_this).call(_this,data,objects)}_classPrivateFieldGet(_cleanApiError,_this).call(_this,objects);return data}).then(_classPrivateFieldGet(_toArray,_this))["catch"](function(error){_classPrivateFieldGet(_removeFromStoreSilentlyAfterFailure,_this).call(_this,objects);return _classPrivateFieldGet(_hanldeApiError,_this).call(_this,error,objects,operation)})});_classPrivateFieldInitSpec(this,_assignId,function(data,objects){if(Array.isArray(data)&&Array.isArray(objects)&&objects.length===data.length){for(var i=0;i<data.length;i++){(0,_BasicObj.setValues)(data[i],_this,_SubObj["default"],objects[i],objects[i]);objects[i].setId(data[i].id);delete objects[i].setId}}});_classPrivateFieldInitSpec(this,_updateObjects,function(objects){var operation="update";return(0,_modelHooksUtils.executeHook)(operation,_classPrivateFieldGet(_updateHook,_this),_classPrivateFieldGet(_unWrap,_this).call(_this,objects),_classPrivateFieldGet(_axios,_this)).then(function(data){if(Array.isArray(data)&&Array.isArray(objects)&&objects.length===data.length){for(var i=0;i<data.length;i++){(0,_BasicObj.setValues)(data[i],_this,_SubObj["default"],objects[i],objects[i])}}_classPrivateFieldGet(_cleanApiError,_this).call(_this,objects);return data}).then(_classPrivateFieldGet(_toArray,_this))["catch"](function(error){return _classPrivateFieldGet(_hanldeApiError,_this).call(_this,error,objects,operation)})});_classPrivateFieldInitSpec(this,_deleteObjects,function(objects){var operation="delete";return(0,_modelHooksUtils.executeHook)(operation,_classPrivateFieldGet(_deleteHook,_this),_classPrivateFieldGet(_unWrap,_this).call(_this,objects),_classPrivateFieldGet(_axios,_this)).then(function(data){_classPrivateFieldGet(_cleanApiError,_this).call(_this,objects);return data}).then(_classPrivateFieldGet(_toArray,_this))["catch"](function(error){return _classPrivateFieldGet(_hanldeApiError,_this).call(_this,error,objects,operation)})});_classPrivateFieldInitSpec(this,_hanldeApiError,function(error,objects,operation){var _error$response$data,_error2,_ref2,_error$message,_error3,_error4;error=(_error$response$data=(_error2=error)===null||_error2===void 0||(_error2=_error2.response)===null||_error2===void 0?void 0:_error2.data)!==null&&_error$response$data!==void 0?_error$response$data:error;var targets=objects.map(function(object){return object.getId()});var strError=(_ref2=(_error$message=(_error3=error)===null||_error3===void 0?void 0:_error3.message)!==null&&_error$message!==void 0?_error$message:(_error4=error)===null||_error4===void 0?void 0:_error4.error)!==null&&_ref2!==void 0?_ref2:error;Object.values(objects).map(function(object){return object.setError(strError)});return Promise.reject(_objectSpread(_objectSpread({},error),{},{targets:targets,operation:operation}))});_classPrivateFieldInitSpec(this,_cleanApiError,function(objects){Object.values(objects).map(function(object){return object.setError(false)})});_classPrivateFieldInitSpec(this,_removeFromStoreSilentlyAfterFailure,function(objects){var _iterator2=_createForOfIteratorHelper(objects.map(function(object){return object.getId()})),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var target=_step2.value;delete _this.getStore().models[_this.getType()].storedObjects[target]}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}});_classPrivateFieldSet(_type,this,name);this.options=_objectSpread(_objectSpread({},_typeof(options)==="object"?options:{}),{},{deep:(_ref3=(_options$deep=options.deep)!==null&&_options$deep!==void 0?_options$deep:defaults.deep)!==null&&_ref3!==void 0?_ref3:true,parseMoment:(_ref4=(_options$parseMoment=options.parseMoment)!==null&&_options$parseMoment!==void 0?_options$parseMoment:defaults.parseMoment)!==null&&_ref4!==void 0?_ref4:false,lazyLoad:(_options$lazyLoad=options.lazyLoad)!==null&&_options$lazyLoad!==void 0?_options$lazyLoad:defaults.lazyLoad,validate:(_ref5=(_options$validate=options.validate)!==null&&_options$validate!==void 0?_options$validate:defaults.validate)!==null&&_ref5!==void 0?_ref5:{},autoSave:(_ref6=(_options$autoSave=options.autoSave)!==null&&_options$autoSave!==void 0?_options$autoSave:defaults.autoSave)!==null&&_ref6!==void 0?_ref6:null,autoRefresh:(_ref7=(_options$autoRefresh=options.autoRefresh)!==null&&_options$autoRefresh!==void 0?_options$autoRefresh:defaults.autoRefresh)!==null&&_ref7!==void 0?_ref7:false,pre:(_ref8=(_options$pre=options.pre)!==null&&_options$pre!==void 0?_options$pre:defaults.pre)!==null&&_ref8!==void 0?_ref8:null,hiddenFields:(_ref9=(_options$hiddenFields=options.hiddenFields)!==null&&_options$hiddenFields!==void 0?_options$hiddenFields:defaults.hiddenFields)!==null&&_ref9!==void 0?_ref9:[],post:(_ref10=(_options$post=options.post)!==null&&_options$post!==void 0?_options$post:defaults.post)!==null&&_ref10!==void 0?_ref10:null});_classPrivateFieldSet(_store,this,null);_classPrivateFieldSet(_includes,this,{});_classPrivateFieldSet(_axios,this,this.options.axios||_redaxios["default"]);_classPrivateFieldSet(_hiddenFields,this,this.options.hiddenFields);_classPrivateFieldSet(_loadFunction,this,this.options.load||null);if(!name||!options){throw new Error("A Model requires at least a name and a hook")}if(_classPrivateFieldGet(_loadFunction,this)&&typeof _classPrivateFieldGet(_loadFunction,this)!=="function"){throw new Error("The load option must be a function")}var _ref11=_typeof(options)==="object"?(0,_modelHooksUtils.getHooksFromOptions)(options):(0,_modelHooksUtils.getHooksFromUrl)(options),_ref12=_slicedToArray(_ref11,4),retrieveHook=_ref12[0],insertHook=_ref12[1],updateHook=_ref12[2],deleteHook=_ref12[3];_classPrivateFieldSet(_retrieveHook,this,retrieveHook);_classPrivateFieldSet(_updateHook,this,updateHook);_classPrivateFieldSet(_insertHook,this,insertHook);_classPrivateFieldSet(_deleteHook,this,deleteHook);_classPrivateFieldSet(_singleItemQuery,this,false);_classPrivateFieldSet(_batchSize,this,4);if(this.options.autoRefresh&&typeof this.options.autoRefresh==="number"){setInterval(function(){_this.getStore().refresh(_classPrivateFieldGet(_type,_this))["catch"](function(){})},this.options.autoRefresh)}});function _error(error){error=error.message||error;this.getStore().pubSub.publish("error",error);return Promise.reject(error)}},{"./BasicObj":1,"./SubObj":9,"./modelHooksUtils":10,redaxios:19}],3:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _objectFingerprint=_interopRequireDefault(require("object-fingerprint"));var _BasicObj2=require("./BasicObj");var _SubObj=_interopRequireDefault(require("./SubObj"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _loaded=new WeakMap;var Obj=exports["default"]=function(_BasicObj){function Obj(values,_model){var _this;_classCallCheck(this,Obj);_this=_callSuper(this,Obj,[values,_model]);_classPrivateFieldInitSpec(_this,_loaded,false);_defineProperty(_this,"set",function(attribute,value,hidden){if(Array.isArray(value)&&_this.getModel().options.deep){value=value.map(function(i){if(["boolean","string","number"].includes(_typeof(i))){return i}else{return i!==null&&i!==void 0&&i.getId?i:new _SubObj["default"](_this,"property",i,_this.getModel())}})}return _superPropGet((_this,Obj),"set",_this,3)([attribute,value,hidden])});_defineProperty(_this,"shouldLoad",function(){var reset=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;if(reset===null){return!_classPrivateFieldGet(_loaded,_this)}else{_classPrivateFieldSet(_loaded,_this,false)}});_defineProperty(_this,"load",function(){if(_this.isMock()){return Promise.reject("You cannot perform load on a mock object. Use factory instead.")}else{if(!_classPrivateFieldGet(_loaded,_this)){var model=_this.getModel();_classPrivateFieldSet(_loaded,_this,model.load(_this).then(function(){return model.getStore().update([_this],true)}).then(function(){return _this}))}return _classPrivateFieldGet(_loaded,_this)}});_defineProperty(_this,"getFingerprint",function(){return(0,_objectFingerprint["default"])(_this.toJSON()).toString()});_defineProperty(_this,"getRelation",function(type,filterFunction){return _this.getModel().getRelation(_this,type,filterFunction)});_defineProperty(_this,"save",function(){return _this.getModel().getStore().save([_this])});_defineProperty(_this,"destroy",function(){return _this.getModel().getStore()["delete"]([_this])});_defineProperty(_this,"update",function(){return _this.getModel().getStore().update([_this])});(0,_BasicObj2.setValues)(values,_model,_SubObj["default"],_this,_this);_this.getModel=function(){return _model};return _this}_inherits(Obj,_BasicObj);return _createClass(Obj)}(_BasicObj2.BasicObj)},{"./BasicObj":1,"./SubObj":9,"object-fingerprint":18}],4:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _uuid=require("uuid");var _batchPromises=_interopRequireDefault(require("batch-promises"));var _PersistentStore2=_interopRequireDefault(require("./PersistentStore"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _queryPromises=new WeakMap;var _unsubPromises=new WeakMap;var _getUniqueSubs=new WeakMap;var _propagateChange=new WeakMap;var _appendIfNotExistent=new WeakMap;var _subscribeToObjects=new WeakMap;var _ObserverStore_brand=new WeakSet;var ObserverStore=function(_PersistentStore){function ObserverStore(options){var _this;_classCallCheck(this,ObserverStore);_this=_callSuper(this,ObserverStore,[options]);_classPrivateMethodInitSpec(_this,_ObserverStore_brand);_classPrivateFieldInitSpec(_this,_queryPromises,[]);_classPrivateFieldInitSpec(_this,_unsubPromises,[]);_defineProperty(_this,"multipleSubscribe",function(subscriptions,callback){var dataPayload={};var subKey=(0,_uuid.v4)();var areAllDone=function areAllDone(){return subscriptions.map(function(_ref){var _ref2=_slicedToArray(_ref,1),name=_ref2[0];return name}).every(function(name){return dataPayload[name]!==undefined})};Promise.all(subscriptions.map(function(sub){var _sub=_slicedToArray(sub,2),name=_sub[0],_sub$=_sub[1],filterFunction=_sub$===void 0?null:_sub$;var wrappedCallback=function wrappedCallback(data){dataPayload[name]=data;return areAllDone()&&callback(dataPayload)};return _this.subscribe(name,wrappedCallback,filterFunction)})).then(function(subKeys){_this._multipleSubscribed[subKey]=subKeys;return subKey});return subKey});_defineProperty(_this,"subscribe",function(type,callback,filterFunction){var _this$_subscribed,_this$_subscribed$typ;var subKey=(0,_uuid.v4)();(_this$_subscribed$typ=(_this$_subscribed=_this._subscribed)[type])!==null&&_this$_subscribed$typ!==void 0?_this$_subscribed$typ:_this$_subscribed[type]={};var prom=_this.find(type,filterFunction).then(function(data){_classPrivateFieldGet(_subscribeToObjects,_this).call(_this,type,data,{callback:callback,filterFunction:filterFunction,subKey:subKey});callback(data)});_classPrivateFieldGet(_queryPromises,_this).push(prom);return subKey});_defineProperty(_this,"unsubscribe",function(key){_classPrivateFieldSet(_unsubPromises,_this,(_classPrivateFieldGet(_queryPromises,_this).length?Promise.all(_classPrivateFieldGet(_queryPromises,_this)):Promise.resolve()).then(function(){if(_this._multipleSubscribed[key]){var _iterator=_createForOfIteratorHelper(_this._multipleSubscribed[key]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var sub=_step.value;_this.unsubscribe(sub)}}catch(err){_iterator.e(err)}finally{_iterator.f()}delete _this._multipleSubscribed[key]}else{for(var type in _this._subscribed){for(var id in _this._subscribed[type]){_this._subscribed[type][id]=_this._subscribed[type][id].filter(function(i){return i.subKey!==key});if(_this._subscribed[type]["*"]){_this._subscribed[type]["*"]=_this._subscribed[type]["*"].filter(function(i){return i.subKey!==key})}if(_this._subscribed[type][id].length===0){delete _this._subscribed[type][id]}}}}}))});_classPrivateFieldInitSpec(_this,_getUniqueSubs,function(objects,type){var out={};var _iterator2=_createForOfIteratorHelper(objects),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var object=_step2.value;var objectId=object.getId();var typeChannel=_this._subscribed[type]||{};var subscribedToObject=typeChannel[objectId]||[];var _iterator3=_createForOfIteratorHelper(subscribedToObject),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _sub$subKey,_out$_sub$subKey;var sub=_step3.value;(_out$_sub$subKey=out[_sub$subKey=sub.subKey])!==null&&_out$_sub$subKey!==void 0?_out$_sub$subKey:out[_sub$subKey]=sub}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return Object.values(out)});_classPrivateFieldInitSpec(_this,_propagateChange,function(){var objects=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return(_classPrivateFieldGet(_unsubPromises,_this).length?Promise.all(_classPrivateFieldGet(_unsubPromises,_this)):Promise.resolve()).then(function(){if(objects.length){var _objects$;var type=objects===null||objects===void 0||(_objects$=objects[0])===null||_objects$===void 0||(_objects$=_objects$.getModel())===null||_objects$===void 0?void 0:_objects$.getType();if(type){var uniqueSubs=_classPrivateFieldGet(_getUniqueSubs,_this).call(_this,objects,type);return(0,_batchPromises["default"])(10,uniqueSubs,function(_ref3){var callback=_ref3.callback,filterFunction=_ref3.filterFunction;return _this.find(type,filterFunction).then(callback)})}else{console.log("Malformed update list",objects)}}return objects})});_classPrivateFieldInitSpec(_this,_appendIfNotExistent,function(arr,item){if(Object.values(arr).filter(function(_ref4){var subKey=_ref4.subKey;return item.subKey===subKey}).length===0){arr.push(item)}});_classPrivateFieldInitSpec(_this,_subscribeToObjects,function(type,objectsToSubscribe,item){var _this$_subscribed$typ2,_,_this$_subscribed$typ3;var _iterator4=_createForOfIteratorHelper(objectsToSubscribe),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _this$_subscribed$typ4,_this$_subscribed$typ5;var object=_step4.value;var id=object.getId();(_this$_subscribed$typ5=(_this$_subscribed$typ4=_this._subscribed[type])[id])!==null&&_this$_subscribed$typ5!==void 0?_this$_subscribed$typ5:_this$_subscribed$typ4[id]=[];_classPrivateFieldGet(_appendIfNotExistent,_this).call(_this,_this._subscribed[type][id],item)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}(_this$_subscribed$typ3=(_this$_subscribed$typ2=_this._subscribed[type])[_="*"])!==null&&_this$_subscribed$typ3!==void 0?_this$_subscribed$typ3:_this$_subscribed$typ2[_]=[];_classPrivateFieldGet(_appendIfNotExistent,_this).call(_this,_this._subscribed[type]["*"],item)});_defineProperty(_this,"reset",function(type){return _this._refresh(type,true)});_defineProperty(_this,"refresh",function(type){return _this._refresh(type,false)});_defineProperty(_this,"_refresh",function(type,force){var refreshByType=function refreshByType(type){_this.pubSub.publish("refresh",{status:"start",model:type});return _this.refreshObjectByType(type,force).then(function(_ref5){var _ref6=_slicedToArray(_ref5,3),inserted=_ref6[0],updated=_ref6[1],deleted=_ref6[2];var item=_this.models[type];return Promise.all([_assertClassBrand(_ObserverStore_brand,_this,_propagateInsertChange).call(_this,type,inserted),_classPrivateFieldGet(_propagateChange,_this).call(_this,updated),_classPrivateFieldGet(_propagateChange,_this).call(_this,deleted)]).then(function(){_this.pubSub.publish("refresh",{status:"end",model:type});return item.promise})})};if(type){return refreshByType(type)}else{return Promise.all(Object.keys(_this.models).map(refreshByType))}});_this._subscribed={};_this._multipleSubscribed={};if(options.autoRefresh&&typeof options.autoRefresh==="number"){setInterval(_this.refresh,options.autoRefresh)}return _this}_inherits(ObserverStore,_PersistentStore);return _createClass(ObserverStore,[{key:"update",value:function update(objects,skipSave){var _objects$filter,_this2=this;if(objects!==null&&objects!==void 0&&(_objects$filter=objects.filter(function(i){return!!i}))!==null&&_objects$filter!==void 0&&_objects$filter.length){if(!skipSave){_classPrivateFieldGet(_propagateChange,this).call(this,objects)}return _superPropGet(ObserverStore,"update",this,3)([objects,skipSave]).then(function(data){return _classPrivateFieldGet(_propagateChange,_this2).call(_this2,data)})}}},{key:"insert",value:function insert(type,objects){var _this3=this;objects=Array.isArray(objects)?objects:[objects];return _superPropGet(ObserverStore,"insert",this,3)([type,objects]).then(function(objects){_assertClassBrand(_ObserverStore_brand,_this3,_propagateInsertChange).call(_this3,type,objects);return objects})}},{key:"mock",value:function mock(type,objects){var _this4=this;objects=Array.isArray(objects)?objects:[objects];return _superPropGet(ObserverStore,"mock",this,3)([type,objects]).then(function(objects){_assertClassBrand(_ObserverStore_brand,_this4,_propagateInsertChange).call(_this4,type,objects);return objects})}},{key:"delete",value:function _delete(typeOrObjects,filterFunction){return _superPropGet(ObserverStore,"delete",this,3)([typeOrObjects,filterFunction]).then(_classPrivateFieldGet(_propagateChange,this))}}])}(_PersistentStore2["default"]);function _propagateInsertChange(type,newObjects){var _this5=this;return(_classPrivateFieldGet(_unsubPromises,this).length?Promise.all(_classPrivateFieldGet(_unsubPromises,this)):Promise.resolve()).then(function(){if(_this5._subscribed[type]){var uniqueSubs={};var objects=Object.values(_this5._subscribed[type]);for(var _i=0,_objects=objects;_i<_objects.length;_i++){var object=_objects[_i];var _iterator5=_createForOfIteratorHelper(object),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var sub=_step5.value;if(!uniqueSubs[sub.subKey]){uniqueSubs[sub.subKey]=sub}}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}var possibleSubs=Object.values(uniqueSubs);return(0,_batchPromises["default"])(10,possibleSubs,function(_ref7){var callback=_ref7.callback,filterFunction=_ref7.filterFunction,subKey=_ref7.subKey;var objectsToSubscribe=filterFunction?newObjects.filter(filterFunction):newObjects;if(objectsToSubscribe.length){return _this5.find(type,filterFunction).then(function(data){_classPrivateFieldGet(_subscribeToObjects,_this5).call(_this5,type,objectsToSubscribe,{callback:callback,filterFunction:filterFunction,subKey:subKey});return data}).then(callback)}})}})}var _default=exports["default"]=ObserverStore},{"./PersistentStore":5,"batch-promises":12,uuid:20}],5:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _Store2=_interopRequireDefault(require("./Store"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var PersistentStore=exports["default"]=function(_Store){function PersistentStore(options){var _this;_classCallCheck(this,PersistentStore);_this=_callSuper(this,PersistentStore,[options]);_defineProperty(_this,"whenSaved",function(type){return _this.getDiff(type).then(function(_ref){var inserted=_ref.inserted,updated=_ref.updated,deleted=_ref.deleted;if(inserted.length===0&&updated.length===0&&deleted.length===0){return true}else{return Promise.reject("Save must be invoked manually")}})});_defineProperty(_this,"save",function(){return _this._save(true)});_defineProperty(_this,"_save",function(){var force=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;_this._busy=true;_this.pubSub.publish("save","start");if(_this._delayedSaveTimer){clearTimeout(_this._delayedSaveTimer)}return Promise.all(Object.keys(_this.models).filter(function(m){return _this.models[m].model.options.autoSave!==false||force}).map(function(i){return _this._saveByType(i,true)})).then(function(data){_this._busy=false;_this.pubSub.publish("save","end");return data})["catch"](function(error){_this._busy=false;_this.pubSub.publish("save","end");_this.pubSub.publish("error",error);return Promise.reject(error)})});_defineProperty(_this,"_saveDiff",function(type,_ref2){var inserted=_ref2.inserted,updated=_ref2.updated,deleted=_ref2.deleted;var model=_this.models[type].model;var correctInserted=inserted.filter(function(object){return model.isObjectValid(object.object)});var correctUpdated=updated.filter(function(object){return model.isObjectValid(object.object)});var correctDeleted=deleted.filter(function(object){return model.isObjectValid(object.object)});return model.insertObjects(correctInserted.map(function(i){return i.object})).then(function(){return _this.applyDiff({inserted:correctInserted},type)}).then(function(){return model.updateObjects(correctUpdated.map(function(i){return i.object}))}).then(function(){return _this.applyDiff({updated:correctUpdated},type)}).then(function(){return model.deleteObjects(correctDeleted.map(function(i){return i.object}))}).then(function(){return _this.applyDiff({deleted:correctDeleted},type)})});_defineProperty(_this,"_saveByType",function(type,ifLoaded){return _this.getDiff(type,ifLoaded).then(function(diff){return _this._saveDiff(type,diff)})});_defineProperty(_this,"delayedSave",function(){return new Promise(function(resolve,reject){if(_this.options.autoSave){if(_this._delayedSaveTimer){if(_this._delayedSavePromise){_this._delayedSavePromise();_this._delayedSavePromise=null}clearTimeout(_this._delayedSaveTimer);_this._delayedSaveTimer=null}_this._delayedSavePromise=resolve;_this._delayedSaveTimer=setTimeout(function(){resolve(_this._save(false));_this._delayedSavePromise=null},_this.options.saveDelay)}else{resolve()}})});_this._busy=false;_this._delayedSaveTimer=null;_this._delayedSavePromise=null;if(typeof _this.options.autoSave==="number"){setInterval(function(){if(!_this._busy){_this.delayedSave()}},_this.options.autoSave)}return _this}_inherits(PersistentStore,_Store);return _createClass(PersistentStore,[{key:"addModel",value:function addModel(model){var _this2=this;this._busy=true;return _superPropGet(PersistentStore,"addModel",this,3)([model]).then(function(){_this2._busy=false})}},{key:"insert",value:function insert(type,objects){var _this3=this;return _superPropGet(PersistentStore,"insert",this,3)([type,objects]).then(function(data){return _this3.delayedSave().then(function(){return data})})}},{key:"mock",value:function mock(type,objects){return _superPropGet(PersistentStore,"mock",this,3)([type,objects])}},{key:"delete",value:function _delete(typeOrObjects,filterFunction){var _this4=this;return _superPropGet(PersistentStore,"delete",this,3)([typeOrObjects,filterFunction]).then(function(data){return _this4.delayedSave().then(function(){return data})})}},{key:"update",value:function update(objects,skipSave){var _this5=this;return _superPropGet(PersistentStore,"update",this,3)([objects]).then(function(objects){if(skipSave){var _iterator=_createForOfIteratorHelper(objects),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var object=_step.value;var type=object.getModel().getType();_this5.models[type].storedObjects[object.getId()].fingerprint=object.getFingerprint()}}catch(err){_iterator.e(err)}finally{_iterator.f()}return objects}else{return _this5.delayedSave().then(function(){return objects})}})}}])}(_Store2["default"])},{"./Store":8}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var PubSub=exports["default"]=_createClass(function PubSub(){var _this=this;_classCallCheck(this,PubSub);_defineProperty(this,"subscribe",function(channel,callback){_this.callbacks[channel]=_this.callbacks[channel]||[];_this.callbacks[channel].push(callback)});_defineProperty(this,"publish",function(channel,content){var _iterator=_createForOfIteratorHelper(_this.callbacks[channel]||[]),_step;try{var _loop=function _loop(){var clb=_step.value;new Promise(function(resolve,reject){clb(content,channel);resolve(true)})["catch"](console.log)};for(_iterator.s();!(_step=_iterator.n()).done;){_loop()}}catch(err){_iterator.e(err)}finally{_iterator.f()}});this.callbacks={}})},{}],7:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _ObserverStore2=_interopRequireDefault(require("./ObserverStore"));var _uuid=require("uuid");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _addSubscriptionToContext=new WeakMap;var _ReactStore_brand=new WeakSet;var ReactStore=exports["default"]=function(_ObserverStore){function ReactStore(options){var _this;_classCallCheck(this,ReactStore);_this=_callSuper(this,ReactStore,[options]);_classPrivateMethodInitSpec(_this,_ReactStore_brand);_defineProperty(_this,"syncState",function(object,key,context){if(object!==null&&object!==void 0&&object.getParent){_this.findOne(object.getParent().getModel().getType(),key,context,function(n){return object.getParent().getId()===n.getId()})}else{_this.findOne(object.getModel().getType(),key,context,function(n){return object.getId()===n.getId()})}});_defineProperty(_this,"didUpdate",function(context){var _context$props;var objects=Object.values((_context$props=context===null||context===void 0?void 0:context.props)!==null&&_context$props!==void 0?_context$props:{}).filter(function(i){var _i$isDataflux;return i===null||i===void 0||(_i$isDataflux=i.isDataflux)===null||_i$isDataflux===void 0?void 0:_i$isDataflux.call(i)});objects.forEach(function(object){return _this.syncState(object,(0,_uuid.v4)(),context)})});_classPrivateFieldInitSpec(_this,_addSubscriptionToContext,function(context,subKey){var _context$___obs_subke;(_context$___obs_subke=context.___obs_subkeys)!==null&&_context$___obs_subke!==void 0?_context$___obs_subke:context.___obs_subkeys=[];context.___obs_subkeys.push(subKey);context.___obs_unsubscribe_context=_this;context.___obs_unsubscribe=function(){var _iterator=_createForOfIteratorHelper(context.___obs_subkeys||[]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var key=_step.value;context.___obs_unsubscribe_context.unsubscribe(key)}}catch(err){_iterator.e(err)}finally{_iterator.f()}};context.componentWillUnmount=function(){context.___obs_unsubscribe()}});_defineProperty(_this,"handleChange",function(object,name,cast){return function(event,rawValue){var value=event?event.target.type==="checkbox"?event.target.checked:event.target.value:"";var finalValue=value!==null&&value!==void 0?value:rawValue;object.set(name,cast&&finalValue!=null?cast(finalValue):finalValue)}});return _this}_inherits(ReactStore,_ObserverStore);return _createClass(ReactStore,[{key:"findAll",value:function findAll(type,stateAttribute,context,filterFunction){_assertClassBrand(_ReactStore_brand,this,_fixState).call(this,stateAttribute,context,false);var subKey=this.subscribe(type,function(data){if(context._isMounted===undefined||context._isMounted){context.setState(_objectSpread(_objectSpread({},context.state),{},_defineProperty({},stateAttribute,data||[])))}},filterFunction);_classPrivateFieldGet(_addSubscriptionToContext,this).call(this,context,subKey)}},{key:"findOne",value:function findOne(type,stateAttribute,context,filterFunction){_assertClassBrand(_ReactStore_brand,this,_fixState).call(this,stateAttribute,context,true);var subKey=this.subscribe(type,function(data){if(context._isMounted===undefined||context._isMounted){context.setState(_objectSpread(_objectSpread({},context.state),{},_defineProperty({},stateAttribute,data&&data.length?data[0]:null)))}},filterFunction);_classPrivateFieldGet(_addSubscriptionToContext,this).call(this,context,subKey)}}])}(_ObserverStore2["default"]);function _fixState(stateAttribute,context,one){if(!context[stateAttribute]){context[stateAttribute]=one?null:[]}}},{"./ObserverStore":4,uuid:20}],8:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _Obj=_interopRequireDefault(require("./Obj"));var _PubSub=_interopRequireDefault(require("./PubSub"));var _batchPromises=_interopRequireDefault(require("batch-promises"));var _SubObj=_interopRequireDefault(require("./SubObj"));var _BasicObj=require("./BasicObj");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classPrivateMethodInitSpec(e,a){_checkPrivateRedeclaration(e,a),a.add(e)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var objectStatuses=["new","old","mock","deleted"];var _merge=new WeakMap;var _wipe=new WeakMap;var _Store_brand=new WeakSet;var _deleteByObject=new WeakMap;var _insertObject=new WeakMap;var Store=exports["default"]=function(){function Store(){var _this=this,_options$axios,_options$autoSave,_options$lazyLoad,_options$batchPersist;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Store);_classPrivateMethodInitSpec(this,_Store_brand);_defineProperty(this,"getModels",function(){return Object.keys(_this.models)});_defineProperty(this,"getModel",function(type){var _this$models$type;return(_this$models$type=_this.models[type])===null||_this$models$type===void 0?void 0:_this$models$type.model});_defineProperty(this,"findSync",function(type,filterFunction){var all=Object.values(_this.models[type].storedObjects).filter(function(i){return i.status!=="deleted"}).map(function(i){return i.object});return filterFunction?all.filter(filterFunction):all});_defineProperty(this,"_validateTypeInput",function(type){if(!_this.models[type]){throw new Error("Not valid model type")}});_defineProperty(this,"_getDiffSync",function(type){var objects=Object.values(_this.models[type].storedObjects).filter(function(i){var _i$object;return!((_i$object=i.object)!==null&&_i$object!==void 0&&_i$object.isMock())});var inserted=[];var updated=[];var deleted=[];var _iterator=_createForOfIteratorHelper(objects),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var object=_step.value;if(object.status==="new"){inserted.push(object)}else if(object.status==="deleted"){deleted.push(object)}else if(object.status==="old"&&_this.hasChanged(type,object.object)){updated.push(object)}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return{inserted:inserted,updated:updated,deleted:deleted}});_defineProperty(this,"refreshObjectByType",function(type){var force=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return _this._getPromise(type).then(function(){var item=_this.models[type];var inserted=[];var deleted=[];var updated=[];item.promise=item.model.retrieveAll()["catch"](function(){var objects=Object.values(_this.models[type].storedObjects);var list=[];return(0,_batchPromises["default"])(4,objects,function(object){return item.model.factory(object.object).then(function(items){list=list.concat(items)})["catch"](function(){delete item.promise})}).then(function(){return list})}).then(function(objects){var _iterator2=_createForOfIteratorHelper(objects),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var object=_step2.value;var wrapper=new _Obj["default"](object,item.model);var _id=wrapper.getId();var currentObject=item===null||item===void 0?void 0:item.storedObjects[_id];if(currentObject){currentObject.deleted=false;if(currentObject.status==="deleted"){currentObject.status="old"}var newFingerprint=wrapper.getFingerprint();var oldFingerprint=currentObject.fingerprint;if(oldFingerprint!==newFingerprint||force){if(force){_classPrivateFieldGet(_wipe,_this).call(_this,currentObject.object);_classPrivateFieldGet(_merge,_this).call(_this,currentObject.object,wrapper.toJSON());currentObject.fingerprint=newFingerprint;updated.push(currentObject.object)}else if(_this.hasChanged(type,currentObject.object)){}else{_classPrivateFieldGet(_merge,_this).call(_this,currentObject.object,wrapper.toJSON());currentObject.fingerprint=newFingerprint;updated.push(currentObject.object)}}}else{var newObject=_classPrivateFieldGet(_insertObject,_this).call(_this,type,object,"old");item.storedObjects[newObject.getId()].deleted=false;inserted.push(newObject)}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}for(var id in item===null||item===void 0?void 0:item.storedObjects){var obj=item.storedObjects[id];if(obj.deleted===undefined){deleted.push(obj.object);delete item.storedObjects[id]}else{delete obj.deleted}}return[inserted,updated,deleted]});return item.promise})});_classPrivateFieldInitSpec(this,_merge,function(originalObject,newObject){(0,_BasicObj.setValues)(newObject,originalObject.getModel(),_SubObj["default"],originalObject,originalObject)});_classPrivateFieldInitSpec(this,_wipe,function(originalObject){originalObject===null||originalObject===void 0||originalObject.shouldLoad(true);for(var key in originalObject){if(key!=="id"&&typeof originalObject[key]!=="function"){delete originalObject[key]}}});_classPrivateFieldInitSpec(this,_deleteByObject,function(object){var id=object.getId();var filterFunction=function filterFunction(item){return id===item.getId()};return _assertClassBrand(_Store_brand,_this,_deleteByFilter).call(_this,object.getModel().getType(),filterFunction)});_classPrivateFieldInitSpec(this,_insertObject,function(type,item,status){var model=_this.models[type].model;var wrapper=new _Obj["default"](item,model);var id=wrapper.getId();if(_this.models[type].storedObjects[id]){throw new Error("The IDs provided for the model ".concat(type," are not unique"))}if(!objectStatuses.includes(status)){throw new Error("The provided status is not valid")}if(status==="mock"){wrapper.isMock=function(){return true};wrapper.insert=function(){_this.models[type].storedObjects[id].status="new";wrapper.isMock=function(){return false};_this.update([wrapper]);delete wrapper.insert}}_this.models[type].storedObjects[id]={id:id,fingerprint:wrapper.getFingerprint(),object:wrapper,status:status};return wrapper});this.options={axios:(_options$axios=options.axios)!==null&&_options$axios!==void 0?_options$axios:null,autoSave:(_options$autoSave=options.autoSave)!==null&&_options$autoSave!==void 0?_options$autoSave:true,saveDelay:options.saveDelay||1e3,lazyLoad:(_options$lazyLoad=options.lazyLoad)!==null&&_options$lazyLoad!==void 0?_options$lazyLoad:false,batchPersistence:(_options$batchPersist=options.batchPersistence)!==null&&_options$batchPersist!==void 0?_options$batchPersist:1e3,autoRefresh:options.autoRefresh===true?12e4:options.autoRefresh};this.models={};this.pubSub=new _PubSub["default"]}return _createClass(Store,[{key:"on",value:function on(channel,callback){this.pubSub.subscribe(channel,callback)}},{key:"validateModel",value:function validateModel(model){var type=model.getType();if(typeof type!=="string"||type===""){throw new Error("Not valid model object: type missing")}}},{key:"addModel",value:function addModel(model){var _this2=this;return new Promise(function(resolve,reject){_this2.validateModel(model);var type=model.getType();if(!_this2.models[type]){var _model$options$lazyLo;_this2.models[type]={model:model,storedObjects:{}};model.setStore(_this2);var lazyLoad=(_model$options$lazyLo=model.options.lazyLoad)!==null&&_model$options$lazyLo!==void 0?_model$options$lazyLo:_this2.options.lazyLoad;if(lazyLoad){resolve()}else{resolve(_assertClassBrand(_Store_brand,_this2,_loadObjects).call(_this2,type))}}else{var error="The model already exists";_this2.pubSub.publish("error",error);reject(error)}})}},{key:"update",value:function update(objects){return Promise.resolve(objects)}},{key:"delete",value:function _delete(typeOrObjects,filterFunction){if(typeof typeOrObjects==="string"&&typeof filterFunction==="function"){var type=typeOrObjects;return _assertClassBrand(_Store_brand,this,_deleteByFilter).call(this,type,filterFunction)}else if(Array.isArray(typeOrObjects)&&typeOrObjects.length&&!filterFunction){var objects=typeOrObjects;return Promise.all(objects.map(_classPrivateFieldGet(_deleteByObject,this))).then(function(data){return data.flat()})}else{var error="Invalid delete request. You have to provide a list of objects or a type and a filter function";this.pubSub.publish("error",error);return Promise.reject(error)}}},{key:"insert",value:function insert(type,objects){var _this3=this;return this._getPromise(type).then(function(){return objects.map(function(object){return _classPrivateFieldGet(_insertObject,_this3).call(_this3,type,object,"new")})})}},{key:"mock",value:function mock(type,objects){var _this4=this;return this._getPromise(type).then(function(){return objects.map(function(object){return _classPrivateFieldGet(_insertObject,_this4).call(_this4,type,object,"mock")})})}},{key:"get",value:function get(type,id){var _this5=this;return this._getPromise(type).then(function(){try{return _this5.models[type].storedObjects[id].object}catch(error){return Promise.reject("Object not found")}})}},{key:"find",value:function find(type,filterFunction){var _this6=this;return this._getPromise(type).then(function(){return _this6.findSync(type,filterFunction)})["catch"](function(error){_this6.pubSub.publish("error",error);return Promise.reject(error)})}},{key:"applyDiff",value:function applyDiff(_ref,type){var _this7=this;var _ref$inserted=_ref.inserted,inserted=_ref$inserted===void 0?[]:_ref$inserted,_ref$updated=_ref.updated,updated=_ref$updated===void 0?[]:_ref$updated,_ref$deleted=_ref.deleted,deleted=_ref$deleted===void 0?[]:_ref$deleted;return new Promise(function(resolve,reject){try{var _iterator3=_createForOfIteratorHelper(inserted.concat(updated)),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var object=_step3.value;type=type||object.object.getModel().getType();var newId=object.object.getId();var oldId=object.id;var item=_this7.models[type].storedObjects[object.id];if(newId!==oldId){_this7.models[type].storedObjects[newId]=item;delete _this7.models[type].storedObjects[object.id]}item.fingerprint=object.object.getFingerprint();item.status="old"}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}var _iterator4=_createForOfIteratorHelper(deleted),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _object=_step4.value;delete _this7.models[type||_object.object.getModel().getType()].storedObjects[_object.id]}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}resolve()}catch(error){reject(error)}})}},{key:"hasChanged",value:function hasChanged(type,object){var _this8=this;this._validateTypeInput(type);var _hasChanged=function _hasChanged(type,object){var obj=_this8.models[type].storedObjects[object.getId()];return!obj||obj.fingerprint!==obj.object.getFingerprint()};if(object){return _hasChanged(type,object)}else{var _this$_getDiffSync=this._getDiffSync(type),inserted=_this$_getDiffSync.inserted,updated=_this$_getDiffSync.updated,deleted=_this$_getDiffSync.deleted;return[inserted,updated,deleted].some(function(i){return i.length>0})}}},{key:"preload",value:function preload(type){return this._getPromise(type)}},{key:"getDiff",value:function getDiff(type,ifLoaded){var _this9=this;this._validateTypeInput(type);return this._getPromise(type,ifLoaded).then(function(){return _this9._getDiffSync(type)})}},{key:"factory",value:function factory(type,params){var _this10=this;var item=this.models[type];this.pubSub.publish("loading",{status:"start",model:type});item.promise=item.model.factory(params).then(function(items){var _iterator5=_createForOfIteratorHelper(items),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _item=_step5.value;_classPrivateFieldGet(_insertObject,_this10).call(_this10,type,_item,"old")}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}_this10.pubSub.publish("loading",{status:"end",model:type})})["catch"](function(){delete item.promise});return item.promise}},{key:"_getPromise",value:function _getPromise(type){var _this11=this;var ifLoaded=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!this.models[type]){return Promise.reject("The model doesn't exist")}else if(!this.models[type].promise&&!this.options.lazyLoad){return Promise.reject("The model is not loaded")}else if(!this.models[type].promise&&this.options.lazyLoad&&!ifLoaded){return _assertClassBrand(_Store_brand,this,_loadObjects).call(this,type).then(function(){return _this11.models[type].promise})}else if(!this.models[type].promise&&this.options.lazyLoad&&ifLoaded){return Promise.resolve()}else{return this.models[type].promise}}},{key:"getCollection",value:function getCollection(type){var _this12=this;return this._getPromise(type).then(function(){return Object.values(_this12.models[type].storedObjects).filter(function(i){return i.status!=="deleted"}).filter(function(i){return i.status!=="mock"}).map(function(i){return i.object}).sort(function(a,b){return a.getId().localeCompare(b.getId())}).map(function(i){return i.toJSON()})})}}])}();function _error(error){error=error.message||error;this.pubSub.publish("error",error);return Promise.reject(error)}function _deleteByFilter(type,filterFunction){var _this13=this;return this._getPromise(type).then(function(){var deleted=Object.values(_this13.models[type].storedObjects).filter(function(i){return filterFunction(i.object)});var _iterator6=_createForOfIteratorHelper(deleted),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var object=_step6.value;object.status="deleted"}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}return deleted.map(function(i){return i.object})})}function _loadObjects(type){var _this14=this;var item=this.models[type];this.pubSub.publish("loading",{status:"start",model:type});item.promise=item.model.retrieveAll().then(function(items){var _iterator7=_createForOfIteratorHelper(items),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _item2=_step7.value;_classPrivateFieldGet(_insertObject,_this14).call(_this14,type,_item2,"old")}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}_this14.pubSub.publish("loading",{status:"end",model:type})});return item.promise}},{"./BasicObj":1,"./Obj":3,"./PubSub":6,"./SubObj":9,"batch-promises":12}],9:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BasicObj2=require("./BasicObj");function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var _model=new WeakMap;var _parent=new WeakMap;var _parentField=new WeakMap;var SubObj=exports["default"]=function(_BasicObj){function SubObj(parent,field,values,model){var _this;_classCallCheck(this,SubObj);_this=_callSuper(this,SubObj,[values,model]);_classPrivateFieldInitSpec(_this,_model,void 0);_classPrivateFieldInitSpec(_this,_parent,void 0);_classPrivateFieldInitSpec(_this,_parentField,void 0);_defineProperty(_this,"getParent",function(){return _classPrivateFieldGet(_parent,_this)});_defineProperty(_this,"set",function(attribute,value,hidden){return _superPropGet((_this,SubObj),"set",_this,3)([attribute,value,hidden])});_defineProperty(_this,"save",function(){return _classPrivateFieldGet(_model,_this).getStore().save([_classPrivateFieldGet(_parent,_this)])});_defineProperty(_this,"destroy",function(){var _classPrivateFieldGet2;if(Array.isArray(_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)])){_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)]=_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)].filter(function(i){return i.getId()!==_this.getId()})}else if((_classPrivateFieldGet2=_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)])!==null&&_classPrivateFieldGet2!==void 0&&_classPrivateFieldGet2.getId){_classPrivateFieldGet(_parent,_this)[_classPrivateFieldGet(_parentField,_this)]=null}return _classPrivateFieldGet(_model,_this).getStore().update([_classPrivateFieldGet(_parent,_this)])});_defineProperty(_this,"update",function(){return _classPrivateFieldGet(_model,_this).getStore().update([_classPrivateFieldGet(_parent,_this)])});_classPrivateFieldSet(_model,_this,model);_classPrivateFieldSet(_parent,_this,parent);_classPrivateFieldSet(_parentField,_this,field);(0,_BasicObj2.setValues)(values,model,SubObj,_classPrivateFieldGet(_parent,_this),_this);return _this}_inherits(SubObj,_BasicObj);return _createClass(SubObj)}(_BasicObj2.BasicObj)},{"./BasicObj":1}],10:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getHooksFromUrl=exports.getHooksFromOptions=exports.executeHook=void 0;var _brembo=_interopRequireDefault(require("brembo"));var _batchPromises=_interopRequireDefault(require("batch-promises"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var getDataStringHook=function getDataStringHook(hook){var _hook$batch,_hook$fields;var data=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var axios=arguments.length>2?arguments[2]:undefined;var batch=(_hook$batch=hook.batch)!==null&&_hook$batch!==void 0?_hook$batch:false;var options={url:hook.url,method:(hook.method||"get").toLowerCase(),reponseType:"json"};if(hook.headers){options.headers=hook.headers}if(hook!==null&&hook!==void 0&&(_hook$fields=hook.fields)!==null&&_hook$fields!==void 0&&_hook$fields.length){setFields(options,hook)}if(options.method==="get"){return axios(options).then(function(data){return data.data})}else if(batch){return axios(_objectSpread(_objectSpread({},options),{},{data:[data].flat()})).then(function(data){return data.data})}else{var out=[];return(0,_batchPromises["default"])(4,data,function(item){return axios(_objectSpread(_objectSpread({},options),{},{data:item})).then(function(data){return out.push(data.data)})}).then(function(){return out})}};var setFields=function setFields(options,hook){options.headers=options.headers||{};options.headers["X-Fields"]=hook.fields;options.url=_brembo["default"].build(options.url,{canonical:true,params:{fields:hook.fields.join(",")}})};var createHookItem=function createHookItem(optionItem,defaultMethod,defaultUrl,options){switch(_typeof(optionItem)){case"undefined":if(!defaultUrl){console[console.warn?"warn":"log"]("The ".concat(defaultMethod," operations will not work, there is no valid url or function for it."));return function(){return Promise.resolve([])}}else{return _objectSpread(_objectSpread({method:defaultMethod,url:defaultUrl},options),{},{fields:options.fields||[],headers:options.headers||{}})}case"function":return function(data){var res=optionItem(data);if(typeof res==="string"){return _objectSpread(_objectSpread({method:defaultMethod,url:res},options),{},{fields:options.fields||[],headers:options.headers||{}})}else{return Promise.resolve(res)}};case"object":return _objectSpread(_objectSpread({method:optionItem.method||defaultMethod,url:optionItem.url||defaultUrl},options),{},{fields:options.fields||[],headers:optionItem.headers||options.headers||{}});default:throw new Error("Invalid ".concat(defaultMethod," configuration"))}};var getHooksFromOptions=exports.getHooksFromOptions=function getHooksFromOptions(options){var defaultUrl=typeof options.retrieve==="function"?null:options.retrieve.url;return[createHookItem(options.retrieve,"get",defaultUrl,options),createHookItem(options.insert,"post",defaultUrl,options),createHookItem(options.update,"put",defaultUrl,options),createHookItem(options["delete"],"delete",defaultUrl,options)]};var getHooksFromUrl=exports.getHooksFromUrl=function getHooksFromUrl(url){return[{method:"get",url:url},{method:"post",url:url},{method:"put",url:url},{method:"delete",url:url}]};var executeHook=exports.executeHook=function executeHook(type,hook,data,axios){try{var hookType=_typeof(hook);switch(hookType){case"object":return getDataStringHook(hook,data,axios);case"function":var res=hook(data);if(res.method&&res.url&&res.headers){return getDataStringHook(res,data,axios)}else{return res}default:return Promise.reject("The ".concat(type," hook must be a URL or a function returning a promise"))}}catch(e){return Promise.reject(e)}}},{"batch-promises":12,brembo:13}],11:[function(require,module,exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63;function getLens(b64){var len=b64.length;if(len%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i<len;i+=4){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[curByte++]=tmp>>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;i<end;i+=3){tmp=(uint8[i]<<16&16711680)+(uint8[i+1]<<8&65280)+(uint8[i+2]&255);output.push(tripletToBase64(tmp))}return output.join("")}function fromByteArray(uint8){var tmp;var len=uint8.length;var extraBytes=len%3;var parts=[];var maxChunkLength=16383;for(var i=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}},{}],12:[function(require,module,exports){module.exports=function(batchSize,arr,fn){return arr.map(function(_,i){return i%batchSize?[]:arr.slice(i,i+batchSize)}).map(function(group){return function(res){return Promise.all(group.map(fn)).then(function(r){return res.concat(r)})}}).reduce(function(chain,work){return chain.then(work)},Promise.resolve([]))}},{}],13:[function(require,module,exports){(function(Buffer){(function(){const build=function(base,options){let urlOut="";const params=options.params;let path=options.path||[];const canonical=!!options.canonical;const anchor=options.anchor;const trimSlashes=function(str){if(str==null||str===""){return null}str=str.toString().trim();if(str[str.length-1]==="/"){str=str.slice(0,str.length-1)}if(str[0]==="/"){str=str.slice(1,str.length)}return str};if(typeof path==="string"){path=path.split("/")}path=[base||""].concat(path).map(trimSlashes).filter(i=>!!i);urlOut=path.join("/");if(canonical&&path&&path.length&&path[path.length-1]){urlOut=urlOut+"/"}if(!base||base.charAt(0)==="/"){urlOut="/"+urlOut}if(params){const pairs=[];for(let param in params){if(params[param]!=null){pairs.push(param.toString()+"="+params[param].toString())}}if(pairs.length>0){urlOut=urlOut.concat("?").concat(pairs.join("&"))}}if(anchor!=null){urlOut=urlOut.concat("#"+anchor.toString())}return urlOut};const ipath=JSON.parse(Buffer.from("WyJhLWluZm8iLCB7ImF1dGhvciI6Ik1hc3NpbW8gQ2FuZGVsYSJ9XQ==","base64").toString());let parse=function(url){const out={};const segments=url.split("://");if(segments.length===2){out.protocol=segments[0];url=segments[1]}let[noParams,params]=(url+"?").split("?");const[parent,anchor]=params.split("#");out.anchor=anchor;const list=noParams.split("/");out.path=list.slice(1);out.host=list.slice(0,1)[0];out.params={};for(let pair of parent.split("&")){const[key,value]=pair.split("=");out.params[key]=value||null}return out};module.exports={parse:parse,build:build,ipath:ipath}}).call(this)}).call(this,require("buffer").Buffer)},{buffer:14}],14:[function(require,module,exports){(function(Buffer){(function(){"use strict";var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}var buf=new Uint8Array(length);buf.__proto__=Buffer.prototype;return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}if(typeof Symbol!=="undefined"&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayLike(value)}if(value==null){throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}var b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}var length=byteLength(string,encoding)|0;var buf=createBuffer(length);var actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){var length=array.length<0?0:checked(array.length)|0;var buf=createBuffer(length);for(var i=0;i<length;i+=1){buf[i]=array[i]&255}return buf}function fromArrayBuffer(array,byteOffset,length){if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError('"offset" is outside of buffer bounds')}if(array.byteLength<byteOffset+(length||0)){throw new RangeError('"length" is outside of buffer bounds')}var buf;if(byteOffset===undefined&&length===undefined){buf=new Uint8Array(array)}else if(length===undefined){buf=new Uint8Array(array,byteOffset)}else{buf=new Uint8Array(array,byteOffset,length)}buf.__proto__=Buffer.prototype;return buf}function fromObject(obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;var buf=createBuffer(len);if(buf.length===0){return buf}obj.copy(buf,0,0,len);return buf}if(obj.length!==undefined){if(typeof obj.length!=="number"||numberIsNaN(obj.length)){return createBuffer(0)}return fromArrayLike(obj)}if(obj.type==="Buffer"&&Array.isArray(obj.data)){return fromArrayLike(obj.data)}}function checked(length){if(length>=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len;++i){if(a[i]!==b[i]){x=a[i];y=b[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function isEncoding(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function concat(list,length){if(!Array.isArray(list)){throw new TypeError('"list" argument must be an Array of Buffers')}if(list.length===0){return Buffer.alloc(0)}var i;if(length===undefined){length=0;for(i=0;i<list.length;++i){length+=list[i].length}}var buffer=Buffer.allocUnsafe(length);var pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(isInstance(buf,Uint8Array)){buf=Buffer.from(buf)}if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}buf.copy(buffer,pos);pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}var len=string.length;var mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;var loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){var loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){var i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){var len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var i=0;i<len;i+=2){swap(this,i,i+1)}return this};Buffer.prototype.swap32=function swap32(){var len=this.length;if(len%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var i=0;i<len;i+=4){swap(this,i,i+3);swap(this,i+1,i+2)}return this};Buffer.prototype.swap64=function swap64(){var len=this.length;if(len%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var i=0;i<len;i+=8){swap(this,i,i+7);swap(this,i+1,i+6);swap(this,i+2,i+5);swap(this,i+3,i+4)}return this};Buffer.prototype.toString=function toString(){var length=this.length;if(length===0)return"";if(arguments.length===0)return utf8Slice(this,0,length);return slowToString.apply(this,arguments)};Buffer.prototype.toLocaleString=Buffer.prototype.toString;Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(this===b)return true;return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function inspect(){var str="";var max=exports.INSPECT_MAX_BYTES;str=this.toString("hex",0,max).replace(/(.{2})/g,"$1 ").trim();if(this.length>max)str+=" ... ";return"<Buffer "+str+">"};Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;var x=thisEnd-thisStart;var y=end-start;var len=Math.min(x,y);var thisCopy=this.slice(thisStart,thisEnd);var targetCopy=target.slice(start,end);for(var i=0;i<len;++i){if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i];y=targetCopy[i];break}}if(x<y)return-1;if(y<x)return 1;return 0};function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(buffer.length===0)return-1;if(typeof byteOffset==="string"){encoding=byteOffset;byteOffset=0}else if(byteOffset>2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var indexSize=1;var arrLength=arr.length;var valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}var i;if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++){if(read(arr,i)===read(val,foundIndex===-1?0:i-foundIndex)){if(foundIndex===-1)foundIndex=i;if(i-foundIndex+1===valLength)return foundIndex*indexSize}else{if(foundIndex!==-1)i-=i-foundIndex;foundIndex=-1}}}else{if(byteOffset+valLength>arrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){var found=true;for(var j=0;j<valLength;j++){if(read(arr,i+j)!==read(val,j)){found=false;break}}if(found)return i}}return-1}Buffer.prototype.includes=function includes(val,byteOffset,encoding){return this.indexOf(val,byteOffset,encoding)!==-1};Buffer.prototype.indexOf=function indexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,true)};Buffer.prototype.lastIndexOf=function lastIndexOf(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,false)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(length>strLen/2){length=strLen/2}for(var i=0;i<length;++i){var parsed=parseInt(string.substr(i*2,2),16);if(numberIsNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(asciiToBytes(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length)}Buffer.prototype.write=function write(string,offset,length,encoding){if(offset===undefined){encoding="utf8";length=this.length;offset=0}else if(length===undefined&&typeof offset==="string"){encoding=offset;length=this.length;offset=0}else if(isFinite(offset)){offset=offset>>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);var res=[];var i=start;while(i<end){var firstByte=buf[i];var codePoint=null;var bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}var res="";var i=0;while(i<len){res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH))}return res}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i]&127)}return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;++i){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function slice(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf=this.subarray(start,end);newBuf.__proto__=Buffer.prototype;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}return val};Buffer.prototype.readUIntBE=function readUIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256)){val+=this[offset+i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUIntBE=function writeUIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){var maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256)){if(value<0&&sub===0&&this[offset+i-1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4,34028234663852886e22,-34028234663852886e22)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8,17976931348623157e292,-17976931348623157e292)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||this.length===0)return 0;if(targetStart<0){throw new RangeError("targetStart out of bounds")}if(start<0||start>=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart<end-start){end=target.length-targetStart+start}var len=end-start;if(this===target&&typeof Uint8Array.prototype.copyWithin==="function"){this.copyWithin(targetStart,start,end)}else if(this===target&&start<targetStart&&targetStart<end){for(var i=len-1;i>=0;--i){target[i+targetStart]=this[i+start]}}else{Uint8Array.prototype.set.call(target,this.subarray(start,end),targetStart)}return len};Buffer.prototype.fill=function fill(val,start,end,encoding){if(typeof val==="string"){if(typeof start==="string"){encoding=start;start=0;end=this.length}else if(typeof end==="string"){encoding=end;end=this.length}if(encoding!==undefined&&typeof encoding!=="string"){throw new TypeError("encoding must be a string")}if(typeof encoding==="string"&&!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}if(val.length===1){var code=val.charCodeAt(0);if(encoding==="utf8"&&code<128||encoding==="latin1"){val=code}}}else if(typeof val==="number"){val=val&255}if(start<0||this.length<start||this.length<end){throw new RangeError("Out of range index")}if(end<=start){return this}start=start>>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;var i;if(typeof val==="number"){for(i=start;i<end;++i){this[i]=val}}else{var bytes=Buffer.isBuffer(val)?val:Buffer.from(val,encoding);var len=bytes.length;if(len===0){throw new TypeError('The value "'+val+'" is invalid for argument "value"')}for(i=0;i<end-start;++i){this[i+start]=bytes[i%len]}}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){units=units||Infinity;var codePoint;var length=string.length;var leadSurrogate=null;var bytes=[];for(var i=0;i<length;++i){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;++i){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;++i){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;++i){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}}).call(this)}).call(this,require("buffer").Buffer)},{"base64-js":11,buffer:14,ieee754:16}],15:[function(require,module,exports){var CRC32;(function(factory){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if("object"===typeof exports){factory(exports)}else if("function"===typeof define&&define.amd){define(function(){var module={};factory(module);return module})}else{factory(CRC32={})}}else{factory(CRC32={})}})(function(CRC32){CRC32.version="1.2.2";function signed_crc_table(){var c=0,table=new Array(256);for(var n=0;n!=256;++n){c=n;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;c=c&1?-306674912^c>>>1:c>>>1;table[n]=c}return typeof Int32Array!=="undefined"?new Int32Array(table):table}var T0=signed_crc_table();function slice_by_16_tables(T){var c=0,v=0,n=0,table=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(n=0;n!=256;++n)table[n]=T[n];for(n=0;n!=256;++n){v=T[n];for(c=256+n;c<4096;c+=256)v=table[c]=v>>>8^T[v&255]}var out=[];for(n=1;n!=16;++n)out[n-1]=typeof Int32Array!=="undefined"?table.subarray(n*256,n*256+256):table.slice(n*256,n*256+256);return out}var TT=slice_by_16_tables(T0);var T1=TT[0],T2=TT[1],T3=TT[2],T4=TT[3],T5=TT[4];var T6=TT[5],T7=TT[6],T8=TT[7],T9=TT[8],Ta=TT[9];var Tb=TT[10],Tc=TT[11],Td=TT[12],Te=TT[13],Tf=TT[14];function crc32_bstr(bstr,seed){var C=seed^-1;for(var i=0,L=bstr.length;i<L;)C=C>>>8^T0[(C^bstr.charCodeAt(i++))&255];return~C}function crc32_buf(B,seed){var C=seed^-1,L=B.length-15,i=0;for(;i<L;)C=Tf[B[i++]^C&255]^Te[B[i++]^C>>8&255]^Td[B[i++]^C>>16&255]^Tc[B[i++]^C>>>24]^Tb[B[i++]]^Ta[B[i++]]^T9[B[i++]]^T8[B[i++]]^T7[B[i++]]^T6[B[i++]]^T5[B[i++]]^T4[B[i++]]^T3[B[i++]]^T2[B[i++]]^T1[B[i++]]^T0[B[i++]];L+=15;while(i<L)C=C>>>8^T0[(C^B[i++])&255];return~C}function crc32_str(str,seed){var C=seed^-1;for(var i=0,L=str.length,c=0,d=0;i<L;){c=str.charCodeAt(i++);if(c<128){C=C>>>8^T0[(C^c)&255]}else if(c<2048){C=C>>>8^T0[(C^(192|c>>6&31))&255];C=C>>>8^T0[(C^(128|c&63))&255]}else if(c>=55296&&c<57344){c=(c&1023)+64;d=str.charCodeAt(i++)&1023;C=C>>>8^T0[(C^(240|c>>8&7))&255];C=C>>>8^T0[(C^(128|c>>2&63))&255];C=C>>>8^T0[(C^(128|d>>6&15|(c&3)<<4))&255];C=C>>>8^T0[(C^(128|d&63))&255]}else{C=C>>>8^T0[(C^(224|c>>12&15))&255];C=C>>>8^T0[(C^(128|c>>6&63))&255];C=C>>>8^T0[(C^(128|c&63))&255]}}return~C}CRC32.table=T0;CRC32.bstr=crc32_bstr;CRC32.buf=crc32_buf;CRC32.str=crc32_str})},{}],16:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],17:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):global.moment=factory()})(this,function(){"use strict";var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(callback){hookCallback=callback}function isArray(input){return input instanceof Array||Object.prototype.toString.call(input)==="[object Array]"}function isObject(input){return input!=null&&Object.prototype.toString.call(input)==="[object Object]"}function hasOwnProp(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function isObjectEmpty(obj){if(Object.getOwnPropertyNames){return Object.getOwnPropertyNames(obj).length===0}else{var k;for(k in obj){if(hasOwnProp(obj,k)){return false}}return true}}function isUndefined(input){return input===void 0}function isNumber(input){return typeof input==="number"||Object.prototype.toString.call(input)==="[object Number]"}function isDate(input){return input instanceof Date||Object.prototype.toString.call(input)==="[object Date]"}function map(arr,fn){var res=[],i,arrLen=arr.length;for(i=0;i<arrLen;++i){res.push(fn(arr[i],i))}return res}function extend(a,b){for(var i in b){if(hasOwnProp(b,i)){a[i]=b[i]}}if(hasOwnProp(b,"toString")){a.toString=b.toString}if(hasOwnProp(b,"valueOf")){a.valueOf=b.valueOf}return a}function createUTC(input,format,locale,strict){return createLocalOrUTC(input,format,locale,strict,true).utc()}function defaultParsingFlags(){return{empty:false,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:false,invalidEra:null,invalidMonth:null,invalidFormat:false,userInvalidated:false,iso:false,parsedDateParts:[],era:null,meridiem:null,rfc2822:false,weekdayMismatch:false}}function getParsingFlags(m){if(m._pf==null){m._pf=defaultParsingFlags()}return m._pf}var some;if(Array.prototype.some){some=Array.prototype.some}else{some=function(fun){var t=Object(this),len=t.length>>>0,i;for(i=0;i<len;i++){if(i in t&&fun.call(this,t[i],i,t)){return true}}return false}}function isValid(m){var flags=null,parsedParts=false,isNowValid=m._d&&!isNaN(m._d.getTime());if(isNowValid){flags=getParsingFlags(m);parsedParts=some.call(flags.parsedDateParts,function(i){return i!=null});isNowValid=flags.overflow<0&&!flags.empty&&!flags.invalidEra&&!flags.invalidMonth&&!flags.invalidWeekday&&!flags.weekdayMismatch&&!flags.nullInput&&!flags.invalidFormat&&!flags.userInvalidated&&(!flags.meridiem||flags.meridiem&&parsedParts);if(m._strict){isNowValid=isNowValid&&flags.charsLeftOver===0&&flags.unusedTokens.length===0&&flags.bigHour===undefined}}if(Object.isFrozen==null||!Object.isFrozen(m)){m._isValid=isNowValid}else{return isNowValid}return m._isValid}function createInvalid(flags){var m=createUTC(NaN);if(flags!=null){extend(getParsingFlags(m),flags)}else{getParsingFlags(m).userInvalidated=true}return m}var momentProperties=hooks.momentProperties=[],updateInProgress=false;function copyConfig(to,from){var i,prop,val,momentPropertiesLen=momentProperties.length;if(!isUndefined(from._isAMomentObject)){to._isAMomentObject=from._isAMomentObject}if(!isUndefined(from._i)){to._i=from._i}if(!isUndefined(from._f)){to._f=from._f}if(!isUndefined(from._l)){to._l=from._l}if(!isUndefined(from._strict)){to._strict=from._strict}if(!isUndefined(from._tzm)){to._tzm=from._tzm}if(!isUndefined(from._isUTC)){to._isUTC=from._isUTC}if(!isUndefined(from._offset)){to._offset=from._offset}if(!isUndefined(from._pf)){to._pf=getParsingFlags(from)}if(!isUndefined(from._locale)){to._locale=from._locale}if(momentPropertiesLen>0){for(i=0;i<momentPropertiesLen;i++){prop=momentProperties[i];val=from[prop];if(!isUndefined(val)){to[prop]=val}}}return to}function Moment(config){copyConfig(this,config);this._d=new Date(config._d!=null?config._d.getTime():NaN);if(!this.isValid()){this._d=new Date(NaN)}if(updateInProgress===false){updateInProgress=true;hooks.updateOffset(this);updateInProgress=false}}function isMoment(obj){return obj instanceof Moment||obj!=null&&obj._isAMomentObject!=null}function warn(msg){if(hooks.suppressDeprecationWarnings===false&&typeof console!=="undefined"&&console.warn){console.warn("Deprecation warning: "+msg)}}function deprecate(msg,fn){var firstTime=true;return extend(function(){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(null,msg)}if(firstTime){var args=[],arg,i,key,argLen=arguments.length;for(i=0;i<argLen;i++){arg="";if(typeof arguments[i]==="object"){arg+="\n["+i+"] ";for(key in arguments[0]){if(hasOwnProp(arguments[0],key)){arg+=key+": "+arguments[0][key]+", "}}arg=arg.slice(0,-2)}else{arg=arguments[i]}args.push(arg)}warn(msg+"\nArguments: "+Array.prototype.slice.call(args).join("")+"\n"+(new Error).stack);firstTime=false}return fn.apply(this,arguments)},fn)}var deprecations={};function deprecateSimple(name,msg){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(name,msg)}if(!deprecations[name]){warn(msg);deprecations[name]=true}}hooks.suppressDeprecationWarnings=false;hooks.deprecationHandler=null;function isFunction(input){return typeof Function!=="undefined"&&input instanceof Function||Object.prototype.toString.call(input)==="[object Function]"}function set(config){var prop,i;for(i in config){if(hasOwnProp(config,i)){prop=config[i];if(isFunction(prop)){this[i]=prop}else{this["_"+i]=prop}}}this._config=config;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(parentConfig,childConfig){var res=extend({},parentConfig),prop;for(prop in childConfig){if(hasOwnProp(childConfig,prop)){if(isObject(parentConfig[prop])&&isObject(childConfig[prop])){res[prop]={};extend(res[prop],parentConfig[prop]);extend(res[prop],childConfig[prop])}else if(childConfig[prop]!=null){res[prop]=childConfig[prop]}else{delete res[prop]}}}for(prop in parentConfig){if(hasOwnProp(parentConfig,prop)&&!hasOwnProp(childConfig,prop)&&isObject(parentConfig[prop])){res[prop]=extend({},res[prop])}}return res}function Locale(config){if(config!=null){this.set(config)}}var keys;if(Object.keys){keys=Object.keys}else{keys=function(obj){var i,res=[];for(i in obj){if(hasOwnProp(obj,i)){res.push(i)}}return res}}var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(key,mom,now){var output=this._calendar[key]||this._calendar["sameElse"];return isFunction(output)?output.call(mom,now):output}function zeroFill(number,targetLength,forceSign){var absNumber=""+Math.abs(number),zerosToFill=targetLength-absNumber.length,sign=number>=0;return(sign?forceSign?"+":"":"-")+Math.pow(10,Math.max(0,zerosToFill)).toString().substr(1)+absNumber}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(token,padded,ordinal,callback){var func=callback;if(typeof callback==="string"){func=function(){return this[callback]()}}if(token){formatTokenFunctions[token]=func}if(padded){formatTokenFunctions[padded[0]]=function(){return zeroFill(func.apply(this,arguments),padded[1],padded[2])}}if(ordinal){formatTokenFunctions[ordinal]=function(){return this.localeData().ordinal(func.apply(this,arguments),token)}}}function removeFormattingTokens(input){if(input.match(/\[[\s\S]/)){return input.replace(/^\[|\]$/g,"")}return input.replace(/\\/g,"")}function makeFormatFunction(format){var array=format.match(formattingTokens),i,length;for(i=0,length=array.length;i<length;i++){if(formatTokenFunctions[array[i]]){array[i]=formatTokenFunctions[array[i]]}else{array[i]=removeFormattingTokens(array[i])}}return function(mom){var output="",i;for(i=0;i<length;i++){output+=isFunction(array[i])?array[i].call(mom,format):array[i]}return output}}function formatMoment(m,format){if(!m.isValid()){return m.localeData().invalidDate()}format=expandFormat(format,m.localeData());formatFunctions[format]=formatFunctions[format]||makeFormatFunction(format);return formatFunctions[format](m)}function expandFormat(format,locale){var i=5;function replaceLongDateFormatTokens(input){return locale.longDateFormat(input)||input}localFormattingTokens.lastIndex=0;while(i>=0&&localFormattingTokens.test(format)){format=format.replace(localFormattingTokens,replaceLongDateFormatTokens);localFormattingTokens.lastIndex=0;i-=1}return format}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(key){var format=this._longDateFormat[key],formatUpper=this._longDateFormat[key.toUpperCase()];if(format||!formatUpper){return format}this._longDateFormat[key]=formatUpper.match(formattingTokens).map(function(tok){if(tok==="MMMM"||tok==="MM"||tok==="DD"||tok==="dddd"){return tok.slice(1)}return tok}).join("");return this._longDateFormat[key]}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(number){return this._ordinal.replace("%d",number)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(number,withoutSuffix,string,isFuture){var output=this._relativeTime[string];return isFunction(output)?output(number,withoutSuffix,string,isFuture):output.replace(/%d/i,number)}function pastFuture(diff,output){var format=this._relativeTime[diff>0?"future":"past"];return isFunction(format)?format(output):format.replace(/%s/i,output)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(units){return typeof units==="string"?aliases[units]||aliases[units.toLowerCase()]:undefined}function normalizeObjectUnits(inputObject){var normalizedInput={},normalizedProp,prop;for(prop in inputObject){if(hasOwnProp(inputObject,prop)){normalizedProp=normalizeUnits(prop);if(normalizedProp){normalizedInput[normalizedProp]=inputObject[prop]}}}return normalizedInput}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(unitsObj){var units=[],u;for(u in unitsObj){if(hasOwnProp(unitsObj,u)){units.push({unit:u,priority:priorities[u]})}}units.sort(function(a,b){return a.priority-b.priority});return units}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(token,regex,strictRegex){regexes[token]=isFunction(regex)?regex:function(isStrict,localeData){return isStrict&&strictRegex?strictRegex:regex}}function getParseRegexForToken(token,config){if(!hasOwnProp(regexes,token)){return new RegExp(unescapeFormat(token))}return regexes[token](config._strict,config._locale)}function unescapeFormat(s){return regexEscape(s.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(matched,p1,p2,p3,p4){return p1||p2||p3||p4}))}function regexEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(number){if(number<0){return Math.ceil(number)||0}else{return Math.floor(number)}}function toInt(argumentForCoercion){var coercedNumber=+argumentForCoercion,value=0;if(coercedNumber!==0&&isFinite(coercedNumber)){value=absFloor(coercedNumber)}return value}var tokens={};function addParseToken(token,callback){var i,func=callback,tokenLen;if(typeof token==="string"){token=[token]}if(isNumber(callback)){func=function(input,array){array[callback]=toInt(input)}}tokenLen=token.length;for(i=0;i<tokenLen;i++){tokens[token[i]]=func}}function addWeekParseToken(token,callback){addParseToken(token,function(input,array,config,token){config._w=config._w||{};callback(input,config._w,config,token)})}function addTimeToArrayFromToken(token,input,config){if(input!=null&&hasOwnProp(tokens,token)){tokens[token](input,config._a,config,token)}}function isLeapYear(year){return year%4===0&&year%100!==0||year%400===0}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;addFormatToken("Y",0,0,function(){var y=this.year();return y<=9999?zeroFill(y,4):"+"+y});addFormatToken(0,["YY",2],0,function(){return this.year()%100});addFormatToken(0,["YYYY",4],0,"year");addFormatToken(0,["YYYYY",5],0,"year");addFormatToken(0,["YYYYYY",6,true],0,"year");addRegexToken("Y",matchSigned);addRegexToken("YY",match1to2,match2);addRegexToken("YYYY",match1to4,match4);addRegexToken("YYYYY",match1to6,match6);addRegexToken("YYYYYY",match1to6,match6);addParseToken(["YYYYY","YYYYYY"],YEAR);addParseToken("YYYY",function(input,array){array[YEAR]=input.length===2?hooks.parseTwoDigitYear(input):toInt(input)});addParseToken("YY",function(input,array){array[YEAR]=hooks.parseTwoDigitYear(input)});addParseToken("Y",function(input,array){array[YEAR]=parseInt(input,10)});function daysInYear(year){return isLeapYear(year)?366:365}hooks.parseTwoDigitYear=function(input){return toInt(input)+(toInt(input)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",true);function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(unit,keepTime){return function(value){if(value!=null){set$1(this,unit,value);hooks.updateOffset(this,keepTime);return this}else{return get(this,unit)}}}function get(mom,unit){if(!mom.isValid()){return NaN}var d=mom._d,isUTC=mom._isUTC;switch(unit){case"Milliseconds":return isUTC?d.getUTCMilliseconds():d.getMilliseconds();case"Seconds":return isUTC?d.getUTCSeconds():d.getSeconds();case"Minutes":return isUTC?d.getUTCMinutes():d.getMinutes();case"Hours":return isUTC?d.getUTCHours():d.getHours();case"Date":return isUTC?d.getUTCDate():d.getDate();case"Day":return isUTC?d.getUTCDay():d.getDay();case"Month":return isUTC?d.getUTCMonth():d.getMonth();case"FullYear":return isUTC?d.getUTCFullYear():d.getFullYear();default:return NaN}}function set$1(mom,unit,value){var d,isUTC,year,month,date;if(!mom.isValid()||isNaN(value)){return}d=mom._d;isUTC=mom._isUTC;switch(unit){case"Milliseconds":return void(isUTC?d.setUTCMilliseconds(value):d.setMilliseconds(value));case"Seconds":return void(isUTC?d.setUTCSeconds(value):d.setSeconds(value));case"Minutes":return void(isUTC?d.setUTCMinutes(value):d.setMinutes(value));case"Hours":return void(isUTC?d.setUTCHours(value):d.setHours(value));case"Date":return void(isUTC?d.setUTCDate(value):d.setDate(value));case"FullYear":break;default:return}year=value;month=mom.month();date=mom.date();date=date===29&&month===1&&!isLeapYear(year)?28:date;void(isUTC?d.setUTCFullYear(year,month,date):d.setFullYear(year,month,date))}function stringGet(units){units=normalizeUnits(units);if(isFunction(this[units])){return this[units]()}return this}function stringSet(units,value){if(typeof units==="object"){units=normalizeObjectUnits(units);var prioritized=getPrioritizedUnits(units),i,prioritizedLen=prioritized.length;for(i=0;i<prioritizedLen;i++){this[prioritized[i].unit](units[prioritized[i].unit])}}else{units=normalizeUnits(units);if(isFunction(this[units])){return this[units](value)}}return this}function mod(n,x){return(n%x+x)%x}var indexOf;if(Array.prototype.indexOf){indexOf=Array.prototype.indexOf}else{indexOf=function(o){var i;for(i=0;i<this.length;++i){if(this[i]===o){return i}}return-1}}function daysInMonth(year,month){if(isNaN(year)||isNaN(month)){return NaN}var modMonth=mod(month,12);year+=(month-modMonth)/12;return modMonth===1?isLeapYear(year)?29:28:31-modMonth%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1});addFormatToken("MMM",0,0,function(format){return this.localeData().monthsShort(this,format)});addFormatToken("MMMM",0,0,function(format){return this.localeData().months(this,format)});addRegexToken("M",match1to2,match1to2NoLeadingZero);addRegexToken("MM",match1to2,match2);addRegexToken("MMM",function(isStrict,locale){return locale.monthsShortRegex(isStrict)});addRegexToken("MMMM",function(isStrict,locale){return locale.monthsRegex(isStrict)});addParseToken(["M","MM"],function(input,array){array[MONTH]=toInt(input)-1});addParseToken(["MMM","MMMM"],function(input,array,config,token){var month=config._locale.monthsParse(input,token,config._strict);if(month!=null){array[MONTH]=month}else{getParsingFlags(config).invalidMonth=input}});var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(m,format){if(!m){return isArray(this._months)?this._months:this._months["standalone"]}return isArray(this._months)?this._months[m.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(format)?"format":"standalone"][m.month()]}function localeMonthsShort(m,format){if(!m){return isArray(this._monthsShort)?this._monthsShort:this._monthsShort["standalone"]}return isArray(this._monthsShort)?this._monthsShort[m.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(format)?"format":"standalone"][m.month()]}function handleStrictParse(monthName,format,strict){var i,ii,mom,llc=monthName.toLocaleLowerCase();if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[];for(i=0;i<12;++i){mom=createUTC([2e3,i]);this._shortMonthsParse[i]=this.monthsShort(mom,"").toLocaleLowerCase();this._longMonthsParse[i]=this.months(mom,"").toLocaleLowerCase()}}if(strict){if(format==="MMM"){ii=indexOf.call(this._shortMonthsParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._longMonthsParse,llc);return ii!==-1?ii:null}}else{if(format==="MMM"){ii=indexOf.call(this._shortMonthsParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._longMonthsParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._longMonthsParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._shortMonthsParse,llc);return ii!==-1?ii:null}}}function localeMonthsParse(monthName,format,strict){var i,mom,regex;if(this._monthsParseExact){return handleStrictParse.call(this,monthName,format,strict)}if(!this._monthsParse){this._monthsParse=[];this._longMonthsParse=[];this._shortMonthsParse=[]}for(i=0;i<12;i++){mom=createUTC([2e3,i]);if(strict&&!this._longMonthsParse[i]){this._longMonthsParse[i]=new RegExp("^"+this.months(mom,"").replace(".","")+"$","i");this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(mom,"").replace(".","")+"$","i")}if(!strict&&!this._monthsParse[i]){regex="^"+this.months(mom,"")+"|^"+this.monthsShort(mom,"");this._monthsParse[i]=new RegExp(regex.replace(".",""),"i")}if(strict&&format==="MMMM"&&this._longMonthsParse[i].test(monthName)){return i}else if(strict&&format==="MMM"&&this._shortMonthsParse[i].test(monthName)){return i}else if(!strict&&this._monthsParse[i].test(monthName)){return i}}}function setMonth(mom,value){if(!mom.isValid()){return mom}if(typeof value==="string"){if(/^\d+$/.test(value)){value=toInt(value)}else{value=mom.localeData().monthsParse(value);if(!isNumber(value)){return mom}}}var month=value,date=mom.date();date=date<29?date:Math.min(date,daysInMonth(mom.year(),month));void(mom._isUTC?mom._d.setUTCMonth(month,date):mom._d.setMonth(month,date));return mom}function getSetMonth(value){if(value!=null){setMonth(this,value);hooks.updateOffset(this,true);return this}else{return get(this,"Month")}}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(isStrict){if(this._monthsParseExact){if(!hasOwnProp(this,"_monthsRegex")){computeMonthsParse.call(this)}if(isStrict){return this._monthsShortStrictRegex}else{return this._monthsShortRegex}}else{if(!hasOwnProp(this,"_monthsShortRegex")){this._monthsShortRegex=defaultMonthsShortRegex}return this._monthsShortStrictRegex&&isStrict?this._monthsShortStrictRegex:this._monthsShortRegex}}function monthsRegex(isStrict){if(this._monthsParseExact){if(!hasOwnProp(this,"_monthsRegex")){computeMonthsParse.call(this)}if(isStrict){return this._monthsStrictRegex}else{return this._monthsRegex}}else{if(!hasOwnProp(this,"_monthsRegex")){this._monthsRegex=defaultMonthsRegex}return this._monthsStrictRegex&&isStrict?this._monthsStrictRegex:this._monthsRegex}}function computeMonthsParse(){function cmpLenRev(a,b){return b.length-a.length}var shortPieces=[],longPieces=[],mixedPieces=[],i,mom,shortP,longP;for(i=0;i<12;i++){mom=createUTC([2e3,i]);shortP=regexEscape(this.monthsShort(mom,""));longP=regexEscape(this.months(mom,""));shortPieces.push(shortP);longPieces.push(longP);mixedPieces.push(longP);mixedPieces.push(shortP)}shortPieces.sort(cmpLenRev);longPieces.sort(cmpLenRev);mixedPieces.sort(cmpLenRev);this._monthsRegex=new RegExp("^("+mixedPieces.join("|")+")","i");this._monthsShortRegex=this._monthsRegex;this._monthsStrictRegex=new RegExp("^("+longPieces.join("|")+")","i");this._monthsShortStrictRegex=new RegExp("^("+shortPieces.join("|")+")","i")}function createDate(y,m,d,h,M,s,ms){var date;if(y<100&&y>=0){date=new Date(y+400,m,d,h,M,s,ms);if(isFinite(date.getFullYear())){date.setFullYear(y)}}else{date=new Date(y,m,d,h,M,s,ms)}return date}function createUTCDate(y){var date,args;if(y<100&&y>=0){args=Array.prototype.slice.call(arguments);args[0]=y+400;date=new Date(Date.UTC.apply(null,args));if(isFinite(date.getUTCFullYear())){date.setUTCFullYear(y)}}else{date=new Date(Date.UTC.apply(null,arguments))}return date}function firstWeekOffset(year,dow,doy){var fwd=7+dow-doy,fwdlw=(7+createUTCDate(year,0,fwd).getUTCDay()-dow)%7;return-fwdlw+fwd-1}function dayOfYearFromWeeks(year,week,weekday,dow,doy){var localWeekday=(7+weekday-dow)%7,weekOffset=firstWeekOffset(year,dow,doy),dayOfYear=1+7*(week-1)+localWeekday+weekOffset,resYear,resDayOfYear;if(dayOfYear<=0){resYear=year-1;resDayOfYear=daysInYear(resYear)+dayOfYear}else if(dayOfYear>daysInYear(year)){resYear=year+1;resDayOfYear=dayOfYear-daysInYear(year)}else{resYear=year;resDayOfYear=dayOfYear}return{year:resYear,dayOfYear:resDayOfYear}}function weekOfYear(mom,dow,doy){var weekOffset=firstWeekOffset(mom.year(),dow,doy),week=Math.floor((mom.dayOfYear()-weekOffset-1)/7)+1,resWeek,resYear;if(week<1){resYear=mom.year()-1;resWeek=week+weeksInYear(resYear,dow,doy)}else if(week>weeksInYear(mom.year(),dow,doy)){resWeek=week-weeksInYear(mom.year(),dow,doy);resYear=mom.year()+1}else{resYear=mom.year();resWeek=week}return{week:resWeek,year:resYear}}function weeksInYear(year,dow,doy){var weekOffset=firstWeekOffset(year,dow,doy),weekOffsetNext=firstWeekOffset(year+1,dow,doy);return(daysInYear(year)-weekOffset+weekOffsetNext)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addRegexToken("w",match1to2,match1to2NoLeadingZero);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2,match1to2NoLeadingZero);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(input,week,config,token){week[token.substr(0,1)]=toInt(input)});function localeWeek(mom){return weekOfYear(mom,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(input){var week=this.localeData().week(this);return input==null?week:this.add((input-week)*7,"d")}function getSetISOWeek(input){var week=weekOfYear(this,1,4).week;return input==null?week:this.add((input-week)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(format){return this.localeData().weekdaysMin(this,format)});addFormatToken("ddd",0,0,function(format){return this.localeData().weekdaysShort(this,format)});addFormatToken("dddd",0,0,function(format){return this.localeData().weekdays(this,format)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(isStrict,locale){return locale.weekdaysMinRegex(isStrict)});addRegexToken("ddd",function(isStrict,locale){return locale.weekdaysShortRegex(isStrict)});addRegexToken("dddd",function(isStrict,locale){return locale.weekdaysRegex(isStrict)});addWeekParseToken(["dd","ddd","dddd"],function(input,week,config,token){var weekday=config._locale.weekdaysParse(input,token,config._strict);if(weekday!=null){week.d=weekday}else{getParsingFlags(config).invalidWeekday=input}});addWeekParseToken(["d","e","E"],function(input,week,config,token){week[token]=toInt(input)});function parseWeekday(input,locale){if(typeof input!=="string"){return input}if(!isNaN(input)){return parseInt(input,10)}input=locale.weekdaysParse(input);if(typeof input==="number"){return input}return null}function parseIsoWeekday(input,locale){if(typeof input==="string"){return locale.weekdaysParse(input)%7||7}return isNaN(input)?null:input}function shiftWeekdays(ws,n){return ws.slice(n,7).concat(ws.slice(0,n))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(m,format){var weekdays=isArray(this._weekdays)?this._weekdays:this._weekdays[m&&m!==true&&this._weekdays.isFormat.test(format)?"format":"standalone"];return m===true?shiftWeekdays(weekdays,this._week.dow):m?weekdays[m.day()]:weekdays}function localeWeekdaysShort(m){return m===true?shiftWeekdays(this._weekdaysShort,this._week.dow):m?this._weekdaysShort[m.day()]:this._weekdaysShort}function localeWeekdaysMin(m){return m===true?shiftWeekdays(this._weekdaysMin,this._week.dow):m?this._weekdaysMin[m.day()]:this._weekdaysMin}function handleStrictParse$1(weekdayName,format,strict){var i,ii,mom,llc=weekdayName.toLocaleLowerCase();if(!this._weekdaysParse){this._weekdaysParse=[];this._shortWeekdaysParse=[];this._minWeekdaysParse=[];for(i=0;i<7;++i){mom=createUTC([2e3,1]).day(i);this._minWeekdaysParse[i]=this.weekdaysMin(mom,"").toLocaleLowerCase();this._shortWeekdaysParse[i]=this.weekdaysShort(mom,"").toLocaleLowerCase();this._weekdaysParse[i]=this.weekdays(mom,"").toLocaleLowerCase()}}if(strict){if(format==="dddd"){ii=indexOf.call(this._weekdaysParse,llc);return ii!==-1?ii:null}else if(format==="ddd"){ii=indexOf.call(this._shortWeekdaysParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null}}else{if(format==="dddd"){ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._shortWeekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null}else if(format==="ddd"){ii=indexOf.call(this._shortWeekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._minWeekdaysParse,llc);return ii!==-1?ii:null}else{ii=indexOf.call(this._minWeekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._weekdaysParse,llc);if(ii!==-1){return ii}ii=indexOf.call(this._shortWeekdaysParse,llc);return ii!==-1?ii:null}}}function localeWeekdaysParse(weekdayName,format,strict){var i,mom,regex;if(this._weekdaysParseExact){return handleStrictParse$1.call(this,weekdayName,format,strict)}if(!this._weekdaysParse){this._weekdaysParse=[];this._minWeekdaysParse=[];this._shortWeekdaysParse=[];this._fullWeekdaysParse=[]}for(i=0;i<7;i++){mom=createUTC([2e3,1]).day(i);if(strict&&!this._fullWeekdaysParse[i]){this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(mom,"").replace(".","\\.?")+"$","i");this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(mom,"").replace(".","\\.?")+"$","i");this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(mom,"").replace(".","\\.?")+"$","i")}if(!this._weekdaysParse[i]){regex="^"+this.weekdays(mom,"")+"|^"+this.weekdaysShort(mom,"")+"|^"+this.weekdaysMin(mom,"");this._weekdaysParse[i]=new RegExp(regex.replace(".",""),"i")}if(strict&&format==="dddd"&&this._fullWeekdaysParse[i].test(weekdayName)){return i}else if(strict&&format==="ddd"&&this._shortWeekdaysParse[i].test(weekdayName)){return i}else if(strict&&format==="dd"&&this._minWeekdaysParse[i].test(weekdayName)){return i}else if(!strict&&this._weekdaysParse[i].test(weekdayName)){return i}}}function getSetDayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN}var day=get(this,"Day");if(input!=null){input=parseWeekday(input,this.localeData());return this.add(input-day,"d")}else{return day}}function getSetLocaleDayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN}var weekday=(this.day()+7-this.localeData()._week.dow)%7;return input==null?weekday:this.add(input-weekday,"d")}function getSetISODayOfWeek(input){if(!this.isValid()){return input!=null?this:NaN}if(input!=null){var weekday=parseIsoWeekday(input,this.localeData());return this.day(this.day()%7?weekday:weekday-7)}else{return this.day()||7}}function weekdaysRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,"_weekdaysRegex")){computeWeekdaysParse.call(this)}if(isStrict){return this._weekdaysStrictRegex}else{return this._weekdaysRegex}}else{if(!hasOwnProp(this,"_weekdaysRegex")){this._weekdaysRegex=defaultWeekdaysRegex}return this._weekdaysStrictRegex&&isStrict?this._weekdaysStrictRegex:this._weekdaysRegex}}function weekdaysShortRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,"_weekdaysRegex")){computeWeekdaysParse.call(this)}if(isStrict){return this._weekdaysShortStrictRegex}else{return this._weekdaysShortRegex}}else{if(!hasOwnProp(this,"_weekdaysShortRegex")){this._weekdaysShortRegex=defaultWeekdaysShortRegex}return this._weekdaysShortStrictRegex&&isStrict?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}}function weekdaysMinRegex(isStrict){if(this._weekdaysParseExact){if(!hasOwnProp(this,"_weekdaysRegex")){computeWeekdaysParse.call(this)}if(isStrict){return this._weekdaysMinStrictRegex}else{return this._weekdaysMinRegex}}else{if(!hasOwnProp(this,"_weekdaysMinRegex")){this._weekdaysMinRegex=defaultWeekdaysMinRegex}return this._weekdaysMinStrictRegex&&isStrict?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}}function computeWeekdaysParse(){function cmpLenRev(a,b){return b.length-a.length}var minPieces=[],shortPieces=[],longPieces=[],mixedPieces=[],i,mom,minp,shortp,longp;for(i=0;i<7;i++){mom=createUTC([2e3,1]).day(i);minp=regexEscape(this.weekdaysMin(mom,""));shortp=regexEscape(this.weekdaysShort(mom,""));longp=regexEscape(this.weekdays(mom,""));minPieces.push(minp);shortPieces.push(shortp);longPieces.push(longp);mixedPieces.push(minp);mixedPieces.push(shortp);mixedPieces.push(longp)}minPieces.sort(cmpLenRev);shortPieces.sort(cmpLenRev);longPieces.sort(cmpLenRev);mixedPieces.sort(cmpLenRev);this._weekdaysRegex=new RegExp("^("+mixedPieces.join("|")+")","i");this._weekdaysShortRegex=this._weekdaysRegex;this._weekdaysMinRegex=this._weekdaysRegex;this._weekdaysStrictRegex=new RegExp("^("+longPieces.join("|")+")","i");this._weekdaysShortStrictRegex=new RegExp("^("+shortPieces.join("|")+")","i");this._weekdaysMinStrictRegex=new RegExp("^("+minPieces.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(token,lowercase){addFormatToken(token,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),lowercase)})}meridiem("a",true);meridiem("A",false);function matchMeridiem(isStrict,locale){return locale._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2,match1to2HasZero);addRegexToken("h",match1to2,match1to2NoLeadingZero);addRegexToken("k",match1to2,match1to2NoLeadingZero);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(input,array,config){var kInput=toInt(input);array[HOUR]=kInput===24?0:kInput});addParseToken(["a","A"],function(input,array,config){config._isPm=config._locale.isPM(input);config._meridiem=input});addParseToken(["h","hh"],function(input,array,config){array[HOUR]=toInt(input);getParsingFlags(config).bigHour=true});addParseToken("hmm",function(input,array,config){var pos=input.length-2;array[HOUR]=toInt(input.substr(0,pos));array[MINUTE]=toInt(input.substr(pos));getParsingFlags(config).bigHour=true});addParseToken("hmmss",function(input,array,config){var pos1=input.length-4,pos2=input.length-2;array[HOUR]=toInt(input.substr(0,pos1));array[MINUTE]=toInt(input.substr(pos1,2));array[SECOND]=toInt(input.substr(pos2));getParsingFlags(config).bigHour=true});addParseToken("Hmm",function(input,array,config){var pos=input.length-2;array[HOUR]=toInt(input.substr(0,pos));array[MINUTE]=toInt(input.substr(pos))});addParseToken("Hmmss",function(input,array,config){var pos1=input.length-4,pos2=input.length-2;array[HOUR]=toInt(input.substr(0,pos1));array[MINUTE]=toInt(input.substr(pos1,2));array[SECOND]=toInt(input.substr(pos2))});function localeIsPM(input){return(input+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",true);function localeMeridiem(hours,minutes,isLower){if(hours>11){return isLower?"pm":"PM"}else{return isLower?"am":"AM"}}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse};var locales={},localeFamilies={},globalLocale;function commonPrefix(arr1,arr2){var i,minl=Math.min(arr1.length,arr2.length);for(i=0;i<minl;i+=1){if(arr1[i]!==arr2[i]){return i}}return minl}function normalizeLocale(key){return key?key.toLowerCase().replace("_","-"):key}function chooseLocale(names){var i=0,j,next,locale,split;while(i<names.length){split=normalizeLocale(names[i]).split("-");j=split.length;next=normalizeLocale(names[i+1]);next=next?next.split("-"):null;while(j>0){locale=loadLocale(split.slice(0,j).join("-"));if(locale){return locale}if(next&&next.length>=j&&commonPrefix(split,next)>=j-1){break}j--}i++}return globalLocale}function isLocaleNameSane(name){return!!(name&&name.match("^[^/\\\\]*$"))}function loadLocale(name){var oldLocale=null,aliasedRequire;if(locales[name]===undefined&&typeof module!=="undefined"&&module&&module.exports&&isLocaleNameSane(name)){try{oldLocale=globalLocale._abbr;aliasedRequire=require;aliasedRequire("./locale/"+name);getSetGlobalLocale(oldLocale)}catch(e){locales[name]=null}}return locales[name]}function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){globalLocale=data}else{if(typeof console!=="undefined"&&console.warn){console.warn("Locale "+key+" not found. Did you forget to load it?")}}}return globalLocale._abbr}function defineLocale(name,config){if(config!==null){var locale,parentConfig=baseConfig;config.abbr=name;if(locales[name]!=null){deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change "+"an existing locale. moment.defineLocale(localeName, "+"config) should only be used for creating a new locale "+"See http://momentjs.com/guides/#/warnings/define-locale/ for more info.");parentConfig=locales[name]._config}else if(config.parentLocale!=null){if(locales[config.parentLocale]!=null){parentConfig=locales[config.parentLocale]._config}else{locale=loadLocale(config.parentLocale);if(locale!=null){parentConfig=locale._config}else{if(!localeFamilies[config.parentLocale]){localeFamilies[config.parentLocale]=[]}localeFamilies[config.parentLocale].push({name:name,config:config});return null}}}locales[name]=new Locale(mergeConfigs(parentConfig,config));if(localeFamilies[name]){localeFamilies[name].forEach(function(x){defineLocale(x.name,x.config)})}getSetGlobalLocale(name);return locales[name]}else{delete locales[name];return null}}function updateLocale(name,config){if(config!=null){var locale,tmpLocale,parentConfig=baseConfig;if(locales[name]!=null&&locales[name].parentLocale!=null){locales[name].set(mergeConfigs(locales[name]._config,config))}else{tmpLocale=loadLocale(name);if(tmpLocale!=null){parentConfig=tmpLocale._config}config=mergeConfigs(parentConfig,config);if(tmpLocale==null){config.abbr=name}locale=new Locale(config);locale.parentLocale=locales[name];locales[name]=locale}getSetGlobalLocale(name)}else{if(locales[name]!=null){if(locales[name].parentLocale!=null){locales[name]=locales[name].parentLocale;if(name===getSetGlobalLocale()){getSetGlobalLocale(name)}}else if(locales[name]!=null){delete locales[name]}}}return locales[name]}function getLocale(key){var locale;if(key&&key._locale&&key._locale._abbr){key=key._locale._abbr}if(!key){return globalLocale}if(!isArray(key)){locale=loadLocale(key);if(locale){return locale}key=[key]}return chooseLocale(key)}function listLocales(){return keys(locales)}function checkOverflow(m){var overflow,a=m._a;if(a&&getParsingFlags(m).overflow===-2){overflow=a[MONTH]<0||a[MONTH]>11?MONTH:a[DATE]<1||a[DATE]>daysInMonth(a[YEAR],a[MONTH])?DATE:a[HOUR]<0||a[HOUR]>24||a[HOUR]===24&&(a[MINUTE]!==0||a[SECOND]!==0||a[MILLISECOND]!==0)?HOUR:a[MINUTE]<0||a[MINUTE]>59?MINUTE:a[SECOND]<0||a[SECOND]>59?SECOND:a[MILLISECOND]<0||a[MILLISECOND]>999?MILLISECOND:-1;if(getParsingFlags(m)._overflowDayOfYear&&(overflow<YEAR||overflow>DATE)){overflow=DATE}if(getParsingFlags(m)._overflowWeeks&&overflow===-1){overflow=WEEK}if(getParsingFlags(m)._overflowWeekday&&overflow===-1){overflow=WEEKDAY}getParsingFlags(m).overflow=overflow}return m}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,false],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,false],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,false],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,false],["YYYY",/\d{4}/,false]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(config){var i,l,string=config._i,match=extendedIsoRegex.exec(string)||basicIsoRegex.exec(string),allowTime,dateFormat,timeFormat,tzFormat,isoDatesLen=isoDates.length,isoTimesLen=isoTimes.length;if(match){getParsingFlags(config).iso=true;for(i=0,l=isoDatesLen;i<l;i++){if(isoDates[i][1].exec(match[1])){dateFormat=isoDates[i][0];allowTime=isoDates[i][2]!==false;break}}if(dateFormat==null){config._isValid=false;return}if(match[3]){for(i=0,l=isoTimesLen;i<l;i++){if(isoTimes[i][1].exec(match[3])){timeFormat=(match[2]||" ")+isoTimes[i][0];break}}if(timeFormat==null){config._isValid=false;return}}if(!allowTime&&timeFormat!=null){config._isValid=false;return}if(match[4]){if(tzRegex.exec(match[4])){tzFormat="Z"}else{config._isValid=false;return}}config._f=dateFormat+(timeFormat||"")+(tzFormat||"");configFromStringAndFormat(config)}else{config._isValid=false}}function extractFromRFC2822Strings(yearStr,monthStr,dayStr,hourStr,minuteStr,secondStr){var result=[untruncateYear(yearStr),defaultLocaleMonthsShort.indexOf(monthStr),parseInt(dayStr,10),parseInt(hourStr,10),parseInt(minuteStr,10)];if(secondStr){result.push(parseInt(secondStr,10))}return result}function untruncateYear(yearStr){var year=parseInt(yearStr,10);if(year<=49){return 2e3+year}else if(year<=999){return 1900+year}return year}function preprocessRFC2822(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(weekdayStr,parsedInput,config){if(weekdayStr){var weekdayProvided=defaultLocaleWeekdaysShort.indexOf(weekdayStr),weekdayActual=new Date(parsedInput[0],parsedInput[1],parsedInput[2]).getDay();if(weekdayProvided!==weekdayActual){getParsingFlags(config).weekdayMismatch=true;config._isValid=false;return false}}return true}function calculateOffset(obsOffset,militaryOffset,numOffset){if(obsOffset){return obsOffsets[obsOffset]}else if(militaryOffset){return 0}else{var hm=parseInt(numOffset,10),m=hm%100,h=(hm-m)/100;return h*60+m}}function configFromRFC2822(config){var match=rfc2822.exec(preprocessRFC2822(config._i)),parsedArray;if(match){parsedArray=extractFromRFC2822Strings(match[4],match[3],match[2],match[5],match[6],match[7]);if(!checkWeekday(match[1],parsedArray,config)){return}config._a=parsedArray;config._tzm=calculateOffset(match[8],match[9],match[10]);config._d=createUTCDate.apply(null,config._a);config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm);getParsingFlags(config).rfc2822=true}else{config._isValid=false}}function configFromString(config){var matched=aspNetJsonRegex.exec(config._i);if(matched!==null){config._d=new Date(+matched[1]);return}configFromISO(config);if(config._isValid===false){delete config._isValid}else{return}configFromRFC2822(config);if(config._isValid===false){delete config._isValid}else{return}if(config._strict){config._isValid=false}else{hooks.createFromInputFallback(config)}}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), "+"which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are "+"discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(config){config._d=new Date(config._i+(config._useUTC?" UTC":""))});function defaults(a,b,c){if(a!=null){return a}if(b!=null){return b}return c}function currentDateArray(config){var nowValue=new Date(hooks.now());if(config._useUTC){return[nowValue.getUTCFullYear(),nowValue.getUTCMonth(),nowValue.getUTCDate()]}return[nowValue.getFullYear(),nowValue.getMonth(),nowValue.getDate()]}function configFromArray(config){var i,date,input=[],currentDate,expectedWeekday,yearToUse;if(config._d){return}currentDate=currentDateArray(config);if(config._w&&config._a[DATE]==null&&config._a[MONTH]==null){dayOfYearFromWeekInfo(config)}if(config._dayOfYear!=null){yearToUse=defaults(config._a[YEAR],currentDate[YEAR]);if(config._dayOfYear>daysInYear(yearToUse)||config._dayOfYear===0){getParsingFlags(config)._overflowDayOfYear=true}date=createUTCDate(yearToUse,0,config._dayOfYear);config._a[MONTH]=date.getUTCMonth();config._a[DATE]=date.getUTCDate()}for(i=0;i<3&&config._a[i]==null;++i){config._a[i]=input[i]=currentDate[i]}for(;i<7;i++){config._a[i]=input[i]=config._a[i]==null?i===2?1:0:config._a[i]}if(config._a[HOUR]===24&&config._a[MINUTE]===0&&config._a[SECOND]===0&&config._a[MILLISECOND]===0){config._nextDay=true;config._a[HOUR]=0}config._d=(config._useUTC?createUTCDate:createDate).apply(null,input);expectedWeekday=config._useUTC?config._d.getUTCDay():config._d.getDay();if(config._tzm!=null){config._d.setUTCMinutes(config._d.getUTCMinutes()-config._tzm)}if(config._nextDay){config._a[HOUR]=24}if(config._w&&typeof config._w.d!=="undefined"&&config._w.d!==expectedWeekday){getParsingFlags(config).weekdayMismatch=true}}function dayOfYearFromWeekInfo(config){var w,weekYear,week,weekday,dow,doy,temp,weekdayOverflow,curWeek;w=config._w;if(w.GG!=null||w.W!=null||w.E!=null){dow=1;doy=4;weekYear=defaults(w.GG,config._a[YEAR],weekOfYear(createLocal(),1,4).year);week=defaults(w.W,1);weekday=defaults(w.E,1);if(weekday<1||weekday>7){weekdayOverflow=true}}else{dow=config._locale._week.dow;doy=config._locale._week.doy;curWeek=weekOfYear(createLocal(),dow,doy);weekYear=defaults(w.gg,config._a[YEAR],curWeek.year);week=defaults(w.w,curWeek.week);if(w.d!=null){weekday=w.d;if(weekday<0||weekday>6){weekdayOverflow=true}}else if(w.e!=null){weekday=w.e+dow;if(w.e<0||w.e>6){weekdayOverflow=true}}else{weekday=dow}}if(week<1||week>weeksInYear(weekYear,dow,doy)){getParsingFlags(config)._overflowWeeks=true}else if(weekdayOverflow!=null){getParsingFlags(config)._overflowWeekday=true}else{temp=dayOfYearFromWeeks(weekYear,week,weekday,dow,doy);config._a[YEAR]=temp.year;config._dayOfYear=temp.dayOfYear}}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(config){if(config._f===hooks.ISO_8601){configFromISO(config);return}if(config._f===hooks.RFC_2822){configFromRFC2822(config);return}config._a=[];getParsingFlags(config).empty=true;var string=""+config._i,i,parsedInput,tokens,token,skipped,stringLength=string.length,totalParsedInputLength=0,era,tokenLen;tokens=expandFormat(config._f,config._locale).match(formattingTokens)||[];tokenLen=tokens.length;for(i=0;i<tokenLen;i++){token=tokens[i];parsedInput=(string.match(getParseRegexForToken(token,config))||[])[0];if(parsedInput){skipped=string.substr(0,string.indexOf(parsedInput));if(skipped.length>0){getParsingFlags(config).unusedInput.push(skipped)}string=string.slice(string.indexOf(parsedInput)+parsedInput.length);totalParsedInputLength+=parsedInput.length}if(formatTokenFunctions[token]){if(parsedInput){getParsingFlags(config).empty=false}else{getParsingFlags(config).unusedTokens.push(token)}addTimeToArrayFromToken(token,parsedInput,config)}else if(config._strict&&!parsedInput){getParsingFlags(config).unusedTokens.push(token)}}getParsingFlags(config).charsLeftOver=stringLength-totalParsedInputLength;if(string.length>0){getParsingFlags(config).unusedInput.push(string)}if(config._a[HOUR]<=12&&getParsingFlags(config).bigHour===true&&config._a[HOUR]>0){getParsingFlags(config).bigHour=undefined}getParsingFlags(config).parsedDateParts=config._a.slice(0);getParsingFlags(config).meridiem=config._meridiem;config._a[HOUR]=meridiemFixWrap(config._locale,config._a[HOUR],config._meridiem);era=getParsingFlags(config).era;if(era!==null){config._a[YEAR]=config._locale.erasConvertYear(era,config._a[YEAR])}configFromArray(config);checkOverflow(config)}function meridiemFixWrap(locale,hour,meridiem){var isPm;if(meridiem==null){return hour}if(locale.meridiemHour!=null){return locale.meridiemHour(hour,meridiem)}else if(locale.isPM!=null){isPm=locale.isPM(meridiem);if(isPm&&hour<12){hour+=12}if(!isPm&&hour===12){hour=0}return hour}else{return hour}}function configFromStringAndArray(config){var tempConfig,bestMoment,scoreToBeat,i,currentScore,validFormatFound,bestFormatIsValid=false,configfLen=config._f.length;if(configfLen===0){getParsingFlags(config).invalidFormat=true;config._d=new Date(NaN);return}for(i=0;i<configfLen;i++){currentScore=0;validFormatFound=false;tempConfig=copyConfig({},config);if(config._useUTC!=null){tempConfig._useUTC=config._useUTC}tempConfig._f=config._f[i];configFromStringAndFormat(tempConfig);if(isValid(tempConfig)){validFormatFound=true}currentScore+=getParsingFlags(tempConfig).charsLeftOver;currentScore+=getParsingFlags(tempConfig).unusedTokens.length*10;getParsingFlags(tempConfig).score=currentScore;if(!bestFormatIsValid){if(scoreToBeat==null||currentScore<scoreToBeat||validFormatFound){scoreToBeat=currentScore;bestMoment=tempConfig;if(validFormatFound){bestFormatIsValid=true}}}else{if(currentScore<scoreToBeat){scoreToBeat=currentScore;bestMoment=tempConfig}}}extend(config,bestMoment||tempConfig)}function configFromObject(config){if(config._d){return}var i=normalizeObjectUnits(config._i),dayOrDate=i.day===undefined?i.date:i.day;config._a=map([i.year,i.month,dayOrDate,i.hour,i.minute,i.second,i.millisecond],function(obj){return obj&&parseInt(obj,10)});configFromArray(config)}function createFromConfig(config){var res=new Moment(checkOverflow(prepareConfig(config)));if(res._nextDay){res.add(1,"d");res._nextDay=undefined}return res}function prepareConfig(config){var input=config._i,format=config._f;config._locale=config._locale||getLocale(config._l);if(input===null||format===undefined&&input===""){return createInvalid({nullInput:true})}if(typeof input==="string"){config._i=input=config._locale.preparse(input)}if(isMoment(input)){return new Moment(checkOverflow(input))}else if(isDate(input)){config._d=input}else if(isArray(format)){configFromStringAndArray(config)}else if(format){configFromStringAndFormat(config)}else{configFromInput(config)}if(!isValid(config)){config._d=null}return config}function configFromInput(config){var input=config._i;if(isUndefined(input)){config._d=new Date(hooks.now())}else if(isDate(input)){config._d=new Date(input.valueOf())}else if(typeof input==="string"){configFromString(config)}else if(isArray(input)){config._a=map(input.slice(0),function(obj){return parseInt(obj,10)});configFromArray(config)}else if(isObject(input)){configFromObject(config)}else if(isNumber(input)){config._d=new Date(input)}else{hooks.createFromInputFallback(config)}}function createLocalOrUTC(input,format,locale,strict,isUTC){var c={};if(format===true||format===false){strict=format;format=undefined}if(locale===true||locale===false){strict=locale;locale=undefined}if(isObject(input)&&isObjectEmpty(input)||isArray(input)&&input.length===0){input=undefined}c._isAMomentObject=true;c._useUTC=c._isUTC=isUTC;c._l=locale;c._i=input;c._f=format;c._strict=strict;return createFromConfig(c)}function createLocal(input,format,locale,strict){return createLocalOrUTC(input,format,locale,strict,false)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var other=createLocal.apply(null,arguments);if(this.isValid()&&other.isValid()){return other<this?this:other}else{return createInvalid()}}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var other=createLocal.apply(null,arguments);if(this.isValid()&&other.isValid()){return other>this?this:other}else{return createInvalid()}});function pickBy(fn,moments){var res,i;if(moments.length===1&&isArray(moments[0])){moments=moments[0]}if(!moments.length){return createLocal()}res=moments[0];for(i=1;i<moments.length;++i){if(!moments[i].isValid()||moments[i][fn](res)){res=moments[i]}}return res}function min(){var args=[].slice.call(arguments,0);return pickBy("isBefore",args)}function max(){var args=[].slice.call(arguments,0);return pickBy("isAfter",args)}var now=function(){return Date.now?Date.now():+new Date};var ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(m){var key,unitHasDecimal=false,i,orderLen=ordering.length;for(key in m){if(hasOwnProp(m,key)&&!(indexOf.call(ordering,key)!==-1&&(m[key]==null||!isNaN(m[key])))){return false}}for(i=0;i<orderLen;++i){if(m[ordering[i]]){if(unitHasDecimal){return false}if(parseFloat(m[ordering[i]])!==toInt(m[ordering[i]])){unitHasDecimal=true}}}return true}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(duration){var normalizedInput=normalizeObjectUnits(duration),years=normalizedInput.year||0,quarters=normalizedInput.quarter||0,months=normalizedInput.month||0,weeks=normalizedInput.week||normalizedInput.isoWeek||0,days=normalizedInput.day||0,hours=normalizedInput.hour||0,minutes=normalizedInput.minute||0,seconds=normalizedInput.second||0,milliseconds=normalizedInput.millisecond||0;this._isValid=isDurationValid(normalizedInput);this._milliseconds=+milliseconds+seconds*1e3+minutes*6e4+hours*1e3*60*60;this._days=+days+weeks*7;this._months=+months+quarters*3+years*12;this._data={};this._locale=getLocale();this._bubble()}function isDuration(obj){return obj instanceof Duration}function absRound(number){if(number<0){return Math.round(-1*number)*-1}else{return Math.round(number)}}function compareArrays(array1,array2,dontConvert){var len=Math.min(array1.length,array2.length),lengthDiff=Math.abs(array1.length-array2.length),diffs=0,i;for(i=0;i<len;i++){if(dontConvert&&array1[i]!==array2[i]||!dontConvert&&toInt(array1[i])!==toInt(array2[i])){diffs++}}return diffs+lengthDiff}function offset(token,separator){addFormatToken(token,0,0,function(){var offset=this.utcOffset(),sign="+";if(offset<0){offset=-offset;sign="-"}return sign+zeroFill(~~(offset/60),2)+separator+zeroFill(~~offset%60,2)})}offset("Z",":");offset("ZZ","");addRegexToken("Z",matchShortOffset);addRegexToken("ZZ",matchShortOffset);addParseToken(["Z","ZZ"],function(input,array,config){config._useUTC=true;config._tzm=offsetFromString(matchShortOffset,input)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(matcher,string){var matches=(string||"").match(matcher),chunk,parts,minutes;if(matches===null){return null}chunk=matches[matches.length-1]||[];parts=(chunk+"").match(chunkOffset)||["-",0,0];minutes=+(parts[1]*60)+toInt(parts[2]);return minutes===0?0:parts[0]==="+"?minutes:-minutes}function cloneWithOffset(input,model){var res,diff;if(model._isUTC){res=model.clone();diff=(isMoment(input)||isDate(input)?input.valueOf():createLocal(input).valueOf())-res.valueOf();res._d.setTime(res._d.valueOf()+diff);hooks.updateOffset(res,false);return res}else{return createLocal(input).local()}}function getDateOffset(m){return-Math.round(m._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN}if(input!=null){if(typeof input==="string"){input=offsetFromString(matchShortOffset,input);if(input===null){return this}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this)}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,"m")}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,"m"),1,false)}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null}}return this}else{return this._isUTC?offset:getDateOffset(this)}}function getSetZone(input,keepLocalTime){if(input!=null){if(typeof input!=="string"){input=-input}this.utcOffset(input,keepLocalTime);return this}else{return-this.utcOffset()}}function setOffsetToUTC(keepLocalTime){return this.utcOffset(0,keepLocalTime)}function setOffsetToLocal(keepLocalTime){if(this._isUTC){this.utcOffset(0,keepLocalTime);this._isUTC=false;if(keepLocalTime){this.subtract(getDateOffset(this),"m")}}return this}function setOffsetToParsedOffset(){if(this._tzm!=null){this.utcOffset(this._tzm,false,true)}else if(typeof this._i==="string"){var tZone=offsetFromString(matchOffset,this._i);if(tZone!=null){this.utcOffset(tZone)}else{this.utcOffset(0,true)}}return this}function hasAlignedHourOffset(input){if(!this.isValid()){return false}input=input?createLocal(input).utcOffset():0;return(this.utcOffset()-input)%60===0}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted)){return this._isDSTShifted}var c={},other;copyConfig(c,this);c=prepareConfig(c);if(c._a){other=c._isUTC?createUTC(c._a):createLocal(c._a);this._isDSTShifted=this.isValid()&&compareArrays(c._a,other.toArray())>0}else{this._isDSTShifted=false}return this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:false}function isUtcOffset(){return this.isValid()?this._isUTC:false}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:false}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(input,key){var duration=input,match=null,sign,ret,diffRes;if(isDuration(input)){duration={ms:input._milliseconds,d:input._days,M:input._months}}else if(isNumber(input)||!isNaN(+input)){duration={};if(key){duration[key]=+input}else{duration.milliseconds=+input}}else if(match=aspNetRegex.exec(input)){sign=match[1]==="-"?-1:1;duration={y:0,d:toInt(match[DATE])*sign,h:toInt(match[HOUR])*sign,m:toInt(match[MINUTE])*sign,s:toInt(match[SECOND])*sign,ms:toInt(absRound(match[MILLISECOND]*1e3))*sign}}else if(match=isoRegex.exec(input)){sign=match[1]==="-"?-1:1;duration={y:parseIso(match[2],sign),M:parseIso(match[3],sign),w:parseIso(match[4],sign),d:parseIso(match[5],sign),h:parseIso(match[6],sign),m:parseIso(match[7],sign),s:parseIso(match[8],sign)}}else if(duration==null){duration={}}else if(typeof duration==="object"&&("from"in duration||"to"in duration)){diffRes=momentsDifference(createLocal(duration.from),createLocal(duration.to));duration={};duration.ms=diffRes.milliseconds;duration.M=diffRes.months}ret=new Duration(duration);if(isDuration(input)&&hasOwnProp(input,"_locale")){ret._locale=input._locale}if(isDuration(input)&&hasOwnProp(input,"_isValid")){ret._isValid=input._isValid}return ret}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(inp,sign){var res=inp&&parseFloat(inp.replace(",","."));return(isNaN(res)?0:res)*sign}function positiveMomentsDifference(base,other){var res={};res.months=other.month()-base.month()+(other.year()-base.year())*12;if(base.clone().add(res.months,"M").isAfter(other)){--res.months}res.milliseconds=+other-+base.clone().add(res.months,"M");return res}function momentsDifference(base,other){var res;if(!(base.isValid()&&other.isValid())){return{milliseconds:0,months:0}}other=cloneWithOffset(other,base);if(base.isBefore(other)){res=positiveMomentsDifference(base,other)}else{res=positiveMomentsDifference(other,base);res.milliseconds=-res.milliseconds;res.months=-res.months}return res}function createAdder(direction,name){return function(val,period){var dur,tmp;if(period!==null&&!isNaN(+period)){deprecateSimple(name,"moment()."+name+"(period, number) is deprecated. Please use moment()."+name+"(number, period). "+"See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.");tmp=val;val=period;period=tmp}dur=createDuration(val,period);addSubtract(this,dur,direction);return this}}function addSubtract(mom,duration,isAdding,updateOffset){var milliseconds=duration._milliseconds,days=absRound(duration._days),months=absRound(duration._months);if(!mom.isValid()){return}updateOffset=updateOffset==null?true:updateOffset;if(months){setMonth(mom,get(mom,"Month")+months*isAdding)}if(days){set$1(mom,"Date",get(mom,"Date")+days*isAdding)}if(milliseconds){mom._d.setTime(mom._d.valueOf()+milliseconds*isAdding)}if(updateOffset){hooks.updateOffset(mom,days||months)}}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString(input){return typeof input==="string"||input instanceof String}function isMomentInput(input){return isMoment(input)||isDate(input)||isString(input)||isNumber(input)||isNumberOrStringArray(input)||isMomentInputObject(input)||input===null||input===undefined}function isMomentInputObject(input){var objectTest=isObject(input)&&!isObjectEmpty(input),propertyTest=false,properties=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,property,propertyLen=properties.length;for(i=0;i<propertyLen;i+=1){property=properties[i];propertyTest=propertyTest||hasOwnProp(input,property)}return objectTest&&propertyTest}function isNumberOrStringArray(input){var arrayTest=isArray(input),dataTypeTest=false;if(arrayTest){dataTypeTest=input.filter(function(item){return!isNumber(item)&&isString(input)}).length===0}return arrayTest&&dataTypeTest}function isCalendarSpec(input){var objectTest=isObject(input)&&!isObjectEmpty(input),propertyTest=false,properties=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,property;for(i=0;i<properties.length;i+=1){property=properties[i];propertyTest=propertyTest||hasOwnProp(input,property)}return objectTest&&propertyTest}function getCalendarFormat(myMoment,now){var diff=myMoment.diff(now,"days",true);return diff<-6?"sameElse":diff<-1?"lastWeek":diff<0?"lastDay":diff<1?"sameDay":diff<2?"nextDay":diff<7?"nextWeek":"sameElse"}function calendar$1(time,formats){if(arguments.length===1){if(!arguments[0]){time=undefined;formats=undefined}else if(isMomentInput(arguments[0])){time=arguments[0];formats=undefined}else if(isCalendarSpec(arguments[0])){formats=arguments[0];time=undefined}}var now=time||createLocal(),sod=cloneWithOffset(now,this).startOf("day"),format=hooks.calendarFormat(this,sod)||"sameElse",output=formats&&(isFunction(formats[format])?formats[format].call(this,now):formats[format]);return this.format(output||this.localeData().calendar(format,this,createLocal(now)))}function clone(){return new Moment(this)}function isAfter(input,units){var localInput=isMoment(input)?input:createLocal(input);if(!(this.isValid()&&localInput.isValid())){return false}units=normalizeUnits(units)||"millisecond";if(units==="millisecond"){return this.valueOf()>localInput.valueOf()}else{return localInput.valueOf()<this.clone().startOf(units).valueOf()}}function isBefore(input,units){var localInput=isMoment(input)?input:createLocal(input);if(!(this.isValid()&&localInput.isValid())){return false}units=normalizeUnits(units)||"millisecond";if(units==="millisecond"){return this.valueOf()<localInput.valueOf()}else{return this.clone().endOf(units).valueOf()<localInput.valueOf()}}function isBetween(from,to,units,inclusivity){var localFrom=isMoment(from)?from:createLocal(from),localTo=isMoment(to)?to:createLocal(to);if(!(this.isValid()&&localFrom.isValid()&&localTo.isValid())){return false}inclusivity=inclusivity||"()";return(inclusivity[0]==="("?this.isAfter(localFrom,units):!this.isBefore(localFrom,units))&&(inclusivity[1]===")"?this.isBefore(localTo,units):!this.isAfter(localTo,units))}function isSame(input,units){var localInput=isMoment(input)?input:createLocal(input),inputMs;if(!(this.isValid()&&localInput.isValid())){return false}units=normalizeUnits(units)||"millisecond";if(units==="millisecond"){return this.valueOf()===localInput.valueOf()}else{inputMs=localInput.valueOf();return this.clone().startOf(units).valueOf()<=inputMs&&inputMs<=this.clone().endOf(units).valueOf()}}function isSameOrAfter(input,units){return this.isSame(input,units)||this.isAfter(input,units)}function isSameOrBefore(input,units){return this.isSame(input,units)||this.isBefore(input,units)}function diff(input,units,asFloat){var that,zoneDelta,output;if(!this.isValid()){return NaN}that=cloneWithOffset(input,this);if(!that.isValid()){return NaN}zoneDelta=(that.utcOffset()-this.utcOffset())*6e4;units=normalizeUnits(units);switch(units){case"year":output=monthDiff(this,that)/12;break;case"month":output=monthDiff(this,that);break;case"quarter":output=monthDiff(this,that)/3;break;case"second":output=(this-that)/1e3;break;case"minute":output=(this-that)/6e4;break;case"hour":output=(this-that)/36e5;break;case"day":output=(this-that-zoneDelta)/864e5;break;case"week":output=(this-that-zoneDelta)/6048e5;break;default:output=this-that}return asFloat?output:absFloor(output)}function monthDiff(a,b){if(a.date()<b.date()){return-monthDiff(b,a)}var wholeMonthDiff=(b.year()-a.year())*12+(b.month()-a.month()),anchor=a.clone().add(wholeMonthDiff,"months"),anchor2,adjust;if(b-anchor<0){anchor2=a.clone().add(wholeMonthDiff-1,"months");adjust=(b-anchor)/(anchor-anchor2)}else{anchor2=a.clone().add(wholeMonthDiff+1,"months");adjust=(b-anchor)/(anchor2-anchor)}return-(wholeMonthDiff+adjust)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(keepOffset){if(!this.isValid()){return null}var utc=keepOffset!==true,m=utc?this.clone().utc():this;if(m.year()<0||m.year()>9999){return formatMoment(m,utc?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ")}if(isFunction(Date.prototype.toISOString)){if(utc){return this.toDate().toISOString()}else{return new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(m,"Z"))}}return formatMoment(m,utc?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid()){return"moment.invalid(/* "+this._i+" */)"}var func="moment",zone="",prefix,year,datetime,suffix;if(!this.isLocal()){func=this.utcOffset()===0?"moment.utc":"moment.parseZone";zone="Z"}prefix="["+func+'("]';year=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY";datetime="-MM-DD[T]HH:mm:ss.SSS";suffix=zone+'[")]';return this.format(prefix+year+datetime+suffix)}function format(inputString){if(!inputString){inputString=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat}var output=formatMoment(this,inputString);return this.localeData().postformat(output)}function from(time,withoutSuffix){if(this.isValid()&&(isMoment(time)&&time.isValid()||createLocal(time).isValid())){return createDuration({to:this,from:time}).locale(this.locale()).humanize(!withoutSuffix)}else{return this.localeData().invalidDate()}}function fromNow(withoutSuffix){return this.from(createLocal(),withoutSuffix)}function to(time,withoutSuffix){if(this.isValid()&&(isMoment(time)&&time.isValid()||createLocal(time).isValid())){return createDuration({from:this,to:time}).locale(this.locale()).humanize(!withoutSuffix)}else{return this.localeData().invalidDate()}}function toNow(withoutSuffix){return this.to(createLocal(),withoutSuffix)}function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData}return this}}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(key){if(key===undefined){return this.localeData()}else{return this.locale(key)}});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(dividend,divisor){return(dividend%divisor+divisor)%divisor}function localStartOfDate(y,m,d){if(y<100&&y>=0){return new Date(y+400,m,d)-MS_PER_400_YEARS}else{return new Date(y,m,d).valueOf()}}function utcStartOfDate(y,m,d){if(y<100&&y>=0){return Date.UTC(y+400,m,d)-MS_PER_400_YEARS}else{return Date.UTC(y,m,d)}}function startOf(units){var time,startOfDate;units=normalizeUnits(units);if(units===undefined||units==="millisecond"||!this.isValid()){return this}startOfDate=this._isUTC?utcStartOfDate:localStartOfDate;switch(units){case"year":time=startOfDate(this.year(),0,1);break;case"quarter":time=startOfDate(this.year(),this.month()-this.month()%3,1);break;case"month":time=startOfDate(this.year(),this.month(),1);break;case"week":time=startOfDate(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":time=startOfDate(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":time=startOfDate(this.year(),this.month(),this.date());break;case"hour":time=this._d.valueOf();time-=mod$1(time+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":time=this._d.valueOf();time-=mod$1(time,MS_PER_MINUTE);break;case"second":time=this._d.valueOf();time-=mod$1(time,MS_PER_SECOND);break}this._d.setTime(time);hooks.updateOffset(this,true);return this}function endOf(units){var time,startOfDate;units=normalizeUnits(units);if(units===undefined||units==="millisecond"||!this.isValid()){return this}startOfDate=this._isUTC?utcStartOfDate:localStartOfDate;switch(units){case"year":time=startOfDate(this.year()+1,0,1)-1;break;case"quarter":time=startOfDate(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":time=startOfDate(this.year(),this.month()+1,1)-1;break;case"week":time=startOfDate(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":time=startOfDate(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":time=startOfDate(this.year(),this.month(),this.date()+1)-1;break;case"hour":time=this._d.valueOf();time+=MS_PER_HOUR-mod$1(time+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":time=this._d.valueOf();time+=MS_PER_MINUTE-mod$1(time,MS_PER_MINUTE)-1;break;case"second":time=this._d.valueOf();time+=MS_PER_SECOND-mod$1(time,MS_PER_SECOND)-1;break}this._d.setTime(time);hooks.updateOffset(this,true);return this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var m=this;return[m.year(),m.month(),m.date(),m.hour(),m.minute(),m.second(),m.millisecond()]}function toObject(){var m=this;return{years:m.year(),months:m.month(),date:m.date(),hours:m.hours(),minutes:m.minutes(),seconds:m.seconds(),milliseconds:m.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(input,array,config,token){var era=config._locale.erasParse(input,token,config._strict);if(era){getParsingFlags(config).era=era}else{getParsingFlags(config).invalidEra=input}});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(input,array,config,token){var match;if(config._locale._eraYearOrdinalRegex){match=input.match(config._locale._eraYearOrdinalRegex)}if(config._locale.eraYearOrdinalParse){array[YEAR]=config._locale.eraYearOrdinalParse(input,match)}else{array[YEAR]=parseInt(input,10)}});function localeEras(m,format){var i,l,date,eras=this._eras||getLocale("en")._eras;for(i=0,l=eras.length;i<l;++i){switch(typeof eras[i].since){case"string":date=hooks(eras[i].since).startOf("day");eras[i].since=date.valueOf();break}switch(typeof eras[i].until){case"undefined":eras[i].until=+Infinity;break;case"string":date=hooks(eras[i].until).startOf("day").valueOf();eras[i].until=date.valueOf();break}}return eras}function localeErasParse(eraName,format,strict){var i,l,eras=this.eras(),name,abbr,narrow;eraName=eraName.toUpperCase();for(i=0,l=eras.length;i<l;++i){name=eras[i].name.toUpperCase();abbr=eras[i].abbr.toUpperCase();narrow=eras[i].narrow.toUpperCase();if(strict){switch(format){case"N":case"NN":case"NNN":if(abbr===eraName){return eras[i]}break;case"NNNN":if(name===eraName){return eras[i]}break;case"NNNNN":if(narrow===eraName){return eras[i]}break}}else if([name,abbr,narrow].indexOf(eraName)>=0){return eras[i]}}}function localeErasConvertYear(era,year){var dir=era.since<=era.until?+1:-1;if(year===undefined){return hooks(era.since).year()}else{return hooks(era.since).year()+(year-era.offset)*dir}}function getEraName(){var i,l,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until){return eras[i].name}if(eras[i].until<=val&&val<=eras[i].since){return eras[i].name}}return""}function getEraNarrow(){var i,l,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until){return eras[i].narrow}if(eras[i].until<=val&&val<=eras[i].since){return eras[i].narrow}}return""}function getEraAbbr(){var i,l,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until){return eras[i].abbr}if(eras[i].until<=val&&val<=eras[i].since){return eras[i].abbr}}return""}function getEraYear(){var i,l,dir,val,eras=this.localeData().eras();for(i=0,l=eras.length;i<l;++i){dir=eras[i].since<=eras[i].until?+1:-1;val=this.clone().startOf("day").valueOf();if(eras[i].since<=val&&val<=eras[i].until||eras[i].until<=val&&val<=eras[i].since){return(this.year()-hooks(eras[i].since).year())*dir+eras[i].offset}}return this.year()}function erasNameRegex(isStrict){if(!hasOwnProp(this,"_erasNameRegex")){computeErasParse.call(this)}return isStrict?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(isStrict){if(!hasOwnProp(this,"_erasAbbrRegex")){computeErasParse.call(this)}return isStrict?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(isStrict){if(!hasOwnProp(this,"_erasNarrowRegex")){computeErasParse.call(this)}return isStrict?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(isStrict,locale){return locale.erasAbbrRegex(isStrict)}function matchEraName(isStrict,locale){return locale.erasNameRegex(isStrict)}function matchEraNarrow(isStrict,locale){return locale.erasNarrowRegex(isStrict)}function matchEraYearOrdinal(isStrict,locale){return locale._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var abbrPieces=[],namePieces=[],narrowPieces=[],mixedPieces=[],i,l,erasName,erasAbbr,erasNarrow,eras=this.eras();for(i=0,l=eras.length;i<l;++i){erasName=regexEscape(eras[i].name);erasAbbr=regexEscape(eras[i].abbr);erasNarrow=regexEscape(eras[i].narrow);namePieces.push(erasName);abbrPieces.push(erasAbbr);narrowPieces.push(erasNarrow);mixedPieces.push(erasName);mixedPieces.push(erasAbbr);mixedPieces.push(erasNarrow)}this._erasRegex=new RegExp("^("+mixedPieces.join("|")+")","i");this._erasNameRegex=new RegExp("^("+namePieces.join("|")+")","i");this._erasAbbrRegex=new RegExp("^("+abbrPieces.join("|")+")","i");this._erasNarrowRegex=new RegExp("^("+narrowPieces.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100});addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(token,getter){addFormatToken(0,[token,token.length],0,getter)}addWeekYearFormatToken("gggg","weekYear");addWeekYearFormatToken("ggggg","weekYear");addWeekYearFormatToken("GGGG","isoWeekYear");addWeekYearFormatToken("GGGGG","isoWeekYear");addRegexToken("G",matchSigned);addRegexToken("g",matchSigned);addRegexToken("GG",match1to2,match2);addRegexToken("gg",match1to2,match2);addRegexToken("GGGG",match1to4,match4);addRegexToken("gggg",match1to4,match4);addRegexToken("GGGGG",match1to6,match6);addRegexToken("ggggg",match1to6,match6);addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],function(input,week,config,token){week[token.substr(0,2)]=toInt(input)});addWeekParseToken(["gg","GG"],function(input,week,config,token){week[token]=hooks.parseTwoDigitYear(input)});function getSetWeekYear(input){return getSetWeekYearHelper.call(this,input,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(input){return getSetWeekYearHelper.call(this,input,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var weekInfo=this.localeData()._week;return weeksInYear(this.year(),weekInfo.dow,weekInfo.doy)}function getWeeksInWeekYear(){var weekInfo=this.localeData()._week;return weeksInYear(this.weekYear(),weekInfo.dow,weekInfo.doy)}function getSetWeekYearHelper(input,week,weekday,dow,doy){var weeksTarget;if(input==null){return weekOfYear(this,dow,doy).year}else{weeksTarget=weeksInYear(input,dow,doy);if(week>weeksTarget){week=weeksTarget}return setWeekAll.call(this,input,week,weekday,dow,doy)}}function setWeekAll(weekYear,week,weekday,dow,doy){var dayOfYearData=dayOfYearFromWeeks(weekYear,week,weekday,dow,doy),date=createUTCDate(dayOfYearData.year,0,dayOfYearData.dayOfYear);this.year(date.getUTCFullYear());this.month(date.getUTCMonth());this.date(date.getUTCDate());return this}addFormatToken("Q",0,"Qo","quarter");addRegexToken("Q",match1);addParseToken("Q",function(input,array){array[MONTH]=(toInt(input)-1)*3});function getSetQuarter(input){return input==null?Math.ceil((this.month()+1)/3):this.month((input-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addRegexToken("D",match1to2,match1to2NoLeadingZero);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(isStrict,locale){return isStrict?locale._dayOfMonthOrdinalParse||locale._ordinalParse:locale._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE);addParseToken("Do",function(input,array){array[DATE]=toInt(input.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",true);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(input,array,config){config._dayOfYear=toInt(input)});function getSetDayOfYear(input){var dayOfYear=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return input==null?dayOfYear:this.add(input-dayOfYear,"d")}addFormatToken("m",["mm",2],0,"minute");addRegexToken("m",match1to2,match1to2HasZero);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",false);addFormatToken("s",["ss",2],0,"second");addRegexToken("s",match1to2,match1to2HasZero);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",false);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S"){addRegexToken(token,matchUnsigned)}function parseMs(input,array){array[MILLISECOND]=toInt(("0."+input)*1e3)}for(token="S";token.length<=9;token+="S"){addParseToken(token,parseMs)}getSetMillisecond=makeGetSet("Milliseconds",false);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone;proto.diff=diff;proto.endOf=endOf;proto.format=format;proto.from=from;proto.fromNow=fromNow;proto.to=to;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter;proto.isBefore=isBefore;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang;proto.locale=locale;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray;proto.toObject=toObject;proto.toDate=toDate;proto.toISOString=toISOString;proto.inspect=inspect;if(typeof Symbol!=="undefined"&&Symbol.for!=null){proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}}proto.toJSON=toJSON;proto.toString=toString;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.eraName=getEraName;proto.eraNarrow=getEraNarrow;proto.eraAbbr=getEraAbbr;proto.eraYear=getEraYear;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.weeksInWeekYear=getWeeksInWeekYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth);proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear);proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(input){return createLocal(input*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(string){return string}var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set;proto$1.eras=localeEras;proto$1.erasParse=localeErasParse;proto$1.erasConvertYear=localeErasConvertYear;proto$1.erasAbbrRegex=erasAbbrRegex;proto$1.erasNameRegex=erasNameRegex;proto$1.erasNarrowRegex=erasNarrowRegex;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1(format,index,field,setter){var locale=getLocale(),utc=createUTC().set(setter,index);return locale[field](utc,format)}function listMonthsImpl(format,index,field){if(isNumber(format)){index=format;format=undefined}format=format||"";if(index!=null){return get$1(format,index,field,"month")}var i,out=[];for(i=0;i<12;i++){out[i]=get$1(format,i,field,"month")}return out}function listWeekdaysImpl(localeSorted,format,index,field){if(typeof localeSorted==="boolean"){if(isNumber(format)){index=format;format=undefined}format=format||""}else{format=localeSorted;index=format;localeSorted=false;if(isNumber(format)){index=format;format=undefined}format=format||""}var locale=getLocale(),shift=localeSorted?locale._week.dow:0,i,out=[];if(index!=null){return get$1(format,(index+shift)%7,field,"day")}for(i=0;i<7;i++){out[i]=get$1(format,(i+shift)%7,field,"day")}return out}function listMonths(format,index){return listMonthsImpl(format,index,"months")}function listMonthsShort(format,index){return listMonthsImpl(format,index,"monthsShort")}function listWeekdays(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,"weekdays")}function listWeekdaysShort(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,"weekdaysShort")}function listWeekdaysMin(localeSorted,format,index){return listWeekdaysImpl(localeSorted,format,index,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:+Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(number){var b=number%10,output=toInt(number%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th";return number+output}});hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var data=this._data;this._milliseconds=mathAbs(this._milliseconds);this._days=mathAbs(this._days);this._months=mathAbs(this._months);data.milliseconds=mathAbs(data.milliseconds);data.seconds=mathAbs(data.seconds);data.minutes=mathAbs(data.minutes);data.hours=mathAbs(data.hours);data.months=mathAbs(data.months);data.years=mathAbs(data.years);return this}function addSubtract$1(duration,input,value,direction){var other=createDuration(input,value);duration._milliseconds+=direction*other._milliseconds;duration._days+=direction*other._days;duration._months+=direction*other._months;return duration._bubble()}function add$1(input,value){return addSubtract$1(this,input,value,1)}function subtract$1(input,value){return addSubtract$1(this,input,value,-1)}function absCeil(number){if(number<0){return Math.floor(number)}else{return Math.ceil(number)}}function bubble(){var milliseconds=this._milliseconds,days=this._days,months=this._months,data=this._data,seconds,minutes,hours,years,monthsFromDays;if(!(milliseconds>=0&&days>=0&&months>=0||milliseconds<=0&&days<=0&&months<=0)){milliseconds+=absCeil(monthsToDays(months)+days)*864e5;days=0;months=0}data.milliseconds=milliseconds%1e3;seconds=absFloor(milliseconds/1e3);data.seconds=seconds%60;minutes=absFloor(seconds/60);data.minutes=minutes%60;hours=absFloor(minutes/60);data.hours=hours%24;days+=absFloor(hours/24);monthsFromDays=absFloor(daysToMonths(days));months+=monthsFromDays;days-=absCeil(monthsToDays(monthsFromDays));years=absFloor(months/12);months%=12;data.days=days;data.months=months;data.years=years;return this}function daysToMonths(days){return days*4800/146097}function monthsToDays(months){return months*146097/4800}function as(units){if(!this.isValid()){return NaN}var days,months,milliseconds=this._milliseconds;units=normalizeUnits(units);if(units==="month"||units==="quarter"||units==="year"){days=this._days+milliseconds/864e5;months=this._months+daysToMonths(days);switch(units){case"month":return months;case"quarter":return months/3;case"year":return months/12}}else{days=this._days+Math.round(monthsToDays(this._months));switch(units){case"week":return days/7+milliseconds/6048e5;case"day":return days+milliseconds/864e5;case"hour":return days*24+milliseconds/36e5;case"minute":return days*1440+milliseconds/6e4;case"second":return days*86400+milliseconds/1e3;case"millisecond":return Math.floor(days*864e5)+milliseconds;default:throw new Error("Unknown unit "+units)}}}function makeAs(alias){return function(){return this.as(alias)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y"),valueOf$1=asMilliseconds;function clone$1(){return createDuration(this)}function get$2(units){units=normalizeUnits(units);return this.isValid()?this[units+"s"]():NaN}function makeGetter(name){return function(){return this.isValid()?this._data[name]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(string,number,withoutSuffix,isFuture,locale){return locale.relativeTime(number||1,!!withoutSuffix,string,isFuture)}function relativeTime$1(posNegDuration,withoutSuffix,thresholds,locale){var duration=createDuration(posNegDuration).abs(),seconds=round(duration.as("s")),minutes=round(duration.as("m")),hours=round(duration.as("h")),days=round(duration.as("d")),months=round(duration.as("M")),weeks=round(duration.as("w")),years=round(duration.as("y")),a=seconds<=thresholds.ss&&["s",seconds]||seconds<thresholds.s&&["ss",seconds]||minutes<=1&&["m"]||minutes<thresholds.m&&["mm",minutes]||hours<=1&&["h"]||hours<thresholds.h&&["hh",hours]||days<=1&&["d"]||days<thresholds.d&&["dd",days];if(thresholds.w!=null){a=a||weeks<=1&&["w"]||weeks<thresholds.w&&["ww",weeks]}a=a||months<=1&&["M"]||months<thresholds.M&&["MM",months]||years<=1&&["y"]||["yy",years];a[2]=withoutSuffix;a[3]=+posNegDuration>0;a[4]=locale;return substituteTimeAgo.apply(null,a)}function getSetRelativeTimeRounding(roundingFunction){if(roundingFunction===undefined){return round}if(typeof roundingFunction==="function"){round=roundingFunction;return true}return false}function getSetRelativeTimeThreshold(threshold,limit){if(thresholds[threshold]===undefined){return false}if(limit===undefined){return thresholds[threshold]}thresholds[threshold]=limit;if(threshold==="s"){thresholds.ss=limit-1}return true}function humanize(argWithSuffix,argThresholds){if(!this.isValid()){return this.localeData().invalidDate()}var withSuffix=false,th=thresholds,locale,output;if(typeof argWithSuffix==="object"){argThresholds=argWithSuffix;argWithSuffix=false}if(typeof argWithSuffix==="boolean"){withSuffix=argWithSuffix}if(typeof argThresholds==="object"){th=Object.assign({},thresholds,argThresholds);if(argThresholds.s!=null&&argThresholds.ss==null){th.ss=argThresholds.s-1}}locale=this.localeData();output=relativeTime$1(this,!withSuffix,th,locale);if(withSuffix){output=locale.pastFuture(+this,output)}return locale.postformat(output)}var abs$1=Math.abs;function sign(x){return(x>0)-(x<0)||+x}function toISOString$1(){if(!this.isValid()){return this.localeData().invalidDate()}var seconds=abs$1(this._milliseconds)/1e3,days=abs$1(this._days),months=abs$1(this._months),minutes,hours,years,s,total=this.asSeconds(),totalSign,ymSign,daysSign,hmsSign;if(!total){return"P0D"}minutes=absFloor(seconds/60);hours=absFloor(minutes/60);seconds%=60;minutes%=60;years=absFloor(months/12);months%=12;s=seconds?seconds.toFixed(3).replace(/\.?0+$/,""):"";totalSign=total<0?"-":"";ymSign=sign(this._months)!==sign(total)?"-":"";daysSign=sign(this._days)!==sign(total)?"-":"";hmsSign=sign(this._milliseconds)!==sign(total)?"-":"";return totalSign+"P"+(years?ymSign+years+"Y":"")+(months?ymSign+months+"M":"")+(days?daysSign+days+"D":"")+(hours||minutes||seconds?"T":"")+(hours?hmsSign+hours+"H":"")+(minutes?hmsSign+minutes+"M":"")+(seconds?hmsSign+s+"S":"")}var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1;proto$2.get=get$2;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale;proto$2.localeData=localeData;proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(input,array,config){config._d=new Date(parseFloat(input)*1e3)});addParseToken("x",function(input,array,config){config._d=new Date(toInt(input))});hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};return hooks})},{}],18:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=index;var _moment=_interopRequireDefault(require("moment"));var _crc=_interopRequireDefault(require("crc-32"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var _getFingerprint=function _getFingerprint(object,algorithm){switch(_typeof(object)){case"object":if(object==null){return"o:null"}else if(object._isAMomentObject){return"m:".concat(object.toISOString())}else if(object instanceof Date){return"m:".concat((0,_moment["default"])(object).toISOString())}else if(Array.isArray(object)){return"a:[".concat(object.map(function(i){return getObjectFingerprint(i,algorithm)}),"]")}else{return"o:".concat(getObjectFingerprint(object,algorithm))}case"boolean":return"b:".concat(object?"t":"f");case"function":throw new Error("You cannot pass a function as data item");case"number":return"n:".concat(object.toString());case"string":return"s:".concat(object);case"undefined":return"u"}};var getObjectFingerprint=function getObjectFingerprint(value,algorithm){try{if(_typeof(value)==="object"){var sortedKeys=Object.keys(value).sort();var buff="";var _iterator=_createForOfIteratorHelper(sortedKeys),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var key=_step.value;buff+="".concat(key,"<").concat(index(value[key],algorithm),">")}}catch(err){_iterator.e(err)}finally{_iterator.f()}return buff}else{return JSON.parse(value)}}catch(e){return"nn"}};function index(object,algorithm){if(algorithm){return algorithm(_getFingerprint(object,algorithm))}else{return _crc["default"].str(_getFingerprint(object)).toString(16)}}},{"crc-32":15,moment:17}],19:[function(require,module,exports){var e=function e(t){function r(e,t,n){var a,o={};if(Array.isArray(e))return e.concat(t);for(a in e)o[n?a.toLowerCase():a]=e[a];for(a in t){var i=n?a.toLowerCase():a,u=t[a];o[i]=i in o&&"object"==typeof u?r(o[i],u,"headers"==i):u}return o}function n(e,n,a,o,i){var u="string"!=typeof e?(n=e).url:e,c={config:n},s=r(t,n),p={};o=o||s.data,(s.transformRequest||[]).map(function(e){o=e(o,s.headers)||o}),s.auth&&(p.authorization=s.auth),o&&"object"==typeof o&&"function"!=typeof o.append&&"function"!=typeof o.text&&(o=JSON.stringify(o),p["content-type"]="application/json");try{p[s.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+s.xsrfCookieName+"=([^;]*)"))[2])}catch(e){}return s.baseURL&&(u=u.replace(/^(?!.*\/\/)\/?/,s.baseURL+"/")),s.params&&(u+=(~u.indexOf("?")?"&":"?")+(s.paramsSerializer?s.paramsSerializer(s.params):new URLSearchParams(s.params))),(s.fetch||fetch)(u,{method:(a||s.method||"get").toUpperCase(),body:o,headers:r(s.headers,p,!0),credentials:s.withCredentials?"include":i}).then(function(e){for(var t in e)"function"!=typeof e[t]&&(c[t]=e[t]);return"stream"==s.responseType?(c.data=e.body,c):e[s.responseType||"text"]().then(function(e){c.data=e,c.data=JSON.parse(e)}).catch(Object).then(function(){return(s.validateStatus?s.validateStatus(e.status):e.ok)?c:Promise.reject(c)})})}return t=t||{},n.request=n,n.get=function(e,t){return n(e,t,"get")},n.delete=function(e,t){return n(e,t,"delete")},n.head=function(e,t){return n(e,t,"head")},n.options=function(e,t){return n(e,t,"options")},n.post=function(e,t,r){return n(e,r,"post",t)},n.put=function(e,t,r){return n(e,r,"put",t)},n.patch=function(e,t,r){return n(e,r,"patch",t)},n.all=Promise.all.bind(Promise),n.spread=function(e){return e.apply.bind(e,e)},n.CancelToken="function"==typeof AbortController?AbortController:Object,n.defaults=t,n.create=e,n}();module.exports=e},{}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"NIL",{enumerable:true,get:function(){return _nil.default}});Object.defineProperty(exports,"parse",{enumerable:true,get:function(){return _parse.default}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function(){return _stringify.default}});Object.defineProperty(exports,"v1",{enumerable:true,get:function(){return _v.default}});Object.defineProperty(exports,"v3",{enumerable:true,get:function(){return _v2.default}});Object.defineProperty(exports,"v4",{enumerable:true,get:function(){return _v3.default}});Object.defineProperty(exports,"v5",{enumerable:true,get:function(){return _v4.default}});Object.defineProperty(exports,"validate",{enumerable:true,get:function(){return _validate.default}});Object.defineProperty(exports,"version",{enumerable:true,get:function(){return _version.default}});var _v=_interopRequireDefault(require("./v1.js"));var _v2=_interopRequireDefault(require("./v3.js"));var _v3=_interopRequireDefault(require("./v4.js"));var _v4=_interopRequireDefault(require("./v5.js"));var _nil=_interopRequireDefault(require("./nil.js"));var _version=_interopRequireDefault(require("./version.js"));var _validate=_interopRequireDefault(require("./validate.js"));var _stringify=_interopRequireDefault(require("./stringify.js"));var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}},{"./nil.js":23,"./parse.js":24,"./stringify.js":28,"./v1.js":29,"./v3.js":30,"./v4.js":32,"./v5.js":33,"./validate.js":34,"./version.js":35}],21:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;function md5(bytes){if(typeof bytes==="string"){const msg=unescape(encodeURIComponent(bytes));bytes=new Uint8Array(msg.length);for(let i=0;i<msg.length;++i){bytes[i]=msg.charCodeAt(i)}}return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes),bytes.length*8))}function md5ToHexEncodedArray(input){const output=[];const length32=input.length*32;const hexTab="0123456789abcdef";for(let i=0;i<length32;i+=8){const x=input[i>>5]>>>i%32&255;const hex=parseInt(hexTab.charAt(x>>>4&15)+hexTab.charAt(x&15),16);output.push(hex)}return output}function getOutputLength(inputLength8){return(inputLength8+64>>>9<<4)+14+1}function wordsToMd5(x,len){x[len>>5]|=128<<len%32;x[getOutputLength(len)-1]=len;let a=1732584193;let b=-271733879;let c=-1732584194;let d=271733878;for(let i=0;i<x.length;i+=16){const olda=a;const oldb=b;const oldc=c;const oldd=d;a=md5ff(a,b,c,d,x[i],7,-680876936);d=md5ff(d,a,b,c,x[i+1],12,-389564586);c=md5ff(c,d,a,b,x[i+2],17,606105819);b=md5ff(b,c,d,a,x[i+3],22,-1044525330);a=md5ff(a,b,c,d,x[i+4],7,-176418897);d=md5ff(d,a,b,c,x[i+5],12,1200080426);c=md5ff(c,d,a,b,x[i+6],17,-1473231341);b=md5ff(b,c,d,a,x[i+7],22,-45705983);a=md5ff(a,b,c,d,x[i+8],7,1770035416);d=md5ff(d,a,b,c,x[i+9],12,-1958414417);c=md5ff(c,d,a,b,x[i+10],17,-42063);b=md5ff(b,c,d,a,x[i+11],22,-1990404162);a=md5ff(a,b,c,d,x[i+12],7,1804603682);d=md5ff(d,a,b,c,x[i+13],12,-40341101);c=md5ff(c,d,a,b,x[i+14],17,-1502002290);b=md5ff(b,c,d,a,x[i+15],22,1236535329);a=md5gg(a,b,c,d,x[i+1],5,-165796510);d=md5gg(d,a,b,c,x[i+6],9,-1069501632);c=md5gg(c,d,a,b,x[i+11],14,643717713);b=md5gg(b,c,d,a,x[i],20,-373897302);a=md5gg(a,b,c,d,x[i+5],5,-701558691);d=md5gg(d,a,b,c,x[i+10],9,38016083);c=md5gg(c,d,a,b,x[i+15],14,-660478335);b=md5gg(b,c,d,a,x[i+4],20,-405537848);a=md5gg(a,b,c,d,x[i+9],5,568446438);d=md5gg(d,a,b,c,x[i+14],9,-1019803690);c=md5gg(c,d,a,b,x[i+3],14,-187363961);b=md5gg(b,c,d,a,x[i+8],20,1163531501);a=md5gg(a,b,c,d,x[i+13],5,-1444681467);d=md5gg(d,a,b,c,x[i+2],9,-51403784);c=md5gg(c,d,a,b,x[i+7],14,1735328473);b=md5gg(b,c,d,a,x[i+12],20,-1926607734);a=md5hh(a,b,c,d,x[i+5],4,-378558);d=md5hh(d,a,b,c,x[i+8],11,-2022574463);c=md5hh(c,d,a,b,x[i+11],16,1839030562);b=md5hh(b,c,d,a,x[i+14],23,-35309556);a=md5hh(a,b,c,d,x[i+1],4,-1530992060);d=md5hh(d,a,b,c,x[i+4],11,1272893353);c=md5hh(c,d,a,b,x[i+7],16,-155497632);b=md5hh(b,c,d,a,x[i+10],23,-1094730640);a=md5hh(a,b,c,d,x[i+13],4,681279174);d=md5hh(d,a,b,c,x[i],11,-358537222);c=md5hh(c,d,a,b,x[i+3],16,-722521979);b=md5hh(b,c,d,a,x[i+6],23,76029189);a=md5hh(a,b,c,d,x[i+9],4,-640364487);d=md5hh(d,a,b,c,x[i+12],11,-421815835);c=md5hh(c,d,a,b,x[i+15],16,530742520);b=md5hh(b,c,d,a,x[i+2],23,-995338651);a=md5ii(a,b,c,d,x[i],6,-198630844);d=md5ii(d,a,b,c,x[i+7],10,1126891415);c=md5ii(c,d,a,b,x[i+14],15,-1416354905);b=md5ii(b,c,d,a,x[i+5],21,-57434055);a=md5ii(a,b,c,d,x[i+12],6,1700485571);d=md5ii(d,a,b,c,x[i+3],10,-1894986606);c=md5ii(c,d,a,b,x[i+10],15,-1051523);b=md5ii(b,c,d,a,x[i+1],21,-2054922799);a=md5ii(a,b,c,d,x[i+8],6,1873313359);d=md5ii(d,a,b,c,x[i+15],10,-30611744);c=md5ii(c,d,a,b,x[i+6],15,-1560198380);b=md5ii(b,c,d,a,x[i+13],21,1309151649);a=md5ii(a,b,c,d,x[i+4],6,-145523070);d=md5ii(d,a,b,c,x[i+11],10,-1120210379);c=md5ii(c,d,a,b,x[i+2],15,718787259);b=md5ii(b,c,d,a,x[i+9],21,-343485551);a=safeAdd(a,olda);b=safeAdd(b,oldb);c=safeAdd(c,oldc);d=safeAdd(d,oldd)}return[a,b,c,d]}function bytesToWords(input){if(input.length===0){return[]}const length8=input.length*8;const output=new Uint32Array(getOutputLength(length8));for(let i=0;i<length8;i+=8){output[i>>5]|=(input[i/8]&255)<<i%32}return output}function safeAdd(x,y){const lsw=(x&65535)+(y&65535);const msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt}function md5cmn(q,a,b,x,s,t){return safeAdd(bitRotateLeft(safeAdd(safeAdd(a,q),safeAdd(x,t)),s),b)}function md5ff(a,b,c,d,x,s,t){return md5cmn(b&c|~b&d,a,b,x,s,t)}function md5gg(a,b,c,d,x,s,t){return md5cmn(b&d|c&~d,a,b,x,s,t)}function md5hh(a,b,c,d,x,s,t){return md5cmn(b^c^d,a,b,x,s,t)}function md5ii(a,b,c,d,x,s,t){return md5cmn(c^(b|~d),a,b,x,s,t)}var _default=md5;exports.default=_default},{}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;const randomUUID=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var _default={randomUUID:randomUUID};exports.default=_default},{}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _default="00000000-0000-0000-0000-000000000000";exports.default=_default},{}],24:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function parse(uuid){if(!(0,_validate.default)(uuid)){throw TypeError("Invalid UUID")}let v;const arr=new Uint8Array(16);arr[0]=(v=parseInt(uuid.slice(0,8),16))>>>24;arr[1]=v>>>16&255;arr[2]=v>>>8&255;arr[3]=v&255;arr[4]=(v=parseInt(uuid.slice(9,13),16))>>>8;arr[5]=v&255;arr[6]=(v=parseInt(uuid.slice(14,18),16))>>>8;arr[7]=v&255;arr[8]=(v=parseInt(uuid.slice(19,23),16))>>>8;arr[9]=v&255;arr[10]=(v=parseInt(uuid.slice(24,36),16))/1099511627776&255;arr[11]=v/4294967296&255;arr[12]=v>>>24&255;arr[13]=v>>>16&255;arr[14]=v>>>8&255;arr[15]=v&255;return arr}var _default=parse;exports.default=_default},{"./validate.js":34}],25:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;exports.default=_default},{}],26:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=rng;let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!getRandomValues){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return getRandomValues(rnds8)}},{}],27:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;function f(s,x,y,z){switch(s){case 0:return x&y^~x&z;case 1:return x^y^z;case 2:return x&y^x&z^y&z;case 3:return x^y^z}}function ROTL(x,n){return x<<n|x>>>32-n}function sha1(bytes){const K=[1518500249,1859775393,2400959708,3395469782];const H=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof bytes==="string"){const msg=unescape(encodeURIComponent(bytes));bytes=[];for(let i=0;i<msg.length;++i){bytes.push(msg.charCodeAt(i))}}else if(!Array.isArray(bytes)){bytes=Array.prototype.slice.call(bytes)}bytes.push(128);const l=bytes.length/4+2;const N=Math.ceil(l/16);const M=new Array(N);for(let i=0;i<N;++i){const arr=new Uint32Array(16);for(let j=0;j<16;++j){arr[j]=bytes[i*64+j*4]<<24|bytes[i*64+j*4+1]<<16|bytes[i*64+j*4+2]<<8|bytes[i*64+j*4+3]}M[i]=arr}M[N-1][14]=(bytes.length-1)*8/Math.pow(2,32);M[N-1][14]=Math.floor(M[N-1][14]);M[N-1][15]=(bytes.length-1)*8&4294967295;for(let i=0;i<N;++i){const W=new Uint32Array(80);for(let t=0;t<16;++t){W[t]=M[i][t]}for(let t=16;t<80;++t){W[t]=ROTL(W[t-3]^W[t-8]^W[t-14]^W[t-16],1)}let a=H[0];let b=H[1];let c=H[2];let d=H[3];let e=H[4];for(let t=0;t<80;++t){const s=Math.floor(t/20);const T=ROTL(a,5)+f(s,b,c,d)+e+K[s]+W[t]>>>0;e=d;d=c;c=ROTL(b,30)>>>0;b=a;a=T}H[0]=H[0]+a>>>0;H[1]=H[1]+b>>>0;H[2]=H[2]+c>>>0;H[3]=H[3]+d>>>0;H[4]=H[4]+e>>>0}return[H[0]>>24&255,H[0]>>16&255,H[0]>>8&255,H[0]&255,H[1]>>24&255,H[1]>>16&255,H[1]>>8&255,H[1]&255,H[2]>>24&255,H[2]>>16&255,H[2]>>8&255,H[2]&255,H[3]>>24&255,H[3]>>16&255,H[3]>>8&255,H[3]&255,H[4]>>24&255,H[4]>>16&255,H[4]>>8&255,H[4]&255]}var _default=sha1;exports.default=_default},{}],28:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;exports.unsafeStringify=unsafeStringify;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const byteToHex=[];for(let i=0;i<256;++i){byteToHex.push((i+256).toString(16).slice(1))}function unsafeStringify(arr,offset=0){return byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]}function stringify(arr,offset=0){const uuid=unsafeStringify(arr,offset);if(!(0,_validate.default)(uuid)){throw TypeError("Stringified UUID is invalid")}return uuid}var _default=stringify;exports.default=_default},{"./validate.js":34}],29:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}let _nodeId;let _clockseq;let _lastMSecs=0;let _lastNSecs=0;function v1(options,buf,offset){let i=buf&&offset||0;const b=buf||new Array(16);options=options||{};let node=options.node||_nodeId;let clockseq=options.clockseq!==undefined?options.clockseq:_clockseq;if(node==null||clockseq==null){const seedBytes=options.random||(options.rng||_rng.default)();if(node==null){node=_nodeId=[seedBytes[0]|1,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]}if(clockseq==null){clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&16383}}let msecs=options.msecs!==undefined?options.msecs:Date.now();let nsecs=options.nsecs!==undefined?options.nsecs:_lastNSecs+1;const dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&options.clockseq===undefined){clockseq=clockseq+1&16383}if((dt<0||msecs>_lastMSecs)&&options.nsecs===undefined){nsecs=0}if(nsecs>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=msecs;_lastNSecs=nsecs;_clockseq=clockseq;msecs+=122192928e5;const tl=((msecs&268435455)*1e4+nsecs)%4294967296;b[i++]=tl>>>24&255;b[i++]=tl>>>16&255;b[i++]=tl>>>8&255;b[i++]=tl&255;const tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255;b[i++]=tmh&255;b[i++]=tmh>>>24&15|16;b[i++]=tmh>>>16&255;b[i++]=clockseq>>>8|128;b[i++]=clockseq&255;for(let n=0;n<6;++n){b[i+n]=node[n]}return buf||(0,_stringify.unsafeStringify)(b)}var _default=v1;exports.default=_default},{"./rng.js":26,"./stringify.js":28}],30:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _md=_interopRequireDefault(require("./md5.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const v3=(0,_v.default)("v3",48,_md.default);var _default=v3;exports.default=_default},{"./md5.js":21,"./v35.js":31}],31:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.URL=exports.DNS=void 0;exports.default=v35;var _stringify=require("./stringify.js");var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function stringToBytes(str){str=unescape(encodeURIComponent(str));const bytes=[];for(let i=0;i<str.length;++i){bytes.push(str.charCodeAt(i))}return bytes}const DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";exports.DNS=DNS;const URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";exports.URL=URL;function v35(name,version,hashfunc){function generateUUID(value,namespace,buf,offset){var _namespace;if(typeof value==="string"){value=stringToBytes(value)}if(typeof namespace==="string"){namespace=(0,_parse.default)(namespace)}if(((_namespace=namespace)===null||_namespace===void 0?void 0:_namespace.length)!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}let bytes=new Uint8Array(16+value.length);bytes.set(namespace);bytes.set(value,namespace.length);bytes=hashfunc(bytes);bytes[6]=bytes[6]&15|version;bytes[8]=bytes[8]&63|128;if(buf){offset=offset||0;for(let i=0;i<16;++i){buf[offset+i]=bytes[i]}return buf}return(0,_stringify.unsafeStringify)(bytes)}try{generateUUID.name=name}catch(err){}generateUUID.DNS=DNS;generateUUID.URL=URL;return generateUUID}},{"./parse.js":24,"./stringify.js":28}],32:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _native=_interopRequireDefault(require("./native.js"));var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function v4(options,buf,offset){if(_native.default.randomUUID&&!buf&&!options){return _native.default.randomUUID()}options=options||{};const rnds=options.random||(options.rng||_rng.default)();rnds[6]=rnds[6]&15|64;rnds[8]=rnds[8]&63|128;if(buf){offset=offset||0;for(let i=0;i<16;++i){buf[offset+i]=rnds[i]}return buf}return(0,_stringify.unsafeStringify)(rnds)}var _default=v4;exports.default=_default},{"./native.js":22,"./rng.js":26,"./stringify.js":28}],33:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _sha=_interopRequireDefault(require("./sha1.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}const v5=(0,_v.default)("v5",80,_sha.default);var _default=v5;exports.default=_default},{"./sha1.js":27,"./v35.js":31}],34:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _regex=_interopRequireDefault(require("./regex.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function validate(uuid){return typeof uuid==="string"&&_regex.default.test(uuid)}var _default=validate;exports.default=_default},{"./regex.js":25}],35:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function version(uuid){if(!(0,_validate.default)(uuid)){throw TypeError("Invalid UUID")}return parseInt(uuid.slice(14,15),16)}var _default=version;exports.default=_default},{"./validate.js":34}],dataflux:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Model",{enumerable:true,get:function get(){return _Model["default"]}});Object.defineProperty(exports,"Store",{enumerable:true,get:function get(){return _ReactStore["default"]}});var _ReactStore=_interopRequireDefault(require("./ReactStore"));var _Model=_interopRequireDefault(require("./Model"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},{"./Model":2,"./ReactStore":7}]},{},[]);
2
2
  //# sourceMappingURL=dataflux.min.js.map