backendless 6.3.13 → 6.3.14

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,6 +1,6 @@
1
1
  /*
2
2
  * ********************************************************************************************************************
3
- * Backendless SDK for JavaScript. Version: 6.3.13
3
+ * Backendless SDK for JavaScript. Version: 6.3.14
4
4
  *
5
5
  * Copyright 2012-2022 BACKENDLESS.COM. All Rights Reserved.
6
6
  *
@@ -12,4 +12,4 @@
12
12
  * ********************************************************************************************************************
13
13
  */
14
14
  /*! For license information please see backendless.min.js.LICENSE.txt */
15
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Backendless=t():e.Backendless=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=44)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){e.exports=n(48)},function(e,t){function n(e,t,n,r,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,s){var i=e.apply(t,r);function a(e){n(i,o,s,a,u,"next",e)}function u(e){n(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(9).default,o=n(32);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";(function(e){var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(9)),s={isBrowser:i(),isLocalStorageSupported:function(){try{if(i()&&window.localStorage)return localStorage.setItem("localStorageTest",!0),localStorage.removeItem("localStorageTest"),!0}catch(e){}return!1}(),globalScope:"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===e?"undefined":(0,o.default)(e))&&e.global===e&&e,castArray:function(e){return Array.isArray(e)?e:void 0===e?[]:[e]},isCustomClassInstance:function(e){return!(!e||"object"!==(0,o.default)(e)||Array.isArray(e))&&e.constructor!==Object},getClassName:function(e){if(e&&e.className)return e.className;if("function"==typeof e&&e.name)return e.name;if(e&&"object"===(0,o.default)(e)&&!Array.isArray(e)){if(e.___class)return e.___class;if(e.constructor!==Object)return s.getClassName(e.constructor)}return null},uuid:function(){var e=function(){return Math.random().toString(16).slice(-4).toUpperCase()};return"".concat("".concat(e()).concat(e()),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat("".concat(e()).concat(e()).concat(e()))}};function i(){return"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&"object"===("undefined"==typeof window?"undefined":(0,o.default)(window))&&window===self}var a=s;t.default=a}).call(this,n(26))},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PAGING_DEFAULTS=void 0;var o=r(n(6)),s=r(n(1)),i=r(n(2)),a=r(n(10));function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var c={pageSize:10,offset:0};t.PAGING_DEFAULTS=c;var l=function(){function e(){(0,s.default)(this,e),this.offset=c.offset,this.pageSize=c.pageSize,this.sortBy=null,this.groupBy=null,this.properties=null,this.excludeProps=null,this.whereClause=null,this.havingClause=null,this.relations=null,this.relationsDepth=null,this.relationsPageSize=null,this.distinct=!1}return(0,i.default)(e,[{key:"setPageSize",value:function(e){if(e<=0)throw new Error("Page size must be a positive value.");return this.pageSize=e,this}},{key:"getPageSize",value:function(){return this.pageSize}},{key:"setOffset",value:function(e){if(e<0)throw new Error("Offset cannot have a negative value.");return this.offset=e,this}},{key:"getOffset",value:function(){return this.offset}},{key:"prepareNextPage",value:function(){return this.setOffset(this.offset+this.pageSize),this}},{key:"preparePreviousPage",value:function(){return this.setOffset(Math.max(this.offset-this.pageSize,0)),this}},{key:"getProperties",value:function(){return this.properties}},{key:"setProperties",value:function(e){return this.properties=a.default.castArray(e),this}},{key:"addProperty",value:function(e){return this.properties=this.properties||[],this.properties.push(e),this}},{key:"addProperties",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.addProperty(t)}))})),this}},{key:"addAllProperties",value:function(){return this.addProperty("*"),this}},{key:"excludeProperty",value:function(e){return this.excludeProps=this.excludeProps||[],this.excludeProps.push(e),this}},{key:"excludeProperties",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.excludeProperty(t)}))})),this}},{key:"getExcludeProperties",value:function(){return this.excludeProps}},{key:"getWhereClause",value:function(){return this.whereClause}},{key:"setWhereClause",value:function(e){return this.whereClause=e,this}},{key:"getHavingClause",value:function(){return this.havingClause}},{key:"setHavingClause",value:function(e){return this.havingClause=e,this}},{key:"getSortBy",value:function(){return this.sortBy}},{key:"setSortBy",value:function(e){return this.sortBy=a.default.castArray(e),this}},{key:"getGroupBy",value:function(){return this.groupBy}},{key:"setGroupBy",value:function(e){return this.groupBy=a.default.castArray(e),this}},{key:"getRelated",value:function(){return this.relations}},{key:"setRelated",value:function(e){return this.relations=a.default.castArray(e),this}},{key:"addRelated",value:function(e){return this.relations=(this.relations||[]).concat(e),this}},{key:"setRelationsDepth",value:function(e){return this.relationsDepth=e,this}},{key:"getRelationsDepth",value:function(){return this.relationsDepth}},{key:"setRelationsPageSize",value:function(e){return this.relationsPageSize=e,this}},{key:"getRelationsPageSize",value:function(){return this.relationsPageSize}},{key:"setDistinct",value:function(e){return this.distinct=!!e,this}},{key:"getDistinct",value:function(){return this.distinct}},{key:"setFileReferencePrefix",value:function(e){return this.fileReferencePrefix=e,this}},{key:"getFileReferencePrefix",value:function(){return this.fileReferencePrefix}},{key:"toJSON",value:function(){return{pageSize:this.pageSize,offset:this.offset,properties:this.properties,excludeProps:this.excludeProps,where:this.whereClause,having:this.havingClause,sortBy:this.sortBy,groupBy:this.groupBy,relations:this.relations,relationsDepth:this.relationsDepth,relationsPageSize:this.relationsPageSize,distinct:this.distinct,fileReferencePrefix:this.fileReferencePrefix}}}],[{key:"create",value:function(){return new this}},{key:"toRequestBody",value:function(t){var n=t instanceof e?t.toJSON():t?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t):{};return Object.keys(n).forEach((function(e){Array.isArray(n[e])?"groupPath"!==e&&(n[e]=n[e].join(",")):null==n[e]&&delete n[e]})),n.properties&&(n.props=n.properties,delete n.properties),n.relations&&(n.loadRelations=n.relations,delete n.relations),n}},{key:"toQueryString",value:function(t){if(t){t instanceof e&&(t=t.toJSON());var n=[];return t.pageSize>0&&n.push("pageSize=".concat(t.pageSize)),t.offset>0&&n.push("offset=".concat(t.offset)),Array.isArray(t.properties)&&t.properties.length&&t.properties.map((function(e){n.push("property=".concat(encodeURIComponent(e)))})),Array.isArray(t.excludeProps)&&t.excludeProps.length&&n.push("excludeProps=".concat(f(t.excludeProps))),t.where&&n.push("where=".concat(encodeURIComponent(t.where))),t.having&&n.push("having=".concat(encodeURIComponent(t.having))),t.sortBy&&n.push(Array.isArray(t.sortBy)?"sortBy=".concat(f(t.sortBy)):"sortBy=".concat(encodeURIComponent(t.sortBy))),t.groupBy&&n.push(Array.isArray(t.groupBy)?"groupBy=".concat(f(t.groupBy)):"groupBy=".concat(encodeURIComponent(t.groupBy))),Array.isArray(t.relations)&&n.push(t.relations.length?"loadRelations=".concat(f(t.relations)):"loadRelations=*"),t.relationsDepth>0&&n.push("relationsDepth=".concat(t.relationsDepth)),t.relationsPageSize>0&&n.push("relationsPageSize=".concat(t.relationsPageSize)),t.distinct&&n.push("distinct=".concat(t.distinct)),t.fileReferencePrefix&&n.push("fileReferencePrefix=".concat(encodeURIComponent(t.fileReferencePrefix))),n.join("&")}}}]),e}();function f(e){return e.map((function(e){return encodeURIComponent(e)})).join(",")}t.default=l},function(e,t,n){var r=n(67);function o(t,n,s){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(n):s.value}},e.exports.default=e.exports,e.exports.__esModule=!0),o(t,n,s||t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(22)),a=r(n(37)),u=r(n(38)),c=function(){function e(t){(0,o.default)(this,e),this.srs=t||i.default.DEFAULT}return(0,s.default)(e,[{key:"getSRS",value:function(){return this.srs}},{key:"getGeojsonType",value:function(){}},{key:"getWktType",value:function(){}},{key:"wktCoordinatePairs",value:function(){}},{key:"jsonCoordinatePairs",value:function(){}},{key:"asGeoJSON",value:function(){return{type:this.getGeojsonType(),coordinates:this.jsonCoordinatePairs()}}},{key:"asWKT",value:function(){return this.getWktType()+"("+this.wktCoordinatePairs()+")"}},{key:"toJSON",value:function(){return this.asGeoJSON()}},{key:"toString",value:function(){return"'"+this.asWKT()+"'"}}],[{key:"fromWKT",value:function(e,t){return new u.default(t).read(e)}},{key:"fromGeoJSON",value:function(e,t){return new a.default(t).read(e)}}]),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoTypes=void 0;t.GeoTypes={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon"}},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t){var n=this;(0,o.default)(this,e),t=t||{},Object.keys(t).map((function(e){n[e]=t[e]})),this.___class=e.className}return(0,s.default)(e,null,[{key:"className",get:function(){return"Users"}}]),e}();t.default=i,i.prototype.___class=i.className},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=r(n(7)),c=r(n(8)),l=r(n(5)),f=r(n(17)),p=r(n(68)),h=r(n(10));function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var y=p.default.Listeners;t.RTListeners=y;var v=p.default.ScopeConnector;function m(e){return f.default.get("".concat(e,"/info"))}t.RTScopeConnector=v;var g=function(e){(0,u.default)(n,e);var t=d(n);function n(e){var r;(0,i.default)(this,n);var a,u=e.appId,c=e.apiKey,l=e.appPath,f=e.debugMode,p=h.default.uuid(),d="".concat(l,"/rt/lookup");return(r=t.call(this,{appId:u||void 0,lookupPath:d,debugMode:f,connectQuery:function(){var t=e.getCurrentUserToken();return{apiKey:c||void 0,clientId:p,userToken:t}},socketConfigTransform:(a=(0,s.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=7;break}return e.next=3,m(l);case 3:n=e.sent,t.url="".concat(t.host,"/").concat(n.appId),t.options.path="/".concat(n.appId),t.options.query.apiKey=n.apiKey;case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})})).app=e,r}return(0,a.default)(n,[{key:"updateUserTokenIfNeeded",value:function(){if(this.session){var e=this.app.getCurrentUserToken();this.methods.setUserToken({userToken:e})}}},{key:"setDebugMode",value:function(e){this.setConfig({debugMode:e})}}]),n}(p.default);t.default=g},function(e,t){var n,r;n="undefined"!=typeof self?self:this,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===(void 0===e?"undefined":r(e))},t.isFormData=function(e){return e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData")},t.isStream=function(e){return e instanceof n(6).Stream}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=c(n(3)),i=c(n(4)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(5)),u=n(0);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=new s.default(6e4),d=function(e){function t(e){l(this,t);var n,r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=502===(n=e).status?"No connection with server":n.body||"Status Code "+n.status+" ("+n.statusText+")";return r.message=o.message||o,r.code=o.code,r.status=e.status,r.headers=e.headers,r.body=e.body,r}return p(t,Error),t}();function y(e){try{return o({},e,{body:JSON.parse(e.body)})}catch(t){return e}}var v=function(e,t,n,r,o,s){return new Promise((function(i,a){var u=new b.XMLHttpRequest;u.timeout=s,o||(u.responseType="arraybuffer"),u.open(t.toUpperCase(),e,!0),u.onload=function(){var e,t,n=(e=u.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var n=e.indexOf(":"),r=e.substr(0,n).trim(),o=e.substr(n+1).trim();r&&(t[r]=t[r]?t[r]+", "+o:o)})),t):t),r=u,s={status:r.status,statusText:r.statusText,headers:n};"utf8"===o?s.body=u.response||u.responseText:u.response&&(s.body=new Uint8Array(u.response)),i(s),u=null},u.onerror=function(){a(new Error("Network Error")),u=null},u.ontimeout=function(){a(new Error("Connection aborted due to timeout")),u=null},Object.keys(n).forEach((function(e){u.setRequestHeader(e,n[e])})),u.send(r)}))},m=function(e,t,r,s,i,a){return new Promise((function(c,l){var f=n(7).parse(e),p=(0,u.isFormData)(s)&&s,h="https:"===f.protocol,d={host:f.hostname,port:f.port||(h?443:80),path:f.path,method:t,headers:r,timeout:a},y=function(){var e=n(1).Buffer,t=n(h?8:9).request(d,(function(t){var n=[],r=[],o=0,s="",a=t.statusCode,u=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,r.push(t)):n.push(t)})),t.on("end",(function(){o?(s=e.concat(r,o),null!=i&&(s=s.toString(i))):n.length&&(s=n.join()),c({status:a,statusText:u,headers:f,body:s})})),t.on("error",l)}));if(t.on("error",l),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,u.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(p)o(d.headers,p.getHeaders()),p.getLength((function(e,t){e||isNaN(t)||(d.headers["content-length"]=t),y()}));else{if(s&&!d.headers["content-length"]){var v=n(1).Buffer;d.headers["content-length"]=v.byteLength(s)}y()}}))};function g(e){if(e.status>=200&&e.status<300)return e;throw new d(e)}var b=function(t){function n(e,t,r){l(this,n);var o=f(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return o.method=t,o.path=e,o.body=r,o.tags=void 0,o.unwrap=!0,o.cacheTTL=0,o.headers={},o.queryParams={},o.encoding="utf8",o.timeout=0,o}return p(n,t),r(n,[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var n in e)this.set(n,e[n]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.tags=t,this}},{key:"query",value:function(e){return o(this.queryParams,e),this}},{key:"form",value:function(t){var n=this;if(t){var r=e.exports.FormData;t instanceof r?this.body=t:function(){var e=new r,o=function(n){n&&(0,u.castArray)(t[n]).forEach((function(t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?e.append(n,t.value,t.options):e.append(n,t)}))};for(var s in t)o(s);n.body=e}()}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&h.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var r=this.path,o=a.stringify(this.queryParams);if(o&&(r+="?"+o),this.cacheTTL){var s=h.get(r);if(void 0!==s)return Promise.resolve(s)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),n.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(r),e,this.headers);var i=n.send(r,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout).then(y).then(g).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&h.set(r,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&h.deleteByTags(t.tags),e}));return i.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),i}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}]),n}(i.default);Object.defineProperty(b,"FormData",{get:function(){return"undefined"!=typeof FormData?FormData:n(10)}}),b.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,b.send=function(e,t,n,r,o,s){return(void 0!==b.XMLHttpRequest?v:m)(e,t,n,r,o,s)},b.verbose=!1,b.methods=["get","post","put","patch","delete"],b.methods.forEach((function(e){b[e]=function(t,n){return new b(t,e,n)}})),e.exports=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,s=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw s}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){return{value:e,tags:t,ttl:n}},i=function(){return(new Date).getTime()},a=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var n=e==t;return!n&&e instanceof RegExp&&(n=e.test(t)),!n&&t instanceof RegExp&&(n=t.test(e)),n}(e,t)}))}))},u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.flushInterval=t,this.map=new Map}return o(e,[{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>i())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e4;this.map.set(e,s(t,n,i()+r)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteByTags",value:function(e){var t=!0,n=!1,o=void 0;try{for(var s,i=this.map[Symbol.iterator]();!(t=(s=i.next()).done);t=!0){var u=r(s.value,2),c=u[0],l=u[1];l.tags&&a(e,l.tags)&&this.delete(c)}}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}}},{key:"flush",value:function(){var e=i(),t=!0,n=!1,o=void 0;try{for(var s,a=this.map[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var u=r(s.value,2),c=u[0];u[1].ttl<e&&this.delete(c)}}catch(e){n=!0,o=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw o}}}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}return r(e,[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,n)}))}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var r=n(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(n){var o=e[n];void 0!==o&&(0,r.castArray)(o).forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}))})),t.join("&")}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')}])},"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.BackendlessRequest=r():n.BackendlessRequest=r()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExecutionType=t.ExecutionTypes=t.EXECUTION_TYPE_HEADER=void 0;t.EXECUTION_TYPE_HEADER="bl-execution-type";var r={SYNC:"sync",ASYNC:"async",ASYNC_LOW_PRIORITY:"async-low-priority"};t.ExecutionTypes=r;var o=Object.keys(r).map((function(e){return r[e]}));t.isExecutionType=function(e){return o.includes(e)}},function(e,t,n){var r=n(29);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,n(t,r)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=y[e.type];if(t=t||p.default.valueBySRSId(e.srsId),n)return n(e.coordinates,t);throw new Error("There is no constructor for ".concat(e.type))},t.GEO_CLASSES=void 0;var o,s=r(n(6)),i=r(n(69)),a=r(n(27)),u=r(n(36)),c=r(n(24)),l=r(n(39)),f=n(14),p=r(n(22));t.GEO_CLASSES=["com.backendless.persistence.Polygon","com.backendless.persistence.LineString","com.backendless.persistence.Point","com.backendless.persistence.Geometry"];var h=function(e,t){var n=(0,a.default)(e,2),r=n[0],o=n[1];return new u.default(t).setX(r).setY(o)},d=function(e,t){var n=e.map((function(e){return h(e,t)}));return new c.default(n,t)},y=(o={},(0,s.default)(o,f.GeoTypes.POINT,h),(0,s.default)(o,f.GeoTypes.LINE_STRING,d),(0,s.default)(o,f.GeoTypes.POLYGON,(function(e,t){var n=e.map((function(e){return d(e,t)})),r=(0,i.default)(n),o=r[0],s=r.slice(1);return new l.default(o,s,t)})),o)},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t){var n=t.srsId,r=t.name;(0,o.default)(this,e),this.srsId=n,this.name=r}return(0,s.default)(e,[{key:"getSRSId",value:function(){return this.srsId}},{key:"getName",value:function(){return this.name}},{key:"toString",value:function(){return this.getName()+"("+this.getSRSId()+")"}}]),e}(),a=new i({srsId:0,name:"Cartesian"}),u=new i({srsId:4200,name:"Pulkovo 1995"}),c=new i({srsId:4326,name:"WGS 84"}),l={CARTESIAN:a,PULKOVO_1995:u,WGS84:c,WGS84_PSEUDO_MERCATOR:new i({srsId:3857,name:"WGS 84 / Pseudo-Mercator"}),WGS84_WORLD_MERCATOR:new i({srsId:3395,name:"WGS 84 / World Mercator"}),DEFAULT:c,SRS_MAP:{},valueBySRSId:function(e){return l.SRS_MAP[e]}};Object.keys(l).forEach((function(e){if(l[e]instanceof i){var t=l[e];l.SRS_MAP[t.getSRSId()]=t}}));var f=l;t.default=f},function(e,t,n){var r=n(71),o=n(35),s=n(19),i=n(72);e.exports=function(e){return r(e)||o(e)||s(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(7)),a=r(n(8)),u=r(n(5)),c=r(n(13));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var f=n(14).GeoTypes.LINE_STRING,p=f.toUpperCase(),h=function(e){(0,i.default)(n,e);var t=l(n);function n(e,r){var s;return(0,o.default)(this,n),(s=t.call(this,r)).points=e||[],s}return(0,s.default)(n,[{key:"getPoints",value:function(){return this.points}},{key:"setPoints",value:function(e){return this.points=e,this}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"jsonCoordinatePairs",value:function(){var e=[];return this.getPoints().forEach((function(t){e.push([t.getX(),t.getY()])})),e}},{key:"wktCoordinatePairs",value:function(){return this.getPoints().map((function(e){return"".concat(e.getX()," ").concat(e.getY())})).join(",")}}]),n}(c.default);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IsolationLevelEnum=t.OperationType=void 0;t.OperationType={CREATE:"CREATE",CREATE_BULK:"CREATE_BULK",UPDATE:"UPDATE",UPDATE_BULK:"UPDATE_BULK",DELETE:"DELETE",DELETE_BULK:"DELETE_BULK",UPSERT:"UPSERT",UPSERT_BULK:"UPSERT_BULK",FIND:"FIND",ADD_RELATION:"ADD_RELATION",SET_RELATION:"SET_RELATION",DELETE_RELATION:"DELETE_RELATION"};t.IsolationLevelEnum={READ_UNCOMMITTED:"READ_UNCOMMITTED",READ_COMMITTED:"READ_COMMITTED",REPEATABLE_READ:"REPEATABLE_READ",SERIALIZABLE:"SERIALIZABLE"}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(28),o=n(64),s=n(19),i=n(30);e.exports=function(e,t){return r(e)||o(e,t)||s(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(65);e.exports=function(e,t){if(null==e)return{};var n,o,s=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(12)),a=r(n(7)),u=r(n(8)),c=r(n(5));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var f=function(e){(0,a.default)(n,e);var t=l(n);function n(e){var r;return(0,o.default)(this,n),(r=t.call(this)).relationModel=e,r.relationName=null,r}return(0,s.default)(n,[{key:"setRelationName",value:function(e){return this.relationName=e,this}},{key:"getRelationName",value:function(){return this.relationName}},{key:"setRelationModel",value:function(e){return this.relationModel=e,this}},{key:"getRelationModel",value:function(){return this.relationModel}},{key:"toJSON",value:function(){var e=(0,i.default)((0,c.default)(n.prototype),"toJSON",this).call(this);return e.relationName=this.getRelationName(),e.relationModel=this.getRelationModel(),e}}],[{key:"of",value:function(e){return new this(e)}}]),n}(r(n(11)).default);t.default=f},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(7)),s=r(n(8)),i=r(n(5)),a=r(n(1)),u=r(n(2));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,i.default)(e);if(t){var o=(0,i.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}var l="JSON_SET",f="JSON_INSERT",p="JSON_REPLACE",h="JSON_REMOVE",d="JSON_ARRAY_APPEND",y="JSON_ARRAY_INSERT",v=function(){function e(t){(0,a.default)(this,e),this.operationName=t,this.args={}}return(0,u.default)(e,[{key:"addArgument",value:function(e,t){if(void 0===t)throw new Error("You have to specify function's second argument");return this.args[e]=t,this}},{key:"toJSON",value:function(){return this.validate(),{___operation:this.operationName,args:this.args}}},{key:"create",value:function(){return this.toJSON()}},{key:"validate",value:function(){if(!Object.keys(this.args).length)throw new Error("You have to add at least one argument")}}],[{key:"SET",value:function(){return new e(l)}},{key:"INSERT",value:function(){return new e(f)}},{key:"REPLACE",value:function(){return new e(p)}},{key:"REMOVE",value:function(){return new m}},{key:"ARRAY_APPEND",value:function(){return new e(d)}},{key:"ARRAY_INSERT",value:function(){return new e(y)}}]),e}();t.default=v;var m=function(e){(0,o.default)(n,e);var t=c(n);function n(){var e;return(0,a.default)(this,n),(e=t.call(this,h)).args=[],e}return(0,u.default)(n,[{key:"addArgument",value:function(e){return this.args.push(e),this}},{key:"validate",value:function(){if(!this.args.length)throw new Error("You have to add at least one argument")}}]),n}(v)},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(7)),a=r(n(8)),u=r(n(5)),c=r(n(13));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var f=n(14).GeoTypes.POINT,p=f.toUpperCase(),h=function(e){(0,i.default)(n,e);var t=l(n);function n(e){return(0,o.default)(this,n),t.call(this,e)}return(0,s.default)(n,[{key:"lng",get:function(){return this.getLongitude()},set:function(e){this.setLongitude(e)}},{key:"lat",get:function(){return this.getLatitude()},set:function(e){this.setLatitude(e)}},{key:"getX",value:function(){return this.x}},{key:"getY",value:function(){return this.y}},{key:"getLongitude",value:function(){return this.x}},{key:"getLatitude",value:function(){return this.y}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setLongitude",value:function(e){return this.setX(e)}},{key:"setLatitude",value:function(e){return this.setY(e)}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"wktCoordinatePairs",value:function(){return"".concat(this.x," ").concat(this.y)}},{key:"jsonCoordinatePairs",value:function(){return[this.x,this.y]}},{key:"equals",value:function(e){return this===e||e instanceof n&&(Math.abs(e.x-this.x)<1e-9&&Math.abs(e.y-this.y)<1e-9&&this.srs===e.srs)}}]),n}(c.default);t.default=h},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(21)),a=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){return(0,i.default)(e,this.srs)}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(70)),a=r(n(21)),u=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){var t=(0,i.default)(e);if(!t)throw new Error("WKT string is invalid");return(0,a.default)(t,this.srs)}}]),e}();t.default=u},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(23)),s=r(n(1)),i=r(n(2)),a=r(n(7)),u=r(n(8)),c=r(n(5)),l=r(n(13)),f=r(n(24));function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var h=n(14).GeoTypes.POLYGON,d=h.toUpperCase(),y=function(e){(0,a.default)(n,e);var t=p(n);function n(e,r,o){var i;return(0,s.default)(this,n),(i=t.call(this,o)).setBoundary(e),i.setHoles(r),i}return(0,i.default)(n,[{key:"getBoundary",value:function(){return this.boundary}},{key:"setBoundary",value:function(e){if(!e)throw new Error("The 'boundary' argument is required.");return e instanceof f.default||(e=new f.default(e,this.srs)),this.boundary=e,this}},{key:"getHoles",value:function(){return this.holes}},{key:"setHoles",value:function(e){return this.holes=e||[],this}},{key:"getGeojsonType",value:function(){return h}},{key:"getWktType",value:function(){return d}},{key:"jsonCoordinatePairs",value:function(){var e=[];this.getBoundary().getPoints().forEach((function(t){e.push([t.getX(),t.getY()])}));var t=this.holes.map((function(e){return e.getPoints().map((function(e){return[e.getX(),e.getY()]}))}));return[e].concat((0,o.default)(t))}},{key:"wktCoordinatePairs",value:function(){var e=[this.getBoundary().wktCoordinatePairs()];this.holes.forEach((function(t){return e.push(t.wktCoordinatePairs())}));return e.map((function(e){return"("+e+")"})).join(",")}}]),n}(l.default);t.default=y},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(6)),a="GRANT",u="DENY",c=function(){function e(t,n){(0,o.default)(this,e),this.permission=t,this.app=n,this.grantUser=this.backwardCompatibility("grantForUser","grantUser"),this.denyUser=this.backwardCompatibility("denyForUser","denyUser"),this.grantRole=this.backwardCompatibility("grantForRole","grantRole"),this.denyRole=this.backwardCompatibility("denyForRole","denyRole"),this.grant=this.backwardCompatibility("grantForAllUsers","grant"),this.deny=this.backwardCompatibility("denyForAllUsers","deny")}return(0,s.default)(e,[{key:"backwardCompatibility",value:function(e,t){var n=this,r=this.constructor.BACKWARD_COMPATIBILITY_LABEL;return function(){var o='"'.concat(r,".").concat(t,'" is deprecated and will be removed in the nearest release.'),s='Please use "'.concat(r,".").concat(e,'" instead of.');return console.warn("".concat(o,"\n").concat(s)),n[e].apply(n,arguments)}}},{key:"grantForUser",value:function(e,t){return this.sendRequest(a,t,{userId:e})}},{key:"denyForUser",value:function(e,t){return this.sendRequest(u,t,{userId:e})}},{key:"grantForRole",value:function(e,t){return this.sendRequest(a,t,{roleName:e})}},{key:"denyForRole",value:function(e,t){return this.sendRequest(u,t,{roleName:e})}},{key:"grantForAllUsers",value:function(e){return this.sendRequest(a,e,{userId:"*"})}},{key:"denyForAllUsers",value:function(e){return this.sendRequest(u,e,{userId:"*"})}},{key:"grantForAllRoles",value:function(e){return this.sendRequest(a,e,{roleName:"*"})}},{key:"denyForAllRoles",value:function(e){return this.sendRequest(u,e,{roleName:"*"})}},{key:"sendRequest",value:function(e,t,n){var r=n.userId,o=n.roleName,s={permission:this.permission};return r?s.user=r:o&&(s.role=o),this.app.request.put({url:this.getRequestURL(e,t),data:s})}},{key:"getRequestURL",value:function(){}}]),e}();t.default=c,(0,i.default)(c,"BACKWARD_COMPATIBILITY_LABEL",null)},function(e,t){e.exports=function(e,t,n,r,o){var s={};return Object.keys(r).forEach((function(e){s[e]=r[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResult=void 0;var o=r(n(1)),s=r(n(2)),i=n(25),a=n(43),u=function(){function e(t,n){var r=n.operationType,s=n.table,i=n.payload;(0,o.default)(this,e),this.uow=t,this.operationType=r,this.table=s,this.payload=i;var a=this.uow.getOpStackName(r,s),u=this.uow.getNextOpResultIndex(a);this.opResultId="".concat(a).concat(u),this.result=null}return(0,s.default)(e,[{key:"setResult",value:function(e){this.result=e}},{key:"getResult",value:function(){return this.result}},{key:"setError",value:function(e){this.error=e}},{key:"getError",value:function(){return this.error}},{key:"getType",value:function(){return this.operationType}},{key:"isFindRef",value:function(){return this.operationType===i.OperationType.FIND}},{key:"isCollectionRef",value:function(){return this.operationType===i.OperationType.FIND||this.operationType===i.OperationType.CREATE_BULK}},{key:"isObjectRef",value:function(){return this.operationType===i.OperationType.CREATE||this.operationType===i.OperationType.UPDATE}},{key:"setOpResultId",value:function(e){return this.opResultId=e,this}},{key:"getOpResultId",value:function(){return this.opResultId}},{key:"getTableName",value:function(){return this.table}},{key:"resolveTo",value:function(e,t){return"string"==typeof e&&(t=e,e=void 0),new a.OpResultValueReference(this,{resultIndex:e,propName:t})}},{key:"toJSON",value:function(){var e={___ref:!0,opResultId:this.opResultId};return this.isObjectRef()&&(e.propName="objectId"),e}}]),e}();t.OpResult=u},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResultValueReference=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t,n){var r=n.resultIndex,s=n.propName;(0,o.default)(this,e),this.opResult=t,this.resultIndex=r,this.propName=s}return(0,s.default)(e,[{key:"getTableName",value:function(){return this.opResult.getTableName()}},{key:"toJSON",value:function(){var e=this.opResult.toJSON();return void 0!==this.resultIndex&&(e.resultIndex=this.resultIndex),void 0!==this.propName&&(e.propName=this.propName),!e.propName&&this.opResult.isFindRef()&&(e.propName="objectId"),e}}]),e}();t.OpResultValueReference=i},function(e,t,n){"use strict";(function(r){var o=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=o(n(6)),i=o(n(1)),a=o(n(2)),u=o(n(9)),c=o(n(17)),l=o(n(45)),f=o(n(46)),p=o(n(10));function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var d={appId:null,apiKey:null,serverURL:"https://api.backendless.com",domain:null,apiURI:"/api",debugMode:!1,standalone:!1,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,useTableClassesFromGlobalScope:!0},y=["appId","apiKey","domain"],v="object"===("undefined"==typeof self?"undefined":(0,u.default)(self))&&self.self===self&&self||"object"===(void 0===r?"undefined":(0,u.default)(r))&&r.global===r&&r,m=v&&v.Backendless,g=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],o=t[1];return r&&"object"===(0,u.default)(r)?r:"string"!=typeof r||o?{appId:r,apiKey:o}:{domain:r}},b=function(e){if(e.domain&&!e.domain.startsWith("https://")&&!e.domain.startsWith("http://"))throw new Error("When initialize the SDK with a custom domain it should start with http:// or https://, for example: Backendless.initApp('https://foobar.com')")},k={Logging:function(){return n(47).default},Counters:function(){return n(50).default},Cache:function(){return n(52).default},Commerce:function(){return n(53).default},Users:function(){return n(54).default},BL:function(){return n(59).default},Data:function(){return n(62).default},Messaging:function(){return n(75).default},Files:function(){return n(84).default},RT:function(){return n(16).default},SharedObject:function(){return n(87).default},LocalCache:function(){return n(89).default},UnitOfWork:function(){return n(92).default}},w=new(function(){function e(t){(0,i.default)(this,e),this.initConfig(t),this.Request=c.default,this.request=new l.default(this),this.urls=new f.default(this)}return(0,a.default)(e,[{key:"initConfig",value:function(e){for(var t in(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e)).domain&&(delete e.appId,delete e.apiKey),d)if(d.hasOwnProperty(t)){var n="__".concat(t);y.includes(t)&&delete this[n];var r=void 0===this[n]?d[t]:this[n];this[n]=void 0===e[t]?r:e[t]}}},{key:"initApp",value:function(){var t=g.apply(void 0,arguments);b(t);var n=t.standalone?new e(this):this;return n.initConfig(t),n.resetRT(),n.__removeService("LocalCache"),n.__hasService("Logging")&&n.Logging.reset(),n.__hasService("Users")&&(n.Users.currentUser=null),delete this.__device,n}},{key:"__hasService",value:function(e){return!!this["__".concat(e)]}},{key:"__removeService",value:function(e){delete this["__".concat(e)]}},{key:"__getService",value:function(e){var t="__".concat(e);if(!this[t]){var n=k[e]();this[t]=new n(this)}return this[t]}},{key:"standalone",get:function(){return this.__standalone},set:function(e){throw new Error("Setting value to Backendless.standalone directly is not possible, "+"instead you must use Backendless.initApp({ appId: [APP_ID], apiKey: [API_KEY], standalone: ".concat(e," })"))}},{key:"appId",get:function(){return this.__appId},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appId directly is not possible, ")+"instead you must use Backendless.initApp('".concat(e,"', API_KEY)"))}},{key:"apiKey",get:function(){return this.__apiKey},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.apiKey directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, '".concat(e,"')"))}},{key:"serverURL",get:function(){return this.__serverURL},set:function(e){this.__serverURL=e}},{key:"domain",get:function(){return this.__domain},set:function(e){this.__domain=e}},{key:"apiURI",get:function(){return this.__apiURI},set:function(e){this.__apiURI=e}},{key:"appPath",get:function(){return this.domain?this.domain+this.apiURI:[this.serverURL,this.appId,this.apiKey].join("/")},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appPath directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, API_KEY) for setup the value")}},{key:"useTableClassesFromGlobalScope",get:function(){return this.__useTableClassesFromGlobalScope},set:function(e){this.__useTableClassesFromGlobalScope=!!e}},{key:"debugMode",get:function(){return this.__debugMode},set:function(e){e=!!e,this.__debugMode!==e&&(this.__debugMode=e,this.__RT&&this.RT.setDebugMode(e))}},{key:"XMLHttpRequest",get:function(){return this.__XMLHttpRequest},set:function(e){this.__XMLHttpRequest=e}},{key:"device",get:function(){if(!this.__device)throw new Error("Device is not defined. Please, run the Backendless.setupDevice");return this.__device},set:function(e){throw new Error("Setting value to Backendless.device directly is not possible, instead you must use Backendless.setupDevice(deviceProperties) for setup the device")}},{key:"setupDevice",value:function(e){var t=n(98).default;this.__device=new t(e)}},{key:"Utils",get:function(){return p.default}},{key:"getCurrentUserToken",value:function(){return this.Users.getCurrentUserToken()}},{key:"setCurrentUserToken",value:function(e){this.Users.setCurrentUserToken(e)}},{key:"browser",get:function(){return n(99).getUserAgent()}},{key:"noConflict",value:function(){return v&&(v.Backendless=m),this}},{key:"Logging",get:function(){return this.__getService("Logging")}},{key:"Counters",get:function(){return this.__getService("Counters")}},{key:"Cache",get:function(){return this.__getService("Cache")}},{key:"Commerce",get:function(){return this.__getService("Commerce")}},{key:"Users",get:function(){return this.__getService("Users")}},{key:"User",get:function(){return n(15).default}},{key:"UserService",get:function(){return this.Users}},{key:"BL",get:function(){return this.__getService("BL")}},{key:"CustomServices",get:function(){return this.BL.CustomServices}},{key:"APIServices",get:function(){return this.BL.CustomServices}},{key:"Events",get:function(){return this.BL.Events}},{key:"Data",get:function(){return this.__getService("Data")}},{key:"Messaging",get:function(){return this.__getService("Messaging")}},{key:"Files",get:function(){return this.__getService("Files")}},{key:"RT",get:function(){return this.__getService("RT")}},{key:"resetRT",value:function(){this.__RT&&(this.__RT.terminate(),delete this.__RT)}},{key:"SharedObject",get:function(){return this.__getService("SharedObject")}},{key:"LocalCache",get:function(){return this.__getService("LocalCache")}},{key:"UnitOfWork",get:function(){return this.__getService("UnitOfWork")}},{key:"applicationId",get:function(){return this.appId},set:function(e){console.warn("getter/setter for Backendless.applicationId is deprecated, instead use Backendless.appId"),this.appId=e}},{key:"secretKey",get:function(){return console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey},set:function(e){console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey=e}},{key:"Persistence",get:function(){return function e(){e.isShown||(console.warn("Backendless.Persistence is deprecated namespace, use Backendless.Data instead"),e.isShown=!0)}(),this.Data}},{key:"DataQueryBuilder",get:function(){return this.Data.QueryBuilder}},{key:"GroupQueryBuilder",get:function(){return this.Data.GroupQueryBuilder}},{key:"JSONUpdateBuilder",get:function(){return this.Data.JSONUpdateBuilder}},{key:"LoadRelationsQueryBuilder",get:function(){return this.Data.LoadRelationsQueryBuilder}},{key:"Bodyparts",get:function(){return this.Messaging.Bodyparts}},{key:"PublishOptions",get:function(){return this.Messaging.PublishOptions}},{key:"DeliveryOptions",get:function(){return this.Messaging.DeliveryOptions}},{key:"PublishOptionsHeaders",get:function(){return this.Messaging.PublishOptionsHeaders}},{key:"EmailEnvelope",get:function(){return this.Messaging.EmailEnvelope}}]),e}())(d);v&&(v.Backendless=w);var E=w;(t=e.exports=w).default=E}).call(this,n(26))},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(6)),s=r(n(1)),i=r(n(2)),a=r(n(17));function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH"},f=function(){function e(t){(0,s.default)(this,e),this.app=t,this.Methods=l}return(0,i.default)(e,[{key:"send",value:function(e){a.default.verbose=!!this.app.debugMode,a.default.XMLHttpRequest=this.app.XMLHttpRequest;var t=e.method.toLowerCase(),n=e.headers||{},r=this.app.getCurrentUserToken();return r&&(n["user-token"]=r),e.queryString&&(e.url="".concat(e.url,"?").concat(e.queryString)),a.default[t](e.url,e.data).set(n).query(e.query).form(e.form)}},{key:"get",value:function(e){return this.send(c(c({},e),{},{method:l.GET}))}},{key:"post",value:function(e){return this.send(c(c({},e),{},{method:l.POST}))}},{key:"put",value:function(e){return this.send(c(c({},e),{},{method:l.PUT}))}},{key:"delete",value:function(e){return this.send(c(c({},e),{},{method:l.DELETE}))}}]),e}();t.default=f},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"root",value:function(){return this.app.appPath}},{key:"blServices",value:function(){return"".concat(this.root(),"/services")}},{key:"blServiceMethod",value:function(e,t){return"".concat(this.blServices(),"/").concat(e,"/").concat(t)}},{key:"blEvent",value:function(e){return"".concat(this.root(),"/servercode/events/").concat(e)}},{key:"logging",value:function(){return"".concat(this.root(),"/log")}},{key:"cache",value:function(){return"".concat(this.root(),"/cache")}},{key:"cacheItem",value:function(e){return"".concat(this.cache(),"/").concat(e)}},{key:"cacheItemExpireIn",value:function(e){return"".concat(this.cacheItem(e),"/expireIn")}},{key:"cacheItemExpireAt",value:function(e){return"".concat(this.cacheItem(e),"/expireAt")}},{key:"cacheItemCheck",value:function(e){return"".concat(this.cacheItem(e),"/check")}},{key:"counters",value:function(){return"".concat(this.root(),"/counters")}},{key:"countersList",value:function(e){return"".concat(this.counters(),"/").concat(e||"*","/list")}},{key:"counter",value:function(e){return"".concat(this.counters(),"/").concat(e)}},{key:"counterAddAndGet",value:function(e){return"".concat(this.counter(e),"/incrementby/get")}},{key:"counterGetAndAdd",value:function(e){return"".concat(this.counter(e),"/get/incrementby")}},{key:"counterIncrementAndGet",value:function(e){return"".concat(this.counter(e),"/increment/get")}},{key:"counterDecrementAndGet",value:function(e){return"".concat(this.counter(e),"/decrement/get")}},{key:"counterGetAndDecrement",value:function(e){return"".concat(this.counter(e),"/get/decrement")}},{key:"counterGetAndIncrement",value:function(e){return"".concat(this.counter(e),"/get/increment")}},{key:"counterCompareAndSet",value:function(e){return"".concat(this.counter(e),"/get/compareandset")}},{key:"counterReset",value:function(e){return"".concat(this.counter(e),"/reset")}},{key:"data",value:function(){return"".concat(this.root(),"/data")}},{key:"dataGrouping",value:function(e){return"".concat(this.data(),"/data-grouping/").concat(e)}},{key:"dataTable",value:function(e){return"".concat(this.data(),"/").concat(e)}},{key:"dataTableUpsert",value:function(e){return"".concat(this.data(),"/").concat(e,"/upsert")}},{key:"dataTableDeepSave",value:function(e){return"".concat(this.data(),"/").concat(e,"/deep-save")}},{key:"dataTableFind",value:function(e){return"".concat(this.dataTable(e),"/find")}},{key:"dataTablePrimaryKey",value:function(e){return"".concat(this.dataTable(e),"/pk")}},{key:"dataTableObject",value:function(e,t){return"".concat(this.dataTable(e),"/").concat(t)}},{key:"dataTableObjectRelation",value:function(e,t,n){return"".concat(this.dataTableObject(e,t),"/").concat(n)}},{key:"dataTableCount",value:function(e){return"".concat(this.dataTable(e),"/count")}},{key:"dataTableProps",value:function(e){return"".concat(this.dataTable(e),"/properties")}},{key:"dataBulkTable",value:function(e){return"".concat(this.data(),"/bulk/").concat(e)}},{key:"dataBulkTableUpsert",value:function(e){return"".concat(this.data(),"/bulkupsert/").concat(e)}},{key:"dataBulkTableDelete",value:function(e){return"".concat(this.dataBulkTable(e),"/delete")}},{key:"dataObjectPermission",value:function(e,t,n){return"".concat(this.dataTable(e),"/permissions/").concat(t,"/").concat(n)}},{key:"dataTableNameById",value:function(e){return"".concat(this.data(),"/").concat(e,"/table-name")}},{key:"transactions",value:function(){return"".concat(this.root(),"/transaction/unit-of-work")}},{key:"messaging",value:function(){return"".concat(this.root(),"/messaging")}},{key:"messagingPush",value:function(){return"".concat(this.messaging(),"/push")}},{key:"messagingPushTemplates",value:function(e){return"".concat(this.messaging(),"/pushtemplates/").concat(e)}},{key:"messagingPushWithTemplate",value:function(e){return"".concat(this.messagingPush(),"/").concat(e)}},{key:"messagingEmail",value:function(){return"".concat(this.messaging(),"/email")}},{key:"messagingChannel",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingMessage",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingRegistrations",value:function(){return"".concat(this.messaging(),"/registrations")}},{key:"messagingRegistrationDevice",value:function(e){return"".concat(this.messagingRegistrations(),"/").concat(e)}},{key:"emailTemplate",value:function(){return"".concat(this.root(),"/emailtemplate")}},{key:"emailTemplateSend",value:function(){return"".concat(this.emailTemplate(),"/send")}},{key:"commerce",value:function(){return"".concat(this.root(),"/commerce/googleplay")}},{key:"commerceValidate",value:function(e,t,n){return"".concat(this.commerce(),"/validate/").concat(e,"/inapp/").concat(t,"/purchases/").concat(n)}},{key:"commerceSubCancel",value:function(e,t,n){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(n,"/cancel")}},{key:"commerceSubStatus",value:function(e,t,n){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(n)}},{key:"files",value:function(){return"".concat(this.root(),"/files")}},{key:"filePath",value:function(e){return"".concat(this.files(),"/").concat(e)}},{key:"fileCopy",value:function(){return"".concat(this.files(),"/copy")}},{key:"fileMove",value:function(){return"".concat(this.files(),"/move")}},{key:"fileRename",value:function(){return"".concat(this.files(),"/rename")}},{key:"filePermissions",value:function(){return"".concat(this.files(),"/permissions")}},{key:"filePermission",value:function(e,t){return"".concat(this.filePermissions(),"/").concat(e,"/").concat(encodeURIComponent(t))}},{key:"fileBinaryPath",value:function(e){return"".concat(this.files(),"/binary/").concat(e)}},{key:"fileAppendPath",value:function(e){return"".concat(this.files(),"/append/").concat(e)}},{key:"fileAppendBinaryPath",value:function(e){return"".concat(this.files(),"/append/binary/").concat(e)}},{key:"users",value:function(){return"".concat(this.root(),"/users")}},{key:"userObject",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userRegister",value:function(){return"".concat(this.users(),"/register")}},{key:"userLogin",value:function(){return"".concat(this.users(),"/login")}},{key:"userLogout",value:function(){return"".concat(this.users(),"/logout")}},{key:"userRoles",value:function(e){return"".concat(this.users(),"/userroles").concat(e?"/".concat(e):"")}},{key:"usersRole",value:function(e){return"".concat(this.users(),"/role/").concat(e)}},{key:"userRoleOperation",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userClassProps",value:function(){return"".concat(this.users(),"/userclassprops")}},{key:"userRestorePassword",value:function(e){return"".concat(this.users(),"/restorepassword/").concat(encodeURIComponent(e))}},{key:"userTokenCheck",value:function(e){return"".concat(this.users(),"/isvalidusertoken/").concat(e)}},{key:"userVerifyPassowrd",value:function(){return"".concat(this.users(),"/verifypassowrd")}},{key:"userResendConfirmation",value:function(e){return"".concat(this.users(),"/resendconfirmation/").concat(e)}},{key:"userCreateConfirmationURL",value:function(e){return"".concat(this.users(),"/createEmailConfirmationURL/").concat(e)}},{key:"userSocial",value:function(){return"".concat(this.users(),"/social")}},{key:"userSocialOAuth",value:function(e){return"".concat(this.userSocial(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"userSocialLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/sdk/login")}},{key:"userOAuthLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/login")}},{key:"userAuthorizationURL",value:function(e){return"".concat(this.users(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"guestLogin",value:function(){return"".concat(this.users(),"/register/guest")}},{key:"userStatus",value:function(e){return"".concat(this.userObject(e),"/status")}}]),e}();t.default=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=r(n(49)),c=function(){function e(t){(0,i.default)(this,e),this.app=t,this.reset()}var t;return(0,a.default)(e,[{key:"reset",value:function(){this.loggers={},this.pool=[],this.numOfMessages=10,this.timeFrequency=1}},{key:"getLogger",value:function(e){if(!e||"string"!=typeof e)throw new Error("Logger Name must be provided and must be a string.");return this.loggers[e]||(this.loggers[e]=new u.default(e,this)),this.loggers[e]}},{key:"flush",value:(t=(0,s.default)(o.default.mark((function e(){var t=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!this.flushRequest&&this.pool.length&&(this.stopFlushInterval(),this.flushRequest=this.app.request.put({url:this.app.urls.logging(),data:this.pool}).then((function(){delete t.flushRequest})),this.pool=[]),e.abrupt("return",this.flushRequest);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"push",value:function(e,t,n,r){if("string"!=typeof n)throw new Error('"message" must be a string');this.pool.push({logger:e,message:n,exception:r,"log-level":t,timestamp:Date.now()}),this.checkMessagesLen()}},{key:"checkMessagesLen",value:function(){this.pool.length>=this.numOfMessages&&this.startFlushInterval()}},{key:"startFlushInterval",value:function(){var e=this;this.flushInterval||(this.flushInterval=setTimeout((function(){return e.flush()}),1e3*this.timeFrequency))}},{key:"stopFlushInterval",value:function(){this.flushInterval&&(clearTimeout(this.flushInterval),delete this.flushInterval)}},{key:"setLogReportingPolicy",value:function(e,t){void 0!==t&&this.timeFrequency!==t&&this.stopFlushInterval(),this.numOfMessages=e,this.timeFrequency=t,this.checkMessagesLen()}}]),e}();t.default=c},function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),i=new O(r||[]);return s._invoke=function(e,t,n){var r="suspendedStart";return function(o,s){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw s;return R()}for(n.method=o,n.arg=s;;){var i=n.delegate;if(i){var a=k(i,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,i),s}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var m=h.prototype=f.prototype=Object.create(d);function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,s){function i(){return new t((function(r,i){!function r(o,s,i,a){var u=c(e[o],e,s);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return r("throw",e,i,a)}))}a(u.arg)}(o,s,r,i)}))}return r=r?r.then(i,i):i()}}function k(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,s=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return s.next=s}}return{next:R}}function R(){return{value:void 0,done:!0}}return p.prototype=m.constructor=h,h.constructor=p,p.displayName=a(h,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,a(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(b.prototype),b.prototype[s]=function(){return this},e.AsyncIterator=b,e.async=function(t,n,r,o,s){void 0===s&&(s=Promise);var i=new b(u(t,n,r,o),s);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},g(m),a(m,i,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],i=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var a=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var i=s?s.completion:{};return i.type=e,i.arg=t,s?(this.method="next",this.next=s.finallyLoc,l):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t,n){(0,o.default)(this,e),this.name=t,this.logging=n}return(0,s.default)(e,[{key:"debug",value:function(e){return this.logging.push(this.name,"DEBUG",e)}},{key:"info",value:function(e){return this.logging.push(this.name,"INFO",e)}},{key:"warn",value:function(e,t){return this.logging.push(this.name,"WARN",e,t)}},{key:"error",value:function(e,t){return this.logging.push(this.name,"ERROR",e,t)}},{key:"fatal",value:function(e,t){return this.logging.push(this.name,"FATAL",e,t)}},{key:"trace",value:function(e){return this.logging.push(this.name,"TRACE",e)}}]),e}();t.default=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=r(n(51)),c=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,n,r,c,l,f,p,h,d,y;return(0,a.default)(e,[{key:"of",value:function(e){return new u.default(e,this)}},{key:"list",value:(y=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||"string"==typeof t){e.next=2;break}throw new Error("Counters Pattern can be a string only");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.countersList(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"incrementAndGet",value:(d=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterIncrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"getAndIncrement",value:(h=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndIncrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"decrementAndGet",value:(p=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterDecrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"getAndDecrement",value:(f=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndDecrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"reset",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterReset(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"get",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.counter(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"addAndGet",value:(r=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof n){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterAddAndGet(t),query:{value:n}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getAndAdd",value:(n=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof n){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndAdd(t),query:{value:n}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"compareAndSet",value:(t=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof n){e.next=4;break}throw new Error("Counter Expected Value must be a number.");case 4:if("number"==typeof r){e.next=6;break}throw new Error("Counter Updated Value must be a number.");case 6:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterCompareAndSet(t),query:{expected:n,updatedvalue:r}}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t,n){if((0,o.default)(this,e),!t||"string"!=typeof t)throw new Error("Counter Name must be non empty String");this.name=t,this.counters=n}return(0,s.default)(e,[{key:"incrementAndGet",value:function(){return this.counters.incrementAndGet(this.name)}},{key:"getAndIncrement",value:function(){return this.counters.getAndIncrement(this.name)}},{key:"decrementAndGet",value:function(){return this.counters.decrementAndGet(this.name)}},{key:"getAndDecrement",value:function(){return this.counters.getAndDecrement(this.name)}},{key:"reset",value:function(){return this.counters.reset(this.name)}},{key:"get",value:function(){return this.counters.get(this.name)}},{key:"addAndGet",value:function(e){return this.counters.addAndGet(this.name,e)}},{key:"getAndAdd",value:function(e){return this.counters.getAndAdd(this.name,e)}},{key:"compareAndSet",value:function(e,t){return this.counters.compareAndSet(this.name,e,t)}}]),e}();t.default=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=r(n(10)),c=function(){function e(t){(0,i.default)(this,e),this.app=t,this.parsers={}}var t,n,r,c,l,f;return(0,a.default)(e,[{key:"setObjectFactory",value:function(e,t){this.parsers[e]=t}},{key:"parseItem",value:function(e){var t=e&&e.___class;if(t){var n=this.parsers[t];n&&(e=new n(e))}return e}},{key:"stringifyItem",value:function(e){return u.default.isCustomClassInstance(e)&&(e.___class=e.___class||u.default.getClassName(e)),JSON.stringify(e)}},{key:"put",value:(f=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!r||!("number"!=typeof r||r<0)){e.next=4;break}throw new Error("Cache TimeToLive must be a positive number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItem(t),query:{timeout:r},headers:{"Content-Type":"application/json"},data:this.stringifyItem(n)}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return f.apply(this,arguments)})},{key:"get",value:(l=(0,s.default)(o.default.mark((function e(t){var n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItem(t)}).then((function(e){return n.parseItem(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"remove",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.cacheItem(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"contains",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItemCheck(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"expireIn",value:(n=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!("number"!=typeof n||n<=0)){e.next=4;break}throw new Error("Cache Expiration must be provided and must be a number of seconds.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireIn(t),query:{timeout:n},data:{}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"expireAt",value:(t=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!(n instanceof Date)){e.next=6;break}n=n.getTime(),e.next=8;break;case 6:if(!("number"!=typeof n||n<=0)){e.next=8;break}throw new Error("Cache Expiration must be provided and must be a timestamp or an instance of Date.");case 8:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireAt(t),query:{timestamp:n},data:{}}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,n,r;return(0,a.default)(e,[{key:"validatePlayPurchase",value:(r=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("Product Id must be provided and must be a string.");case 4:if(r&&"string"==typeof r){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceValidate(t,n,r)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"cancelPlaySubscription",value:(n=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(r&&"string"==typeof r){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.post({url:this.app.urls.commerceSubCancel(t,n,r)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getPlaySubscriptionStatus",value:(t=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(r&&"string"==typeof r){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceSubStatus(t,n,r)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=u},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(6)),i=r(n(4)),a=r(n(1)),u=r(n(2)),c=n(55),l=r(n(15)),f=r(n(56)),p=r(n(57));function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=function(){function e(t){(0,a.default)(this,e),this.app=t,this.roles=new f.default(this),this.social=new p.default(this),this.dataStore=this.app.Data.of(l.default)}var t,n,r,s,h,y,v,m,g,b,k,w,E,O,S,R,_,T,x,C,P,A,N,j,L,I;return(0,u.default)(e,[{key:"Utils",get:function(){return c.UsersUtils}},{key:"register",value:(I=(0,i.default)(o.default.mark((function e(t){var n,r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=d({},t)).blUserLocale||(n=this.Utils.getClientUserLocale())&&(t.blUserLocale=n),e.abrupt("return",this.app.request.post({url:this.app.urls.userRegister(),data:t}).then((function(e){return r.dataStore.parseResponse(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"login",value:(L=(0,i.default)(o.default.mark((function e(t,n,r){var s,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"string"==typeof t||"number"==typeof t){e.next=3;break}throw new Error("the first argument must be either a string or a number");case 3:if(t){e.next=5;break}throw new Error("the first argument cannot be an empty value");case 5:if("boolean"==typeof n&&(r=n,n=void 0),"string"!=typeof t||void 0!==n){e.next=10;break}s.objectId=t,e.next=14;break;case 10:if(n){e.next=12;break}throw new Error('the "password" value cannot be an empty value');case 12:s.login=t,s.password=n;case 14:return r=!0===r,e.abrupt("return",this.app.request.post({url:this.app.urls.userLogin(),data:s}).then((function(e){return i.setCurrentUser(e,r)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return L.apply(this,arguments)})},{key:"loginAsGuest",value:(j=(0,i.default)(o.default.mark((function e(t){var n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=!0===t,e.abrupt("return",this.app.request.post({url:this.app.urls.guestLogin()}).then((function(e){return n.setCurrentUser(e,t)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return j.apply(this,arguments)})},{key:"loginWithFacebook",value:(N=(0,i.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebook(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return N.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(A=(0,i.default)(o.default.mark((function e(t,n,r,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebookSdk(t,n,r,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return A.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(P=(0,i.default)(o.default.mark((function e(t,n,r,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlus(t,n,r,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return P.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(C=(0,i.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlusSdk(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return C.apply(this,arguments)})},{key:"loginWithTwitter",value:(x=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithTwitter(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"loginWithOauth2",value:(T=(0,i.default)(o.default.mark((function e(t,n,r,s,i){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth2(t,n,r,s,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,o){return T.apply(this,arguments)})},{key:"loginWithOauth1",value:(_=(0,i.default)(o.default.mark((function e(t,n,r,s,i,a){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth1(t,n,r,s,i,a));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,o,s){return _.apply(this,arguments)})},{key:"logout",value:(R=(0,i.default)(o.default.mark((function e(){var t=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userLogout()}).then((function(){t.setCurrentUser(null)})).catch((function(e){throw[3023,3064,3090,3091].includes(e.code)&&t.setCurrentUser(null),e})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return R.apply(this,arguments)})},{key:"getCurrentUser",value:(S=(0,i.default)(o.default.mark((function e(t){var n,r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.currentUser||t){e.next=2;break}return e.abrupt("return",this.currentUser);case 2:if(!this.currentUserRequest){e.next=4;break}return e.abrupt("return",this.currentUserRequest);case 4:if(!(n=this.getCurrentUserId())){e.next=7;break}return e.abrupt("return",this.currentUserRequest=this.dataStore.findById(n).then((function(e){return r.currentUserRequest=null,r.currentUser=e})).catch((function(e){throw r.currentUserRequest=null,e})));case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"setCurrentUser",value:function(e,t){return this.app.LocalCache.remove(this.app.LocalCache.Keys.USER_TOKEN),this.app.LocalCache.remove(this.app.LocalCache.Keys.CURRENT_USER_ID),this.app.LocalCache.remove(this.app.LocalCache.Keys.STAY_LOGGED_IN),this.currentUser=e||null,this.currentUser&&(this.currentUser instanceof l.default||(this.currentUser=this.dataStore.parseResponse(this.currentUser)),t&&(this.app.LocalCache.set(this.app.LocalCache.Keys.STAY_LOGGED_IN,!0),this.app.LocalCache.set(this.app.LocalCache.Keys.USER_TOKEN,this.currentUser["user-token"]),this.app.LocalCache.set(this.app.LocalCache.Keys.CURRENT_USER_ID,this.currentUser.objectId))),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded(),this.currentUser}},{key:"isValidLogin",value:(O=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getCurrentUserToken())){e.next=3;break}return e.abrupt("return",this.app.request.get({url:this.app.urls.userTokenCheck(t)}));case 3:return e.abrupt("return",!1);case 4:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"verifyPassword",value:(E=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Password has to be a non empty string");case 2:if(this.getCurrentUserToken()){e.next=4;break}throw new Error("In order to check password you have to be logged in");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userVerifyPassowrd(),data:{password:t}}).then((function(e){return!(!e||!e.valid)})));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"restorePassword",value:(w=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Address must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRestorePassword(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"resendEmailConfirmation",value:(k=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userResendConfirmation(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"createEmailConfirmationURL",value:(b=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userCreateConfirmationURL(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"update",value:(g=(0,i.default)(o.default.mark((function e(t){var n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.userObject(t.objectId),data:t}).then((function(e){return n.dataStore.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"findByRole",value:(m=(0,i.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.findByRole(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return m.apply(this,arguments)})},{key:"getUserRoles",value:(v=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.getUserRoles(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"assignRole",value:(y=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.assignRole(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"unassignRole",value:(h=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.unassignRole(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"describeUserClass",value:(s=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userClassProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"enableUser",value:(r=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"ENABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"disableUser",value:(n=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"DISABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"updateUserStatus",value:(t=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("User objectId must be non empty string");case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("User Status must be a valid string");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.userStatus(t),data:{userStatus:n}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"getAuthorizationUrlLink",value:function(e,t,n,r,o,s){return this.app.request.post({url:this.app.urls.userAuthorizationURL(e),data:{fieldsMapping:t,permissions:n,redirect:r,redirectAfterLoginUrl:o,callbackUrlDomain:s}})}},{key:"loggedInUser",value:function(){return this.getCurrentUserId()}},{key:"getCurrentUserToken",value:function(){return this.currentUser&&this.currentUser["user-token"]?this.currentUser["user-token"]:this.app.LocalCache.get(this.app.LocalCache.Keys.USER_TOKEN)||null}},{key:"setCurrentUserToken",value:function(e){e=e||null,this.currentUser&&(this.currentUser["user-token"]=e),this.app.LocalCache.get("user-token")&&this.app.LocalCache.set("user-token",e),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded()}},{key:"getCurrentUserId",value:function(){return this.currentUser?this.currentUser.objectId:this.app.LocalCache.get(this.app.LocalCache.Keys.CURRENT_USER_ID)||null}},{key:"getLocalCurrentUser",value:function(){return this.currentUser}},{key:"setLocalCurrentUser",value:function(e,t){return this.setCurrentUser(e,t)}}]),e}();t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsersUtils=void 0;var r={getClientUserLocale:function(){if("undefined"!=typeof navigator){return(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"").slice(0,2).toLowerCase()}}};t.UsersUtils=r},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(9)),i=r(n(4)),a=r(n(1)),u=r(n(2)),c=r(n(11)),l=function(){function e(t){(0,a.default)(this,e),this.users=t,this.app=t.app}var t,n,r,l,f;return(0,u.default)(e,[{key:"findByRole",value:(f=(0,i.default)(o.default.mark((function e(t,n,r){var i,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Role Name must be a string and can not be empty");case 2:if(null==n||"boolean"==typeof n){e.next=4;break}throw new Error('The second argument "loadRoles" can be a boolean only');case 4:if(null==r||!Array.isArray(r)&&"object"===(0,s.default)(r)){e.next=6;break}throw new Error('The third argument "query" can be an instance of DataQueryBuilder or a plain object only');case 6:return i=[],"boolean"==typeof n&&i.push("loadRoles=".concat(n)),r&&i.push(c.default.toQueryString(r)),e.abrupt("return",this.app.request.get({url:this.app.urls.usersRole(t),queryString:i.join("&")}).then((function(e){return a.users.dataStore.parseResponse(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return f.apply(this,arguments)})},{key:"getUserRoles",value:(l=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRoles(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"assignRole",value:(r=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,n,"assignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"unassignRole",value:(n=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,n,"unassignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"changeRole",value:(t=(0,i.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||"number"==typeof t)){e.next=2;break}throw new Error("User identity must be a string or number and can not be empty.");case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("Role Name must be a string and can not be empty.");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userRoleOperation(r),data:{user:t,roleName:n}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=l},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=r(n(15)),c=n(58),l=function(){function e(t){(0,i.default)(this,e),this.users=t,this.app=t.app}var t,n,r,l,h,d,y,v,m;return(0,a.default)(e,[{key:"loginWithFacebook",value:(m=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("facebook",t,n,null,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return m.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(v=(0,s.default)(o.default.mark((function e(t,n,r,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("googleplus",t,n,r,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return v.apply(this,arguments)})},{key:"loginWithTwitter",value:(y=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("twitter",t,null,null,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(d=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("facebook",t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return d.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(h=(0,s.default)(o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("googleplus",t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return h.apply(this,arguments)})},{key:"sendWithAccessToken",value:(l=(0,s.default)(o.default.mark((function e(t,n,r,s){var i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&"string"==typeof n){e.next=2;break}throw new Error('"accessToken" must be non empty string.');case 2:return"boolean"==typeof r&&(s=r,r=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialLogin(t),data:{accessToken:n,fieldsMapping:r}}).then((function(e){return i.users.setCurrentUser(e,s)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return l.apply(this,arguments)})},{key:"loginWithContainer",value:(r=(0,s.default)(o.default.mark((function e(t,n,r,s,i){var a,u,l=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new c.SocialContainer(t,s),u=function(){return new Promise((function(e,t){f("message",window,(function n(r){if(r.origin===l.app.serverURL){var o=JSON.parse(r.data);o.fault?t(new Error(o.fault)):e(o),p("message",window,n),a.closeContainer()}}))}))},e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialOAuth(t),data:{fieldsMapping:n||{},permissions:r||[]}}).then((function(e){return a.doAuthorizationActivity(e)})).catch((function(e){throw a.closeContainer(),e})).then(u).then((function(e){return l.users.setCurrentUser(e,i)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n,o,s){return r.apply(this,arguments)})},{key:"loginWithOauth2",value:(n=(0,s.default)(o.default.mark((function e(t,n,r,s,i){var a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:return!r||r instanceof u.default||(i=s,s=r,r=void 0),"boolean"==typeof s&&(i=s,s=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:n,fieldsMapping:s,guestUser:r}}).then((function(e){return a.users.setCurrentUser(e,i)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o,s){return n.apply(this,arguments)})},{key:"loginWithOauth1",value:(t=(0,s.default)(o.default.mark((function e(t,n,r,s,i,a){var c=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:if(r&&"string"==typeof r){e.next=6;break}throw new Error('"accessTokenSecret" must be non empty string.');case 6:return!s||s instanceof u.default||(a=i,i=s,s=void 0),"boolean"==typeof i&&(a=i,i=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:n,accessTokenSecret:r,fieldsMapping:i,guestUser:s}}).then((function(e){return c.users.setCurrentUser(e,a)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,n,r,o,s,i){return t.apply(this,arguments)})}]),e}();function f(e,t,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t[e]=n}function p(e,t,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n),t[e]=null}t.default=l},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.SocialContainer=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(t,n){(0,o.default)(this,e),this.socialType=t,this.container=n,n?this.processContainer():this.createContainer()}return(0,s.default)(e,[{key:"processContainer",value:function(){var e,t=this,n=this.container[0]||this.container,r=document.createElement("div");r.innerHTML="Loading...",n.appendChild(r),n.style.cursor="wait",this.closeContainer=function(){n.style.cursor="default",n.removeChild(e)},this.removeLoading=function(){n.removeChild(r)},this.doAuthorizationActivity=function(r){t.removeLoading(),(e=document.createElement("iframe")).frameBorder=0,e.width=n.style.width,e.height=n.style.height,e.id="SocialAuthFrame",e.setAttribute("src",r+"&amp;output=embed"),n.appendChild(e),e.onload=function(){n.style.cursor="default"}}}},{key:"createContainer",value:function(){var e=window.open("",this.socialType+" authorization","resizable=yes, scrollbars=yes, titlebar=yes, top=10, left=10");e.document.getElementsByTagName("body")[0].innerHTML="Loading...",e.document.getElementsByTagName("html")[0].style.cursor="wait",this.closeContainer=function(){e.close()},this.doAuthorizationActivity=function(t){e.location.href=t,e.onload=function(){e.document.getElementsByTagName("html")[0].style.cursor="default"}}}}]),e}();t.SocialContainer=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=n(18),i=r(n(60)),a=r(n(61)),u=function e(t){(0,o.default)(this,e),this.app=t,this.ExecutionTypes=s.ExecutionTypes,this.CustomServices=new i.default(t),this.Events=new a.default(t)};t.default=u},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(6)),i=r(n(4)),a=r(n(1)),u=r(n(2)),c=n(18);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"invoke",value:(t=(0,i.default)(o.default.mark((function e(t,n,r,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Service Name must be provided and must be a string.");case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("Method Name must be provided and must be a string.");case 4:return"string"==typeof s&&(s={executionType:s}),"string"==typeof r&&(0,c.isExecutionType)(r)&&(s={executionType:r},r=void 0),i=f({},(s=s||{}).httpRequestHeaders),s.executionType&&(i[c.EXECUTION_TYPE_HEADER]=s.executionType),e.abrupt("return",this.app.request.post({url:this.app.urls.blServiceMethod(t,n),data:r,headers:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,n,r,o){return t.apply(this,arguments)})}]),e}();t.default=p},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(9)),i=r(n(4)),a=r(n(1)),u=r(n(2)),c=n(18),l=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"dispatch",value:(t=(0,i.default)(o.default.mark((function e(t,n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Event Name must be provided and must be a string.");case 2:if("string"==typeof n&&(0,c.isExecutionType)(n)&&(r=n,n=void 0),!n||"object"===(0,s.default)(n)&&!Array.isArray(n)){e.next=5;break}throw new Error("Event Arguments must be an object.");case 5:return i={},r&&(i[c.EXECUTION_TYPE_HEADER]=r),e.abrupt("return",this.app.request.post({url:this.app.urls.blEvent(t),data:n||{},headers:i}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=l},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(6)),a=r(n(1)),u=r(n(2)),c=r(n(10)),l=r(n(15)),f=r(n(63)),p=r(n(11)),h=r(n(73)),d=r(n(33)),y=r(n(34)),v=r(n(36)),m=r(n(24)),g=r(n(39)),b=r(n(13)),k=r(n(22)),w=r(n(38)),E=r(n(37)),O=r(n(74)),S=function(){function e(t){(0,a.default)(this,e),this.app=t,this.classToTableMap=(0,i.default)({},l.default.className,l.default),this.Permissions={FIND:new O.default("FIND",t),REMOVE:new O.default("REMOVE",t),UPDATE:new O.default("UPDATE",t)},this.QueryBuilder=p.default,this.GroupQueryBuilder=h.default,this.LoadRelationsQueryBuilder=d.default,this.JSONUpdateBuilder=y.default,this.Point=v.default,this.LineString=m.default,this.Polygon=g.default,this.Geometry=b.default,this.GeoJSONParser=E.default,this.WKTParser=w.default,this.SpatialReferenceSystem=k.default}var t,n;return(0,u.default)(e,[{key:"of",value:function(e){return new f.default(e,this)}},{key:"describe",value:(n=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="string"==typeof t?t:c.default.getClassName(t),e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableProps(t)}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getTableNameById",value:(t=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableNameById(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mapTableToClass",value:function(e,t){if("function"==typeof e&&(t=e,e=c.default.getClassName(t)),!e||"string"!=typeof e)throw new Error("Table Name must be provided and must be a string.");if(!t||"function"!=typeof t)throw new Error("Class must be provided and must be a constructor function.");this.classToTableMap[e]=t}}]),e}();t.default=S},function(e,t,n){"use strict";var r=n(0),o=n(9);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(27)),i=r(n(31)),a=r(n(3)),u=r(n(9)),c=r(n(4)),l=r(n(1)),f=r(n(2)),p=r(n(6)),h=r(n(10)),d=r(n(66)),y=r(n(11)),v=r(n(33)),m=r(n(34)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=w(t);if(n&&n.has(e))return n.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(21)),b=r(n(13)),k=["relationName","relationModel"];function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(w=function(e){return e?n:t})(e)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e,t){var n=e instanceof y.default?e.toJSON():e?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){(0,p.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e):{};return n.pageSize=1,n.offset=0,n.sortBy||(n.sortBy=["created ".concat(t)]),y.default.toRequestBody(n)}var S=function(){function e(t,n){if((0,l.default)(this,e),this.app=n.app,this.classToTableMap=n.classToTableMap,"string"==typeof t?(this.className=t,this.model=this.classToTableMap[this.className]):(this.className=h.default.getClassName(t),this.model=this.classToTableMap[this.className]||t),!this.className)throw new Error("Class name should be specified")}var t,n,r,o,s,p,m,g,b,w,E,S,T,x,C,P,A,N;return(0,f.default)(e,[{key:"rt",value:function(){return this.rtHandlers=this.rtHandlers||new d.default(this)}},{key:"save",value:(N=(0,c.default)(a.default.mark((function e(t,n){var r,o=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n?this.app.urls.dataTableUpsert(this.className):this.app.urls.dataTable(this.className),e.abrupt("return",this.app.request.put({url:r,data:R(t)}).then((function(e){return o.parseResponse(e)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"deepSave",value:(A=(0,c.default)(a.default.mark((function e(t){var n=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataTableDeepSave(this.className),data:R(t)}).then((function(e){return n.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"remove",value:(P=(0,c.default)(a.default.mark((function e(t){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t&&t.objectId||t)&&"string"==typeof n){e.next=3;break}throw new Error("Object Id must be provided and must be a string.");case 3:return e.abrupt("return",this.app.request.delete({url:this.app.urls.dataTableObject(this.className,n)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"find",value:(C=(0,c.default)(a.default.mark((function e(t){var n=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:y.default.toRequestBody(t)}).then((function(e){return n.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"group",value:(x=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataGrouping(this.className),data:y.default.toRequestBody(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"countInGroup",value:(T=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.groupPath&&"object"===(0,u.default)(t.groupPath)){e.next=2;break}throw new Error("Group Path must be provided and must be an object.");case 2:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.dataGrouping(this.className),"/count"),data:y.default.toRequestBody(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"findById",value:(S=(0,c.default)(a.default.mark((function e(t,n){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||"object"!==(0,u.default)(t)||Array.isArray(t)){e.next=8;break}if(Object.keys(t).length){e.next=3;break}throw new Error("Provided object must have at least 1 primary keys.");case 3:return e.next=5,this.app.request.get({url:this.app.urls.dataTablePrimaryKey(this.className),query:t});case 5:r=e.sent,e.next=14;break;case 8:if(t&&"string"==typeof t){e.next=10;break}throw new Error("Object Id must be provided and must be a string or an object of primary keys.");case 10:return n&&(n.pageSize=null,n.offset=null),e.next=13,this.app.request.get({url:this.app.urls.dataTableObject(this.className,t),queryString:y.default.toQueryString(n)});case 13:r=e.sent;case 14:return e.abrupt("return",this.parseResponse(r));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"findFirst",value:(E=(0,c.default)(a.default.mark((function e(t){var n=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:O(t,"asc")}).then((function(e){return n.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"findLast",value:(w=(0,c.default)(a.default.mark((function e(t){var n=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:O(t,"desc")}).then((function(e){return n.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"getObjectCount",value:(b=(0,c.default)(a.default.mark((function e(t){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,!t){e.next=9;break}if(!(t instanceof y.default)){e.next=7;break}n=t.getDistinct()||void 0,t=t.getWhereClause()||void 0,e.next=9;break;case 7:if("string"==typeof t){e.next=9;break}throw new Error("Condition must be a string or an instance of DataQueryBuilder.");case 9:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableCount(this.className),data:{where:t,distinct:n}}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"loadRelations",value:(g=(0,c.default)(a.default.mark((function e(t,n){var r,o,s,u,c,l=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t&&t.objectId||t)&&"string"==typeof r){e.next=3;break}throw new Error("Parent Object Id must be provided and must be a string.");case 3:if(o=n instanceof v.default?n.toJSON():n,s=o.relationName,u=o.relationModel,c=(0,i.default)(o,k),s&&"string"==typeof s){e.next=6;break}throw new Error("Relation Name must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableObjectRelation(this.className,r,s),queryString:v.default.toQueryString(c)}).then((function(e){return l.parseRelationsResponse(e,u)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"setRelation",value:(m=(0,c.default)(a.default.mark((function e(t,n,r){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.POST,t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return m.apply(this,arguments)})},{key:"addRelation",value:(p=(0,c.default)(a.default.mark((function e(t,n,r){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.PUT,t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"deleteRelation",value:(s=(0,c.default)(a.default.mark((function e(t,n,r){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.DELETE,t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"bulkCreate",value:(o=(0,c.default)(a.default.mark((function e(t){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)){e.next=3;break}throw new Error(n);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(n);return e})),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTable(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"bulkUpsert",value:(r=(0,c.default)(a.default.mark((function e(t){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)&&t.length){e.next=3;break}throw new Error(n);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(n);return e})),e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTableUpsert(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"bulkUpdate",value:(n=(0,c.default)(a.default.mark((function e(t,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Condition must be provided and must be a string.");case 2:if(n&&"object"===(0,u.default)(n)&&!Array.isArray(n)){e.next=4;break}throw new Error("Changes must be provided and must be an object.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTable(this.className),query:{where:t},data:n}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"bulkDelete",value:(t=(0,c.default)(a.default.mark((function e(t){var n,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||Array.isArray(t))){e.next=2;break}throw new Error("Condition must be provided and must be a string or a list of objects.");case 2:return n={},"string"==typeof t?n.where=t:(r=t.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t)throw new Error('Can not transform "objects" to "whereClause". Item must be a string or an object with property "objectId" as string.');return"'".concat(t,"'")})),n.where="objectId in (".concat(r.join(","),")")),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTableDelete(this.className),data:n}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"parseRelationsResponse",value:function(e,t){return _(e,t,this)}},{key:"parseResponse",value:function(e){return _(e,this.model,this)}},{key:"changeRelation",value:function(e,t,n,r){var o=t&&t.objectId||t;if(!o||"string"!=typeof o)throw new Error("Relation Parent must be provided and must be a string or an object with objectId property.");if(!n||"string"!=typeof n)throw new Error("Relation Column Name must be provided and must be a string.");if(!r||"string"!=typeof r&&!Array.isArray(r))throw new Error("Relation Children must be provided and must be a string or a list of objects.");var s={};"string"==typeof r?s.whereClause=r:s.childrenIds=r.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t)throw new Error("Child Id must be provided and must be a string.");return t}));var i={};return s.whereClause&&(i.whereClause=s.whereClause),this.app.request.send({method:e,url:this.app.urls.dataTableObjectRelation(this.className,o,n),query:i,data:s.childrenIds})}}]),e}();t.default=S;var R=function(e){return function e(t,n,r){for(var o in n)if(Array.isArray(n[o]))e(t,n[o],r[o]=[]);else if(!n[o]||"object"!==(0,u.default)(n[o])||n[o]instanceof b.default||n[o]instanceof m.default)r[o]=n[o];else if(n[o]instanceof Date)r[o]=n[o].getTime();else if(t.instancesMap.has(n[o])){var s=t.instancesMap.get(n[o]);s.__subID||(s.__subID=h.default.uuid()),r[o]={__originSubID:s.__subID}}else{var i=r[o]={};t.instancesMap.set(n[o],i),e(t,n[o],i)}return r}({instancesMap:new WeakMap},e,{})},_=function(){return function(e,t,r){if(!e)return e;var o={RootModel:t,app:r.app,classToTableMap:r.classToTableMap,subIds:{},postAssign:[]},i=Array.isArray(e)?e.map((function(e){return n(o,e)})):n(o,e);return function(e){e.postAssign.forEach((function(t){var n=(0,s.default)(t,3),r=n[0],o=n[1],i=n[2];r[o]=e.subIds[i]}))}(o),i};function e(e,n,r,o){Array.isArray(n[o])?t(e,n[o],r[o]=[]):n[o]&&"object"===(0,u.default)(n[o])?g.GEO_CLASSES.includes(n[o].___class)?r[o]=(0,g.default)(n[o]):n[o].__originSubID?e.postAssign.push([r,o,n[o].__originSubID]):function(e,n,r,o){var s=n[o].__subID;if(s&&e.subIds[s])r[o]=e.subIds[s],delete n[o].__subID;else{var i=e.classToTableMap[n[o].___class];!i&&e.app.useTableClassesFromGlobalScope&&h.default.globalScope[n[o].___class]&&(console.warn("Resolving DataTable classes from the global scope is deprecated and it won't be supported in the nearest future. Instead, you should register your DataTable classes using the following method Backendless.Data.mapTableToClass"),i=h.default.globalScope[n[o].___class]),r[o]=i?new i:{},s&&!e.subIds[s]&&(e.subIds[s]=r[o],delete n[o].__subID),t(e,n[o],r[o])}}(e,n,r,o):r[o]=n[o]}function t(t,n,r){for(var o in n)e(t,n,r,o)}function n(e,n){var r=e.RootModel||e.classToTableMap[n.___class],o=r?new r:{};if(n.__subID){if(e.subIds[n.__subID])return e.subIds[n.__subID];e.subIds[n.__subID]=o,delete n.__subID}return t(e,n,o),o}}()},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,s=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return s}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(12)),a=r(n(7)),u=r(n(8)),c=r(n(5)),l=n(16);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var p="created",h="updated",d="deleted",y="upserted",v="bulk-created",m="bulk-updated",g="bulk-deleted",b="bulk-upserted",k="add",w="set",E="delete",O=[p,h,d,y],S=function(e){(0,a.default)(n,e);var t=f(n);function n(e){var r;return(0,o.default)(this,n),(r=t.call(this)).dataStore=e,r.app=e.app,r}return(0,s.default)(n,[{key:"getSubscriptionOptions",value:function(){return{tableName:this.dataStore.className}}},{key:"addCreateListener",value:function(e,t,n){this.addChangesListener(p,e,t,n)}},{key:"removeCreateListeners",value:function(e,t){this.removeChangesListeners(p,e,t)}},{key:"removeCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeCreateListeners(void 0,e)}},{key:"addUpsertListener",value:function(e,t,n){this.addChangesListener(y,e,t,n)}},{key:"removeUpsertListeners",value:function(e,t){this.removeChangesListeners(y,e,t)}},{key:"removeUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpsertListeners(void 0,e)}},{key:"addUpdateListener",value:function(e,t,n){this.addChangesListener(h,e,t,n)}},{key:"removeUpdateListeners",value:function(e,t){this.removeChangesListeners(h,e,t)}},{key:"removeUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpdateListeners(void 0,e)}},{key:"addDeleteListener",value:function(e,t,n){this.addChangesListener(d,e,t,n)}},{key:"removeDeleteListeners",value:function(e,t){this.removeChangesListeners(d,e,t)}},{key:"removeDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeDeleteListeners(void 0,e)}},{key:"addBulkCreateListener",value:function(e,t,n){this.addChangesListener(v,e,t,n)}},{key:"removeBulkCreateListeners",value:function(){this.removeChangesListeners(v)}},{key:"removeBulkCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(v,void 0,e)}},{key:"addBulkUpdateListener",value:function(e,t,n){this.addChangesListener(m,e,t,n)}},{key:"removeBulkUpdateListeners",value:function(e,t){this.removeChangesListeners(m,e,t)}},{key:"removeBulkUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkUpdateListeners(void 0,e)}},{key:"addBulkDeleteListener",value:function(e,t,n){this.addChangesListener(g,e,t,n)}},{key:"removeBulkDeleteListeners",value:function(e,t){this.removeChangesListeners(g,e,t)}},{key:"removeBulkDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkDeleteListeners(void 0,e)}},{key:"addBulkUpsertListener",value:function(e,t,n){this.addChangesListener(b,e,t,n)}},{key:"removeBulkUpsertListeners",value:function(){this.removeChangesListeners(b)}},{key:"removeBulkUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(b,void 0,e)}},{key:"addSetRelationListener",value:function(e,t,n,r){this.addRelationsChangesListener(w,e,t,n,r)}},{key:"removeSetRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(w,void 0,e)}},{key:"removeSetRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(w,e,t)}},{key:"addAddRelationListener",value:function(e,t,n,r){this.addRelationsChangesListener(k,e,t,n,r)}},{key:"removeAddRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(k,void 0,e)}},{key:"removeAddRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(k,e,t)}},{key:"addDeleteRelationListener",value:function(e,t,n,r){this.addRelationsChangesListener(E,e,t,n,r)}},{key:"removeDeleteRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(E,void 0,e)}},{key:"removeDeleteRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(E,e,t)}},{key:"addChangesListener",value:function(e,t,n,r){if("function"==typeof t&&(r=n,n=t,t=void 0),"function"!=typeof n)throw new Error("Listener Function must be passed.");this.addSubscription(e,this.app.RT.subscriptions.onObjectsChanges,{callback:n,onError:r,parser:O.includes(e)?this.parseObjectToInstance.bind(this):void 0,params:{event:e,whereClause:t}})}},{key:"removeChangesListeners",value:function(e,t,n){"function"==typeof t&&(n=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var r=e.params;return t?r.whereClause===t:!n||e.callback===n}})}},{key:"addRelationsChangesListener",value:function(e,t,n,r,o){if(!t||"string"!=typeof t)throw new Error("Relation Column Name must be a string.");if("function"==typeof n&&(o=r,r=n,n=void 0),"function"!=typeof r)throw new Error("Listener Function must be passed.");if(n){if(!Array.isArray(n))throw new Error("Parent Objects must be an array");n=n.map((function(e){return e.objectId||e}))}this.addSubscription(e,this.app.RT.subscriptions.onRelationsChanges,{callback:r,onError:o,params:{event:e,relationColumnName:t,parentObjects:n}})}},{key:"removeRelationsChangesListeners",value:function(e,t,n){"function"==typeof t&&(n=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var r=e.params;return t?r.relationColumnName===t:!n||e.callback===n}})}},{key:"removeAllListeners",value:function(){(0,i.default)((0,c.default)(n.prototype),"removeAllListeners",this).call(this)}},{key:"parseObjectToInstance",value:function(e){return this.dataStore.parseResponse(e)}}]),n}(l.RTListeners);t.default=S},function(e,t,n){var r=n(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r,o,s,i;"undefined"!=typeof self&&self,i=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=22)}([function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(r){function o(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}(t=e.exports=n(32)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))})),e.splice(s,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=o,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(o())}).call(t,n(31))},function(e,t,n){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){(function(e){var r,o=n(38),s=n(39),i=n(41),a=n(42),u=n(43);e&&e.ArrayBuffer&&(r=n(45));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),l="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=c||l;t.protocol=3;var p=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=o(p),d={type:"error",data:"parser error"},y=n(46);function v(e,t,n){for(var r=new Array(e.length),o=a(e.length,n),s=function(e,n,o){t(n,(function(t,n){r[e]=n,o(t,r)}))},i=0;i<e.length;i++)s(i,e[i],o)}t.encodePacket=function(n,r,o,s){"function"==typeof r&&(s=r,r=!1),"function"==typeof o&&(s=o,o=null);var i=void 0===n.data?void 0:n.data.buffer||n.data;if(e.ArrayBuffer&&i instanceof ArrayBuffer)return function(e,n,r){if(!n)return t.encodeBase64Packet(e,r);var o=e.data,s=new Uint8Array(o),i=new Uint8Array(1+o.byteLength);i[0]=p[e.type];for(var a=0;a<s.length;a++)i[a+1]=s[a];return r(i.buffer)}(n,r,s);if(y&&i instanceof e.Blob)return function(e,n,r){if(!n)return t.encodeBase64Packet(e,r);if(f)return function(e,n,r){if(!n)return t.encodeBase64Packet(e,r);var o=new FileReader;return o.onload=function(){e.data=o.result,t.encodePacket(e,n,!0,r)},o.readAsArrayBuffer(e.data)}(e,n,r);var o=new Uint8Array(1);o[0]=p[e.type];var s=new y([o.buffer,e.data]);return r(s)}(n,r,s);if(i&&i.base64)return function(e,n){var r="b"+t.packets[e.type]+e.data.data;return n(r)}(n,s);var a=p[n.type];return void 0!==n.data&&(a+=o?u.encode(String(n.data),{strict:!1}):String(n.data)),s(""+a)},t.encodeBase64Packet=function(n,r){var o,s="b"+t.packets[n.type];if(y&&n.data instanceof e.Blob){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];r(s+e)},i.readAsDataURL(n.data)}try{o=String.fromCharCode.apply(null,new Uint8Array(n.data))}catch(e){for(var a=new Uint8Array(n.data),u=new Array(a.length),c=0;c<a.length;c++)u[c]=a[c];o=String.fromCharCode.apply(null,u)}return s+=e.btoa(o),r(s)},t.decodePacket=function(e,n,r){if(void 0===e)return d;if("string"==typeof e){if("b"===e.charAt(0))return t.decodeBase64Packet(e.substr(1),n);if(r&&!1===(e=function(e){try{e=u.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return d;var o=e.charAt(0);return Number(o)==o&&h[o]?e.length>1?{type:h[o],data:e.substring(1)}:{type:h[o]}:d}o=new Uint8Array(e)[0];var s=i(e,1);return y&&"blob"===n&&(s=new y([s])),{type:h[o],data:s}},t.decodeBase64Packet=function(e,t){var n=h[e.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:e.substr(1)}};var o=r.decode(e.substr(1));return"blob"===t&&y&&(o=new y([o])),{type:n,data:o}},t.encodePayload=function(e,n,r){"function"==typeof n&&(r=n,n=null);var o=s(e);return n&&o?y&&!f?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r):e.length?void v(e,(function(e,r){t.encodePacket(e,!!o&&n,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))})):r("0:")},t.decodePayload=function(e,n,r){if("string"!=typeof e)return t.decodePayloadAsBinary(e,n,r);var o;if("function"==typeof n&&(r=n,n=null),""===e)return r(d,0,1);for(var s,i,a="",u=0,c=e.length;u<c;u++){var l=e.charAt(u);if(":"===l){if(""===a||a!=(s=Number(a)))return r(d,0,1);if(a!=(i=e.substr(u+1,s)).length)return r(d,0,1);if(i.length){if(o=t.decodePacket(i,n,!1),d.type===o.type&&d.data===o.data)return r(d,0,1);if(!1===r(o,u+s,c))return}u+=s,a=""}else a+=l}return""!==a?r(d,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,n){if(!e.length)return n(new ArrayBuffer(0));v(e,(function(e,n){t.encodePacket(e,!0,!0,(function(e){return n(null,e)}))}),(function(e,t){var r=t.reduce((function(e,t){var n;return e+(n="string"==typeof t?t.length:t.byteLength).toString().length+n+2}),0),o=new Uint8Array(r),s=0;return t.forEach((function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);n=r.buffer}o[s++]=t?0:1;var a=n.byteLength.toString();for(i=0;i<a.length;i++)o[s++]=parseInt(a[i]);for(o[s++]=255,r=new Uint8Array(n),i=0;i<r.length;i++)o[s++]=r[i]})),n(o.buffer)}))},t.encodePayloadAsBlob=function(e,n){v(e,(function(e,n){t.encodePacket(e,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);e=r.buffer,t[0]=0}var s=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),i=new Uint8Array(s.length+1);for(o=0;o<s.length;o++)i[o]=parseInt(s[o]);if(i[s.length]=255,y){var a=new y([t.buffer,i.buffer,e]);n(null,a)}}))}),(function(e,t){return n(new y(t))}))},t.decodePayloadAsBinary=function(e,n,r){"function"==typeof n&&(r=n,n=null);for(var o=e,s=[];o.byteLength>0;){for(var a=new Uint8Array(o),u=0===a[0],c="",l=1;255!==a[l];l++){if(c.length>310)return r(d,0,1);c+=a[l]}o=i(o,2+c.length),c=parseInt(c);var f=i(o,0,c);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(e){var p=new Uint8Array(f);for(f="",l=0;l<p.length;l++)f+=String.fromCharCode(p[l])}s.push(f),o=i(o,c)}var h=s.length;s.forEach((function(e,o){r(t.decodePacket(e,n,!0),o,h)}))}}).call(t,n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSocketEvents={CONNECTING:"connecting",CONNECT:"connect",CONNECT_ERROR:"connect_error",CONNECT_TIMEOUT:"connect_timeout",DISCONNECT:"disconnect",RECONNECT:"reconnect",RECONNECT_ATTEMPT:"reconnect_attempt",RECONNECTING:"reconnecting",RECONNECT_ERROR:"reconnect_error",RECONNECT_FAILED:"reconnect_failed",ERROR:"error",PING:"ping",PONG:"pong"},t.RTSocketEvents={SUB_ON:"SUB_ON",SUB_OFF:"SUB_OFF",SUB_RES:"SUB_RES",SUB_READY:"SUB_READY",MET_REQ:"MET_REQ",MET_RES:"MET_RES"},t.RTSubscriptionTypes={OBJECTS_CHANGES:"OBJECTS_CHANGES",RELATIONS_CHANGES:"RELATIONS_CHANGES",PUB_SUB_CONNECT:"PUB_SUB_CONNECT",PUB_SUB_MESSAGES:"PUB_SUB_MESSAGES",PUB_SUB_COMMANDS:"PUB_SUB_COMMANDS",PUB_SUB_USERS:"PUB_SUB_USERS",RSO_CONNECT:"RSO_CONNECT",RSO_CHANGES:"RSO_CHANGES",RSO_CLEARED:"RSO_CLEARED",RSO_COMMANDS:"RSO_COMMANDS",RSO_INVOKE:"RSO_INVOKE",RSO_USERS:"RSO_USERS",LOGGING_MESSAGES:"LOGGING_MESSAGES",CONSOLE_MESSAGES:"CONSOLE_MESSAGES",DEVELOPER_MESSAGES:"DEVELOPER_MESSAGES"},t.RTMethodTypes={SET_USER_TOKEN:"SET_USER_TOKEN",RSO_GET:"RSO_GET",RSO_SET:"RSO_SET",RSO_CLEAR:"RSO_CLEAR",RSO_COMMAND:"RSO_COMMAND",RSO_INVOKE:"RSO_INVOKE",PUB_SUB_COMMAND:"PUB_SUB_COMMAND"}},function(e,t){t.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},t.decode=function(e){for(var t={},n=e.split("&"),r=0,o=n.length;r<o;r++){var s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},function(e,t){e.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";var r=n(2);function o(){}function s(e){var n=""+e.type;return t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(n+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(n+=e.nsp+","),null!=e.id&&(n+=e.id),null!=e.data&&(n+=JSON.stringify(e.data)),n}function i(){}function a(){return{type:t.ERROR,data:"parser error"}}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=o,t.Decoder=i,o.prototype.encode=function(e,t){t([s(e)])},r(i.prototype),i.prototype.add=function(e){if("string"!=typeof e)throw new Error("Unknown type: "+e);this.emit("decoded",function(e){var n=0,r={type:Number(e.charAt(0))};if(null==t.types[r.type])return a();if(t.BINARY_EVENT===r.type||t.BINARY_ACK===r.type){for(var o="";"-"!==e.charAt(++n)&&(o+=e.charAt(n),n!=e.length););if(o!=Number(o)||"-"!==e.charAt(n))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===e.charAt(n+1))for(r.nsp="";++n&&","!==(i=e.charAt(n))&&(r.nsp+=i,n!==e.length););else r.nsp="/";var s=e.charAt(n+1);if(""!==s&&Number(s)==s){for(r.id="";++n;){var i;if(null==(i=e.charAt(n))||Number(i)!=i){--n;break}if(r.id+=e.charAt(n),n===e.length)break}r.id=Number(r.id)}return e.charAt(++n)&&(r=function(e,t){try{e.data=JSON.parse(t)}catch(e){return a()}return e}(r,e.substr(n))),r}(e))},i.prototype.destroy=function(){}},function(e,t,n){(function(t){var r=n(36);e.exports=function(e){var n=e.xdomain,o=e.xscheme,s=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!n||r))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!o&&s)return new XDomainRequest}catch(e){}if(!n)try{return new(t[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(t,n(0))},function(e,t,n){var r=n(3),o=n(2);function s(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=s,o(s.prototype),s.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},s.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},s.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},s.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},s.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},s.prototype.onData=function(e){var t=r.decodePacket(e,this.socket.binaryType);this.onPacket(t)},s.prototype.onPacket=function(e){this.emit("packet",e)},s.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(e,t){var n;"undefined"!=typeof self&&self,n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===(void 0===e?"undefined":r(e))},t.isFormData=function(e){return e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData")},t.isStream=function(e){return e instanceof n(6).Stream}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=c(n(3)),i=c(n(4)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(5)),u=n(0);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=new s.default(6e4),d=function(e){function t(e){l(this,t);var n,r=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=502===(n=e).status?"No connection with server":n.body||"Status Code "+n.status+" ("+n.statusText+")";return r.message=o.message||o,r.code=o.code,r.status=e.status,r.headers=e.headers,r.body=e.body,r}return p(t,Error),t}();function y(e){try{return o({},e,{body:JSON.parse(e.body)})}catch(t){return e}}var v=function(e,t,n,r){return new Promise((function(o,s){var i=new b.XMLHttpRequest;i.open(t.toUpperCase(),e,!0),i.onload=function(){var e,t,n=(e=i.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var n=e.indexOf(":"),r=e.substr(0,n).trim(),o=e.substr(n+1).trim();r&&(t[r]=t[r]?t[r]+", "+o:o)})),t):t),r=i,s=r.status,a=r.statusText,u=r.response,c=r.responseText;o({status:s,statusText:a,headers:n,body:u||c}),i=null},i.onerror=function(){s(new Error("Network Error")),i=null},i.ontimeout=function(){s(new Error("Connection aborted due to timeout")),i=null},Object.keys(n).forEach((function(e){i.setRequestHeader(e,n[e])})),i.send(r)}))},m=function(e,t,r,s,i){return new Promise((function(a,c){var l=n(7).parse(e),f=(0,u.isFormData)(s)&&s,p="https:"===l.protocol,h={host:l.hostname,port:l.port||(p?443:80),method:t,path:l.path,headers:r},d=function(){var e=n(1).Buffer,t=n(p?8:9).request(h,(function(t){var n=[],r=[],o=0,s="",u=t.statusCode,l=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,r.push(t)):n.push(t)})),t.on("end",(function(){o?(s=e.concat(r,o),null!=i&&(s=s.toString(i))):n.length&&(s=n.join()),a({status:u,statusText:l,headers:f,body:s})})),t.on("error",c)}));if(t.on("error",c),s){if((0,u.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(f)o(h.headers,f.getHeaders()),f.getLength((function(e,t){e||isNaN(t)||(h.headers["content-length"]=t),d()}));else{if(s&&!h.headers["content-length"]){var y=n(1).Buffer;h.headers["content-length"]=y.byteLength(s)}d()}}))};function g(e){if(e.status>=200&&e.status<300)return e;throw new d(e)}var b=function(t){function n(e,t,r){l(this,n);var o=f(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return o.method=t,o.path=e,o.body=r,o.tags=void 0,o.unwrap=!0,o.cacheTTL=0,o.headers={},o.queryParams={},o.encoding="utf8",o}return p(n,t),r(n,[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var n in e)this.set(n,e[n]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.tags=t,this}},{key:"query",value:function(e){return o(this.queryParams,e),this}},{key:"form",value:function(t){var n=this;if(t){var r=e.exports.FormData;t instanceof r?this.body=t:function(){var e=new r,o=function(n){n&&(0,u.castArray)(t[n]).forEach((function(t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?e.append(n,t.value,t.options):e.append(n,t)}))};for(var s in t)o(s);n.body=e}()}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&h.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var r=this.path,o=a.stringify(this.queryParams);if(o&&(r+="?"+o),this.cacheTTL){var s=h.get(r);if(void 0!==s)return Promise.resolve(s)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),n.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(r),e,this.headers);var i=n.send(r,this.method.toUpperCase(),this.headers,e,this.encoding).then(y).then(g).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&h.set(r,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&h.deleteByTags(t.tags),e}));return i.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),i}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}]),n}(i.default);Object.defineProperty(b,"FormData",{get:function(){return"undefined"!=typeof FormData?FormData:n(10)}}),b.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,b.send=function(e,t,n,r,o){return(void 0!==b.XMLHttpRequest?v:m)(e,t,n,r,o)},b.verbose=!1,b.methods=["get","post","put","patch","delete"],b.methods.forEach((function(e){b[e]=function(t,n){return new b(t,e,n)}})),e.exports=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,s=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw s}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){return{value:e,tags:t,ttl:n}},i=function(){return(new Date).getTime()},a=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var n=e==t;return!n&&e instanceof RegExp&&(n=e.test(t)),!n&&t instanceof RegExp&&(n=t.test(e)),n}(e,t)}))}))},u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.flushInterval=t,this.map=new Map}return o(e,[{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>i())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e4;this.map.set(e,s(t,n,i()+r)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteByTags",value:function(e){var t=!0,n=!1,o=void 0;try{for(var s,i=this.map[Symbol.iterator]();!(t=(s=i.next()).done);t=!0){var u=r(s.value,2),c=u[0],l=u[1];l.tags&&a(e,l.tags)&&this.delete(c)}}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}}},{key:"flush",value:function(){var e=i(),t=!0,n=!1,o=void 0;try{for(var s,a=this.map[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var u=r(s.value,2),c=u[0];u[1].ttl<e&&this.delete(c)}}catch(e){n=!0,o=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw o}}}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}return r(e,[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,n)}))}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var r=n(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(n){var o=e[n];void 0!==o&&(0,r.castArray)(o).forEach((function(e){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}))})),t.join("&")}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')}])},"object"==typeof t&&"object"==typeof e?e.exports=n():(o=[],void 0===(s="function"==typeof(r=n)?r.apply(t,o):r)||(e.exports=s))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o={generateUID:function(){for(var e="",t=0;t<8;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e+Date.now()}};t.default=o},function(e,t){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var t=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));for(var i=n.exec(e||""),a={},u=14;u--;)a[r[u]]=i[u]||"";return-1!=o&&-1!=s&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(e,t,n){var r=n(34),o=n(18),s=n(2),i=n(7),a=n(19),u=n(20),c=n(1)("socket.io-client:manager"),l=n(17),f=n(51),p=Object.prototype.hasOwnProperty;function h(e,t){if(!(this instanceof h))return new h(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||i;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=h,h.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},h.prototype.updateSocketIds=function(){for(var e in this.nsps)p.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},h.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},s(h.prototype),h.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},h.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},h.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},h.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},h.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},h.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},h.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},h.prototype.open=h.prototype.connect=function(e,t){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=r(this.uri,this.opts);var n=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var s=a(n,"open",(function(){o.onopen(),e&&e()})),i=a(n,"error",(function(t){if(c("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var u=this._timeout;c("connect attempt will timeout after %d",u);var l=setTimeout((function(){c("connect attempt timed out after %d",u),s.destroy(),n.close(),n.emit("error","timeout"),o.emitAll("connect_timeout",u)}),u);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(s),this.subs.push(i),this},h.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(a(e,"data",u(this,"ondata"))),this.subs.push(a(e,"ping",u(this,"onping"))),this.subs.push(a(e,"pong",u(this,"onpong"))),this.subs.push(a(e,"error",u(this,"onerror"))),this.subs.push(a(e,"close",u(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",u(this,"ondecoded")))},h.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},h.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},h.prototype.ondata=function(e){this.decoder.add(e)},h.prototype.ondecoded=function(e){this.emit("packet",e)},h.prototype.onerror=function(e){c("error",e),this.emitAll("error",e)},h.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new o(this,e,t),this.nsps[e]=n;var r=this;n.on("connecting",s),n.on("connect",(function(){n.id=r.generateId(e)})),this.autoConnect&&s()}function s(){~l(r.connecting,n)||r.connecting.push(n)}return n},h.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},h.prototype.packet=function(e){c("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()})))},h.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},h.prototype.cleanup=function(){c("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},h.prototype.close=h.prototype.disconnect=function(){c("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},h.prototype.onclose=function(e){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},h.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();c("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(c("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(c("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(c("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},h.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,n){(function(e){var r=n(8),o=n(37),s=n(47),i=n(48);t.polling=function(t){var n=!1,i=!1,a=!1!==t.jsonp;if(e.location){var u="https:"===location.protocol,c=location.port;c||(c=u?443:80),n=t.hostname!==location.hostname||c!==t.port,i=t.secure!==u}if(t.xdomain=n,t.xscheme=i,"open"in new r(t)&&!t.forceJSONP)return new o(t);if(!a)throw new Error("JSONP disabled");return new s(t)},t.websocket=i}).call(t,n(0))},function(e,t,n){var r=n(9),o=n(5),s=n(3),i=n(6),a=n(16),u=n(1)("engine.io-client:polling");e.exports=l;var c=null!=new(n(8))({xdomain:!1}).responseType;function l(e){var t=e&&e.forceBase64;c&&!t||(this.supportsBinary=!1),r.call(this,e)}i(l,r),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;function n(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(u("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--r||n()}))),this.writable||(u("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){u("pre-pause writing complete"),--r||n()})))}else n()},l.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(e){var t=this;u("polling got data %s",e),s.decodePayload(e,this.socket.binaryType,(function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){var e=this;function t(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};s.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},l.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=a()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e}},function(e,t,n){"use strict";var r,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),s={},i=0,a=0;function u(e){var t="";do{t=o[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function c(){var e=u(+new Date);return e!==r?(i=0,r=e):e+"."+u(i++)}for(;a<64;a++)s[o[a]]=a;c.encode=u,c.decode=function(e){var t=0;for(a=0;a<e.length;a++)t=64*t+s[e.charAt(a)];return t},e.exports=c},function(e,t){var n=[].indexOf;e.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}},function(e,t,n){var r=n(7),o=n(2),s=n(50),i=n(19),a=n(20),u=n(1)("socket.io-client:socket"),c=n(5);e.exports=p;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=o.prototype.emit;function p(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}o(p.prototype),p.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[i(e,"open",a(this,"onopen")),i(e,"packet",a(this,"onpacket")),i(e,"close",a(this,"onclose"))]}},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},p.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){if(l.hasOwnProperty(e))return f.apply(this,arguments),this;var t=s(arguments),n={type:r.EVENT,data:t,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),delete this.flags,this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;u("sending connect packet with query %s",e),this.packet({type:r.CONNECT,query:e})}else this.packet({type:r.CONNECT})},p.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(e);break;case r.ACK:case r.BINARY_ACK:this.onack(e);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?f.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var o=s(arguments);u("sending ack %j",o),t.packet({type:r.ACK,id:e,data:o})}}},p.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)f.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},p.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},p.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},p.prototype.close=p.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},p.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}},function(e,t){e.exports=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}},function(e,t){var n=[].slice;e.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.subscriptions={},this.simpleListeners={}}return o(e,[{key:"addSubscription",value:function(e,t,n){var o=this,s=n.callback,i=n.onError,a=n.onReady,u=n.parser,c=n.params;this.subscriptions[e]=this.subscriptions[e]||[];var l=t(r({},c,this.getSubscriptionOptions()),{parser:u,onData:s,onError:i,onReady:a,onStop:function(){o.subscriptions[e]=o.subscriptions[e].filter((function(e){return e.subscription!==l}))}}),f={callback:s,params:c,subscription:l,stop:function(){return l.stop()}};return this.subscriptions[e].push(f),f}},{key:"getSubscriptionOptions",value:function(){return{}}},{key:"stopSubscription",value:function(e,t){var n=t.callback,r=t.matcher,o=this.subscriptions[e]=this.subscriptions[e]||[];r?o.forEach((function(e){r(e)&&e.subscription.stop()})):o.forEach((function(e){n&&e.callback!==n||e.subscription.stop()}))}},{key:"addSimpleListener",value:function(e,t){(this.simpleListeners[e]=this.simpleListeners[e]||[]).push(t)}},{key:"removeSimpleListener",value:function(e,t){this.simpleListeners[e]&&(this.simpleListeners[e]=t?this.simpleListeners[e].filter((function(e){return e!==t})):[])}},{key:"runSimpleListeners",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.simpleListeners[e]&&this.simpleListeners[e].forEach((function(e){return e.apply(void 0,n)}))}},{key:"removeAllListeners",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].forEach((function(e){return e.subscription.stop()}))})),this.simpleListeners={}}}]),e}();t.default=s},function(e,t,n){"use strict";(function(r){Object.defineProperty(t,"__esModule",{value:!0}),t.RTScopeConnector=t.RTListeners=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=c(n(10)),i=c(n(23)),a=c(n(21)),u=c(n(52));function c(e){return e&&e.__esModule?e:{default:e}}var l="object"===("undefined"==typeof self?"undefined":o(self))&&self.self===self&&self||"object"===(void 0===r?"undefined":o(r))&&r.global===r&&r;i.default.Request=s.default,i.default.Listeners=a.default,i.default.ScopeConnector=u.default,l&&(l.BackendlessRTClient=i.default),e.exports=i.default,t.default=i.default,t.RTListeners=a.default,t.RTScopeConnector=u.default}).call(t,n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4),s=c(n(24)),i=c(n(25)),a=c(n(26)),u=c(n(27));function c(e){return e&&e.__esModule?e:{default:e}}var l=[o.NativeSocketEvents.CONNECTING,o.NativeSocketEvents.CONNECT,o.NativeSocketEvents.CONNECT_ERROR,o.NativeSocketEvents.DISCONNECT,o.NativeSocketEvents.RECONNECT_ATTEMPT],f=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onConnectError=function(){n.subscriptions.hasActivity()||n.methods.hasActivity()||(n.disconnect("There are no active subscriptions and methods"),n.connectible=!0)},this.connectOnMethod=function(e){return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];if(n.connectible){var s=n.provideConnection();n.connected&&s.then((function(t){return t[e].apply(t,r)}))}}},this.on=this.connectOnMethod("on"),this.emit=this.connectOnMethod("emit"),this.onSessionDisconnect=function(){n.subscriptions.stop(),n.methods.stop(),delete n.session,n.provideConnection()},this.emitSocketEventListeners=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];n.socketEvents[e]&&n.socketEvents[e].forEach((function(e){return e.apply(void 0,r)}))},this.addConnectingEventListener=function(e){return n.addSocketEventListener(o.NativeSocketEvents.CONNECTING,e)},this.removeConnectingEventListener=function(e){return n.removeSocketEventListener(o.NativeSocketEvents.CONNECTING,e)},this.addConnectEventListener=function(e){return n.addSocketEventListener(o.NativeSocketEvents.CONNECT,e)},this.removeConnectEventListener=function(e){return n.removeSocketEventListener(o.NativeSocketEvents.CONNECT,e)},this.addConnectErrorEventListener=function(e){return n.addSocketEventListener(o.NativeSocketEvents.CONNECT_ERROR,e)},this.removeConnectErrorEventListener=function(e){return n.removeSocketEventListener(o.NativeSocketEvents.CONNECT_ERROR,e)},this.addDisconnectEventListener=function(e){return n.addSocketEventListener(o.NativeSocketEvents.DISCONNECT,e)},this.removeDisconnectEventListener=function(e){return n.removeSocketEventListener(o.NativeSocketEvents.DISCONNECT,e)},this.addReconnectAttemptEventListener=function(e){return n.addSocketEventListener(o.NativeSocketEvents.RECONNECT_ATTEMPT,e)},this.removeReconnectAttemptEventListener=function(e){return n.removeSocketEventListener(o.NativeSocketEvents.RECONNECT_ATTEMPT,e)},this.removeConnectionListeners=function(){l.forEach((function(e){return n.removeSocketEventListener(e)}))},this.config=new s.default(t),this.resetSocketEvents();var r={onMessage:this.on.bind(this),emitMessage:this.emit.bind(this)};this.subscriptions=new i.default(r),this.methods=new a.default(r),this.connectible=!0,this.connected=!1}return r(e,[{key:"resetSocketEvents",value:function(){this.socketEvents={},this.addConnectErrorEventListener(this.onConnectError)}},{key:"setConfig",value:function(e){this.config.set(e),this.session&&(this.disconnect("Re-config socket connection"),this.connect())}},{key:"provideConnection",value:function(){var e=this;return this.session||(this.session=new u.default(this.config,this.emitSocketEventListeners,this.onSessionDisconnect),this.session.getSocket().then((function(){e.connected=!0,e.methods.initialize(),e.methods.restore(),e.subscriptions.initialize(),e.subscriptions.restore()}))),this.session.getSocket()}},{key:"connect",value:function(){this.connectible=!0,this.provideConnection()}},{key:"disconnect",value:function(e){this.session&&(this.subscriptions.stop(),this.methods.stop(),this.session.terminate(),delete this.session,this.emitSocketEventListeners(o.NativeSocketEvents.DISCONNECT,e||"disconnected by client")),this.connectible=!1,this.connected=!1}},{key:"terminate",value:function(e){this.resetSocketEvents(),this.subscriptions.reset(),this.methods.reset(),this.disconnect(e||"Terminated by client")}},{key:"addSocketEventListener",value:function(e,t){return this.socketEvents[e]=this.socketEvents[e]||[],this.socketEvents[e].push(t),this}},{key:"removeSocketEventListener",value:function(e,t){return this.socketEvents[e]&&(this.socketEvents[e]=t?this.socketEvents[e].filter((function(e){return e!==t})):[],this.socketEvents[e].length||delete this.socketEvents[e]),this}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(10),a=(r=i)&&r.__esModule?r:{default:r},u=function(e){return void 0===e},c=function(e){return"string"==typeof e},l=function(e){return"function"==typeof e},f=function(e){return"object"===(void 0===e?"undefined":s(e))&&null!==e},p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.appId=null,this.lookupPath=null,this.lookupHeaders={},this.debugMode=!1,this.connectQuery={},this.socketConfigTransform=null,this.socketConfig=null,this.set(t)}var t,n;return o(e,[{key:"set",value:function(e){if(e){if(!u(e.appId)){if(!c(e.appId))throw new Error('"appId" must be String.');this.appId=e.appId}if(!u(e.lookupPath)){if(!c(e.lookupPath))throw new Error('"lookupPath" must be String.');this.lookupPath=e.lookupPath}if(!u(e.lookupHeaders)){if(!f(e.lookupHeaders))throw new Error('"lookupHeaders" must be Object.');this.lookupHeaders=e.lookupHeaders}if(u(e.debugMode)||(this.debugMode=!!e.debugMode),!u(e.connectQuery))if(l(e.connectQuery))this.getConnectQuery=e.connectQuery;else{if(!f(e.connectQuery))throw new Error('"connectQuery" must be Function or Object.');this.connectQuery=e.connectQuery}if(!u(e.socketConfigTransform)){if(!l(e.socketConfigTransform))throw new Error('"socketConfigTransform" must be Function.');this.socketConfigTransform=e.socketConfigTransform}}}},{key:"getConnectQuery",value:function(){return this.connectQuery}},{key:"prepare",value:(t=regeneratorRuntime.mark((function e(){var t,n,r,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c(this.lookupPath)){e.next=2;break}throw new Error("lookupPath must be String");case 2:return e.next=4,a.default.get(this.lookupPath).set(this.lookupHeaders);case 4:if(t=e.sent,n=this.appId?t+"/"+this.appId:t,r=this.appId?"/"+this.appId:void 0,o=this.getConnectQuery(),this.socketConfig={host:t,url:n,options:{path:r,query:o,forceNew:!0,autoConnect:!1,reconnection:!1}},!this.socketConfigTransform){e.next=14;break}return e.next=12,this.socketConfigTransform(this.socketConfig);case 12:(s=e.sent)&&(this.socketConfig=s);case 14:case"end":return e.stop()}}),e,this)})),n=function(){var e=t.apply(this,arguments);return new Promise((function(t,n){return function r(o,s){try{var i=e[o](s),a=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(a).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(a)}("next")}))},function(){return n.apply(this,arguments)})},{key:"getSocketConfig",value:function(){return this.socketConfig}}]),e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(4),i=n(11),a=(r=i)&&r.__esModule?r:{default:r},u=function(e){return function(t,n){return this.subscribe(e,t,n)}},c=function(){function e(t){var n=t.onMessage,r=t.emitMessage;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onObjectsChanges=u(s.RTSubscriptionTypes.OBJECTS_CHANGES).bind(this),this.onRelationsChanges=u(s.RTSubscriptionTypes.RELATIONS_CHANGES).bind(this),this.connectToPubSub=u(s.RTSubscriptionTypes.PUB_SUB_CONNECT).bind(this),this.onPubSubMessage=u(s.RTSubscriptionTypes.PUB_SUB_MESSAGES).bind(this),this.onPubSubCommand=u(s.RTSubscriptionTypes.PUB_SUB_COMMANDS).bind(this),this.onPubSubUserStatus=u(s.RTSubscriptionTypes.PUB_SUB_USERS).bind(this),this.connectToRSO=u(s.RTSubscriptionTypes.RSO_CONNECT).bind(this),this.onRSOChanges=u(s.RTSubscriptionTypes.RSO_CHANGES).bind(this),this.onRSOClear=u(s.RTSubscriptionTypes.RSO_CLEARED).bind(this),this.onRSOCommand=u(s.RTSubscriptionTypes.RSO_COMMANDS).bind(this),this.onRSOInvoke=u(s.RTSubscriptionTypes.RSO_INVOKE).bind(this),this.onRSOUserStatus=u(s.RTSubscriptionTypes.RSO_USERS).bind(this),this.onLoggingMessages=u(s.RTSubscriptionTypes.LOGGING_MESSAGES).bind(this),this.onConsoleMessages=u(s.RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this),this.onDeveloperMessage=u(s.RTSubscriptionTypes.DEVELOPER_MESSAGES).bind(this),this.onMessage=n,this.emitMessage=r,this.subscriptions={}}return o(e,[{key:"initialize",value:function(){var e=this;this.onMessage(s.RTSocketEvents.SUB_READY,(function(t){return e.onSubscriptionReady(t)})),this.onMessage(s.RTSocketEvents.SUB_RES,(function(t){return e.onSubscriptionResponse(t)}))}},{key:"stop",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].ready=!1}))}},{key:"reset",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){return e.stopSubscription(t)}))}},{key:"restore",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.startSubscription(t)}))}},{key:"hasActivity",value:function(){return!!Object.keys(this.subscriptions).length}},{key:"subscribe",value:function(e,t,n){var r=this,o=n.parser,s=n.onData,i=n.onError,u=n.onStop,c=n.onReady,l=a.default.generateUID();return this.subscriptions[l]={data:{id:l,name:e,options:t},ready:!1,parser:o,onData:s,onError:i,onStop:u,onReady:c},this.startSubscription(l),{isReady:function(){return!!r.subscriptions[l]&&r.subscriptions[l].ready},stop:function(){r.subscriptions[l]&&r.offSubscription(l)}}}},{key:"startSubscription",value:function(e){var t=this.subscriptions[e];this.emitMessage(s.RTSocketEvents.SUB_ON,t.data)}},{key:"stopSubscription",value:function(e){var t=this.subscriptions[e];t&&(t.onStop&&t.onStop(),delete this.subscriptions[e])}},{key:"offSubscription",value:function(e){this.subscriptions[e]&&(this.emitMessage(s.RTSocketEvents.SUB_OFF,{id:e}),this.stopSubscription(e))}},{key:"onSubscriptionReady",value:function(e){var t=e.id,n=this.subscriptions[t];n&&!n.ready&&(n.ready=!0,n.onReady&&n.onReady())}},{key:"onSubscriptionResponse",value:function(e){var t=e.id,n=e.data,r=e.error,o=this.subscriptions[t];o&&(r?(o.onError&&o.onError(r),this.stopSubscription(t)):(o.ready||(o.ready=!0,o.onReady&&o.onReady()),o.onData&&("function"==typeof o.parser&&(n=o.parser(n)),o.onData(n))))}}]),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(4),i=n(11),a=(r=i)&&r.__esModule?r:{default:r},u=function(e){return function(t){return this.send(e,t)}},c=function(){function e(t){var n=this,r=t.onMessage,o=t.emitMessage;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sendRequest=function(e){n.invocations[e]&&n.emitMessage(s.RTSocketEvents.MET_REQ,n.invocations[e].data)},this.onResponse=function(e){var t=e.id,r=e.error,o=e.result;if(n.invocations[t]){var s=n.invocations[t];r?s.reject(r):s.resolve(o),delete n.invocations[t]}},this.setUserToken=u(s.RTMethodTypes.SET_USER_TOKEN).bind(this),this.sendPubSubCommand=u(s.RTMethodTypes.PUB_SUB_COMMAND).bind(this),this.getRSO=u(s.RTMethodTypes.RSO_GET).bind(this),this.setRSO=u(s.RTMethodTypes.RSO_SET).bind(this),this.clearRSO=u(s.RTMethodTypes.RSO_CLEAR).bind(this),this.sendRSOCommand=u(s.RTMethodTypes.RSO_COMMAND).bind(this),this.invokeRSOMethod=u(s.RTMethodTypes.RSO_INVOKE).bind(this),this.onMessage=r,this.emitMessage=o,this.invocations={}}return o(e,[{key:"initialize",value:function(){this.onMessage(s.RTSocketEvents.MET_RES,this.onResponse)}},{key:"restore",value:function(){var e=this;Object.keys(this.invocations).forEach((function(t){e.sendRequest(t)}))}},{key:"stop",value:function(){}},{key:"reset",value:function(){this.invocations={}}},{key:"hasActivity",value:function(){return!!Object.keys(this.invocations).length}},{key:"send",value:function(e,t){var n=this,r=a.default.generateUID();return this.invocations[r]={data:{id:r,name:e,options:t}},this.sendRequest(r),new Promise((function(e,t){n.invocations[r].resolve=e,n.invocations[r].reject=t}))}}]),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(4),i=n(28),a=(r=i)&&r.__esModule?r:{default:r},u=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.dispatch=n,this.onDisconnect=r,this.connectAttempt=0,this.socketPromise=this.connect()}return o(e,[{key:"terminate",value:function(){this.terminated||(this.terminated=!0,this.dispatch=function(){},this.socketPromise.then((function(e){e&&e.close()})))}},{key:"getSocket",value:function(){var e=this;return this.socketPromise.then((function(t){return e.terminated?new Promise((function(){})):t}))}},{key:"connect",value:function(){var e=this;if(!this.terminated){this.connectAttempt=this.connectAttempt+1;var t=this.getNextReconnectionTimeout();return this.onConnecting(),this.connectAttempt>1&&this.onReconnectAttempt(this.connectAttempt-1,t),a.default.connect(this.config,this.onSocketDisconnect.bind(this)).then((function(t){return e.connectAttempt=0,e.onConnect(),t})).catch((function(n){if(e.onConnectError(n),!e.terminated)return(r=t,new Promise((function(e){return setTimeout(e,r)}))).then((function(){return e.connect()}));var r}))}}},{key:"getNextReconnectionTimeout",value:function(){var e=Math.ceil(this.connectAttempt/10),t=200*Math.pow(2,e);return Math.min(t,6e4)}},{key:"onSocketDisconnect",value:function(e){this.dispatch(s.NativeSocketEvents.DISCONNECT,e),this.terminated||(this.terminate(),this.onDisconnect())}},{key:"onConnecting",value:function(){this.dispatch(s.NativeSocketEvents.CONNECTING)}},{key:"onConnect",value:function(){this.dispatch(s.NativeSocketEvents.CONNECT)}},{key:"onConnectError",value:function(e){this.dispatch(s.NativeSocketEvents.CONNECT_ERROR,e&&e.message||e)}},{key:"onReconnectAttempt",value:function(e,t){this.dispatch(s.NativeSocketEvents.RECONNECT_ATTEMPT,e,t)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4),s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var o=n(29);this.config=t,this.events={};var s=t.getSocketConfig(),i=s.url,a=s.options;this.ioSocket=o(i,a)}return r(e,null,[{key:"connect",value:function(t,n){return Promise.resolve().then((function(){return t.prepare()})).then((function(){return new Promise((function(n,r){var s=new e(t);function i(e){s.close(),r(e)}s.on(o.NativeSocketEvents.CONNECT,(function(){n(s)})),s.on(o.NativeSocketEvents.CONNECT_ERROR,i),s.on(o.NativeSocketEvents.CONNECT_TIMEOUT,i),s.on(o.NativeSocketEvents.ERROR,i),s.connect()}))})).then((function(e){return e.on(o.NativeSocketEvents.DISCONNECT,n),e}))}}]),r(e,[{key:"connect",value:function(){this.ioSocket.connect()}},{key:"close",value:function(){this.events={},this.ioSocket.off(),this.ioSocket.close()}},{key:"on",value:function(e,t){var n=this;this.events[e]||this.ioSocket.on(e,(function(t){return n.onEvent(e,t)})),this.events[e]=this.events[e]||[],this.events[e].push(t)}},{key:"off",value:function(e,t){this.events[e]=t?this.events[e].filter((function(e){return e!==t})):[],this.events[e].length||delete this.events[e],this.events[e]||this.ioSocket.off(e)}},{key:"onEvent",value:function(e,t){this.config.debugMode&&i("FROM SERVER",e,t),this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"emit",value:function(e,t){this.config.debugMode&&i("TO SERVER",e,t),this.ioSocket.emit(e,t)}}]),e}();function i(e,t,n){console.log("["+e+"] - [event: "+t+"] - arguments: "+JSON.stringify(n)+" ")}t.default=s},function(e,t,n){var r=n(30),o=n(7),s=n(13),i=n(1)("socket.io-client");e.exports=t=u;var a=t.managers={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,o=r(e),u=o.source,c=o.id,l=o.path,f=a[c]&&l in a[c].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(i("ignoring socket cache for %s",u),n=s(u,t)):(a[c]||(i("new io instance for %s",u),a[c]=s(u,t)),n=a[c]),o.query&&!t.query&&(t.query=o.query),n.socket(o.path,t)}t.protocol=o.protocol,t.connect=u,t.Manager=n(13),t.Socket=n(18)},function(e,t,n){(function(t){var r=n(12),o=n(1)("socket.io-client:url");e.exports=function(e,n){var s=e;n=n||t.location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==n?n.protocol+"//"+e:"https://"+e),o("parse %s",e),s=r(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";var i=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port,s.href=s.protocol+"://"+i+(n&&n.port===s.port?"":":"+s.port),s}}).call(t,n(0))},function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=a(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){var r;function o(e){function n(){if(n.enabled){var e=n,o=+new Date,s=o-(r||o);e.diff=s,e.prev=r,e.curr=o,r=o;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=t.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var u=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;u++;var o=t.formatters[r];if("function"==typeof o){var s=i[u];n=o.call(e,s),i.splice(u,1),u--}return n})),t.formatArgs.call(e,i);var c=n.log||t.log||console.log.bind(console);c.apply(e,i)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(n),n}(t=e.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&("-"===(e=n[o].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(33),t.names=[],t.skips=[],t.formatters={}},function(e,t){var n=1e3,r=6e4,o=60*r,s=24*o;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,t){t=t||{};var a,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"days":case"day":case"d":return i*s;case"hours":case"hour":case"hrs":case"hr":case"h":return i*o;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(e);if("number"===u&&!1===isNaN(e))return t.long?i(a=e,s,"day")||i(a,o,"hour")||i(a,r,"minute")||i(a,n,"second")||a+" ms":function(e){return e>=s?Math.round(e/s)+"d":e>=o?Math.round(e/o)+"h":e>=r?Math.round(e/r)+"m":e>=n?Math.round(e/n)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){e.exports=n(35),e.exports.parser=n(3)},function(e,t,n){(function(t){var r=n(14),o=n(2),s=n(1)("engine.io-client:socket"),i=n(17),a=n(3),u=n(12),c=n(5);function l(e,n){if(!(this instanceof l))return new l(e,n);n=n||{},e&&"object"==typeof e&&(n=e,e=null),e?(e=u(e),n.hostname=e.host,n.secure="https"===e.protocol||"wss"===e.protocol,n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=u(n.host).host),this.secure=null!=n.secure?n.secure:t.location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.agent=n.agent||!1,this.hostname=n.hostname||(t.location?location.hostname:"localhost"),this.port=n.port||(t.location&&location.port?location.port:this.secure?443:80),this.query=n.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==n.upgrade,this.path=(n.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!n.forceJSONP,this.jsonp=!1!==n.jsonp,this.forceBase64=!!n.forceBase64,this.enablesXDR=!!n.enablesXDR,this.timestampParam=n.timestampParam||"t",this.timestampRequests=n.timestampRequests,this.transports=n.transports||["polling","websocket"],this.transportOptions=n.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=n.policyPort||843,this.rememberUpgrade=n.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=n.onlyBinaryUpgrades,this.perMessageDeflate=!1!==n.perMessageDeflate&&(n.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=n.pfx||null,this.key=n.key||null,this.passphrase=n.passphrase||null,this.cert=n.cert||null,this.ca=n.ca||null,this.ciphers=n.ciphers||null,this.rejectUnauthorized=void 0===n.rejectUnauthorized||n.rejectUnauthorized,this.forceNode=!!n.forceNode;var r="object"==typeof t&&t;r.global===r&&(n.extraHeaders&&Object.keys(n.extraHeaders).length>0&&(this.extraHeaders=n.extraHeaders),n.localAddress&&(this.localAddress=n.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=l,l.priorWebsocketSuccess=!1,o(l.prototype),l.protocol=a.protocol,l.Socket=l,l.Transport=n(9),l.transports=n(14),l.parser=n(3),l.prototype.createTransport=function(e){s('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);t.EIO=a.protocol,t.transport=e;var n=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new r[e]({query:t,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0})},l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},l.prototype.setTransport=function(e){s("setting transport %s",e.name);var t=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},l.prototype.probe=function(e){s('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,r=this;function o(){if(r.onlyBinaryUpgrades){var o=!this.supportsBinary&&r.transport.supportsBinary;n=n||o}n||(s('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(s('probe transport "%s" pong',e),r.upgrading=!0,r.emit("upgrading",t),!t)return;l.priorWebsocketSuccess="websocket"===t.name,s('pausing current transport "%s"',r.transport.name),r.transport.pause((function(){n||"closed"!==r.readyState&&(s("changing transport and sending upgrade packet"),p(),r.setTransport(t),t.send([{type:"upgrade"}]),r.emit("upgrade",t),t=null,r.upgrading=!1,r.flush())}))}else{s('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=t.name,r.emit("upgradeError",i)}})))}function i(){n||(n=!0,p(),t.close(),t=null)}function a(n){var o=new Error("probe error: "+n);o.transport=t.name,i(),s('probe transport "%s" failed because of error: %s',e,n),r.emit("upgradeError",o)}function u(){a("transport closed")}function c(){a("socket closed")}function f(e){t&&e.name!==t.name&&(s('"%s" works - aborting "%s"',e.name,t.name),i())}function p(){t.removeListener("open",o),t.removeListener("error",a),t.removeListener("close",u),r.removeListener("close",c),r.removeListener("upgrading",f)}l.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",a),t.once("close",u),this.once("close",c),this.once("upgrading",f),t.open()},l.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},l.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(s('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else s('packet received with socket readyState "%s"',this.readyState)},l.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},l.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){s("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},l.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},l.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},l.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?r():t()})):this.upgrading?r():t()}function t(){e.onClose("forced close"),s("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function r(){e.once("upgrade",n),e.once("upgradeError",n)}return this},l.prototype.onError=function(e){s("socket error %j",e),l.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},l.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(s('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},l.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~i(this.transports,e[n])&&t.push(e[n]);return t}}).call(t,n(0))},function(e,t){try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},function(e,t,n){(function(t){var r=n(8),o=n(15),s=n(2),i=n(6),a=n(1)("engine.io-client:polling-xhr");function u(){}function c(e){if(o.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,t.location){var n="https:"===location.protocol,r=location.port;r||(r=n?443:80),this.xd=e.hostname!==t.location.hostname||r!==e.port,this.xs=e.secure!==n}}function l(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function f(){for(var e in l.requests)l.requests.hasOwnProperty(e)&&l.requests[e].abort()}e.exports=c,e.exports.Request=l,i(c,o),c.prototype.supportsBinary=!0,c.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new l(e)},c.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),o=this;r.on("success",t),r.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=r},c.prototype.doPoll=function(){a("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},s(l.prototype),l.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var n=this.xhr=new r(e),o=this;try{a("xhr open %s: %s",this.method,this.uri),n.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var s in n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this.extraHeaders[s])}catch(e){}if("POST"===this.method)try{this.isBinary?n.setRequestHeader("Content-type","application/octet-stream"):n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in n&&(n.withCredentials=!0),this.requestTimeout&&(n.timeout=this.requestTimeout),this.hasXDR()?(n.onload=function(){o.onLoad()},n.onerror=function(){o.onError(n.responseText)}):n.onreadystatechange=function(){if(2===n.readyState){var e;try{e=n.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===e&&(n.responseType="arraybuffer")}4===n.readyState&&(200===n.status||1223===n.status?o.onLoad():setTimeout((function(){o.onError(n.status)}),0))},a("xhr data %s",this.data),n.send(this.data)}catch(e){return void setTimeout((function(){o.onError(e)}),0)}t.document&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},l.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},l.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=u:this.xhr.onreadystatechange=u,e)try{this.xhr.abort()}catch(e){}t.document&&delete l.requests[this.index],this.xhr=null}},l.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},l.prototype.hasXDR=function(){return void 0!==t.XDomainRequest&&!this.xs&&this.enablesXDR},l.prototype.abort=function(){this.cleanup()},l.requestsCount=0,l.requests={},t.document&&(t.attachEvent?t.attachEvent("onunload",f):t.addEventListener&&t.addEventListener("beforeunload",f,!1))}).call(t,n(0))},function(e,t){e.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}},function(e,t,n){(function(t){var r=n(40),o=Object.prototype.toString,s="function"==typeof t.Blob||"[object BlobConstructor]"===o.call(t.Blob),i="function"==typeof t.File||"[object FileConstructor]"===o.call(t.File);e.exports=function e(n){if(!n||"object"!=typeof n)return!1;if(r(n)){for(var o=0,a=n.length;o<a;o++)if(e(n[o]))return!0;return!1}if("function"==typeof t.Buffer&&t.Buffer.isBuffer&&t.Buffer.isBuffer(n)||"function"==typeof t.ArrayBuffer&&n instanceof ArrayBuffer||s&&n instanceof Blob||i&&n instanceof File)return!0;if(n.toJSON&&"function"==typeof n.toJSON&&1===arguments.length)return e(n.toJSON(),!0);for(var u in n)if(Object.prototype.hasOwnProperty.call(n,u)&&e(n[u]))return!0;return!1}}).call(t,n(0))},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){e.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),s=new Uint8Array(n-t),i=t,a=0;i<n;i++,a++)s[a]=o[i];return s.buffer}},function(e,t){function n(){}e.exports=function(e,t,r){var o=!1;return r=r||n,s.count=e,0===e?t():s;function s(e,n){if(s.count<=0)throw new Error("after called too many times");--s.count,e?(o=!0,t(e),t=r):0!==s.count||o||t(null,n)}}},function(e,t,n){(function(e,r){var o;!function(s){var i=("object"==typeof e&&e&&e.exports,"object"==typeof r&&r);i.global!==i&&i.window;var a,u,c,l=String.fromCharCode;function f(e){for(var t,n,r=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function p(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function h(e,t){return l(e>>t&63|128)}function d(e,t){if(0==(4294967168&e))return l(e);var n="";return 0==(4294965248&e)?n=l(e>>6&31|192):0==(4294901760&e)?(p(e,t)||(e=65533),n=l(e>>12&15|224),n+=h(e,6)):0==(4292870144&e)&&(n=l(e>>18&7|240),n+=h(e,12),n+=h(e,6)),n+=l(63&e|128)}function y(){if(c>=u)throw Error("Invalid byte index");var e=255&a[c];if(c++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function v(e){var t,n;if(c>u)throw Error("Invalid byte index");if(c==u)return!1;if(t=255&a[c],c++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|y())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|y()<<6|y())>=2048)return p(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|y()<<12|y()<<6|y())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var m={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,r=f(e),o=r.length,s=-1,i="";++s<o;)i+=d(r[s],n);return i},decode:function(e,t){var n=!1!==(t=t||{}).strict;a=f(e),u=a.length,c=0;for(var r,o=[];!1!==(r=v(n));)o.push(r);return function(e){for(var t,n=e.length,r=-1,o="";++r<n;)(t=e[r])>65535&&(o+=l((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=l(t);return o}(o)}};void 0===(o=function(){return m}.call(t,n,t,e))||(e.exports=o)}()}).call(t,n(44)(e),n(0))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<e.length;r++)n[e.charCodeAt(r)]=r;t.encode=function(t){var n,r=new Uint8Array(t),o=r.length,s="";for(n=0;n<o;n+=3)s+=e[r[n]>>2],s+=e[(3&r[n])<<4|r[n+1]>>4],s+=e[(15&r[n+1])<<2|r[n+2]>>6],s+=e[63&r[n+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s},t.decode=function(e){var t,r,o,s,i,a=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),f=new Uint8Array(l);for(t=0;t<u;t+=4)r=n[e.charCodeAt(t)],o=n[e.charCodeAt(t+1)],s=n[e.charCodeAt(t+2)],i=n[e.charCodeAt(t+3)],f[c++]=r<<2|o>>4,f[c++]=(15&o)<<4|s>>2,f[c++]=(3&s)<<6|63&i;return l}}()},function(e,t,n){(function(t){var n=t.BlobBuilder||t.WebKitBlobBuilder||t.MSBlobBuilder||t.MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),o=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),s=n&&n.prototype.append&&n.prototype.getBlob;function i(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.buffer instanceof ArrayBuffer){var r=n.buffer;if(n.byteLength!==r.byteLength){var o=new Uint8Array(n.byteLength);o.set(new Uint8Array(r,n.byteOffset,n.byteLength)),r=o.buffer}e[t]=r}}}function a(e,t){t=t||{};var r=new n;i(e);for(var o=0;o<e.length;o++)r.append(e[o]);return t.type?r.getBlob(t.type):r.getBlob()}function u(e,t){return i(e),new Blob(e,t||{})}e.exports=r?o?t.Blob:u:s?a:void 0}).call(t,n(0))},function(e,t,n){(function(t){var r=n(15),o=n(6);e.exports=c;var s,i=/\n/g,a=/\\n/g;function u(){}function c(e){r.call(this,e),this.query=this.query||{},s||(t.___eio||(t.___eio=[]),s=t.___eio),this.index=s.length;var n=this;s.push((function(e){n.onData(e)})),this.query.j=this.index,t.document&&t.addEventListener&&t.addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=u)}),!1)}o(c,r),c.prototype.supportsBinary=!1,c.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),r.prototype.doClose.call(this)},c.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},c.prototype.doWrite=function(e,t){var n=this;if(!this.form){var r,o=document.createElement("form"),s=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=u,o.method="POST",o.setAttribute("accept-charset","utf-8"),s.name="d",o.appendChild(s),document.body.appendChild(o),this.form=o,this.area=s}function c(){l(),t()}function l(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+n.iframeId+'">';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=n.iframeId,r.src="javascript:0"}r.id=n.iframeId,n.form.appendChild(r),n.iframe=r}this.form.action=this.uri(),l(),e=e.replace(a,"\\\n"),this.area.value=e.replace(i,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&c()}:this.iframe.onload=c}}).call(t,n(0))},function(e,t,n){(function(t){var r,o=n(9),s=n(3),i=n(5),a=n(6),u=n(16),c=n(1)("engine.io-client:websocket"),l=t.WebSocket||t.MozWebSocket;if("undefined"==typeof window)try{r=n(49)}catch(e){}var f=l;function p(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=l&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(f=r),o.call(this,e)}f||"undefined"!=typeof window||(f=r),e.exports=p,a(p,o),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new f(e,t):new f(e):new f(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},p.prototype.write=function(e){var n=this;this.writable=!1;for(var r=e.length,o=0,i=r;o<i;o++)!function(e){s.encodePacket(e,n.supportsBinary,(function(o){if(!n.usingBrowserWebSocket){var s={};e.options&&(s.compress=e.options.compress),n.perMessageDeflate&&("string"==typeof o?t.Buffer.byteLength(o):o.length)<n.perMessageDeflate.threshold&&(s.compress=!1)}try{n.usingBrowserWebSocket?n.ws.send(o):n.ws.send(o,s)}catch(e){c("websocket closed before onclose event")}--r||(n.emit("flush"),setTimeout((function(){n.writable=!0,n.emit("drain")}),0))}))}(e[o])},p.prototype.onClose=function(){o.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=u()),this.supportsBinary||(e.b64=1),(e=i.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}}).call(t,n(0))},function(e,t){},function(e,t){e.exports=function(e,t){for(var n=[],r=(t=t||0)||0;r<e.length;r++)n[r-t]=e[r];return n}},function(e,t){function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o,s,i,a,u,c,l,f,p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),d=n(21),y=(f=d)&&f.__esModule?f:{default:f};function v(e,t,n,r,o){var s={};return Object.keys(r).forEach((function(e){s[e]=r[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s}var m="CONNECT",g="ERROR",b="COMMAND",k="USER_STATUS",w=(r=E(),o=E(),s=E(),i=E(),a=E(!0),l=c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.options=e,n.waitConnection=[],n.connect(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),h(t,[{key:"connectSubscriber",get:function(){return null}},{key:"commandSubscriber",get:function(){return null}},{key:"usersSubscriber",get:function(){return null}},{key:"commandSender",get:function(){return null}}]),h(t,[{key:"connect",value:function(){var e=this;this.isConnected()||(this.connection=this.connectSubscriber(this.getScopeOptions(),{onError:function(t){return e.onError(t)},onReady:function(){return e.onConnect()},onStop:function(){return e.onDisconnect()}}))}},{key:"disconnect",value:function(){this.isConnected()&&this.connection.stop()}},{key:"isConnected",value:function(){return!!this.connection&&this.connection.isReady()}},{key:"getSubscriptionOptions",value:function(){return this.getScopeOptions()}},{key:"getScopeOptions",value:function(){return this.options}},{key:"onConnect",value:function(){this.waitConnection.forEach((function(e){return e()})),this.waitConnection=[],this.runSimpleListeners(m)}},{key:"onError",value:function(e){this.runSimpleListeners(g,e)}},{key:"onDisconnect",value:function(){this.connection=null}},{key:"removeAllListeners",value:function(){return this.waitConnection=[],function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,r)}if("value"in o)return o.value;var i=o.get;return void 0!==i?i.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeAllListeners",this).call(this),this}},{key:"addConnectListener",value:function(e,t){return this.addSimpleListener(m,e),t&&this.addSimpleListener(g,t),this}},{key:"removeConnectListeners",value:function(e,t){return this.removeSimpleListener(m,e),t&&this.removeSimpleListener(g,t),this}},{key:"addCommandListener",value:function(e,t){return this.addSubscription(b,this.commandSubscriber,{callback:e,onError:t}),this}},{key:"removeCommandListeners",value:function(e){return this.stopSubscription(b,{callback:e}),this}},{key:"addUserStatusListener",value:function(e,t){return this.addSubscription(k,this.usersSubscriber,{callback:e,onError:t}),this}},{key:"removeUserStatusListeners",value:function(e){return this.stopSubscription(k,{callback:e}),this}},{key:"send",value:function(e,t){return this.commandSender(p({},this.getScopeOptions(),{type:e,data:t}))}}]),t}(y.default),c.connectionRequired=E,v((u=l).prototype,"addCommandListener",[r],Object.getOwnPropertyDescriptor(u.prototype,"addCommandListener"),u.prototype),v(u.prototype,"removeCommandListeners",[o],Object.getOwnPropertyDescriptor(u.prototype,"removeCommandListeners"),u.prototype),v(u.prototype,"addUserStatusListener",[s],Object.getOwnPropertyDescriptor(u.prototype,"addUserStatusListener"),u.prototype),v(u.prototype,"removeUserStatusListeners",[i],Object.getOwnPropertyDescriptor(u.prototype,"removeUserStatusListeners"),u.prototype),v(u.prototype,"send",[a],Object.getOwnPropertyDescriptor(u.prototype,"send"),u.prototype),u);function E(e){return function(t,n,r){var o=r.value;return r.value=function(){var t=this,n=arguments,r=function(){return o.apply(t,n)};return this.isConnected()?r():e?new Promise((function(e,n){return t.waitConnection.push((function(){return r().then(e,n)}))})):(this.waitConnection.push(r),this)},r}}t.default=w}])},e.exports=i()},function(e,t,n){var r=n(28),o=n(35),s=n(19),i=n(30);e.exports=function(e){return r(e)||o(e)||s(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(23)),s=n(14),i=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,a=new RegExp("^"+i.source+"(\\s"+i.source+"){1,}"),u=function(e){var t=0,n=function(n){var r=e.substring(t).match(n);return r?(t+=r[0].length,r[0]):null},r=function(){return n(/^\s*/)},i=function(){for(var e,t,s=[];t=n(a)||n(/^(,)/);)","===t?(s.push(e),e=[]):t.split(/\s/g).some(isNaN)||(e||(e=[]),e=[].concat((0,o.default)(e),(0,o.default)(t.split(/\s/g).map(parseFloat)))),r();return e?(s.push(e),s.length?s:null):null};return function(){if(!n(/^(point(\sz)?)/i))return null;if(r(),!n(/^(\()/))return null;r();var e=i();return e&&n(/^(\))/)?{type:s.GeoTypes.POINT,coordinates:e[0]}:null}()||function(){if(!n(/^(linestring(\sz)?)/i))return null;if(r(),!n(/^(\()/))return null;var e=i();return e&&n(/^(\))/)?{type:s.GeoTypes.LINE_STRING,coordinates:e}:null}()||function(){if(!n(/^(polygon(\sz)?)/i))return null;r();var e=function(){r();for(var e,t=0,o=[],s=[o],i=o;e=n(/^(\()/)||n(/^(\))/)||n(/^(,)/)||n(a);){if("("===e)s.push(i),i=[],s[s.length-1].push(i),t++;else if(")"===e){if(0===i.length)return null;if(!(i=s.pop()))return null;if(0===--t)break}else if(","===e)i=[],s[s.length-1].push(i);else{if(e.split(/\s/g).some(isNaN))return null;Array.prototype.push.apply(i,e.split(/\s/g).map(parseFloat))}r()}return 0!==t?null:o}();return e?{type:s.GeoTypes.POLYGON,coordinates:e}:null}()};t.default=u},function(e,t,n){var r=n(29);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0),o=n(9);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r(n(1)),i=r(n(2)),a=r(n(12)),u=r(n(7)),c=r(n(8)),l=r(n(5)),f=r(n(10)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(11));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var y=function(e){(0,u.default)(n,e);var t=d(n);function n(){var e;return(0,s.default)(this,n),(e=t.call(this)).groupPageSize=p.PAGING_DEFAULTS.pageSize,e.recordsPageSize=p.PAGING_DEFAULTS.pageSize,e.groupDepth=null,e.groupPath=null,e}return(0,i.default)(n,[{key:"setGroupPageSize",value:function(e){if(e<=0)throw new Error("Group page size must be a positive value.");return this.groupPageSize=e,this}},{key:"getGroupPageSize",value:function(){return this.groupPageSize}},{key:"setRecordsPageSize",value:function(e){if(e<=0)throw new Error("Records page size must be a positive value.");return this.recordsPageSize=e,this}},{key:"getRecordsPageSize",value:function(){return this.recordsPageSize}},{key:"setGroupDepth",value:function(e){if(e<0)throw new Error("Group depth cannot have a negative value.");return this.groupDepth=e,this}},{key:"getGroupDepth",value:function(){return this.groupDepth}},{key:"getGroupPath",value:function(){return this.groupPath}},{key:"addGroupPath",value:function(e){return this.groupPath=(this.groupPath||[]).concat(e),this}},{key:"setGroupPath",value:function(e){return this.groupPath=f.default.castArray(e),this}},{key:"toJSON",value:function(){var e=(0,a.default)((0,l.default)(n.prototype),"toJSON",this).call(this);return e.groupDepth=this.getGroupDepth(),e.groupPath=this.getGroupPath(),e.groupPageSize=this.getGroupPageSize(),e.recordsPageSize=this.getRecordsPageSize(),e}}]),n}(p.default);t.default=y},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(7)),a=r(n(8)),u=r(n(5)),c=r(n(6));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var f=function(e){(0,i.default)(n,e);var t=l(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"getRequestURL",value:function(e,t){if(!t.___class||!t.objectId)throw new Error('"dataObject.___class" and "dataObject.objectId" need to be specified');return this.app.urls.dataObjectPermission(t.___class,e,t.objectId)}}]),n}(r(n(40)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Data.Permissions.{FIND|REMOVE|UPDATE}")},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(76)),i=r(n(9)),a=r(n(4)),u=r(n(1)),c=r(n(2)),l=r(n(77)),f=n(78),p=function(){function e(t){(0,u.default)(this,e),this.app=t,this.Bodyparts=f.Bodyparts,this.PublishOptions=f.PublishOptions,this.DeliveryOptions=f.DeliveryOptions,this.PublishOptionsHeaders=f.PublishOptionsHeaders,this.EmailEnvelope=f.EmailEnvelope}var t,n,r,p,d,y,v,m,g,b;return(0,c.default)(e,[{key:"subscribe",value:function(e){return h(e),new l.default({name:e},this.app)}},{key:"publish",value:(b=(0,a.default)(o.default.mark((function e(t,n,r,a){var u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h(t),u={message:n},!r){e.next=6;break}if(!Array.isArray(r)&&"object"===(0,i.default)(r)){e.next=5;break}throw new Error('"publishOptions" argument must be an object.');case 5:(0,s.default)(u,r);case 6:if(!a){e.next=10;break}if(!Array.isArray(a)&&"object"===(0,i.default)(a)){e.next=9;break}throw new Error('"deliveryOptions" argument must be an object.');case 9:(0,s.default)(u,a);case 10:return e.abrupt("return",this.app.request.post({url:this.app.urls.messagingChannel(t),data:u}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return b.apply(this,arguments)})},{key:"pushWithTemplate",value:(g=(0,a.default)(o.default.mark((function e(t,n){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Push Template Name must be provided and must be a string.");case 2:return r={},n&&(r.templateValues=n),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingPushWithTemplate(t),data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"sendEmail",value:(m=(0,a.default)(o.default.mark((function e(t,n,r,s){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Subject must be provided and must be a string.");case 2:if(n&&!Array.isArray(n)&&"object"===(0,i.default)(n)){e.next=4;break}throw new Error("BodyParts must be an object");case 4:if(n.textmessage||n.htmlmessage){e.next=6;break}throw new Error("BodyParts must contain at least one property of [ textmessage | htmlmessage ]");case 6:if(Array.isArray(r)&&r.length){e.next=8;break}throw new Error("Recipients must be a non empty array.");case 8:return a={subject:t,bodyparts:n,to:r},Array.isArray(s)&&s.length&&(a.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingEmail(),data:a}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return m.apply(this,arguments)})},{key:"sendEmailFromTemplate",value:(v=(0,a.default)(o.default.mark((function e(t,n,r,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Template Name must be provided and must be a string.");case 2:if(n instanceof f.EmailEnvelope){e.next=4;break}throw new Error("EmailEnvelope is required and should be instance of Backendless.Messaging.EmailEnvelope");case 4:return(i=n.toJSON())["template-name"]=t,r&&!Array.isArray(r)&&(i["template-values"]=r),Array.isArray(r)&&!s&&(s=r),s&&(i.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.emailTemplateSend(),data:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return v.apply(this,arguments)})},{key:"cancel",value:(y=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"registerDevice",value:(d=(0,a.default)(o.default.mark((function e(t,n,r){var s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this.app.device,i={deviceToken:t,deviceId:s.uuid,os:s.platform,osVersion:s.version},Array.isArray(n)&&(i.channels=n),"number"==typeof r?i.expiration=r:r instanceof Date&&(i.expiration=r.getTime()/1e3),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingRegistrations(),data:i}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return d.apply(this,arguments)})},{key:"getRegistrations",value:(p=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.get({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"unregisterDevice",value:(r=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getMessageStatus",value:(n=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getPushTemplates",value:(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Device Type must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingPushTemplates(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function h(e){if(!e||"string"!=typeof e)throw new Error("Channel Name must be provided and must be a string.");if(e.indexOf("/")>=0)throw new Error("Channel Name can not contain slash chars")}t.default=p},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i=r(n(1)),a=r(n(2)),u=r(n(12)),c=r(n(7)),l=r(n(8)),f=r(n(5)),p=r(n(41)),h=n(16);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}var y="MESSAGE",v=(o=h.RTScopeConnector.connectionRequired(),s=function(e){(0,c.default)(n,e);var t=d(n);function n(e,r){var o;return(0,i.default)(this,n),(o=t.call(this,e)).app=r,o.connect(),o}return(0,a.default)(n,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToPubSub}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendPubSubCommand}},{key:"getScopeOptions",value:function(){return{channel:this.options.name}}},{key:"connect",value:function(){if(this.app)return(0,u.default)((0,f.default)(n.prototype),"connect",this).call(this)}},{key:"publish",value:function(e,t,n){return this.app.Messaging.publish(this.options.name,e,t,n)}},{key:"addMessageListener",value:function(e,t,n){"function"==typeof e&&(n=t,t=e,e=void 0),this.addSubscription(y,this.app.RT.subscriptions.onPubSubMessage,{callback:t,onError:n,params:{selector:e}})}},{key:"removeMessageListener",value:function(e,t){if("function"==typeof e&&(t=e,e=void 0),e&&"string"!=typeof e)throw new Error("Selector must be a string.");if("function"!=typeof t)throw new Error("Callback must be a function.");this.stopSubscription(y,{matcher:function(n){return e?n.params.selector===e&&n.callback===t:n.callback===t}})}},{key:"removeMessageListeners",value:function(e){if("string"!=typeof e)throw new Error("Selector must be a string.");this.stopSubscription(y,{matcher:function(t){return t.params.selector===e}})}},{key:"removeAllMessageListeners",value:function(){this.stopSubscription(y,{})}},{key:"addCommandListener",value:function(e,t){return(0,u.default)((0,f.default)(n.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"addUserStatusListener",value:function(e,t){return(0,u.default)((0,f.default)(n.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,u.default)((0,f.default)(n.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,u.default)((0,f.default)(n.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeUserStatusListeners",value:function(e){return(0,u.default)((0,f.default)(n.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,u.default)((0,f.default)(n.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,u.default)((0,f.default)(n.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,u.default)((0,f.default)(n.prototype),"removeAllListeners",this).call(this),this}},{key:"send",value:function(e,t){return(0,u.default)((0,f.default)(n.prototype),"send",this).call(this,e,t)}},{key:"join",value:function(){(0,u.default)((0,f.default)(n.prototype),"connect",this).call(this)}},{key:"leave",value:function(){(0,u.default)((0,f.default)(n.prototype),"disconnect",this).call(this)}},{key:"isJoined",value:function(){return(0,u.default)((0,f.default)(n.prototype),"isConnected",this).call(this)}}]),n}(h.RTScopeConnector),(0,p.default)(s.prototype,"addMessageListener",[o],Object.getOwnPropertyDescriptor(s.prototype,"addMessageListener"),s.prototype),s);t.default=v},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PublishOptionsHeaders",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"PublishOptions",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"DeliveryOptions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Bodyparts",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EmailEnvelope",{enumerable:!0,get:function(){return u.default}});var o=r(n(79)),s=r(n(80)),i=r(n(81)),a=r(n(82)),u=r(n(83))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={MESSAGE_TAG:"message",IOS_ALERT_TAG:"ios-alert",IOS_BADGE_TAG:"ios-badge",IOS_SOUND_TAG:"ios-sound",ANDROID_TICKER_TEXT_TAG:"android-ticker-text",ANDROID_CONTENT_TITLE_TAG:"android-content-title",ANDROID_CONTENT_TEXT_TAG:"android-content-text",ANDROID_ACTION_TAG:"android-action",WP_TYPE_TAG:"wp-type",WP_TITLE_TAG:"wp-title",WP_TOAST_SUBTITLE_TAG:"wp-subtitle",WP_TOAST_PARAMETER_TAG:"wp-parameter",WP_TILE_BACKGROUND_IMAGE:"wp-backgroundImage",WP_TILE_COUNT:"wp-count",WP_TILE_BACK_TITLE:"wp-backTitle",WP_TILE_BACK_BACKGROUND_IMAGE:"wp-backImage",WP_TILE_BACK_CONTENT:"wp-backContent",WP_RAW_DATA:"wp-raw"};t.default=r},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1));t.default=function e(t){(0,o.default)(this,e),t=t||{},this.publisherId=t.publisherId||void 0,this.headers=t.headers||void 0,this.subtopic=t.subtopic||void 0}},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1));t.default=function e(t){(0,o.default)(this,e),t=t||{},this.publishPolicy=t.publishPolicy||void 0,this.pushBroadcast=t.pushBroadcast||void 0,this.pushSinglecast=t.pushSinglecast||void 0,this.publishAt=t.publishAt||void 0,this.repeatEvery=t.repeatEvery||void 0,this.repeatExpiresAt=t.repeatExpiresAt||void 0}},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1));t.default=function e(t){(0,o.default)(this,e),t=t||{},this.textmessage=t&&t.textmessage,this.htmlmessage=t&&t.htmlmessage}},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(10)),a=function(){function e(t){(0,o.default)(this,e),t=t||{},this.addresses=i.default.castArray(t.addresses),this.ccAddresses=i.default.castArray(t.ccAddresses),this.bccAddresses=i.default.castArray(t.bccAddresses),this.query=t.query||null,this.uniqueEmails=t.uniqueEmails||!1}return(0,s.default)(e,[{key:"setTo",value:function(e){return this.addresses=i.default.castArray(e),this}},{key:"addTo",value:function(e){return this.addresses=this.addresses.concat(i.default.castArray(e)),this}},{key:"getTo",value:function(){return this.addresses}},{key:"setCc",value:function(e){return this.ccAddresses=i.default.castArray(e),this}},{key:"addCc",value:function(e){return this.ccAddresses=this.ccAddresses.concat(i.default.castArray(e)),this}},{key:"getCc",value:function(){return this.ccAddresses}},{key:"setBcc",value:function(e){return this.bccAddresses=i.default.castArray(e),this}},{key:"addBcc",value:function(e){return this.bccAddresses=this.bccAddresses.concat(i.default.castArray(e)),this}},{key:"getBcc",value:function(){return this.bccAddresses}},{key:"setQuery",value:function(e){return this.query=e,this}},{key:"getQuery",value:function(){return this.query}},{key:"setUniqueEmails",value:function(e){return this.uniqueEmails=e,this}},{key:"getUniqueEmails",value:function(){return this.uniqueEmails}},{key:"toJSON",value:function(){var e={};return this.addresses.length>0&&(e.addresses=this.addresses),this.ccAddresses.length>0&&(e["cc-addresses"]=this.ccAddresses),this.bccAddresses.length>0&&(e["bcc-addresses"]=this.bccAddresses),this.query&&(e.criteria=this.query),e.uniqueEmails=this.uniqueEmails,e}}],[{key:"create",value:function(t){return new e(t)}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i=r(n(1)),a=r(n(2)),u=r(n(85)),c=r(n(86)),l=function(){function e(t){(0,i.default)(this,e),this.app=t,this.Permissions={READ:new c.default("READ",t),DELETE:new c.default("DELETE",t),WRITE:new c.default("WRITE",t)}}var t,n,r,l,f,p,h,d,y,v,m,g;return(0,a.default)(e,[{key:"saveFile",value:(g=(0,s.default)(o.default.mark((function e(t,n,r,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("File Name must be provided and must be a string.");case 4:return e.next=6,u.default.toBase64(r);case 6:return r=e.sent,i={},"boolean"==typeof s&&(i.overwrite=s),t=u.default.trimSlashesInPath(t),n=u.default.sanitizeFileName(n),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileBinaryPath(t),"/").concat(n),headers:{"Content-Type":"text/plain"},query:i,data:r}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return g.apply(this,arguments)})},{key:"upload",value:(m=(0,s.default)(o.default.mark((function e(t,n,r){var s,i,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"boolean"==typeof r&&(s.overwrite=r),n=u.default.trimSlashesInPath(n),(i=u.default.parseFilePath(n)).fileName&&(n=i.filePath,a=i.fileName),"string"!=typeof t){e.next=8;break}return a||(c=u.default.parseFilePath(t),a=c.fileName),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(n),"/").concat(a),query:s,data:{url:t}}));case 8:if(a||(a=u.default.getFileName(t)),a){e.next=11;break}throw new Error("Wrong type of the file source object. Can not get file name");case 11:return a=u.default.sanitizeFileName(a),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(n),"/").concat(a),query:s,form:{file:t}}));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return m.apply(this,arguments)})},{key:"append",value:(v=(0,s.default)(o.default.mark((function e(t,n,r){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(r=n,n=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,n=s.fileName)),n){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if(n=u.default.sanitizeFileName(n),"string"!=typeof r){e.next=9;break}return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(n),data:{url:r}}));case 9:if(!u.default.isBytesArray(r)){e.next=14;break}return e.next=12,u.default.toBase64(r);case 12:return r=e.sent,e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendBinaryPath(t),"/").concat(n),headers:{"Content-Type":"text/plain"},data:r}));case 14:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(n),form:{file:r}}));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return v.apply(this,arguments)})},{key:"appendText",value:(y=(0,s.default)(o.default.mark((function e(t,n,r){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(r=n,n=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,n=s.fileName)),n){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if("string"==typeof r){e.next=8;break}throw new Error('"textContent" must be a string');case 8:return n=u.default.sanitizeFileName(n),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(n),headers:{"Content-Type":"text/plain"},data:r}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return y.apply(this,arguments)})},{key:"listing",value:(d=(0,s.default)(o.default.mark((function e(t,n,r,s,i){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={},t&&"string"==typeof t){e.next=3;break}throw new Error('"filePath" must be provided and must be a string.');case 3:return t=u.default.trimSlashesInPath(t),n&&"string"==typeof n&&(a.pattern=n),"boolean"==typeof r&&(a.sub=r),"number"==typeof s&&s>=0&&(a.pagesize=s),"number"==typeof i&&i>=0&&(a.offset=i),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:a}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,o){return d.apply(this,arguments)})},{key:"renameFile",value:(h=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"oldPathName" must be provided and must be a string.');case 2:if(n&&"string"==typeof n){e.next=4;break}throw new Error("New File Name must be provided and must be a string.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileRename(),data:{oldPathName:u.default.ensureSlashInPath(t),newName:n}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"moveFile",value:(p=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileMove(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(n)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"copyFile",value:(f=(0,s.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileCopy(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(n)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"remove",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t.startsWith("http://")||t.startsWith("https://")||(t=this.app.urls.filePath(t)),e.abrupt("return",this.app.request.delete({url:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"exists",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"exists"}}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"removeDirectory",value:(n=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('Directory "path" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.delete({url:this.app.urls.filePath(t)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getFileCount",value:(t=(0,s.default)(o.default.mark((function e(t,n,r,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filesPath" must be provided and must be a string.');case 2:if(!n||"string"==typeof n){e.next=4;break}throw new Error("Files Pattern must be provided and must be a string.");case 4:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"count",pattern:n||"*",sub:!!r,countDirectories:!!s}}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,n,r,o){return t.apply(this,arguments)})}]),e}();t.default=l},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(3)),s=r(n(4)),i={isBytesArray:function(e){return"undefined"!=typeof Buffer&&e instanceof Buffer||("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||Array.isArray(e))},ensureSlashInPath:function(e){return e.startsWith("/")?e:"/".concat(e)},trimSlashesInPath:function(e){return e&&(e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e},parseFilePath:function(e){var t={filePath:e,fileName:null};if(e){var n=e.split("/");n[n.length-1].includes(".")&&(t.fileName=n.pop(),t.filePath=n.join("/"))}return t},sanitizeFileName:function(e){return encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")},getFileName:function(e){if(e.name)return e.name;if(e.path){var t=e.path.split("/");return t[t.length-1]}},toBase64:function(e){return(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof Blob){t.next=3;break}return e instanceof Blob||(e=new Blob([e],{type:""})),t.abrupt("return",new Promise((function(t,n){var r=new FileReader;r.onerror=function(e){return n(e)},r.onload=function(e){return t(e.target.result.split(";base64,")[1])},r.readAsDataURL(e)})));case 3:if("undefined"==typeof Buffer){t.next=5;break}return t.abrupt("return",Buffer.from(e).toString("base64"));case 5:return t.abrupt("return",e);case 6:case"end":return t.stop()}}),t)})))()}};t.default=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(7)),a=r(n(8)),u=r(n(5)),c=r(n(6));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var f=function(e){(0,i.default)(n,e);var t=l(n);function n(){return(0,o.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"getRequestURL",value:function(e,t){return this.app.urls.filePermission(e,t)}}]),n}(r(n(40)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Files.Permissions.{READ|DELETE|WRITE}")},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(88)),a=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"connect",value:function(e){return new i.default({name:e},this.app)}}]),e}();t.default=a},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f,p,h,d=r(n(23)),y=r(n(1)),v=r(n(2)),m=r(n(32)),g=r(n(12)),b=r(n(7)),k=r(n(8)),w=r(n(5)),E=r(n(6)),O=r(n(41)),S=n(16);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){(0,E.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,w.default)(e);if(t){var o=(0,w.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,k.default)(this,n)}}var x="CHANGES",C="CLEARED",P="INVOKE",A=(o=S.RTScopeConnector.connectionRequired(),s=S.RTScopeConnector.connectionRequired(),i=S.RTScopeConnector.connectionRequired(),a=S.RTScopeConnector.connectionRequired(),u=S.RTScopeConnector.connectionRequired(!0),c=S.RTScopeConnector.connectionRequired(!0),l=S.RTScopeConnector.connectionRequired(!0),f=S.RTScopeConnector.connectionRequired(!0),p=S.RTScopeConnector.connectionRequired(!0),h=function(e){(0,b.default)(n,e);var t=T(n);function n(e,r){var o;return(0,y.default)(this,n),o=t.call(this,e),(0,E.default)((0,m.default)(o),"onInvoke",(function(e){var t,n=e.method,r=e.args;N(o.invocationTarget,n),(t=o.invocationTarget)[n].apply(t,(0,d.default)(r))})),o.app=r,o.invocationTarget=null,o.connect(),o}return(0,v.default)(n,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToRSO}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onRSOUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onRSOCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendRSOCommand}},{key:"setInvocationTarget",value:function(e){this.invocationTarget=e}},{key:"connect",value:function(){if(this.app)return(0,g.default)((0,w.default)(n.prototype),"connect",this).call(this)}},{key:"onConnect",value:function(){(0,g.default)((0,w.default)(n.prototype),"onConnect",this).apply(this,arguments),this.addSubscription(P,this.app.RT.subscriptions.onRSOInvoke,{callback:this.onInvoke})}},{key:"onDisconnect",value:function(){this.stopSubscription(P,{callback:this.onInvoke}),(0,g.default)((0,w.default)(n.prototype),"onDisconnect",this).apply(this,arguments)}},{key:"addChangesListener",value:function(e,t){this.addSubscription(x,this.app.RT.subscriptions.onRSOChanges,{callback:e,onError:t})}},{key:"removeChangesListeners",value:function(e){this.stopSubscription(x,{callback:e})}},{key:"addClearListener",value:function(e,t){this.addSubscription(C,this.app.RT.subscriptions.onRSOClear,{callback:e,onError:t})}},{key:"removeClearListeners",value:function(e){this.stopSubscription(C,{callback:e})}},{key:"addCommandListener",value:function(e,t){return(0,g.default)((0,w.default)(n.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,g.default)((0,w.default)(n.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,g.default)((0,w.default)(n.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"addUserStatusListener",value:function(e,t){return(0,g.default)((0,w.default)(n.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeUserStatusListeners",value:function(e){return(0,g.default)((0,w.default)(n.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,g.default)((0,w.default)(n.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,g.default)((0,w.default)(n.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,g.default)((0,w.default)(n.prototype),"removeAllListeners",this).call(this),this}},{key:"get",value:function(e){return this.app.RT.methods.getRSO(_(_({},this.getScopeOptions()),{},{key:e}))}},{key:"set",value:function(e,t){return this.app.RT.methods.setRSO(_(_({},this.getScopeOptions()),{},{key:e,data:t}))}},{key:"clear",value:function(){return this.app.RT.methods.clearRSO(this.getScopeOptions())}},{key:"invoke",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.invokeOn.apply(this,[e,void 0].concat(n))}},{key:"invokeOn",value:function(e,t){for(var n=this,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return Promise.resolve().then((function(){return N(n.invocationTarget,e)})).then((function(){return n.app.RT.methods.invokeRSOMethod(_(_({},n.getScopeOptions()),{},{method:e,targets:t,args:o}))}))}}]),n}(S.RTScopeConnector),(0,O.default)(h.prototype,"addChangesListener",[o],Object.getOwnPropertyDescriptor(h.prototype,"addChangesListener"),h.prototype),(0,O.default)(h.prototype,"removeChangesListeners",[s],Object.getOwnPropertyDescriptor(h.prototype,"removeChangesListeners"),h.prototype),(0,O.default)(h.prototype,"addClearListener",[i],Object.getOwnPropertyDescriptor(h.prototype,"addClearListener"),h.prototype),(0,O.default)(h.prototype,"removeClearListeners",[a],Object.getOwnPropertyDescriptor(h.prototype,"removeClearListeners"),h.prototype),(0,O.default)(h.prototype,"get",[u],Object.getOwnPropertyDescriptor(h.prototype,"get"),h.prototype),(0,O.default)(h.prototype,"set",[c],Object.getOwnPropertyDescriptor(h.prototype,"set"),h.prototype),(0,O.default)(h.prototype,"clear",[l],Object.getOwnPropertyDescriptor(h.prototype,"clear"),h.prototype),(0,O.default)(h.prototype,"invoke",[f],Object.getOwnPropertyDescriptor(h.prototype,"invoke"),h.prototype),(0,O.default)(h.prototype,"invokeOn",[p],Object.getOwnPropertyDescriptor(h.prototype,"invokeOn"),h.prototype),h);function N(e,t){if(!e)throw new Error('"invocationTarget" is not specified');if("function"!=typeof e[t])throw new Error('Method "'.concat(t,'" of invocationTarget is not function'))}t.default=A},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=r(n(10)),a=r(n(90)),u=r(n(91)),c=function(){function e(t){(0,o.default)(this,e),this.app=t,this.storageName=this.app.appId?"".concat("Backendless","_").concat(this.app.appId):"Backendless";var n=i.default.isLocalStorageSupported?u.default:a.default;this.setStorage(n),this.Keys={USER_TOKEN:"user-token",CURRENT_USER_ID:"current-user-id",STAY_LOGGED_IN:"stayLoggedIn"}}return(0,s.default)(e,[{key:"setStorage",value:function(e){this.storage=new e(this.storageName,"Backendless")}},{key:"set",value:function(e,t){this.storage.set(e,t)}},{key:"get",value:function(e){return this.storage.get(e)}},{key:"remove",value:function(e){this.storage.remove(e)}}]),e}();t.default=c},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2)),i=function(){function e(){(0,o.default)(this,e),this.data={}}return(0,s.default)(e,[{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t}},{key:"remove",value:function(e){delete this.data[e]}}]),e}();t.default=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1)),s=r(n(2));var i=function(){function e(t,n){(0,o.default)(this,e),this.storageName=t,function(e,t){if(!localStorage.getItem(e.storageName)){var n=localStorage.getItem(t);n&&(localStorage.setItem(e.storageName,n),localStorage.removeItem(t))}}(this,n)}return(0,s.default)(e,[{key:"getStore",value:function(){try{return JSON.parse(localStorage.getItem(this.storageName))||{}}catch(e){console.warn("Could not parse data from LocalStorage",e)}return{}}},{key:"setStore",value:function(e){localStorage.setItem(this.storageName,JSON.stringify(e))}},{key:"get",value:function(e){return this.getStore()[e]}},{key:"set",value:function(e,t){var n=this.getStore();n[e]=t,this.setStore(n)}},{key:"remove",value:function(e){var t=this.getStore();delete t[e],this.setStore(t)}}]),e}();t.default=i},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t){(0,f.default)(r,t);var n=S(r);function r(t){return(0,c.default)(this,r),n.call(this,t,e)}return(0,l.default)(r,null,[{key:"initFromJSON",value:function(e){var t=new this(e.transactionIsolation);return e.operations.forEach((function(e){g.OperationJSONAdapter[e.operationType](t,e).setOpResultId(e.opResultId)})),t}}]),r}(T)};var o=r(n(3)),s=r(n(9)),i=r(n(4)),a=r(n(31)),u=r(n(6)),c=r(n(1)),l=r(n(2)),f=r(n(7)),p=r(n(8)),h=r(n(5)),d=r(n(93)),y=r(n(10)),v=r(n(11)),m=n(25),g=n(97),b=n(42),k=n(43),w=["meta"];function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){(0,u.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,h.default)(e);if(t){var o=(0,h.default)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,p.default)(this,n)}}var R=function(e){(0,f.default)(n,e);var t=S(n);function n(e,r){var o;return(0,c.default)(this,n),(o=t.call(this,e)).operation=r,o}return(0,l.default)(n,[{key:"toJSON",value:function(){return{message:this.message,operation:this.operation}}}]),n}((0,d.default)(Error)),_=function(){function e(t){var n=t.success,r=t.error,o=t.results;(0,c.default)(this,e),this.success=n,this.error=r,this.results=o}return(0,l.default)(e,[{key:"isSuccess",value:function(){return this.success}},{key:"getError",value:function(){return this.error}},{key:"getResults",value:function(){return this.results}}]),e}(),T=function(){function e(t,n){(0,c.default)(this,e),this.app=n,this.payload={isolationLevelEnum:t,operations:[]},this.usedOpIds={}}var t;return(0,l.default)(e,[{key:"getOpResultById",value:function(e){return this.payload.operations.find((function(t){return t.meta.opResult.getOpResultId()===e})).meta.opResult}},{key:"setIsolationLevel",value:function(e){this.payload.isolationLevelEnum=e}},{key:"getOpStackName",value:function(e,t){return"".concat(e.toLowerCase()).concat(t)}},{key:"getNextOpResultIndex",value:function(e){return this.usedOpIds[e]||(this.usedOpIds[e]=0),++this.usedOpIds[e]}},{key:"addOperations",value:function(e,t,n){Array.isArray(n)?n=n.map((function(e){return delete e.___jsonclass,e})):delete n.___jsonclass;var r=new b.OpResult(this,{operationType:e,table:t,payload:n});return this.payload.operations.push({operationType:e,table:t,payload:n,meta:{opResult:r}}),r}},{key:"composePayload",value:function(){return O(O({},this.payload),{},{operations:this.payload.operations.map((function(e){var t=e.meta;return O(O({},(0,a.default)(e,w)),{},{opResultId:t.opResult.getOpResultId()})}))})}},{key:"execute",value:(t=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.app.request.post({url:this.app.urls.transactions(),data:this.composePayload()});case 2:return t=e.sent,e.abrupt("return",this.setResult(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setResult",value:function(e){if(e.results&&this.payload.operations.forEach((function(t){var n=t.meta.opResult.getOpResultId();e.results[n]&&t.meta.opResult.setResult(e.results[n].result)})),e.error){var t=this.payload.operations.find((function(t){return e.error.operation.opResultId===t.meta.opResult.getOpResultId()}));e.error=new R(e.error.message,t.meta.opResult),t.meta.opResult.setError(e.error)}return new _(e)}},{key:"find",value:function(e,t){var n=t instanceof v.default?t.toJSON():t||{};if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if("object"!==(0,s.default)(n)||Array.isArray(n))throw new Error("Invalid arguments");var r={queryOptions:{}};return n.pageSize>0&&(r.pageSize=n.pageSize),n.offset>0&&(r.offset=n.offset),n.properties&&(r.properties=n.properties),n.excludeProps&&(r.excludeProps=n.excludeProps),n.excludeProps&&(r.excludeProps=n.excludeProps),n.where&&(r.whereClause=n.where),n.having&&(r.havingClause=n.having),n.groupBy&&(r.groupBy=n.groupBy),n.sortBy&&(r.queryOptions.sortBy=n.sortBy),n.relations&&(r.queryOptions.related=n.relations),n.relationsDepth&&(r.queryOptions.relationsDepth=n.relationsDepth),n.relationsPageSize>0&&(r.queryOptions.relationsPageSize=n.relationsPageSize),this.addOperations(m.OperationType.FIND,e,r)}},{key:"upsert",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPSERT,e,t)}},{key:"create",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.CREATE,e,t)}},{key:"update",value:function(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];if(1===r.length)e=y.default.getClassName(r[0]),t=r[0];else if(2===r.length&&"string"==typeof r[0])e=r[0],t=r[1];else{if(!(r[0]instanceof b.OpResult||r[0]instanceof k.OpResultValueReference))throw new Error("Invalid arguments");if(e=r[0].getTableName(),t={objectId:r[0]},3===r.length&&"string"==typeof r[1])t[r[1]]=r[2];else{if(2!==r.length)throw new Error("Invalid arguments");t=O(O({},t),r[1])}}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPDATE,e,t)}},{key:"delete",value:function(){for(var e,t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];if(1===r.length)r[0]instanceof b.OpResult||r[0]instanceof k.OpResultValueReference?(e=r[0].getTableName(),t=r[0]):r[0]&&"object"===(0,s.default)(r[0])&&!Array.isArray(r[0])&&(e=y.default.getClassName(r[0]),t=r[0].objectId);else{if(2!==r.length)throw new Error("Invalid arguments");e=r[0],t=r[1]&&r[1].objectId||r[1]}if(!t||Array.isArray(t)||"string"!=typeof t&&"object"!==(0,s.default)(t))throw new Error("Invalid arguments");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE,e,t)}},{key:"bulkUpsert",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPSERT_BULK,e,t)}},{key:"bulkCreate",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.CREATE_BULK,e,t)}},{key:"bulkUpdate",value:function(){for(var e,t={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];if(2===r.length)t.changes=r[1],"string"==typeof r[0]?(e=y.default.getClassName(r[1]),t.conditional=r[0]):r[0]instanceof b.OpResult&&(e=r[0].getTableName(),t.unconditional=r[0]);else{if(3!==r.length)throw new Error("Invalid arguments");if(e=r[0],t.changes=r[2],"string"==typeof r[1])t.conditional=r[1];else{if(!Array.isArray(r[1]))throw new Error("Invalid arguments");t.unconditional=r[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPDATE_BULK,e,t)}},{key:"bulkDelete",value:function(){for(var e,t={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];if(1===r.length)if(r[0]instanceof b.OpResult)e=r[0].getTableName(),t.unconditional=r[0];else{if(!Array.isArray(r[0]))throw new Error("Invalid arguments");e=y.default.getClassName(r[0][0]),t.unconditional=r[0].map((function(e){return e.objectId}))}else{if(2!==r.length)throw new Error("Invalid arguments");if(e=r[0],"string"==typeof r[1])t.conditional=r[1];else{if(!Array.isArray(r[1]))throw new Error("Invalid arguments");t.unconditional=r[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE_BULK,e,t)}},{key:"addToRelation",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.relationsOperation(m.OperationType.ADD_RELATION,t)}},{key:"setRelation",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.relationsOperation(m.OperationType.SET_RELATION,t)}},{key:"deleteRelation",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.relationsOperation(m.OperationType.DELETE_RELATION,t)}},{key:"relationsOperation",value:function(e,t){var n,r,o,i,a,u;if(3===t.length)if(o=t[0],r=t[1],u=t[2],o instanceof b.OpResult||o instanceof k.OpResultValueReference)n=o.getTableName();else{if(!o||"object"!==(0,s.default)(o))throw new Error("Invalid the first argument, it must be an instance of [OpResult|OpResultValueReference|Object]");n=y.default.getClassName(o)}else{if(4!==t.length)throw new Error("Invalid arguments");if(n=t[0],r=t[2],u=t[3],"string"==typeof t[1])o=t[1];else{if(!t[1]||"object"!==(0,s.default)(t[1]))throw new Error("Invalid the second argument, it must be an Object or objectId");o=t[1]}}if(o&&o.objectId&&(o=o.objectId),"string"==typeof u?i=u:u instanceof b.OpResult&&u.isCollectionRef()?a=u:(Array.isArray(u)||(u=[u]),a=u.map((function(e){if(e){if(e instanceof b.OpResult||e instanceof k.OpResultValueReference)return e;if("string"==typeof e)return e;if(e.objectId)return e.objectId}throw new Error("Invalid child argument, it must be an instance of [OpResult|OpResultValueReference|Object] or objectId")}))),!r||"string"!=typeof r)throw new Error('Invalid "relationColumn" parameter, check passed arguments');if(!a&&!i)throw new Error('Neither "unconditional" nor "conditional" parameter is specified, check passed arguments');if(!n||"string"!=typeof n)throw new Error("Table Name must be a string.");var c={parentObject:o,relationColumn:r};return i?c.conditional=i:c.unconditional=a,this.addOperations(e,n,c)}}]),e}();(0,u.default)(T,"IsolationLevelEnum",m.IsolationLevelEnum),(0,u.default)(T,"OpResult",b.OpResult),(0,u.default)(T,"OpResultValueReference",k.OpResultValueReference)},function(e,t,n){var r=n(5),o=n(20),s=n(94),i=n(95);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return i(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.default=e.exports,e.exports.__esModule=!0,a(t)}e.exports=a,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(20),o=n(96);function s(t,n,i){return o()?(e.exports=s=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=s=function(e,t,n){var o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return n&&r(s,n.prototype),s},e.exports.default=e.exports,e.exports.__esModule=!0),s.apply(null,arguments)}e.exports=s,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.OperationJSONAdapter=void 0;var o=r(n(9)),s=n(25),i=n(42);function a(e,t){if(Array.isArray(t))return t.map((function(t){return a(e,t)}));if(t&&"object"===(0,o.default)(t)){if(t.___ref){var n=e.getOpResultById(t.opResultId);return void 0!==t.resultIndex?n.resolveTo(t.resultIndex,t.propName):void 0!==t.propName?n.resolveTo(t.propName):n}var r={};for(var s in t)r[s]=a(e,t[s]);return r}return t}var u={CREATE:function(e,t){var n=t.table,r=t.payload;return e.create.call(e,n,a(e,r))},DELETE:function(e,t){var n=t.table,r=t.payload;return e.delete.call(e,n,a(e,r))},UPDATE:function(e,t){var n=t.table,r=t.payload;return e.update.call(e,n,a(e,r))},UPSERT:function(e,t){var n=t.table,r=t.payload;return e.upsert.call(e,n,a(e,r))},UPDATE_BULK:function(e,t){var n=t.table,r=t.payload,o=c(e,{table:n,payload:r});return o.push(a(e,r.changes)),e.bulkUpdate.apply(e,o)},DELETE_BULK:function(e,t){var n=c(e,{table:t.table,payload:t.payload});return e.bulkDelete.apply(e,n)},CREATE_BULK:function(e,t){var n=t.table,r=t.payload;return e.bulkCreate.call(e,n,a(e,r))},UPSERT_BULK:function(e,t){var n=t.table,r=t.payload;return e.bulkUpsert.call(e,n,a(e,r))},SET_RELATION:function(e,t){return l(e,"setRelation",{table:t.table,payload:t.payload})},DELETE_RELATION:function(e,t){return l(e,"deleteRelation",{table:t.table,payload:t.payload})},ADD_RELATION:function(e,t){return l(e,"addToRelation",{table:t.table,payload:t.payload})},FIND:function(e,t){var n=t.table,r=t.payload;return e.addOperations(s.OperationType.FIND,n,r)}};function c(e,t){var n=t.table,r=t.payload,o=[];if(r.conditional)o.push(n),o.push(r.conditional);else{var s=a(e,r.unconditional);s instanceof i.OpResult||o.push(n),o.push(s)}return o}function l(e,t,n){var r=n.table,o=n.payload,s=[r];return"string"==typeof o.parentObject?s.push({objectId:o.parentObject}):s.push(a(e,o.parentObject)),s.push(o.relationColumn),s.push(o.conditional||a(e,o.unconditional)),e[t].apply(e,s)}t.OperationJSONAdapter=u},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(n(1));t.default=function e(t){if((0,o.default)(this,e),!(t&&t.uuid&&t.platform&&t.version))throw new Error('Device properties object must consist of fields "uuid", "platform" and "version".');this.uuid=t.uuid,this.platform=t.platform.toUpperCase(),this.version=t.version}},function(e,t,n){"use strict";var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.getUserAgent=function(){var e="NodeJS";o.default.isBrowser&&(e=navigator.userAgent?navigator.userAgent.toLowerCase():"hybrid-app");var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],n={browser:t[1]||"",version:t[2]||"0"},r={};n.browser&&(r[n.browser]=!0,r.version=n.version);return r};var o=r(n(10))}])}));
15
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Backendless=t():e.Backendless=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=44)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){e.exports=r(48)},function(e,t){function r(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,s){var i=e.apply(t,n);function a(e){r(i,o,s,a,u,"next",e)}function u(e){r(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(20);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(9).default,o=r(32);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";(function(e){var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(9)),s={isBrowser:i(),isLocalStorageSupported:function(){try{if(i()&&window.localStorage)return localStorage.setItem("localStorageTest",!0),localStorage.removeItem("localStorageTest"),!0}catch(e){}return!1}(),globalScope:"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===e?"undefined":(0,o.default)(e))&&e.global===e&&e,castArray:function(e){return Array.isArray(e)?e:void 0===e?[]:[e]},isCustomClassInstance:function(e){return!(!e||"object"!==(0,o.default)(e)||Array.isArray(e))&&e.constructor!==Object},getClassName:function(e){if(e&&e.className)return e.className;if("function"==typeof e&&e.name)return e.name;if(e&&"object"===(0,o.default)(e)&&!Array.isArray(e)){if(e.___class)return e.___class;if(e.constructor!==Object)return s.getClassName(e.constructor)}return null},uuid:function(){var e=function(){return Math.random().toString(16).slice(-4).toUpperCase()};return"".concat("".concat(e()).concat(e()),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat("".concat(e()).concat(e()).concat(e()))}};function i(){return"object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&"object"===("undefined"==typeof window?"undefined":(0,o.default)(window))&&window===self}var a=s;t.default=a}).call(this,r(26))},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PAGING_DEFAULTS=void 0;var o=n(r(6)),s=n(r(1)),i=n(r(2)),a=n(r(10));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var c={pageSize:10,offset:0};t.PAGING_DEFAULTS=c;var l=function(){function e(){(0,s.default)(this,e),this.offset=c.offset,this.pageSize=c.pageSize,this.sortBy=null,this.groupBy=null,this.properties=null,this.excludeProps=null,this.whereClause=null,this.havingClause=null,this.relations=null,this.relationsDepth=null,this.relationsPageSize=null,this.distinct=!1}return(0,i.default)(e,[{key:"setPageSize",value:function(e){if(e<=0)throw new Error("Page size must be a positive value.");return this.pageSize=e,this}},{key:"getPageSize",value:function(){return this.pageSize}},{key:"setOffset",value:function(e){if(e<0)throw new Error("Offset cannot have a negative value.");return this.offset=e,this}},{key:"getOffset",value:function(){return this.offset}},{key:"prepareNextPage",value:function(){return this.setOffset(this.offset+this.pageSize),this}},{key:"preparePreviousPage",value:function(){return this.setOffset(Math.max(this.offset-this.pageSize,0)),this}},{key:"getProperties",value:function(){return this.properties}},{key:"setProperties",value:function(e){return this.properties=a.default.castArray(e),this}},{key:"addProperty",value:function(e){return this.properties=this.properties||[],this.properties.push(e),this}},{key:"addProperties",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.addProperty(t)}))})),this}},{key:"addAllProperties",value:function(){return this.addProperty("*"),this}},{key:"excludeProperty",value:function(e){return this.excludeProps=this.excludeProps||[],this.excludeProps.push(e),this}},{key:"excludeProperties",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){a.default.castArray(t).forEach((function(t){return e.excludeProperty(t)}))})),this}},{key:"getExcludeProperties",value:function(){return this.excludeProps}},{key:"getWhereClause",value:function(){return this.whereClause}},{key:"setWhereClause",value:function(e){return this.whereClause=e,this}},{key:"getHavingClause",value:function(){return this.havingClause}},{key:"setHavingClause",value:function(e){return this.havingClause=e,this}},{key:"getSortBy",value:function(){return this.sortBy}},{key:"setSortBy",value:function(e){return this.sortBy=a.default.castArray(e),this}},{key:"getGroupBy",value:function(){return this.groupBy}},{key:"setGroupBy",value:function(e){return this.groupBy=a.default.castArray(e),this}},{key:"getRelated",value:function(){return this.relations}},{key:"setRelated",value:function(e){return this.relations=a.default.castArray(e),this}},{key:"addRelated",value:function(e){return this.relations=(this.relations||[]).concat(e),this}},{key:"setRelationsDepth",value:function(e){return this.relationsDepth=e,this}},{key:"getRelationsDepth",value:function(){return this.relationsDepth}},{key:"setRelationsPageSize",value:function(e){return this.relationsPageSize=e,this}},{key:"getRelationsPageSize",value:function(){return this.relationsPageSize}},{key:"setDistinct",value:function(e){return this.distinct=!!e,this}},{key:"getDistinct",value:function(){return this.distinct}},{key:"setFileReferencePrefix",value:function(e){return this.fileReferencePrefix=e,this}},{key:"getFileReferencePrefix",value:function(){return this.fileReferencePrefix}},{key:"toJSON",value:function(){return{pageSize:this.pageSize,offset:this.offset,properties:this.properties,excludeProps:this.excludeProps,where:this.whereClause,having:this.havingClause,sortBy:this.sortBy,groupBy:this.groupBy,relations:this.relations,relationsDepth:this.relationsDepth,relationsPageSize:this.relationsPageSize,distinct:this.distinct,fileReferencePrefix:this.fileReferencePrefix}}}],[{key:"create",value:function(){return new this}},{key:"toRequestBody",value:function(t){var r=t instanceof e?t.toJSON():t?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t):{};return Object.keys(r).forEach((function(e){Array.isArray(r[e])?"groupPath"!==e&&(r[e]=r[e].join(",")):null==r[e]&&delete r[e]})),r.properties&&(r.props=r.properties,delete r.properties),r.relations&&(r.loadRelations=r.relations,delete r.relations),r}},{key:"toQueryString",value:function(t){if(t){t instanceof e&&(t=t.toJSON());var r=[];return t.pageSize>0&&r.push("pageSize=".concat(t.pageSize)),t.offset>0&&r.push("offset=".concat(t.offset)),Array.isArray(t.properties)&&t.properties.length&&t.properties.map((function(e){r.push("property=".concat(encodeURIComponent(e)))})),Array.isArray(t.excludeProps)&&t.excludeProps.length&&r.push("excludeProps=".concat(f(t.excludeProps))),t.where&&r.push("where=".concat(encodeURIComponent(t.where))),t.having&&r.push("having=".concat(encodeURIComponent(t.having))),t.sortBy&&r.push(Array.isArray(t.sortBy)?"sortBy=".concat(f(t.sortBy)):"sortBy=".concat(encodeURIComponent(t.sortBy))),t.groupBy&&r.push(Array.isArray(t.groupBy)?"groupBy=".concat(f(t.groupBy)):"groupBy=".concat(encodeURIComponent(t.groupBy))),Array.isArray(t.relations)&&r.push(t.relations.length?"loadRelations=".concat(f(t.relations)):"loadRelations=*"),t.relationsDepth>0&&r.push("relationsDepth=".concat(t.relationsDepth)),t.relationsPageSize>0&&r.push("relationsPageSize=".concat(t.relationsPageSize)),t.distinct&&r.push("distinct=".concat(t.distinct)),t.fileReferencePrefix&&r.push("fileReferencePrefix=".concat(encodeURIComponent(t.fileReferencePrefix))),r.join("&")}}}]),e}();function f(e){return e.map((function(e){return encodeURIComponent(e)})).join(",")}t.default=l},function(e,t,r){var n=r(67);function o(t,r,s){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(r):s.value}},e.exports.default=e.exports,e.exports.__esModule=!0),o(t,r,s||t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(22)),a=n(r(37)),u=n(r(38)),c=function(){function e(t){(0,o.default)(this,e),this.srs=t||i.default.DEFAULT}return(0,s.default)(e,[{key:"getSRS",value:function(){return this.srs}},{key:"getGeojsonType",value:function(){}},{key:"getWktType",value:function(){}},{key:"wktCoordinatePairs",value:function(){}},{key:"jsonCoordinatePairs",value:function(){}},{key:"asGeoJSON",value:function(){return{type:this.getGeojsonType(),coordinates:this.jsonCoordinatePairs()}}},{key:"asWKT",value:function(){return this.getWktType()+"("+this.wktCoordinatePairs()+")"}},{key:"toJSON",value:function(){return this.asGeoJSON()}},{key:"toString",value:function(){return"'"+this.asWKT()+"'"}}],[{key:"fromWKT",value:function(e,t){return new u.default(t).read(e)}},{key:"fromGeoJSON",value:function(e,t){return new a.default(t).read(e)}}]),e}();t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GeoTypes=void 0;t.GeoTypes={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon"}},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t){var r=this;(0,o.default)(this,e),t=t||{},Object.keys(t).map((function(e){r[e]=t[e]})),this.___class=e.className}return(0,s.default)(e,null,[{key:"className",get:function(){return"Users"}}]),e}();t.default=i,i.prototype.___class=i.className},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=n(r(7)),c=n(r(8)),l=n(r(5)),f=n(r(17)),p=n(r(68)),d=n(r(10));function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var y=p.default.Listeners;t.RTListeners=y;var v=p.default.ScopeConnector;function m(e){return f.default.get("".concat(e,"/info"))}t.RTScopeConnector=v;var g=function(e){(0,u.default)(r,e);var t=h(r);function r(e){var n;(0,i.default)(this,r);var a,u=e.appId,c=e.apiKey,l=e.appPath,f=e.debugMode,p=d.default.uuid(),h="".concat(l,"/rt/lookup");return(n=t.call(this,{appId:u||void 0,lookupPath:h,debugMode:f,connectQuery:function(){var t=e.getCurrentUserToken();return{apiKey:c||void 0,clientId:p,userToken:t}},socketConfigTransform:(a=(0,s.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=7;break}return e.next=3,m(l);case 3:r=e.sent,t.url="".concat(t.host,"/").concat(r.appId),t.options.path="/".concat(r.appId),t.options.query.apiKey=r.apiKey;case 7:return e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})})).app=e,n}return(0,a.default)(r,[{key:"updateUserTokenIfNeeded",value:function(){if(this.session){var e=this.app.getCurrentUserToken();this.methods.setUserToken({userToken:e})}}},{key:"setDebugMode",value:function(e){this.setConfig({debugMode:e})}}]),r}(p.default);t.default=g},function(e,t){var r,n;r="undefined"!=typeof self?self:this,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===(void 0===e?"undefined":n(e))},t.isFormData=function(e){return e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData")},t.isStream=function(e){return e instanceof r(6).Stream}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=c(r(3)),i=c(r(4)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(5)),u=r(0);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=new s.default(6e4),h=function(e){function t(e){l(this,t);var r,n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=502===(r=e).status?"No connection with server":r.body||"Status Code "+r.status+" ("+r.statusText+")";return n.message=o.message||o,n.code=o.code,n.status=e.status,n.headers=e.headers,n.body=e.body,n}return p(t,Error),t}();function y(e){try{return o({},e,{body:JSON.parse(e.body)})}catch(t){return e}}var v=function(e,t,r,n,o,s){return new Promise((function(i,a){var u=new b.XMLHttpRequest;u.timeout=s,o||(u.responseType="arraybuffer"),u.open(t.toUpperCase(),e,!0),u.onload=function(){var e,t,r=(e=u.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),o=e.substr(r+1).trim();n&&(t[n]=t[n]?t[n]+", "+o:o)})),t):t),n=u,s={status:n.status,statusText:n.statusText,headers:r};"utf8"===o?s.body=u.response||u.responseText:u.response&&(s.body=new Uint8Array(u.response)),i(s),u=null},u.onerror=function(){a(new Error("Network Error")),u=null},u.ontimeout=function(){a(new Error("Connection aborted due to timeout")),u=null},Object.keys(r).forEach((function(e){u.setRequestHeader(e,r[e])})),u.send(n)}))},m=function(e,t,n,s,i,a){return new Promise((function(c,l){var f=r(7).parse(e),p=(0,u.isFormData)(s)&&s,d="https:"===f.protocol,h={host:f.hostname,port:f.port||(d?443:80),path:f.path,method:t,headers:n,timeout:a},y=function(){var e=r(1).Buffer,t=r(d?8:9).request(h,(function(t){var r=[],n=[],o=0,s="",a=t.statusCode,u=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,n.push(t)):r.push(t)})),t.on("end",(function(){o?(s=e.concat(n,o),null!=i&&(s=s.toString(i))):r.length&&(s=r.join()),c({status:a,statusText:u,headers:f,body:s})})),t.on("error",l)}));if(t.on("error",l),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,u.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(p)o(h.headers,p.getHeaders()),p.getLength((function(e,t){e||isNaN(t)||(h.headers["content-length"]=t),y()}));else{if(s&&!h.headers["content-length"]){var v=r(1).Buffer;h.headers["content-length"]=v.byteLength(s)}y()}}))};function g(e){if(e.status>=200&&e.status<300)return e;throw new h(e)}var b=function(t){function r(e,t,n){l(this,r);var o=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return o.method=t,o.path=e,o.body=n,o.tags=void 0,o.unwrap=!0,o.cacheTTL=0,o.headers={},o.queryParams={},o.encoding="utf8",o.timeout=0,o}return p(r,t),n(r,[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var r in e)this.set(r,e[r]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.tags=t,this}},{key:"query",value:function(e){return o(this.queryParams,e),this}},{key:"form",value:function(t){var r=this;if(t){var n=e.exports.FormData;t instanceof n?this.body=t:function(){var e=new n,o=function(r){r&&(0,u.castArray)(t[r]).forEach((function(t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?e.append(r,t.value,t.options):e.append(r,t)}))};for(var s in t)o(s);r.body=e}()}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&d.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var n=this.path,o=a.stringify(this.queryParams);if(o&&(n+="?"+o),this.cacheTTL){var s=d.get(n);if(void 0!==s)return Promise.resolve(s)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),r.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(n),e,this.headers);var i=r.send(n,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout).then(y).then(g).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&d.set(n,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&d.deleteByTags(t.tags),e}));return i.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),i}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}]),r}(i.default);Object.defineProperty(b,"FormData",{get:function(){return"undefined"!=typeof FormData?FormData:r(10)}}),b.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,b.send=function(e,t,r,n,o,s){return(void 0!==b.XMLHttpRequest?v:m)(e,t,r,n,o,s)},b.verbose=!1,b.methods=["get","post","put","patch","delete"],b.methods.forEach((function(e){b[e]=function(t,r){return new b(t,e,r)}})),e.exports=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,s=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw s}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){return{value:e,tags:t,ttl:r}},i=function(){return(new Date).getTime()},a=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var r=e==t;return!r&&e instanceof RegExp&&(r=e.test(t)),!r&&t instanceof RegExp&&(r=t.test(e)),r}(e,t)}))}))},u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.flushInterval=t,this.map=new Map}return o(e,[{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>i())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e4;this.map.set(e,s(t,r,i()+n)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteByTags",value:function(e){var t=!0,r=!1,o=void 0;try{for(var s,i=this.map[Symbol.iterator]();!(t=(s=i.next()).done);t=!0){var u=n(s.value,2),c=u[0],l=u[1];l.tags&&a(e,l.tags)&&this.delete(c)}}catch(e){r=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(r)throw o}}}},{key:"flush",value:function(){var e=i(),t=!0,r=!1,o=void 0;try{for(var s,a=this.map[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var u=n(s.value,2),c=u[0];u[1].ttl<e&&this.delete(c)}}catch(e){r=!0,o=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw o}}}}]),e}();t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}return n(e,[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,r)}))}}]),e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var n=r(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(r){var o=e[r];void 0!==o&&(0,n.castArray)(o).forEach((function(e){t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}))})),t.join("&")}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')}])},"object"==typeof t&&"object"==typeof e?e.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof t?t.BackendlessRequest=n():r.BackendlessRequest=n()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isExecutionType=t.ExecutionTypes=t.EXECUTION_TYPE_HEADER=void 0;t.EXECUTION_TYPE_HEADER="bl-execution-type";var n={SYNC:"sync",ASYNC:"async",ASYNC_LOW_PRIORITY:"async-low-priority"};t.ExecutionTypes=n;var o=Object.keys(n).map((function(e){return n[e]}));t.isExecutionType=function(e){return o.includes(e)}},function(e,t,r){var n=r(29);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,n)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=y[e.type];if(t=t||p.default.valueBySRSId(e.srsId),r)return r(e.coordinates,t);throw new Error("There is no constructor for ".concat(e.type))},t.GEO_CLASSES=void 0;var o,s=n(r(6)),i=n(r(70)),a=n(r(27)),u=n(r(36)),c=n(r(24)),l=n(r(39)),f=r(14),p=n(r(22));t.GEO_CLASSES=["com.backendless.persistence.Polygon","com.backendless.persistence.LineString","com.backendless.persistence.Point","com.backendless.persistence.Geometry"];var d=function(e,t){var r=(0,a.default)(e,2),n=r[0],o=r[1];return new u.default(t).setX(n).setY(o)},h=function(e,t){var r=e.map((function(e){return d(e,t)}));return new c.default(r,t)},y=(o={},(0,s.default)(o,f.GeoTypes.POINT,d),(0,s.default)(o,f.GeoTypes.LINE_STRING,h),(0,s.default)(o,f.GeoTypes.POLYGON,(function(e,t){var r=e.map((function(e){return h(e,t)})),n=(0,i.default)(r),o=n[0],s=n.slice(1);return new l.default(o,s,t)})),o)},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t){var r=t.srsId,n=t.name;(0,o.default)(this,e),this.srsId=r,this.name=n}return(0,s.default)(e,[{key:"getSRSId",value:function(){return this.srsId}},{key:"getName",value:function(){return this.name}},{key:"toString",value:function(){return this.getName()+"("+this.getSRSId()+")"}}]),e}(),a=new i({srsId:0,name:"Cartesian"}),u=new i({srsId:4200,name:"Pulkovo 1995"}),c=new i({srsId:4326,name:"WGS 84"}),l={CARTESIAN:a,PULKOVO_1995:u,WGS84:c,WGS84_PSEUDO_MERCATOR:new i({srsId:3857,name:"WGS 84 / Pseudo-Mercator"}),WGS84_WORLD_MERCATOR:new i({srsId:3395,name:"WGS 84 / World Mercator"}),DEFAULT:c,SRS_MAP:{},valueBySRSId:function(e){return l.SRS_MAP[e]}};Object.keys(l).forEach((function(e){if(l[e]instanceof i){var t=l[e];l.SRS_MAP[t.getSRSId()]=t}}));var f=l;t.default=f},function(e,t,r){var n=r(72),o=r(35),s=r(19),i=r(73);e.exports=function(e){return n(e)||o(e)||s(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(7)),a=n(r(8)),u=n(r(5)),c=n(r(13));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=r(14).GeoTypes.LINE_STRING,p=f.toUpperCase(),d=function(e){(0,i.default)(r,e);var t=l(r);function r(e,n){var s;return(0,o.default)(this,r),(s=t.call(this,n)).points=e||[],s}return(0,s.default)(r,[{key:"getPoints",value:function(){return this.points}},{key:"setPoints",value:function(e){return this.points=e,this}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"jsonCoordinatePairs",value:function(){var e=[];return this.getPoints().forEach((function(t){e.push([t.getX(),t.getY()])})),e}},{key:"wktCoordinatePairs",value:function(){return this.getPoints().map((function(e){return"".concat(e.getX()," ").concat(e.getY())})).join(",")}}]),r}(c.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IsolationLevelEnum=t.OperationType=void 0;t.OperationType={CREATE:"CREATE",CREATE_BULK:"CREATE_BULK",UPDATE:"UPDATE",UPDATE_BULK:"UPDATE_BULK",DELETE:"DELETE",DELETE_BULK:"DELETE_BULK",UPSERT:"UPSERT",UPSERT_BULK:"UPSERT_BULK",FIND:"FIND",ADD_RELATION:"ADD_RELATION",SET_RELATION:"SET_RELATION",DELETE_RELATION:"DELETE_RELATION"};t.IsolationLevelEnum={READ_UNCOMMITTED:"READ_UNCOMMITTED",READ_COMMITTED:"READ_COMMITTED",REPEATABLE_READ:"REPEATABLE_READ",SERIALIZABLE:"SERIALIZABLE"}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(28),o=r(64),s=r(19),i=r(30);e.exports=function(e,t){return n(e)||o(e,t)||s(e,t)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(65);e.exports=function(e,t){if(null==e)return{};var r,o,s=n(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(12)),a=n(r(7)),u=n(r(8)),c=n(r(5));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var f=function(e){(0,a.default)(r,e);var t=l(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).relationModel=e,n.relationName=null,n}return(0,s.default)(r,[{key:"setRelationName",value:function(e){return this.relationName=e,this}},{key:"getRelationName",value:function(){return this.relationName}},{key:"setRelationModel",value:function(e){return this.relationModel=e,this}},{key:"getRelationModel",value:function(){return this.relationModel}},{key:"toJSON",value:function(){var e=(0,i.default)((0,c.default)(r.prototype),"toJSON",this).call(this);return e.relationName=this.getRelationName(),e.relationModel=this.getRelationModel(),e}}],[{key:"of",value:function(e){return new this(e)}}]),r}(n(r(11)).default);t.default=f},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(7)),s=n(r(8)),i=n(r(5)),a=n(r(1)),u=n(r(2));function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,i.default)(e);if(t){var o=(0,i.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,s.default)(this,r)}}var l="JSON_SET",f="JSON_INSERT",p="JSON_REPLACE",d="JSON_REMOVE",h="JSON_ARRAY_APPEND",y="JSON_ARRAY_INSERT",v=function(){function e(t){(0,a.default)(this,e),this.operationName=t,this.args={}}return(0,u.default)(e,[{key:"addArgument",value:function(e,t){if(void 0===t)throw new Error("You have to specify function's second argument");return this.args[e]=t,this}},{key:"toJSON",value:function(){return this.validate(),{___operation:this.operationName,args:this.args}}},{key:"create",value:function(){return this.toJSON()}},{key:"validate",value:function(){if(!Object.keys(this.args).length)throw new Error("You have to add at least one argument")}}],[{key:"SET",value:function(){return new e(l)}},{key:"INSERT",value:function(){return new e(f)}},{key:"REPLACE",value:function(){return new e(p)}},{key:"REMOVE",value:function(){return new m}},{key:"ARRAY_APPEND",value:function(){return new e(h)}},{key:"ARRAY_INSERT",value:function(){return new e(y)}}]),e}();t.default=v;var m=function(e){(0,o.default)(r,e);var t=c(r);function r(){var e;return(0,a.default)(this,r),(e=t.call(this,d)).args=[],e}return(0,u.default)(r,[{key:"addArgument",value:function(e){return this.args.push(e),this}},{key:"validate",value:function(){if(!this.args.length)throw new Error("You have to add at least one argument")}}]),r}(v)},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(7)),a=n(r(8)),u=n(r(5)),c=n(r(13));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=r(14).GeoTypes.POINT,p=f.toUpperCase(),d=function(e){(0,i.default)(r,e);var t=l(r);function r(e){return(0,o.default)(this,r),t.call(this,e)}return(0,s.default)(r,[{key:"lng",get:function(){return this.getLongitude()},set:function(e){this.setLongitude(e)}},{key:"lat",get:function(){return this.getLatitude()},set:function(e){this.setLatitude(e)}},{key:"getX",value:function(){return this.x}},{key:"getY",value:function(){return this.y}},{key:"getLongitude",value:function(){return this.x}},{key:"getLatitude",value:function(){return this.y}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setLongitude",value:function(e){return this.setX(e)}},{key:"setLatitude",value:function(e){return this.setY(e)}},{key:"getGeojsonType",value:function(){return f}},{key:"getWktType",value:function(){return p}},{key:"wktCoordinatePairs",value:function(){return"".concat(this.x," ").concat(this.y)}},{key:"jsonCoordinatePairs",value:function(){return[this.x,this.y]}},{key:"equals",value:function(e){return this===e||e instanceof r&&(Math.abs(e.x-this.x)<1e-9&&Math.abs(e.y-this.y)<1e-9&&this.srs===e.srs)}}]),r}(c.default);t.default=d},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(21)),a=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){return(0,i.default)(e,this.srs)}}]),e}();t.default=a},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(71)),a=n(r(21)),u=function(){function e(t){(0,o.default)(this,e),this.srs=t}return(0,s.default)(e,[{key:"read",value:function(e){var t=(0,i.default)(e);if(!t)throw new Error("WKT string is invalid");return(0,a.default)(t,this.srs)}}]),e}();t.default=u},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(23)),s=n(r(1)),i=n(r(2)),a=n(r(7)),u=n(r(8)),c=n(r(5)),l=n(r(13)),f=n(r(24));function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var d=r(14).GeoTypes.POLYGON,h=d.toUpperCase(),y=function(e){(0,a.default)(r,e);var t=p(r);function r(e,n,o){var i;return(0,s.default)(this,r),(i=t.call(this,o)).setBoundary(e),i.setHoles(n),i}return(0,i.default)(r,[{key:"getBoundary",value:function(){return this.boundary}},{key:"setBoundary",value:function(e){if(!e)throw new Error("The 'boundary' argument is required.");return e instanceof f.default||(e=new f.default(e,this.srs)),this.boundary=e,this}},{key:"getHoles",value:function(){return this.holes}},{key:"setHoles",value:function(e){return this.holes=e||[],this}},{key:"getGeojsonType",value:function(){return d}},{key:"getWktType",value:function(){return h}},{key:"jsonCoordinatePairs",value:function(){var e=[];this.getBoundary().getPoints().forEach((function(t){e.push([t.getX(),t.getY()])}));var t=this.holes.map((function(e){return e.getPoints().map((function(e){return[e.getX(),e.getY()]}))}));return[e].concat((0,o.default)(t))}},{key:"wktCoordinatePairs",value:function(){var e=[this.getBoundary().wktCoordinatePairs()];this.holes.forEach((function(t){return e.push(t.wktCoordinatePairs())}));return e.map((function(e){return"("+e+")"})).join(",")}}]),r}(l.default);t.default=y},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(6)),a="GRANT",u="DENY",c=function(){function e(t,r){(0,o.default)(this,e),this.permission=t,this.app=r,this.grantUser=this.backwardCompatibility("grantForUser","grantUser"),this.denyUser=this.backwardCompatibility("denyForUser","denyUser"),this.grantRole=this.backwardCompatibility("grantForRole","grantRole"),this.denyRole=this.backwardCompatibility("denyForRole","denyRole"),this.grant=this.backwardCompatibility("grantForAllUsers","grant"),this.deny=this.backwardCompatibility("denyForAllUsers","deny")}return(0,s.default)(e,[{key:"backwardCompatibility",value:function(e,t){var r=this,n=this.constructor.BACKWARD_COMPATIBILITY_LABEL;return function(){var o='"'.concat(n,".").concat(t,'" is deprecated and will be removed in the nearest release.'),s='Please use "'.concat(n,".").concat(e,'" instead of.');return console.warn("".concat(o,"\n").concat(s)),r[e].apply(r,arguments)}}},{key:"grantForUser",value:function(e,t){return this.sendRequest(a,t,{userId:e})}},{key:"denyForUser",value:function(e,t){return this.sendRequest(u,t,{userId:e})}},{key:"grantForRole",value:function(e,t){return this.sendRequest(a,t,{roleName:e})}},{key:"denyForRole",value:function(e,t){return this.sendRequest(u,t,{roleName:e})}},{key:"grantForAllUsers",value:function(e){return this.sendRequest(a,e,{userId:"*"})}},{key:"denyForAllUsers",value:function(e){return this.sendRequest(u,e,{userId:"*"})}},{key:"grantForAllRoles",value:function(e){return this.sendRequest(a,e,{roleName:"*"})}},{key:"denyForAllRoles",value:function(e){return this.sendRequest(u,e,{roleName:"*"})}},{key:"sendRequest",value:function(e,t,r){var n=r.userId,o=r.roleName,s={permission:this.permission};return n?s.user=n:o&&(s.role=o),this.app.request.put({url:this.getRequestURL(e,t),data:s})}},{key:"getRequestURL",value:function(){}}]),e}();t.default=c,(0,i.default)(c,"BACKWARD_COMPATIBILITY_LABEL",null)},function(e,t){e.exports=function(e,t,r,n,o){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResult=void 0;var o=n(r(1)),s=n(r(2)),i=r(25),a=r(43),u=function(){function e(t,r){var n=r.operationType,s=r.table,i=r.payload;(0,o.default)(this,e),this.uow=t,this.operationType=n,this.table=s,this.payload=i;var a=this.uow.getOpStackName(n,s),u=this.uow.getNextOpResultIndex(a);this.opResultId="".concat(a).concat(u),this.result=null}return(0,s.default)(e,[{key:"setResult",value:function(e){this.result=e}},{key:"getResult",value:function(){return this.result}},{key:"setError",value:function(e){this.error=e}},{key:"getError",value:function(){return this.error}},{key:"getType",value:function(){return this.operationType}},{key:"isFindRef",value:function(){return this.operationType===i.OperationType.FIND}},{key:"isCollectionRef",value:function(){return this.operationType===i.OperationType.FIND||this.operationType===i.OperationType.CREATE_BULK}},{key:"isObjectRef",value:function(){return this.operationType===i.OperationType.CREATE||this.operationType===i.OperationType.UPDATE}},{key:"setOpResultId",value:function(e){return this.opResultId=e,this}},{key:"getOpResultId",value:function(){return this.opResultId}},{key:"getTableName",value:function(){return this.table}},{key:"resolveTo",value:function(e,t){return"string"==typeof e&&(t=e,e=void 0),new a.OpResultValueReference(this,{resultIndex:e,propName:t})}},{key:"toJSON",value:function(){var e={___ref:!0,opResultId:this.opResultId};return this.isObjectRef()&&(e.propName="objectId"),e}}]),e}();t.OpResult=u},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.OpResultValueReference=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t,r){var n=r.resultIndex,s=r.propName;(0,o.default)(this,e),this.opResult=t,this.resultIndex=n,this.propName=s}return(0,s.default)(e,[{key:"getTableName",value:function(){return this.opResult.getTableName()}},{key:"toJSON",value:function(){var e=this.opResult.toJSON();return void 0!==this.resultIndex&&(e.resultIndex=this.resultIndex),void 0!==this.propName&&(e.propName=this.propName),!e.propName&&this.opResult.isFindRef()&&(e.propName="objectId"),e}}]),e}();t.OpResultValueReference=i},function(e,t,r){"use strict";(function(n){var o=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=o(r(6)),i=o(r(1)),a=o(r(2)),u=o(r(9)),c=o(r(17)),l=o(r(45)),f=o(r(46)),p=o(r(10));function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var h={appId:null,apiKey:null,serverURL:"https://api.backendless.com",domain:null,apiURI:"/api",debugMode:!1,standalone:!1,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,useTableClassesFromGlobalScope:!0},y=["appId","apiKey","domain"],v="object"===("undefined"==typeof self?"undefined":(0,u.default)(self))&&self.self===self&&self||"object"===(void 0===n?"undefined":(0,u.default)(n))&&n.global===n&&n,m=v&&v.Backendless,g=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],o=t[1];return n&&"object"===(0,u.default)(n)?n:"string"!=typeof n||o?{appId:n,apiKey:o}:{domain:n}},b=function(e){if(e.domain&&!e.domain.startsWith("https://")&&!e.domain.startsWith("http://"))throw new Error("When initialize the SDK with a custom domain it should start with http:// or https://, for example: Backendless.initApp('https://foobar.com')")},k={Logging:function(){return r(47).default},Counters:function(){return r(50).default},Cache:function(){return r(52).default},Commerce:function(){return r(53).default},Users:function(){return r(54).default},BL:function(){return r(59).default},Data:function(){return r(62).default},Messaging:function(){return r(76).default},Files:function(){return r(85).default},RT:function(){return r(16).default},SharedObject:function(){return r(88).default},LocalCache:function(){return r(90).default},UnitOfWork:function(){return r(93).default}},w=new(function(){function e(t){(0,i.default)(this,e),this.initConfig(t),this.Request=c.default,this.request=new l.default(this),this.urls=new f.default(this)}return(0,a.default)(e,[{key:"initConfig",value:function(e){for(var t in(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e)).domain&&(delete e.appId,delete e.apiKey),h)if(h.hasOwnProperty(t)){var r="__".concat(t);y.includes(t)&&delete this[r];var n=void 0===this[r]?h[t]:this[r];this[r]=void 0===e[t]?n:e[t]}}},{key:"initApp",value:function(){var t=g.apply(void 0,arguments);b(t);var r=t.standalone?new e(this):this;return r.initConfig(t),r.resetRT(),r.__removeService("LocalCache"),r.__hasService("Logging")&&r.Logging.reset(),r.__hasService("Users")&&(r.Users.currentUser=null),delete this.__device,r}},{key:"__hasService",value:function(e){return!!this["__".concat(e)]}},{key:"__removeService",value:function(e){delete this["__".concat(e)]}},{key:"__getService",value:function(e){var t="__".concat(e);if(!this[t]){var r=k[e]();this[t]=new r(this)}return this[t]}},{key:"standalone",get:function(){return this.__standalone},set:function(e){throw new Error("Setting value to Backendless.standalone directly is not possible, "+"instead you must use Backendless.initApp({ appId: [APP_ID], apiKey: [API_KEY], standalone: ".concat(e," })"))}},{key:"appId",get:function(){return this.__appId},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appId directly is not possible, ")+"instead you must use Backendless.initApp('".concat(e,"', API_KEY)"))}},{key:"apiKey",get:function(){return this.__apiKey},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.apiKey directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, '".concat(e,"')"))}},{key:"serverURL",get:function(){return this.__serverURL},set:function(e){this.__serverURL=e}},{key:"domain",get:function(){return this.__domain},set:function(e){this.__domain=e}},{key:"apiURI",get:function(){return this.__apiURI},set:function(e){this.__apiURI=e}},{key:"appPath",get:function(){return this.domain?this.domain+this.apiURI:[this.serverURL,this.appId,this.apiKey].join("/")},set:function(e){throw new Error("Setting '".concat(e,"' value to Backendless.appPath directly is not possible, ")+"instead you must use Backendless.initApp(APP_ID, API_KEY) for setup the value")}},{key:"useTableClassesFromGlobalScope",get:function(){return this.__useTableClassesFromGlobalScope},set:function(e){this.__useTableClassesFromGlobalScope=!!e}},{key:"debugMode",get:function(){return this.__debugMode},set:function(e){e=!!e,this.__debugMode!==e&&(this.__debugMode=e,this.__RT&&this.RT.setDebugMode(e))}},{key:"XMLHttpRequest",get:function(){return this.__XMLHttpRequest},set:function(e){this.__XMLHttpRequest=e}},{key:"device",get:function(){if(!this.__device)throw new Error("Device is not defined. Please, run the Backendless.setupDevice");return this.__device},set:function(e){throw new Error("Setting value to Backendless.device directly is not possible, instead you must use Backendless.setupDevice(deviceProperties) for setup the device")}},{key:"setupDevice",value:function(e){var t=r(99).default;this.__device=new t(e)}},{key:"Utils",get:function(){return p.default}},{key:"getCurrentUserToken",value:function(){return this.Users.getCurrentUserToken()}},{key:"setCurrentUserToken",value:function(e){this.Users.setCurrentUserToken(e)}},{key:"browser",get:function(){return r(100).getUserAgent()}},{key:"noConflict",value:function(){return v&&(v.Backendless=m),this}},{key:"Logging",get:function(){return this.__getService("Logging")}},{key:"Counters",get:function(){return this.__getService("Counters")}},{key:"Cache",get:function(){return this.__getService("Cache")}},{key:"Commerce",get:function(){return this.__getService("Commerce")}},{key:"Users",get:function(){return this.__getService("Users")}},{key:"User",get:function(){return r(15).default}},{key:"UserService",get:function(){return this.Users}},{key:"BL",get:function(){return this.__getService("BL")}},{key:"CustomServices",get:function(){return this.BL.CustomServices}},{key:"APIServices",get:function(){return this.BL.CustomServices}},{key:"Events",get:function(){return this.BL.Events}},{key:"Data",get:function(){return this.__getService("Data")}},{key:"Messaging",get:function(){return this.__getService("Messaging")}},{key:"Files",get:function(){return this.__getService("Files")}},{key:"RT",get:function(){return this.__getService("RT")}},{key:"resetRT",value:function(){this.__RT&&(this.__RT.terminate(),delete this.__RT)}},{key:"SharedObject",get:function(){return this.__getService("SharedObject")}},{key:"LocalCache",get:function(){return this.__getService("LocalCache")}},{key:"UnitOfWork",get:function(){return this.__getService("UnitOfWork")}},{key:"applicationId",get:function(){return this.appId},set:function(e){console.warn("getter/setter for Backendless.applicationId is deprecated, instead use Backendless.appId"),this.appId=e}},{key:"secretKey",get:function(){return console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey},set:function(e){console.warn("getter/setter for Backendless.secretKey is deprecated, instead use Backendless.apiKey"),this.apiKey=e}},{key:"Persistence",get:function(){return function e(){e.isShown||(console.warn("Backendless.Persistence is deprecated namespace, use Backendless.Data instead"),e.isShown=!0)}(),this.Data}},{key:"DataQueryBuilder",get:function(){return this.Data.QueryBuilder}},{key:"GroupQueryBuilder",get:function(){return this.Data.GroupQueryBuilder}},{key:"JSONUpdateBuilder",get:function(){return this.Data.JSONUpdateBuilder}},{key:"LoadRelationsQueryBuilder",get:function(){return this.Data.LoadRelationsQueryBuilder}},{key:"Bodyparts",get:function(){return this.Messaging.Bodyparts}},{key:"PublishOptions",get:function(){return this.Messaging.PublishOptions}},{key:"DeliveryOptions",get:function(){return this.Messaging.DeliveryOptions}},{key:"PublishOptionsHeaders",get:function(){return this.Messaging.PublishOptionsHeaders}},{key:"EmailEnvelope",get:function(){return this.Messaging.EmailEnvelope}}]),e}())(h);v&&(v.Backendless=w);var E=w;(t=e.exports=w).default=E}).call(this,r(26))},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(6)),s=n(r(1)),i=n(r(2)),a=n(r(17));function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH"},f=function(){function e(t){(0,s.default)(this,e),this.app=t,this.Methods=l}return(0,i.default)(e,[{key:"send",value:function(e){a.default.verbose=!!this.app.debugMode,a.default.XMLHttpRequest=this.app.XMLHttpRequest;var t=e.method.toLowerCase(),r=e.headers||{},n=this.app.getCurrentUserToken();return n&&(r["user-token"]=n),e.queryString&&(e.url="".concat(e.url,"?").concat(e.queryString)),a.default[t](e.url,e.data).set(r).query(e.query).form(e.form)}},{key:"get",value:function(e){return this.send(c(c({},e),{},{method:l.GET}))}},{key:"post",value:function(e){return this.send(c(c({},e),{},{method:l.POST}))}},{key:"put",value:function(e){return this.send(c(c({},e),{},{method:l.PUT}))}},{key:"delete",value:function(e){return this.send(c(c({},e),{},{method:l.DELETE}))}}]),e}();t.default=f},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"root",value:function(){return this.app.appPath}},{key:"blServices",value:function(){return"".concat(this.root(),"/services")}},{key:"blServiceMethod",value:function(e,t){return"".concat(this.blServices(),"/").concat(e,"/").concat(t)}},{key:"blEvent",value:function(e){return"".concat(this.root(),"/servercode/events/").concat(e)}},{key:"logging",value:function(){return"".concat(this.root(),"/log")}},{key:"cache",value:function(){return"".concat(this.root(),"/cache")}},{key:"cacheItem",value:function(e){return"".concat(this.cache(),"/").concat(e)}},{key:"cacheItemExpireIn",value:function(e){return"".concat(this.cacheItem(e),"/expireIn")}},{key:"cacheItemExpireAt",value:function(e){return"".concat(this.cacheItem(e),"/expireAt")}},{key:"cacheItemCheck",value:function(e){return"".concat(this.cacheItem(e),"/check")}},{key:"counters",value:function(){return"".concat(this.root(),"/counters")}},{key:"countersList",value:function(e){return"".concat(this.counters(),"/").concat(e||"*","/list")}},{key:"counter",value:function(e){return"".concat(this.counters(),"/").concat(e)}},{key:"counterAddAndGet",value:function(e){return"".concat(this.counter(e),"/incrementby/get")}},{key:"counterGetAndAdd",value:function(e){return"".concat(this.counter(e),"/get/incrementby")}},{key:"counterIncrementAndGet",value:function(e){return"".concat(this.counter(e),"/increment/get")}},{key:"counterDecrementAndGet",value:function(e){return"".concat(this.counter(e),"/decrement/get")}},{key:"counterGetAndDecrement",value:function(e){return"".concat(this.counter(e),"/get/decrement")}},{key:"counterGetAndIncrement",value:function(e){return"".concat(this.counter(e),"/get/increment")}},{key:"counterCompareAndSet",value:function(e){return"".concat(this.counter(e),"/get/compareandset")}},{key:"counterReset",value:function(e){return"".concat(this.counter(e),"/reset")}},{key:"data",value:function(){return"".concat(this.root(),"/data")}},{key:"dataGrouping",value:function(e){return"".concat(this.data(),"/data-grouping/").concat(e)}},{key:"dataTable",value:function(e){return"".concat(this.data(),"/").concat(e)}},{key:"dataTableUpsert",value:function(e){return"".concat(this.data(),"/").concat(e,"/upsert")}},{key:"dataTableDeepSave",value:function(e){return"".concat(this.data(),"/").concat(e,"/deep-save")}},{key:"dataTableFind",value:function(e){return"".concat(this.dataTable(e),"/find")}},{key:"dataTablePrimaryKey",value:function(e){return"".concat(this.dataTable(e),"/pk")}},{key:"dataTableObject",value:function(e,t){return"".concat(this.dataTable(e),"/").concat(t)}},{key:"dataTableObjectRelation",value:function(e,t,r){return"".concat(this.dataTableObject(e,t),"/").concat(r)}},{key:"dataTableCount",value:function(e){return"".concat(this.dataTable(e),"/count")}},{key:"dataTableProps",value:function(e){return"".concat(this.dataTable(e),"/properties")}},{key:"dataBulkTable",value:function(e){return"".concat(this.data(),"/bulk/").concat(e)}},{key:"dataBulkTableUpsert",value:function(e){return"".concat(this.data(),"/bulkupsert/").concat(e)}},{key:"dataBulkTableDelete",value:function(e){return"".concat(this.dataBulkTable(e),"/delete")}},{key:"dataObjectPermission",value:function(e,t,r){return"".concat(this.dataTable(e),"/permissions/").concat(t,"/").concat(r)}},{key:"dataTableNameById",value:function(e){return"".concat(this.data(),"/").concat(e,"/table-name")}},{key:"transactions",value:function(){return"".concat(this.root(),"/transaction/unit-of-work")}},{key:"messaging",value:function(){return"".concat(this.root(),"/messaging")}},{key:"messagingPush",value:function(){return"".concat(this.messaging(),"/push")}},{key:"messagingPushTemplates",value:function(e){return"".concat(this.messaging(),"/pushtemplates/").concat(e)}},{key:"messagingPushWithTemplate",value:function(e){return"".concat(this.messagingPush(),"/").concat(e)}},{key:"messagingEmail",value:function(){return"".concat(this.messaging(),"/email")}},{key:"messagingChannel",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingMessage",value:function(e){return"".concat(this.messaging(),"/").concat(e)}},{key:"messagingRegistrations",value:function(){return"".concat(this.messaging(),"/registrations")}},{key:"messagingRegistrationDevice",value:function(e){return"".concat(this.messagingRegistrations(),"/").concat(e)}},{key:"emailTemplate",value:function(){return"".concat(this.root(),"/emailtemplate")}},{key:"emailTemplateSend",value:function(){return"".concat(this.emailTemplate(),"/send")}},{key:"commerce",value:function(){return"".concat(this.root(),"/commerce/googleplay")}},{key:"commerceValidate",value:function(e,t,r){return"".concat(this.commerce(),"/validate/").concat(e,"/inapp/").concat(t,"/purchases/").concat(r)}},{key:"commerceSubCancel",value:function(e,t,r){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(r,"/cancel")}},{key:"commerceSubStatus",value:function(e,t,r){return"".concat(this.commerce(),"/").concat(e,"/subscription/").concat(t,"/purchases/").concat(r)}},{key:"files",value:function(){return"".concat(this.root(),"/files")}},{key:"filePath",value:function(e){return"".concat(this.files(),"/").concat(e)}},{key:"fileCopy",value:function(){return"".concat(this.files(),"/copy")}},{key:"fileMove",value:function(){return"".concat(this.files(),"/move")}},{key:"fileRename",value:function(){return"".concat(this.files(),"/rename")}},{key:"filePermissions",value:function(){return"".concat(this.files(),"/permissions")}},{key:"filePermission",value:function(e,t){return"".concat(this.filePermissions(),"/").concat(e,"/").concat(encodeURIComponent(t))}},{key:"fileBinaryPath",value:function(e){return"".concat(this.files(),"/binary/").concat(e)}},{key:"fileAppendPath",value:function(e){return"".concat(this.files(),"/append/").concat(e)}},{key:"fileAppendBinaryPath",value:function(e){return"".concat(this.files(),"/append/binary/").concat(e)}},{key:"users",value:function(){return"".concat(this.root(),"/users")}},{key:"userObject",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userRegister",value:function(){return"".concat(this.users(),"/register")}},{key:"userLogin",value:function(){return"".concat(this.users(),"/login")}},{key:"userLogout",value:function(){return"".concat(this.users(),"/logout")}},{key:"userRoles",value:function(e){return"".concat(this.users(),"/userroles").concat(e?"/".concat(e):"")}},{key:"usersRole",value:function(e){return"".concat(this.users(),"/role/").concat(e)}},{key:"userRoleOperation",value:function(e){return"".concat(this.users(),"/").concat(e)}},{key:"userClassProps",value:function(){return"".concat(this.users(),"/userclassprops")}},{key:"userRestorePassword",value:function(e){return"".concat(this.users(),"/restorepassword/").concat(encodeURIComponent(e))}},{key:"userTokenCheck",value:function(e){return"".concat(this.users(),"/isvalidusertoken/").concat(e)}},{key:"userVerifyPassowrd",value:function(){return"".concat(this.users(),"/verifypassowrd")}},{key:"userResendConfirmation",value:function(e){return"".concat(this.users(),"/resendconfirmation/").concat(e)}},{key:"userCreateConfirmationURL",value:function(e){return"".concat(this.users(),"/createEmailConfirmationURL/").concat(e)}},{key:"userSocial",value:function(){return"".concat(this.users(),"/social")}},{key:"userSocialOAuth",value:function(e){return"".concat(this.userSocial(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"userSocialLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/sdk/login")}},{key:"userOAuthLogin",value:function(e){return"".concat(this.userSocial(),"/").concat(e.toLowerCase(),"/login")}},{key:"userAuthorizationURL",value:function(e){return"".concat(this.users(),"/oauth/").concat(e.toLowerCase(),"/request_url")}},{key:"guestLogin",value:function(){return"".concat(this.users(),"/register/guest")}},{key:"userStatus",value:function(e){return"".concat(this.userObject(e),"/status")}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=n(r(49)),c=function(){function e(t){(0,i.default)(this,e),this.app=t,this.reset()}var t;return(0,a.default)(e,[{key:"reset",value:function(){this.loggers={},this.pool=[],this.numOfMessages=10,this.timeFrequency=1}},{key:"getLogger",value:function(e){if(!e||"string"!=typeof e)throw new Error("Logger Name must be provided and must be a string.");return this.loggers[e]||(this.loggers[e]=new u.default(e,this)),this.loggers[e]}},{key:"flush",value:(t=(0,s.default)(o.default.mark((function e(){var t=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!this.flushRequest&&this.pool.length&&(this.stopFlushInterval(),this.flushRequest=this.app.request.put({url:this.app.urls.logging(),data:this.pool}).then((function(){delete t.flushRequest})),this.pool=[]),e.abrupt("return",this.flushRequest);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"push",value:function(e,t,r,n){if("string"!=typeof r)throw new Error('"message" must be a string');this.pool.push({logger:e,message:r,exception:n,"log-level":t,timestamp:Date.now()}),this.checkMessagesLen()}},{key:"checkMessagesLen",value:function(){this.pool.length>=this.numOfMessages&&this.startFlushInterval()}},{key:"startFlushInterval",value:function(){var e=this;this.flushInterval||(this.flushInterval=setTimeout((function(){return e.flush()}),1e3*this.timeFrequency))}},{key:"stopFlushInterval",value:function(){this.flushInterval&&(clearTimeout(this.flushInterval),delete this.flushInterval)}},{key:"setLogReportingPolicy",value:function(e,t){void 0!==t&&this.timeFrequency!==t&&this.stopFlushInterval(),this.numOfMessages=e,this.timeFrequency=t,this.checkMessagesLen()}}]),e}();t.default=c},function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),i=new _(n||[]);return s._invoke=function(e,t,r){var n="suspendedStart";return function(o,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw s;return S()}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=k(i,r);if(a){if(a===l)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),s}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function p(){}function d(){}var h={};h[o]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(O([])));v&&v!==t&&r.call(v,o)&&(h=v);var m=d.prototype=f.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(o,s){function i(){return new t((function(n,i){!function n(o,s,i,a){var u=c(e[o],e,s);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,a)}),(function(e){n("throw",e,i,a)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,a)}))}a(u.arg)}(o,s,n,i)}))}return n=n?n.then(i,i):i()}}function k(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return s.next=s}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=m.constructor=d,d.constructor=p,p.displayName=a(d,i,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,a(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(b.prototype),b.prototype[s]=function(){return this},e.AsyncIterator=b,e.async=function(t,r,n,o,s){void 0===s&&(s=Promise);var i=new b(u(t,r,n,o),s);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},g(m),a(m,i,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=O,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],i=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(a&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var i=s?s.completion:{};return i.type=e,i.arg=t,s?(this.method="next",this.next=s.finallyLoc,l):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t,r){(0,o.default)(this,e),this.name=t,this.logging=r}return(0,s.default)(e,[{key:"debug",value:function(e){return this.logging.push(this.name,"DEBUG",e)}},{key:"info",value:function(e){return this.logging.push(this.name,"INFO",e)}},{key:"warn",value:function(e,t){return this.logging.push(this.name,"WARN",e,t)}},{key:"error",value:function(e,t){return this.logging.push(this.name,"ERROR",e,t)}},{key:"fatal",value:function(e,t){return this.logging.push(this.name,"FATAL",e,t)}},{key:"trace",value:function(e){return this.logging.push(this.name,"TRACE",e)}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=n(r(51)),c=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r,n,c,l,f,p,d,h,y;return(0,a.default)(e,[{key:"of",value:function(e){return new u.default(e,this)}},{key:"list",value:(y=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||"string"==typeof t){e.next=2;break}throw new Error("Counters Pattern can be a string only");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.countersList(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"incrementAndGet",value:(h=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterIncrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"getAndIncrement",value:(d=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndIncrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"decrementAndGet",value:(p=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterDecrementAndGet(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"getAndDecrement",value:(f=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndDecrement(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"reset",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterReset(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"get",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.counter(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"addAndGet",value:(n=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterAddAndGet(t),query:{value:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getAndAdd",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Value must be a number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterGetAndAdd(t),query:{value:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"compareAndSet",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Counter Name must be provided and must be a string.");case 2:if("number"==typeof r){e.next=4;break}throw new Error("Counter Expected Value must be a number.");case 4:if("number"==typeof n){e.next=6;break}throw new Error("Counter Updated Value must be a number.");case 6:return e.abrupt("return",this.app.request.put({url:this.app.urls.counterCompareAndSet(t),query:{expected:r,updatedvalue:n}}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=c},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t,r){if((0,o.default)(this,e),!t||"string"!=typeof t)throw new Error("Counter Name must be non empty String");this.name=t,this.counters=r}return(0,s.default)(e,[{key:"incrementAndGet",value:function(){return this.counters.incrementAndGet(this.name)}},{key:"getAndIncrement",value:function(){return this.counters.getAndIncrement(this.name)}},{key:"decrementAndGet",value:function(){return this.counters.decrementAndGet(this.name)}},{key:"getAndDecrement",value:function(){return this.counters.getAndDecrement(this.name)}},{key:"reset",value:function(){return this.counters.reset(this.name)}},{key:"get",value:function(){return this.counters.get(this.name)}},{key:"addAndGet",value:function(e){return this.counters.addAndGet(this.name,e)}},{key:"getAndAdd",value:function(e){return this.counters.getAndAdd(this.name,e)}},{key:"compareAndSet",value:function(e,t){return this.counters.compareAndSet(this.name,e,t)}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=n(r(10)),c=function(){function e(t){(0,i.default)(this,e),this.app=t,this.parsers={}}var t,r,n,c,l,f;return(0,a.default)(e,[{key:"setObjectFactory",value:function(e,t){this.parsers[e]=t}},{key:"parseItem",value:function(e){var t=e&&e.___class;if(t){var r=this.parsers[t];r&&(e=new r(e))}return e}},{key:"stringifyItem",value:function(e){return u.default.isCustomClassInstance(e)&&(e.___class=e.___class||u.default.getClassName(e)),JSON.stringify(e)}},{key:"put",value:(f=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!n||!("number"!=typeof n||n<0)){e.next=4;break}throw new Error("Cache TimeToLive must be a positive number.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItem(t),query:{timeout:n},headers:{"Content-Type":"application/json"},data:this.stringifyItem(r)}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"get",value:(l=(0,s.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItem(t)}).then((function(e){return r.parseItem(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"remove",value:(c=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.cacheItem(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"contains",value:(n=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.cacheItemCheck(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"expireIn",value:(r=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!("number"!=typeof r||r<=0)){e.next=4;break}throw new Error("Cache Expiration must be provided and must be a number of seconds.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireIn(t),query:{timeout:r},data:{}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"expireAt",value:(t=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Cache Key must be provided and must be a string.");case 2:if(!(r instanceof Date)){e.next=6;break}r=r.getTime(),e.next=8;break;case 6:if(!("number"!=typeof r||r<=0)){e.next=8;break}throw new Error("Cache Expiration must be provided and must be a timestamp or an instance of Date.");case 8:return e.abrupt("return",this.app.request.put({url:this.app.urls.cacheItemExpireAt(t),query:{timestamp:r},data:{}}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();t.default=c},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=function(){function e(t){(0,i.default)(this,e),this.app=t}var t,r,n;return(0,a.default)(e,[{key:"validatePlayPurchase",value:(n=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Product Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceValidate(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"cancelPlaySubscription",value:(r=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.post({url:this.app.urls.commerceSubCancel(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"getPlaySubscriptionStatus",value:(t=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Package Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Subscription Id must be provided and must be a string.");case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error("Token must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.commerceSubStatus(t,r,n)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=u},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(6)),i=n(r(4)),a=n(r(1)),u=n(r(2)),c=r(55),l=n(r(15)),f=n(r(56)),p=n(r(57));function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=function(){function e(t){(0,a.default)(this,e),this.app=t,this.roles=new f.default(this),this.social=new p.default(this),this.dataStore=this.app.Data.of(l.default)}var t,r,n,s,d,y,v,m,g,b,k,w,E,_,O,S,x,R,T,j,C,P,A,L,N,I;return(0,u.default)(e,[{key:"Utils",get:function(){return c.UsersUtils}},{key:"register",value:(I=(0,i.default)(o.default.mark((function e(t){var r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=h({},t)).blUserLocale||(r=this.Utils.getClientUserLocale())&&(t.blUserLocale=r),e.abrupt("return",this.app.request.post({url:this.app.urls.userRegister(),data:t}).then((function(e){return n.dataStore.parseResponse(e)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"login",value:(N=(0,i.default)(o.default.mark((function e(t,r,n){var s,i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"string"==typeof t||"number"==typeof t){e.next=3;break}throw new Error("the first argument must be either a string or a number");case 3:if(t){e.next=5;break}throw new Error("the first argument cannot be an empty value");case 5:if("boolean"==typeof r&&(n=r,r=void 0),"string"!=typeof t||void 0!==r){e.next=10;break}s.objectId=t,e.next=14;break;case 10:if(r){e.next=12;break}throw new Error('the "password" value cannot be an empty value');case 12:s.login=t,s.password=r;case 14:return n=!0===n,e.abrupt("return",this.app.request.post({url:this.app.urls.userLogin(),data:s}).then((function(e){return i.setCurrentUser(e,n)})));case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return N.apply(this,arguments)})},{key:"loginAsGuest",value:(L=(0,i.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=!0===t,e.abrupt("return",this.app.request.post({url:this.app.urls.guestLogin()}).then((function(e){return r.setCurrentUser(e,t)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return L.apply(this,arguments)})},{key:"loginWithFacebook",value:(A=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebook(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return A.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(P=(0,i.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithFacebookSdk(t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return P.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(C=(0,i.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlus(t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return C.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(j=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithGooglePlusSdk(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return j.apply(this,arguments)})},{key:"loginWithTwitter",value:(T=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithTwitter(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"loginWithOauth2",value:(R=(0,i.default)(o.default.mark((function e(t,r,n,s,i){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth2(t,r,n,s,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return R.apply(this,arguments)})},{key:"loginWithOauth1",value:(x=(0,i.default)(o.default.mark((function e(t,r,n,s,i,a){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.social.loginWithOauth1(t,r,n,s,i,a));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o,s){return x.apply(this,arguments)})},{key:"logout",value:(S=(0,i.default)(o.default.mark((function e(){var t=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userLogout()}).then((function(){t.setCurrentUser(null)})).catch((function(e){throw[3023,3064,3090,3091].includes(e.code)&&t.setCurrentUser(null),e})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"getCurrentUser",value:(O=(0,i.default)(o.default.mark((function e(t){var r,n=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.currentUser||t){e.next=2;break}return e.abrupt("return",this.currentUser);case 2:if(!this.currentUserRequest){e.next=4;break}return e.abrupt("return",this.currentUserRequest);case 4:if(!(r=this.getCurrentUserId())){e.next=7;break}return e.abrupt("return",this.currentUserRequest=this.dataStore.findById(r).then((function(e){return n.currentUserRequest=null,n.currentUser=e})).catch((function(e){throw n.currentUserRequest=null,e})));case 7:return e.abrupt("return",null);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"setCurrentUser",value:function(e,t){return this.app.LocalCache.remove(this.app.LocalCache.Keys.USER_TOKEN),this.app.LocalCache.remove(this.app.LocalCache.Keys.CURRENT_USER_ID),this.app.LocalCache.remove(this.app.LocalCache.Keys.STAY_LOGGED_IN),this.currentUser=e||null,this.currentUser&&(this.currentUser instanceof l.default||(this.currentUser=this.dataStore.parseResponse(this.currentUser)),t&&(this.app.LocalCache.set(this.app.LocalCache.Keys.STAY_LOGGED_IN,!0),this.app.LocalCache.set(this.app.LocalCache.Keys.USER_TOKEN,this.currentUser["user-token"]),this.app.LocalCache.set(this.app.LocalCache.Keys.CURRENT_USER_ID,this.currentUser.objectId))),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded(),this.currentUser}},{key:"isValidLogin",value:(_=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getCurrentUserToken())){e.next=3;break}return e.abrupt("return",this.app.request.get({url:this.app.urls.userTokenCheck(t)}));case 3:return e.abrupt("return",!1);case 4:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"verifyPassword",value:(E=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Password has to be a non empty string");case 2:if(this.getCurrentUserToken()){e.next=4;break}throw new Error("In order to check password you have to be logged in");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userVerifyPassowrd(),data:{password:t}}).then((function(e){return!(!e||!e.valid)})));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"restorePassword",value:(w=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Address must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRestorePassword(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"resendEmailConfirmation",value:(k=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userResendConfirmation(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"createEmailConfirmationURL",value:(b=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=5;break}if(t){e.next=3;break}throw new Error("Identity can not be an empty string.");case 3:e.next=7;break;case 5:if("number"==typeof t){e.next=7;break}throw new Error("Identity must be a string or number.");case 7:return e.abrupt("return",this.app.request.post({url:this.app.urls.userCreateConfirmationURL(t)}));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"update",value:(g=(0,i.default)(o.default.mark((function e(t){var r=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.userObject(t.objectId),data:t}).then((function(e){return r.dataStore.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"findByRole",value:(m=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.findByRole(t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"getUserRoles",value:(v=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.getUserRoles(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"assignRole",value:(y=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.assignRole(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"unassignRole",value:(d=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.roles.unassignRole(t,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"describeUserClass",value:(s=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userClassProps()}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"enableUser",value:(n=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"ENABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"disableUser",value:(r=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.updateUserStatus(t,"DISABLED"));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"updateUserStatus",value:(t=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("User objectId must be non empty string");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("User Status must be a valid string");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.userStatus(t),data:{userStatus:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"getAuthorizationUrlLink",value:function(e,t,r,n,o,s){return this.app.request.post({url:this.app.urls.userAuthorizationURL(e),data:{fieldsMapping:t,permissions:r,redirect:n,redirectAfterLoginUrl:o,callbackUrlDomain:s}})}},{key:"loggedInUser",value:function(){return this.getCurrentUserId()}},{key:"getCurrentUserToken",value:function(){return this.currentUser&&this.currentUser["user-token"]?this.currentUser["user-token"]:this.app.LocalCache.get(this.app.LocalCache.Keys.USER_TOKEN)||null}},{key:"setCurrentUserToken",value:function(e){e=e||null,this.currentUser&&(this.currentUser["user-token"]=e),this.app.LocalCache.get("user-token")&&this.app.LocalCache.set("user-token",e),this.app.__RT&&this.app.RT.updateUserTokenIfNeeded()}},{key:"getCurrentUserId",value:function(){return this.currentUser?this.currentUser.objectId:this.app.LocalCache.get(this.app.LocalCache.Keys.CURRENT_USER_ID)||null}},{key:"getLocalCurrentUser",value:function(){return this.currentUser}},{key:"setLocalCurrentUser",value:function(e,t){return this.setCurrentUser(e,t)}}]),e}();t.default=y},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UsersUtils=void 0;var n={getClientUserLocale:function(){if("undefined"!=typeof navigator){return(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.userLanguage||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"").slice(0,2).toLowerCase()}}};t.UsersUtils=n},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(9)),i=n(r(4)),a=n(r(1)),u=n(r(2)),c=n(r(11)),l=function(){function e(t){(0,a.default)(this,e),this.users=t,this.app=t.app}var t,r,n,l,f;return(0,u.default)(e,[{key:"findByRole",value:(f=(0,i.default)(o.default.mark((function e(t,r,n){var i,a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Role Name must be a string and can not be empty");case 2:if(null==r||"boolean"==typeof r){e.next=4;break}throw new Error('The second argument "loadRoles" can be a boolean only');case 4:if(null==n||!Array.isArray(n)&&"object"===(0,s.default)(n)){e.next=6;break}throw new Error('The third argument "query" can be an instance of DataQueryBuilder or a plain object only');case 6:return i=[],"boolean"==typeof r&&i.push("loadRoles=".concat(r)),n&&i.push(c.default.toQueryString(n)),e.abrupt("return",this.app.request.get({url:this.app.urls.usersRole(t),queryString:i.join("&")}).then((function(e){return a.users.dataStore.parseResponse(e)})));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"getUserRoles",value:(l=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.userRoles(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"assignRole",value:(n=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,r,"assignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"unassignRole",value:(r=(0,i.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRole(t,r,"unassignRole"));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"changeRole",value:(t=(0,i.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||"number"==typeof t)){e.next=2;break}throw new Error("User identity must be a string or number and can not be empty.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Role Name must be a string and can not be empty.");case 4:return e.abrupt("return",this.app.request.post({url:this.app.urls.userRoleOperation(n),data:{user:t,roleName:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=l},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=n(r(15)),c=r(58),l=function(){function e(t){(0,i.default)(this,e),this.users=t,this.app=t.app}var t,r,n,l,d,h,y,v,m;return(0,a.default)(e,[{key:"loginWithFacebook",value:(m=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("facebook",t,r,null,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"loginWithGooglePlus",value:(v=(0,s.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("googleplus",t,r,n,s));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return v.apply(this,arguments)})},{key:"loginWithTwitter",value:(y=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.loginWithContainer("twitter",t,null,null,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"loginWithFacebookSdk",value:(h=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("facebook",t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"loginWithGooglePlusSdk",value:(d=(0,s.default)(o.default.mark((function e(t,r,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.sendWithAccessToken("googleplus",t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return d.apply(this,arguments)})},{key:"sendWithAccessToken",value:(l=(0,s.default)(o.default.mark((function e(t,r,n,s){var i=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&"string"==typeof r){e.next=2;break}throw new Error('"accessToken" must be non empty string.');case 2:return"boolean"==typeof n&&(s=n,n=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialLogin(t),data:{accessToken:r,fieldsMapping:n}}).then((function(e){return i.users.setCurrentUser(e,s)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return l.apply(this,arguments)})},{key:"loginWithContainer",value:(n=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a,u,l=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new c.SocialContainer(t,s),u=function(){return new Promise((function(e,t){f("message",window,(function r(n){if(n.origin===l.app.serverURL){var o=JSON.parse(n.data);o.fault?t(new Error(o.fault)):e(o),p("message",window,r),a.closeContainer()}}))}))},e.abrupt("return",this.app.request.post({url:this.app.urls.userSocialOAuth(t),data:{fieldsMapping:r||{},permissions:n||[]}}).then((function(e){return a.doAuthorizationActivity(e)})).catch((function(e){throw a.closeContainer(),e})).then(u).then((function(e){return l.users.setCurrentUser(e,i)})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o,s){return n.apply(this,arguments)})},{key:"loginWithOauth2",value:(r=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:return!n||n instanceof u.default||(i=s,s=n,n=void 0),"boolean"==typeof s&&(i=s,s=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:r,fieldsMapping:s,guestUser:n}}).then((function(e){return a.users.setCurrentUser(e,i)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,o,s){return r.apply(this,arguments)})},{key:"loginWithOauth1",value:(t=(0,s.default)(o.default.mark((function e(t,r,n,s,i,a){var c=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"providerCode" must be non empty string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error('"accessToken" must be non empty string.');case 4:if(n&&"string"==typeof n){e.next=6;break}throw new Error('"accessTokenSecret" must be non empty string.');case 6:return!s||s instanceof u.default||(a=i,i=s,s=void 0),"boolean"==typeof i&&(a=i,i=void 0),e.abrupt("return",this.app.request.post({url:this.app.urls.userOAuthLogin(t),data:{accessToken:r,accessTokenSecret:n,fieldsMapping:i,guestUser:s}}).then((function(e){return c.users.setCurrentUser(e,a)})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o,s,i){return t.apply(this,arguments)})}]),e}();function f(e,t,r){t.addEventListener?t.addEventListener(e,r,!1):t.attachEvent?t.attachEvent("on"+e,r):t[e]=r}function p(e,t,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.detachEvent&&t.detachEvent("on"+e,r),t[e]=null}t.default=l},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.SocialContainer=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(t,r){(0,o.default)(this,e),this.socialType=t,this.container=r,r?this.processContainer():this.createContainer()}return(0,s.default)(e,[{key:"processContainer",value:function(){var e,t=this,r=this.container[0]||this.container,n=document.createElement("div");n.innerHTML="Loading...",r.appendChild(n),r.style.cursor="wait",this.closeContainer=function(){r.style.cursor="default",r.removeChild(e)},this.removeLoading=function(){r.removeChild(n)},this.doAuthorizationActivity=function(n){t.removeLoading(),(e=document.createElement("iframe")).frameBorder=0,e.width=r.style.width,e.height=r.style.height,e.id="SocialAuthFrame",e.setAttribute("src",n+"&amp;output=embed"),r.appendChild(e),e.onload=function(){r.style.cursor="default"}}}},{key:"createContainer",value:function(){var e=window.open("",this.socialType+" authorization","resizable=yes, scrollbars=yes, titlebar=yes, top=10, left=10");e.document.getElementsByTagName("body")[0].innerHTML="Loading...",e.document.getElementsByTagName("html")[0].style.cursor="wait",this.closeContainer=function(){e.close()},this.doAuthorizationActivity=function(t){e.location.href=t,e.onload=function(){e.document.getElementsByTagName("html")[0].style.cursor="default"}}}}]),e}();t.SocialContainer=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=r(18),i=n(r(60)),a=n(r(61)),u=function e(t){(0,o.default)(this,e),this.app=t,this.ExecutionTypes=s.ExecutionTypes,this.CustomServices=new i.default(t),this.Events=new a.default(t)};t.default=u},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(6)),i=n(r(4)),a=n(r(1)),u=n(r(2)),c=r(18);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,s.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"invoke",value:(t=(0,i.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Service Name must be provided and must be a string.");case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("Method Name must be provided and must be a string.");case 4:return"string"==typeof s&&(s={executionType:s}),"string"==typeof n&&(0,c.isExecutionType)(n)&&(s={executionType:n},n=void 0),i=f({},(s=s||{}).httpRequestHeaders),s.executionType&&(i[c.EXECUTION_TYPE_HEADER]=s.executionType),e.abrupt("return",this.app.request.post({url:this.app.urls.blServiceMethod(t,r),data:n,headers:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o){return t.apply(this,arguments)})}]),e}();t.default=p},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(9)),i=n(r(4)),a=n(r(1)),u=n(r(2)),c=r(18),l=function(){function e(t){(0,a.default)(this,e),this.app=t}var t;return(0,u.default)(e,[{key:"dispatch",value:(t=(0,i.default)(o.default.mark((function e(t,r,n){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Event Name must be provided and must be a string.");case 2:if("string"==typeof r&&(0,c.isExecutionType)(r)&&(n=r,r=void 0),!r||"object"===(0,s.default)(r)&&!Array.isArray(r)){e.next=5;break}throw new Error("Event Arguments must be an object.");case 5:return i={},n&&(i[c.EXECUTION_TYPE_HEADER]=n),e.abrupt("return",this.app.request.post({url:this.app.urls.blEvent(t),data:r||{},headers:i}));case 8:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();t.default=l},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(6)),a=n(r(1)),u=n(r(2)),c=n(r(10)),l=n(r(15)),f=n(r(63)),p=n(r(11)),d=n(r(74)),h=n(r(33)),y=n(r(34)),v=n(r(36)),m=n(r(24)),g=n(r(39)),b=n(r(13)),k=n(r(22)),w=n(r(38)),E=n(r(37)),_=n(r(75)),O=function(){function e(t){(0,a.default)(this,e),this.app=t,this.classToTableMap=(0,i.default)({},l.default.className,l.default),this.Permissions={FIND:new _.default("FIND",t),REMOVE:new _.default("REMOVE",t),UPDATE:new _.default("UPDATE",t)},this.QueryBuilder=p.default,this.GroupQueryBuilder=d.default,this.LoadRelationsQueryBuilder=h.default,this.JSONUpdateBuilder=y.default,this.Point=v.default,this.LineString=m.default,this.Polygon=g.default,this.Geometry=b.default,this.GeoJSONParser=E.default,this.WKTParser=w.default,this.SpatialReferenceSystem=k.default}var t,r;return(0,u.default)(e,[{key:"of",value:function(e){return new f.default(e,this)}},{key:"describe",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="string"==typeof t?t:c.default.getClassName(t),e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableProps(t)}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getTableNameById",value:(t=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableNameById(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mapTableToClass",value:function(e,t){if("function"==typeof e&&(t=e,e=c.default.getClassName(t)),!e||"string"!=typeof e)throw new Error("Table Name must be provided and must be a string.");if(!t||"function"!=typeof t)throw new Error("Class must be provided and must be a constructor function.");this.classToTableMap[e]=t}}]),e}();t.default=O},function(e,t,r){"use strict";var n=r(0),o=r(9);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(27)),i=n(r(31)),a=n(r(3)),u=n(r(9)),c=n(r(4)),l=n(r(1)),f=n(r(2)),p=n(r(6)),d=n(r(10)),h=n(r(66)),y=n(r(11)),v=n(r(33)),m=n(r(34)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=w(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(21)),b=n(r(13)),k=["relationName","relationModel"];function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(w=function(e){return e?r:t})(e)}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e,t){var r=e instanceof y.default?e.toJSON():e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){(0,p.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):{};return r.pageSize=1,r.offset=0,r.sortBy||(r.sortBy=["created ".concat(t)]),y.default.toRequestBody(r)}var O=function(){function e(t,r){if((0,l.default)(this,e),this.app=r.app,this.classToTableMap=r.classToTableMap,"string"==typeof t?(this.className=t,this.model=this.classToTableMap[this.className]):(this.className=d.default.getClassName(t),this.model=this.classToTableMap[this.className]||t),!this.className)throw new Error("Class name should be specified")}var t,r,n,o,s,p,m,g,b,w,E,O,R,T,j,C,P,A;return(0,f.default)(e,[{key:"rt",value:function(){return this.rtHandlers=this.rtHandlers||new h.default(this)}},{key:"save",value:(A=(0,c.default)(a.default.mark((function e(t,r){var n,o=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r?this.app.urls.dataTableUpsert(this.className):this.app.urls.dataTable(this.className),e.abrupt("return",this.app.request.put({url:n,data:S(t)}).then((function(e){return o.parseResponse(e)})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"deepSave",value:(P=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataTableDeepSave(this.className),data:S(t)}).then((function(e){return r.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"remove",value:(C=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t&&t.objectId||t)&&"string"==typeof r){e.next=3;break}throw new Error("Object Id must be provided and must be a string.");case 3:return e.abrupt("return",this.app.request.delete({url:this.app.urls.dataTableObject(this.className,r)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"find",value:(j=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:y.default.toRequestBody(t)}).then((function(e){return r.parseResponse(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return j.apply(this,arguments)})},{key:"group",value:(T=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataGrouping(this.className),data:y.default.toRequestBody(t)}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"countInGroup",value:(R=(0,c.default)(a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.groupPath&&"object"===(0,u.default)(t.groupPath)){e.next=2;break}throw new Error("Group Path must be provided and must be an object.");case 2:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.dataGrouping(this.className),"/count"),data:y.default.toRequestBody(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"findById",value:(O=(0,c.default)(a.default.mark((function e(t,r){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||"object"!==(0,u.default)(t)||Array.isArray(t)){e.next=8;break}if(Object.keys(t).length){e.next=3;break}throw new Error("Provided object must have at least 1 primary keys.");case 3:return e.next=5,this.app.request.get({url:this.app.urls.dataTablePrimaryKey(this.className),query:t});case 5:n=e.sent,e.next=14;break;case 8:if(t&&"string"==typeof t){e.next=10;break}throw new Error("Object Id must be provided and must be a string or an object of primary keys.");case 10:return r&&(r.pageSize=null,r.offset=null),e.next=13,this.app.request.get({url:this.app.urls.dataTableObject(this.className,t),queryString:y.default.toQueryString(r)});case 13:n=e.sent;case 14:return e.abrupt("return",this.parseResponse(n));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"findFirst",value:(E=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:_(t,"asc")}).then((function(e){return r.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"findLast",value:(w=(0,c.default)(a.default.mark((function e(t){var r=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableFind(this.className),data:_(t,"desc")}).then((function(e){return r.parseResponse(e[0])})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"getObjectCount",value:(b=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=void 0,!t){e.next=9;break}if(!(t instanceof y.default)){e.next=7;break}r=t.getDistinct()||void 0,t=t.getWhereClause()||void 0,e.next=9;break;case 7:if("string"==typeof t){e.next=9;break}throw new Error("Condition must be a string or an instance of DataQueryBuilder.");case 9:return e.abrupt("return",this.app.request.post({url:this.app.urls.dataTableCount(this.className),data:{where:t,distinct:r}}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"loadRelations",value:(g=(0,c.default)(a.default.mark((function e(t,r){var n,o,s,u,c,l=this;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t&&t.objectId||t)&&"string"==typeof n){e.next=3;break}throw new Error("Parent Object Id must be provided and must be a string.");case 3:if(o=r instanceof v.default?r.toJSON():r,s=o.relationName,u=o.relationModel,c=(0,i.default)(o,k),s&&"string"==typeof s){e.next=6;break}throw new Error("Relation Name must be provided and must be a string.");case 6:return e.abrupt("return",this.app.request.get({url:this.app.urls.dataTableObjectRelation(this.className,n,s),queryString:v.default.toQueryString(c)}).then((function(e){return l.parseRelationsResponse(e,u)})));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"setRelation",value:(m=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.POST,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"addRelation",value:(p=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.PUT,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return p.apply(this,arguments)})},{key:"deleteRelation",value:(s=(0,c.default)(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.changeRelation(this.app.request.Methods.DELETE,t,r,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return s.apply(this,arguments)})},{key:"bulkCreate",value:(o=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)){e.next=3;break}throw new Error(r);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(r);return e})),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTable(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"bulkUpsert",value:(n=(0,c.default)(a.default.mark((function e(t){var r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="Objects must be provided and must be an array of objects.",t&&Array.isArray(t)&&t.length){e.next=3;break}throw new Error(r);case 3:return t=t.map((function(e){if(!e||"object"!==(0,u.default)(e)||Array.isArray(e))throw new Error(r);return e})),e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTableUpsert(this.className),data:t}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"bulkUpdate",value:(r=(0,c.default)(a.default.mark((function e(t,r){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Condition must be provided and must be a string.");case 2:if(r&&"object"===(0,u.default)(r)&&!Array.isArray(r)){e.next=4;break}throw new Error("Changes must be provided and must be an object.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.dataBulkTable(this.className),query:{where:t},data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"bulkDelete",value:(t=(0,c.default)(a.default.mark((function e(t){var r,n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&("string"==typeof t||Array.isArray(t))){e.next=2;break}throw new Error("Condition must be provided and must be a string or a list of objects.");case 2:return r={},"string"==typeof t?r.where=t:(n=t.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t)throw new Error('Can not transform "objects" to "whereClause". Item must be a string or an object with property "objectId" as string.');return"'".concat(t,"'")})),r.where="objectId in (".concat(n.join(","),")")),e.abrupt("return",this.app.request.post({url:this.app.urls.dataBulkTableDelete(this.className),data:r}));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"parseRelationsResponse",value:function(e,t){return x(e,t,this)}},{key:"parseResponse",value:function(e){return x(e,this.model,this)}},{key:"changeRelation",value:function(e,t,r,n){var o=t&&t.objectId||t;if(!o||"string"!=typeof o)throw new Error("Relation Parent must be provided and must be a string or an object with objectId property.");if(!r||"string"!=typeof r)throw new Error("Relation Column Name must be provided and must be a string.");if(!n||"string"!=typeof n&&!Array.isArray(n))throw new Error("Relation Children must be provided and must be a string or a list of objects.");var s={};"string"==typeof n?s.whereClause=n:s.childrenIds=n.map((function(e){var t=e&&e.objectId||e;if(!t||"string"!=typeof t)throw new Error("Child Id must be provided and must be a string.");return t}));var i={};return s.whereClause&&(i.whereClause=s.whereClause),this.app.request.send({method:e,url:this.app.urls.dataTableObjectRelation(this.className,o,r),query:i,data:s.childrenIds})}}]),e}();t.default=O;var S=function(e){return function e(t,r,n){for(var o in r)if(Array.isArray(r[o]))e(t,r[o],n[o]=[]);else if(!r[o]||"object"!==(0,u.default)(r[o])||r[o]instanceof b.default||r[o]instanceof m.default)n[o]=r[o];else if(r[o]instanceof Date)n[o]=r[o].getTime();else if(t.instancesMap.has(r[o])){var s=t.instancesMap.get(r[o]);s.__subID||(s.__subID=d.default.uuid()),n[o]={__originSubID:s.__subID}}else{var i=n[o]={};t.instancesMap.set(r[o],i),e(t,r[o],i)}return n}({instancesMap:new WeakMap},e,{})},x=function(){return function(e,t,n){if(!e)return e;var o={RootModel:t,app:n.app,classToTableMap:n.classToTableMap,subIds:{},postAssign:[]},i=Array.isArray(e)?e.map((function(e){return r(o,e)})):r(o,e);return function(e){e.postAssign.forEach((function(t){var r=(0,s.default)(t,3),n=r[0],o=r[1],i=r[2];n[o]=e.subIds[i]}))}(o),i};function e(e,r,n,o){Array.isArray(r[o])?t(e,r[o],n[o]=[]):r[o]&&"object"===(0,u.default)(r[o])?g.GEO_CLASSES.includes(r[o].___class)?n[o]=(0,g.default)(r[o]):r[o].__originSubID?e.postAssign.push([n,o,r[o].__originSubID]):function(e,r,n,o){var s=r[o].__subID;if(s&&e.subIds[s])n[o]=e.subIds[s],delete r[o].__subID;else{var i=e.classToTableMap[r[o].___class];!i&&e.app.useTableClassesFromGlobalScope&&d.default.globalScope[r[o].___class]&&(console.warn("Resolving DataTable classes from the global scope is deprecated and it won't be supported in the nearest future. Instead, you should register your DataTable classes using the following method Backendless.Data.mapTableToClass"),i=d.default.globalScope[r[o].___class]),n[o]=i?new i:{},s&&!e.subIds[s]&&(e.subIds[s]=n[o],delete r[o].__subID),t(e,r[o],n[o])}}(e,r,n,o):n[o]=r[o]}function t(t,r,n){for(var o in r)e(t,r,n,o)}function r(e,r){var n=e.RootModel||e.classToTableMap[r.___class],o=n?new n:{};if(r.__subID){if(e.subIds[r.__subID])return e.subIds[r.__subID];e.subIds[r.__subID]=o,delete r.__subID}return t(e,r,o),o}}()},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,s=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw o}}return s}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(12)),a=n(r(7)),u=n(r(8)),c=n(r(5)),l=r(16);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,c.default)(e);if(t){var o=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}var p="created",d="updated",h="deleted",y="upserted",v="bulk-created",m="bulk-updated",g="bulk-deleted",b="bulk-upserted",k="add",w="set",E="delete",_=[p,d,h,y],O=function(e){(0,a.default)(r,e);var t=f(r);function r(e){var n;return(0,o.default)(this,r),(n=t.call(this)).dataStore=e,n.app=e.app,n}return(0,s.default)(r,[{key:"getSubscriptionOptions",value:function(){return{tableName:this.dataStore.className}}},{key:"addCreateListener",value:function(e,t,r){this.addChangesListener(p,e,t,r)}},{key:"removeCreateListeners",value:function(e,t){this.removeChangesListeners(p,e,t)}},{key:"removeCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeCreateListeners(void 0,e)}},{key:"addUpsertListener",value:function(e,t,r){this.addChangesListener(y,e,t,r)}},{key:"removeUpsertListeners",value:function(e,t){this.removeChangesListeners(y,e,t)}},{key:"removeUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpsertListeners(void 0,e)}},{key:"addUpdateListener",value:function(e,t,r){this.addChangesListener(d,e,t,r)}},{key:"removeUpdateListeners",value:function(e,t){this.removeChangesListeners(d,e,t)}},{key:"removeUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeUpdateListeners(void 0,e)}},{key:"addDeleteListener",value:function(e,t,r){this.addChangesListener(h,e,t,r)}},{key:"removeDeleteListeners",value:function(e,t){this.removeChangesListeners(h,e,t)}},{key:"removeDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeDeleteListeners(void 0,e)}},{key:"addBulkCreateListener",value:function(e,t,r){this.addChangesListener(v,e,t,r)}},{key:"removeBulkCreateListeners",value:function(){this.removeChangesListeners(v)}},{key:"removeBulkCreateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(v,void 0,e)}},{key:"addBulkUpdateListener",value:function(e,t,r){this.addChangesListener(m,e,t,r)}},{key:"removeBulkUpdateListeners",value:function(e,t){this.removeChangesListeners(m,e,t)}},{key:"removeBulkUpdateListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkUpdateListeners(void 0,e)}},{key:"addBulkDeleteListener",value:function(e,t,r){this.addChangesListener(g,e,t,r)}},{key:"removeBulkDeleteListeners",value:function(e,t){this.removeChangesListeners(g,e,t)}},{key:"removeBulkDeleteListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeBulkDeleteListeners(void 0,e)}},{key:"addBulkUpsertListener",value:function(e,t,r){this.addChangesListener(b,e,t,r)}},{key:"removeBulkUpsertListeners",value:function(){this.removeChangesListeners(b)}},{key:"removeBulkUpsertListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeChangesListeners(b,void 0,e)}},{key:"addSetRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(w,e,t,r,n)}},{key:"removeSetRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(w,void 0,e)}},{key:"removeSetRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(w,e,t)}},{key:"addAddRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(k,e,t,r,n)}},{key:"removeAddRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(k,void 0,e)}},{key:"removeAddRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(k,e,t)}},{key:"addDeleteRelationListener",value:function(e,t,r,n){this.addRelationsChangesListener(E,e,t,r,n)}},{key:"removeDeleteRelationListener",value:function(e){if(!e||"function"!=typeof e)throw new Error("Listener Function must be passed.");this.removeRelationsChangesListeners(E,void 0,e)}},{key:"removeDeleteRelationListeners",value:function(e,t){this.removeRelationsChangesListeners(E,e,t)}},{key:"addChangesListener",value:function(e,t,r,n){if("function"==typeof t&&(n=r,r=t,t=void 0),"function"!=typeof r)throw new Error("Listener Function must be passed.");this.addSubscription(e,this.app.RT.subscriptions.onObjectsChanges,{callback:r,onError:n,parser:_.includes(e)?this.parseObjectToInstance.bind(this):void 0,params:{event:e,whereClause:t}})}},{key:"removeChangesListeners",value:function(e,t,r){"function"==typeof t&&(r=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var n=e.params;return t?n.whereClause===t:!r||e.callback===r}})}},{key:"addRelationsChangesListener",value:function(e,t,r,n,o){if(!t||"string"!=typeof t)throw new Error("Relation Column Name must be a string.");if("function"==typeof r&&(o=n,n=r,r=void 0),"function"!=typeof n)throw new Error("Listener Function must be passed.");if(r){if(!Array.isArray(r))throw new Error("Parent Objects must be an array");r=r.map((function(e){return e.objectId||e}))}this.addSubscription(e,this.app.RT.subscriptions.onRelationsChanges,{callback:n,onError:o,params:{event:e,relationColumnName:t,parentObjects:r}})}},{key:"removeRelationsChangesListeners",value:function(e,t,r){"function"==typeof t&&(r=t,t=void 0);this.stopSubscription(e,{matcher:function(e){var n=e.params;return t?n.relationColumnName===t:!r||e.callback===r}})}},{key:"removeAllListeners",value:function(){(0,i.default)((0,c.default)(r.prototype),"removeAllListeners",this).call(this)}},{key:"parseObjectToInstance",value:function(e){return this.dataStore.parseResponse(e)}}]),r}(l.RTListeners);t.default=O},function(e,t,r){var n=r(5);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){(function(t){var r,n,o,s;self,s=()=>(()=>{var e={"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js":e=>{e.exports=function(e,t,r,n,o){var s={};return Object.keys(n).forEach((function(e){s[e]=n[e]})),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),s),o&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(o):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/assertThisInitialized.js":e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/asyncToGenerator.js":e=>{function t(e,t,r,n,o,s,i){try{var a=e[s](i),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,s){var i=e.apply(r,n);function a(e){t(i,o,s,a,u,"next",e)}function u(e){t(i,o,s,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/classCallCheck.js":e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/createClass.js":e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/defineProperty.js":e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/get.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/superPropBase.js");function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var o=n(e,t);if(o){var s=Object.getOwnPropertyDescriptor(o,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/getPrototypeOf.js":e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/inherits.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/setPrototypeOf.js");e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/interopRequireDefault.js":e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/typeof.js").default,o=r("./node_modules/@babel/runtime/helpers/assertThisInitialized.js");e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/typeof.js").default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,s=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof h?t:h,s=Object.create(o.prototype),i=new x(n||[]);return s._invoke=function(e,t,r){var n="suspendedStart";return function(o,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw s;return{value:void 0,done:!0}}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=_(i,r);if(a){if(a===d)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,i),s}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var d={};function h(){}function y(){}function v(){}var m={};l(m,a,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(R([])));b&&b!==r&&s.call(b,a)&&(m=b);var k=v.prototype=h.prototype=Object.create(m);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,u){var c=p(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=p(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function R(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(s.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return y.prototype=v,l(k,"constructor",v),l(v,"constructor",y),y.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},w(E.prototype),l(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,s){void 0===s&&(s=Promise);var i=new E(f(e,r,n,o),s);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=R,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:R(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/setPrototypeOf.js":e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/superPropBase.js":(e,t,r)=>{var n=r("./node_modules/@babel/runtime/helpers/getPrototypeOf.js");e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/typeof.js":e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/regenerator/index.js":(e,t,r)=>{const n=r("./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},"./node_modules/after/index.js":e=>{function t(){}e.exports=function(e,r,n){var o=!1;return n=n||t,s.count=e,0===e?r():s;function s(e,t){if(s.count<=0)throw new Error("after called too many times");--s.count,e?(o=!0,r(e),r=n):0!==s.count||o||r(null,t)}}},"./node_modules/arraybuffer.slice/index.js":e=>{e.exports=function(e,t,r){var n=e.byteLength;if(t=t||0,r=r||n,e.slice)return e.slice(t,r);if(t<0&&(t+=n),r<0&&(r+=n),r>n&&(r=n),t>=n||t>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(e),s=new Uint8Array(r-t),i=t,a=0;i<r;i++,a++)s[a]=o[i];return s.buffer}},"./src/client.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/config.js")),c=n(r("./src/subscriptions.js")),l=n(r("./src/methods.js")),f=n(r("./src/session.js")),p=[a.NativeSocketEvents.CONNECTING,a.NativeSocketEvents.CONNECT,a.NativeSocketEvents.CONNECT_ERROR,a.NativeSocketEvents.DISCONNECT,a.NativeSocketEvents.RECONNECT_ATTEMPT],d=function(){function e(t){var r=this;(0,o.default)(this,e),(0,i.default)(this,"onConnectError",(function(){r.subscriptions.hasActivity()||r.methods.hasActivity()||(r.disconnect("There are no active subscriptions and methods"),r.connectible=!0)})),(0,i.default)(this,"connectOnMethod",(function(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];if(r.connectible){var s=r.provideConnection();r.connected&&s.then((function(t){return t[e].apply(t,n)}))}}})),(0,i.default)(this,"on",this.connectOnMethod("on")),(0,i.default)(this,"emit",this.connectOnMethod("emit")),(0,i.default)(this,"onSessionDisconnect",(function(){r.subscriptions.stop(),r.methods.stop(),delete r.session,r.provideConnection()})),(0,i.default)(this,"emitSocketEventListeners",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];r.socketEvents[e]&&r.socketEvents[e].forEach((function(e){return e.apply(void 0,n)}))})),(0,i.default)(this,"addConnectingEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECTING,e)})),(0,i.default)(this,"removeConnectingEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECTING,e)})),(0,i.default)(this,"addConnectEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECT,e)})),(0,i.default)(this,"removeConnectEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECT,e)})),(0,i.default)(this,"addConnectErrorEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.CONNECT_ERROR,e)})),(0,i.default)(this,"removeConnectErrorEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.CONNECT_ERROR,e)})),(0,i.default)(this,"addDisconnectEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.DISCONNECT,e)})),(0,i.default)(this,"removeDisconnectEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.DISCONNECT,e)})),(0,i.default)(this,"addReconnectAttemptEventListener",(function(e){return r.addSocketEventListener(a.NativeSocketEvents.RECONNECT_ATTEMPT,e)})),(0,i.default)(this,"removeReconnectAttemptEventListener",(function(e){return r.removeSocketEventListener(a.NativeSocketEvents.RECONNECT_ATTEMPT,e)})),(0,i.default)(this,"removeConnectionListeners",(function(){p.forEach((function(e){return r.removeSocketEventListener(e)}))})),this.config=new u.default(t),this.resetSocketEvents();var n={onMessage:this.on.bind(this),emitMessage:this.emit.bind(this)};this.subscriptions=new c.default(n),this.methods=new l.default(n),this.connectible=!0,this.connected=!1}return(0,s.default)(e,[{key:"resetSocketEvents",value:function(){this.socketEvents={},this.addConnectErrorEventListener(this.onConnectError)}},{key:"setConfig",value:function(e){this.config.set(e),this.session&&(this.disconnect("Re-config socket connection"),this.connect())}},{key:"provideConnection",value:function(){var e=this;return this.session||(this.session=new f.default(this.config,this.emitSocketEventListeners,this.onSessionDisconnect),this.session.getSocket().then((function(){e.connected=!0,e.methods.initialize(),e.methods.restore(),e.subscriptions.initialize(),e.subscriptions.restore()}))),this.session.getSocket()}},{key:"connect",value:function(){this.connectible=!0,this.provideConnection()}},{key:"disconnect",value:function(e){this.session&&(this.subscriptions.stop(),this.methods.stop(),this.session.terminate(),delete this.session,this.emitSocketEventListeners(a.NativeSocketEvents.DISCONNECT,e||"disconnected by client")),this.connectible=!1,this.connected=!1}},{key:"terminate",value:function(e){this.resetSocketEvents(),this.subscriptions.reset(),this.methods.reset(),this.disconnect(e||"Terminated by client")}},{key:"addSocketEventListener",value:function(e,t){return this.socketEvents[e]=this.socketEvents[e]||[],this.socketEvents[e].push(t),this}},{key:"removeSocketEventListener",value:function(e,t){return this.socketEvents[e]&&(this.socketEvents[e]=t?this.socketEvents[e].filter((function(e){return e!==t})):[],this.socketEvents[e].length||delete this.socketEvents[e]),this}}]),e}();t.default=d},"./src/config.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/regenerator/index.js")),s=n(r("./node_modules/@babel/runtime/helpers/asyncToGenerator.js")),i=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),a=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),u=n(r("./node_modules/@babel/runtime/helpers/typeof.js")),c=n(r("./node_modules/backendless-request/dist/backendless-request.js")),l=function(e){return void 0===e},f=function(e){return"string"==typeof e},p=function(e){return"function"==typeof e},d=function(e){return"object"===(0,u.default)(e)&&null!==e},h=function(){function e(t){(0,i.default)(this,e),this.appId=null,this.lookupPath=null,this.lookupHeaders={},this.debugMode=!1,this.connectQuery={},this.socketConfigTransform=null,this.socketConfig=null,this.set(t)}var t;return(0,a.default)(e,[{key:"set",value:function(e){if(e){if(!l(e.appId)){if(!f(e.appId))throw new Error('"appId" must be String.');this.appId=e.appId}if(!l(e.lookupPath)){if(!f(e.lookupPath))throw new Error('"lookupPath" must be String.');this.lookupPath=e.lookupPath}if(!l(e.lookupHeaders)){if(!d(e.lookupHeaders))throw new Error('"lookupHeaders" must be Object.');this.lookupHeaders=e.lookupHeaders}if(l(e.debugMode)||(this.debugMode=!!e.debugMode),!l(e.connectQuery))if(p(e.connectQuery))this.getConnectQuery=e.connectQuery;else{if(!d(e.connectQuery))throw new Error('"connectQuery" must be Function or Object.');this.connectQuery=e.connectQuery}if(!l(e.socketConfigTransform)){if(!p(e.socketConfigTransform))throw new Error('"socketConfigTransform" must be Function.');this.socketConfigTransform=e.socketConfigTransform}}}},{key:"getConnectQuery",value:function(){return this.connectQuery}},{key:"prepare",value:(t=(0,s.default)(o.default.mark((function e(){var t,r,n,s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f(this.lookupPath)){e.next=2;break}throw new Error("lookupPath must be String");case 2:return e.next=4,c.default.get(this.lookupPath).set(this.lookupHeaders);case 4:if(t=e.sent,r=this.appId?"".concat(t,"/").concat(this.appId):t,n=this.appId?"/".concat(this.appId):void 0,s=this.getConnectQuery(),this.socketConfig={host:t,url:r,options:{path:n,query:s,forceNew:!0,autoConnect:!1,reconnection:!1}},!this.socketConfigTransform){e.next=14;break}return e.next=12,this.socketConfigTransform(this.socketConfig);case 12:(i=e.sent)&&(this.socketConfig=i);case 14:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getSocketConfig",value:function(){return this.socketConfig}}]),e}();t.default=h},"./src/constants.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RTSubscriptionTypes=t.RTSocketEvents=t.RTMethodTypes=t.NativeSocketEvents=void 0,t.NativeSocketEvents={CONNECTING:"connecting",CONNECT:"connect",CONNECT_ERROR:"connect_error",CONNECT_TIMEOUT:"connect_timeout",DISCONNECT:"disconnect",RECONNECT:"reconnect",RECONNECT_ATTEMPT:"reconnect_attempt",RECONNECTING:"reconnecting",RECONNECT_ERROR:"reconnect_error",RECONNECT_FAILED:"reconnect_failed",ERROR:"error",PING:"ping",PONG:"pong"},t.RTSocketEvents={SUB_ON:"SUB_ON",SUB_OFF:"SUB_OFF",SUB_RES:"SUB_RES",SUB_READY:"SUB_READY",MET_REQ:"MET_REQ",MET_RES:"MET_RES"},t.RTSubscriptionTypes={OBJECTS_CHANGES:"OBJECTS_CHANGES",RELATIONS_CHANGES:"RELATIONS_CHANGES",PUB_SUB_CONNECT:"PUB_SUB_CONNECT",PUB_SUB_MESSAGES:"PUB_SUB_MESSAGES",PUB_SUB_COMMANDS:"PUB_SUB_COMMANDS",PUB_SUB_USERS:"PUB_SUB_USERS",RSO_CONNECT:"RSO_CONNECT",RSO_CHANGES:"RSO_CHANGES",RSO_CLEARED:"RSO_CLEARED",RSO_COMMANDS:"RSO_COMMANDS",RSO_INVOKE:"RSO_INVOKE",RSO_USERS:"RSO_USERS",LOGGING_MESSAGES:"LOGGING_MESSAGES",CONSOLE_MESSAGES:"CONSOLE_MESSAGES",DEVELOPER_MESSAGES:"DEVELOPER_MESSAGES"},t.RTMethodTypes={SET_USER_TOKEN:"SET_USER_TOKEN",RSO_GET:"RSO_GET",RSO_SET:"RSO_SET",RSO_CLEAR:"RSO_CLEAR",RSO_COMMAND:"RSO_COMMAND",RSO_INVOKE:"RSO_INVOKE",PUB_SUB_COMMAND:"PUB_SUB_COMMAND"}},"./src/index.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RTScopeConnector=t.RTListeners=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/typeof.js")),s=n(r("./node_modules/backendless-request/dist/backendless-request.js")),i=n(r("./src/client.js")),a=n(r("./src/listeners.js")),u=n(r("./src/scope-connector.js")),c="object"===("undefined"==typeof self?"undefined":(0,o.default)(self))&&self.self===self&&self||"object"===(void 0===r.g?"undefined":(0,o.default)(r.g))&&r.g.global===r.g&&r.g;i.default.Request=s.default,i.default.Listeners=a.default,i.default.ScopeConnector=u.default,c&&(c.BackendlessRTClient=i.default),e.exports=i.default;var l=i.default;t.default=l;var f=a.default;t.RTListeners=f;var p=u.default;t.RTScopeConnector=p},"./src/listeners.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),s=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),i=n(r("./node_modules/@babel/runtime/helpers/createClass.js"));function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,o.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var c=function(){function e(){(0,s.default)(this,e),this.subscriptions={},this.simpleListeners={}}return(0,i.default)(e,[{key:"addSubscription",value:function(e,t,r){var n=this,o=r.callback,s=r.onError,i=r.onReady,a=r.parser,c=r.params;this.subscriptions[e]=this.subscriptions[e]||[];var l=t(u(u({},c),this.getSubscriptionOptions()),{parser:a,onData:o,onError:s,onReady:i,onStop:function(){n.subscriptions[e]=n.subscriptions[e].filter((function(e){return e.subscription!==l}))}}),f={callback:o,params:c,subscription:l,stop:function(){return l.stop()}};return this.subscriptions[e].push(f),f}},{key:"getSubscriptionOptions",value:function(){return{}}},{key:"stopSubscription",value:function(e,t){var r=t.callback,n=t.matcher,o=this.subscriptions[e]=this.subscriptions[e]||[];n?o.forEach((function(e){n(e)&&e.subscription.stop()})):o.forEach((function(e){r&&e.callback!==r||e.subscription.stop()}))}},{key:"addSimpleListener",value:function(e,t){(this.simpleListeners[e]=this.simpleListeners[e]||[]).push(t)}},{key:"removeSimpleListener",value:function(e,t){this.simpleListeners[e]&&(this.simpleListeners[e]=t?this.simpleListeners[e].filter((function(e){return e!==t})):[])}},{key:"runSimpleListeners",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.simpleListeners[e]&&this.simpleListeners[e].forEach((function(e){return e.apply(void 0,r)}))}},{key:"removeAllListeners",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].forEach((function(e){return e.subscription.stop()}))})),this.simpleListeners={}}}]),e}();t.default=c},"./src/methods.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/utils.js")),c=function(e){return function(t){return this.send(e,t)}},l=function(){function e(t){var r=this,n=t.onMessage,s=t.emitMessage;(0,o.default)(this,e),(0,i.default)(this,"sendRequest",(function(e){r.invocations[e]&&r.emitMessage(a.RTSocketEvents.MET_REQ,r.invocations[e].data)})),(0,i.default)(this,"onResponse",(function(e){var t=e.id,n=e.error,o=e.result;if(r.invocations[t]){var s=r.invocations[t];n?s.reject(n):s.resolve(o),delete r.invocations[t]}})),(0,i.default)(this,"setUserToken",c(a.RTMethodTypes.SET_USER_TOKEN).bind(this)),(0,i.default)(this,"sendPubSubCommand",c(a.RTMethodTypes.PUB_SUB_COMMAND).bind(this)),(0,i.default)(this,"getRSO",c(a.RTMethodTypes.RSO_GET).bind(this)),(0,i.default)(this,"setRSO",c(a.RTMethodTypes.RSO_SET).bind(this)),(0,i.default)(this,"clearRSO",c(a.RTMethodTypes.RSO_CLEAR).bind(this)),(0,i.default)(this,"sendRSOCommand",c(a.RTMethodTypes.RSO_COMMAND).bind(this)),(0,i.default)(this,"invokeRSOMethod",c(a.RTMethodTypes.RSO_INVOKE).bind(this)),this.onMessage=n,this.emitMessage=s,this.invocations={}}return(0,s.default)(e,[{key:"initialize",value:function(){this.onMessage(a.RTSocketEvents.MET_RES,this.onResponse)}},{key:"restore",value:function(){var e=this;Object.keys(this.invocations).forEach((function(t){e.sendRequest(t)}))}},{key:"stop",value:function(){}},{key:"reset",value:function(){this.invocations={}}},{key:"hasActivity",value:function(){return!!Object.keys(this.invocations).length}},{key:"send",value:function(e,t){var r=this,n=u.default.generateUID();return this.invocations[n]={data:{id:n,name:e,options:t}},this.sendRequest(n),new Promise((function(e,t){r.invocations[n].resolve=e,r.invocations[n].reject=t}))}}]),e}();t.default=l},"./src/scope-connector.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),p=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),d=n(r("./node_modules/@babel/runtime/helpers/get.js")),h=n(r("./node_modules/@babel/runtime/helpers/inherits.js")),y=n(r("./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")),v=n(r("./node_modules/@babel/runtime/helpers/getPrototypeOf.js")),m=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),g=n(r("./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js")),b=n(r("./src/listeners.js"));function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){(0,m.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,v.default)(e);if(t){var o=(0,v.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,y.default)(this,r)}}var _="CONNECT",O="ERROR",S="COMMAND",x="USER_STATUS",R=(o=T(),s=T(),i=T(),a=T(),u=T(!0),l=function(e){(0,h.default)(r,e);var t=E(r);function r(e){var n;return(0,f.default)(this,r),(n=t.call(this)).options=e,n.waitConnection=[],n.connect(),n}return(0,p.default)(r,[{key:"connectSubscriber",get:function(){return null}},{key:"commandSubscriber",get:function(){return null}},{key:"usersSubscriber",get:function(){return null}},{key:"commandSender",get:function(){return null}},{key:"connect",value:function(){var e=this;this.isConnected()||(this.connection=this.connectSubscriber(this.getScopeOptions(),{onError:function(t){return e.onError(t)},onReady:function(){return e.onConnect()},onStop:function(){return e.onDisconnect()}}))}},{key:"disconnect",value:function(){this.isConnected()&&this.connection.stop()}},{key:"isConnected",value:function(){return!!this.connection&&this.connection.isReady()}},{key:"getSubscriptionOptions",value:function(){return this.getScopeOptions()}},{key:"getScopeOptions",value:function(){return this.options}},{key:"onConnect",value:function(){this.waitConnection.forEach((function(e){return e()})),this.waitConnection=[],this.runSimpleListeners(_)}},{key:"onError",value:function(e){this.runSimpleListeners(O,e)}},{key:"onDisconnect",value:function(){this.connection=null}},{key:"removeAllListeners",value:function(){return this.waitConnection=[],(0,d.default)((0,v.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"addConnectListener",value:function(e,t){return this.addSimpleListener(_,e),t&&this.addSimpleListener(O,t),this}},{key:"removeConnectListeners",value:function(e,t){return this.removeSimpleListener(_,e),t&&this.removeSimpleListener(O,t),this}},{key:"addCommandListener",value:function(e,t){return this.addSubscription(S,this.commandSubscriber,{callback:e,onError:t}),this}},{key:"removeCommandListeners",value:function(e){return this.stopSubscription(S,{callback:e}),this}},{key:"addUserStatusListener",value:function(e,t){return this.addSubscription(x,this.usersSubscriber,{callback:e,onError:t}),this}},{key:"removeUserStatusListeners",value:function(e){return this.stopSubscription(x,{callback:e}),this}},{key:"send",value:function(e,t){return this.commandSender(w(w({},this.getScopeOptions()),{},{type:e,data:t}))}}]),r}(b.default),(0,m.default)(l,"connectionRequired",T),c=l,(0,g.default)(c.prototype,"addCommandListener",[o],Object.getOwnPropertyDescriptor(c.prototype,"addCommandListener"),c.prototype),(0,g.default)(c.prototype,"removeCommandListeners",[s],Object.getOwnPropertyDescriptor(c.prototype,"removeCommandListeners"),c.prototype),(0,g.default)(c.prototype,"addUserStatusListener",[i],Object.getOwnPropertyDescriptor(c.prototype,"addUserStatusListener"),c.prototype),(0,g.default)(c.prototype,"removeUserStatusListeners",[a],Object.getOwnPropertyDescriptor(c.prototype,"removeUserStatusListeners"),c.prototype),(0,g.default)(c.prototype,"send",[u],Object.getOwnPropertyDescriptor(c.prototype,"send"),c.prototype),c);function T(e){return function(t,r,n){var o=n.value;return n.value=function(){var t=arguments,r=this,n=function(){return o.apply(r,t)};return this.isConnected()?n():e?new Promise((function(e,t){return r.waitConnection.push((function(){return n().then(e,t)}))})):(this.waitConnection.push(n),this)},n}}t.default=R},"./src/session.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=r("./src/constants.js"),a=n(r("./src/socket.js")),u=function(){function e(t,r,n){(0,o.default)(this,e),this.config=t,this.dispatch=r,this.onDisconnect=n,this.connectAttempt=0,this.socketPromise=this.connect()}return(0,s.default)(e,[{key:"terminate",value:function(){this.terminated||(this.terminated=!0,this.dispatch=function(){},this.socketPromise.then((function(e){e&&e.close()})))}},{key:"getSocket",value:function(){var e=this;return this.socketPromise.then((function(t){return e.terminated?new Promise((function(){})):t}))}},{key:"connect",value:function(){var e=this;if(!this.terminated){this.connectAttempt=this.connectAttempt+1;var t=this.getNextReconnectionTimeout();return this.onConnecting(),this.connectAttempt>1&&this.onReconnectAttempt(this.connectAttempt-1,t),a.default.connect(this.config,this.onSocketDisconnect.bind(this)).then((function(t){return e.connectAttempt=0,e.onConnect(),t})).catch((function(r){if(e.onConnectError(r),!e.terminated)return(n=t,new Promise((function(e){return setTimeout(e,n)}))).then((function(){return e.connect()}));var n}))}}},{key:"getNextReconnectionTimeout",value:function(){var e=Math.ceil(this.connectAttempt/10),t=200*Math.pow(2,e);return Math.min(t,6e4)}},{key:"onSocketDisconnect",value:function(e){this.dispatch(i.NativeSocketEvents.DISCONNECT,e),this.terminated||(this.terminate(),this.onDisconnect())}},{key:"onConnecting",value:function(){this.dispatch(i.NativeSocketEvents.CONNECTING)}},{key:"onConnect",value:function(){this.dispatch(i.NativeSocketEvents.CONNECT)}},{key:"onConnectError",value:function(e){this.dispatch(i.NativeSocketEvents.CONNECT_ERROR,e&&e.message||e)}},{key:"onReconnectAttempt",value:function(e,t){this.dispatch(i.NativeSocketEvents.RECONNECT_ATTEMPT,e,t)}}]),e}();t.default=u},"./src/socket-parser.js":(e,t,r)=>{"use strict";var n=r("./node_modules/component-emitter/index.js");function o(){}function s(e){var r=""+e.type;return t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(r+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(r+=e.nsp+","),null!=e.id&&(r+=e.id),null!=e.data&&(r+=JSON.stringify(e.data)),r}function i(){}function a(){return{type:t.ERROR,data:"parser error"}}t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=o,t.Decoder=i,o.prototype.encode=function(e,t){t([s(e)])},n(i.prototype),i.prototype.add=function(e){if("string"!=typeof e)throw new Error("Unknown type: "+e);this.emit("decoded",function(e){var r=0,n={type:Number(e.charAt(0))};if(null==t.types[n.type])return a();if(t.BINARY_EVENT===n.type||t.BINARY_ACK===n.type){for(var o="";"-"!==e.charAt(++r)&&(o+=e.charAt(r),r!=e.length););if(o!=Number(o)||"-"!==e.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(r+1))for(n.nsp="";++r&&","!==(i=e.charAt(r))&&(n.nsp+=i,r!==e.length););else n.nsp="/";var s=e.charAt(r+1);if(""!==s&&Number(s)==s){for(n.id="";++r;){var i;if(null==(i=e.charAt(r))||Number(i)!=i){--r;break}if(n.id+=e.charAt(r),r===e.length)break}n.id=Number(n.id)}return e.charAt(++r)&&(n=function(e,t){try{e.data=JSON.parse(t)}catch(e){return a()}return e}(n,e.substr(r))),n}(e))},i.prototype.destroy=function(){}},"./src/socket.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=r("./src/constants.js"),a=function(){function e(t,n){(0,o.default)(this,e);var s=r("./node_modules/socket.io-client/lib/index.js");this.config=t,this.events={};var i=t.getSocketConfig(),a=i.url,u=i.options;this.ioSocket=s(a,u)}return(0,s.default)(e,[{key:"connect",value:function(){this.ioSocket.connect()}},{key:"close",value:function(){this.events={},this.ioSocket.off(),this.ioSocket.close()}},{key:"on",value:function(e,t){var r=this;this.events[e]||this.ioSocket.on(e,(function(t){return r.onEvent(e,t)})),this.events[e]=this.events[e]||[],this.events[e].push(t)}},{key:"off",value:function(e,t){this.events[e]=t?this.events[e].filter((function(e){return e!==t})):[],this.events[e].length||delete this.events[e],this.events[e]||this.ioSocket.off(e)}},{key:"onEvent",value:function(e,t){this.config.debugMode&&u("FROM SERVER",e,t),this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"emit",value:function(e,t){this.config.debugMode&&u("TO SERVER",e,t),this.ioSocket.emit(e,t)}}],[{key:"connect",value:function(t,r){return Promise.resolve().then((function(){return t.prepare()})).then((function(){return new Promise((function(r,n){var o=new e(t);function s(e){o.close(),n(e)}o.on(i.NativeSocketEvents.CONNECT,(function(){r(o)})),o.on(i.NativeSocketEvents.CONNECT_ERROR,s),o.on(i.NativeSocketEvents.CONNECT_TIMEOUT,s),o.on(i.NativeSocketEvents.ERROR,s),o.connect()}))})).then((function(e){return e.on(i.NativeSocketEvents.DISCONNECT,r),e}))}}]),e}();function u(e,t,r){console.log("[".concat(e,"] - [event: ").concat(t,"] - arguments: ").concat(JSON.stringify(r)," "))}t.default=a},"./src/subscriptions.js":(e,t,r)=>{"use strict";var n=r("./node_modules/@babel/runtime/helpers/interopRequireDefault.js");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r("./node_modules/@babel/runtime/helpers/classCallCheck.js")),s=n(r("./node_modules/@babel/runtime/helpers/createClass.js")),i=n(r("./node_modules/@babel/runtime/helpers/defineProperty.js")),a=r("./src/constants.js"),u=n(r("./src/utils.js")),c=function(e){return function(t,r){return this.subscribe(e,t,r)}},l=function(){function e(t){var r=t.onMessage,n=t.emitMessage;(0,o.default)(this,e),(0,i.default)(this,"onObjectsChanges",c(a.RTSubscriptionTypes.OBJECTS_CHANGES).bind(this)),(0,i.default)(this,"onRelationsChanges",c(a.RTSubscriptionTypes.RELATIONS_CHANGES).bind(this)),(0,i.default)(this,"connectToPubSub",c(a.RTSubscriptionTypes.PUB_SUB_CONNECT).bind(this)),(0,i.default)(this,"onPubSubMessage",c(a.RTSubscriptionTypes.PUB_SUB_MESSAGES).bind(this)),(0,i.default)(this,"onPubSubCommand",c(a.RTSubscriptionTypes.PUB_SUB_COMMANDS).bind(this)),(0,i.default)(this,"onPubSubUserStatus",c(a.RTSubscriptionTypes.PUB_SUB_USERS).bind(this)),(0,i.default)(this,"connectToRSO",c(a.RTSubscriptionTypes.RSO_CONNECT).bind(this)),(0,i.default)(this,"onRSOChanges",c(a.RTSubscriptionTypes.RSO_CHANGES).bind(this)),(0,i.default)(this,"onRSOClear",c(a.RTSubscriptionTypes.RSO_CLEARED).bind(this)),(0,i.default)(this,"onRSOCommand",c(a.RTSubscriptionTypes.RSO_COMMANDS).bind(this)),(0,i.default)(this,"onRSOInvoke",c(a.RTSubscriptionTypes.RSO_INVOKE).bind(this)),(0,i.default)(this,"onRSOUserStatus",c(a.RTSubscriptionTypes.RSO_USERS).bind(this)),(0,i.default)(this,"onLoggingMessages",c(a.RTSubscriptionTypes.LOGGING_MESSAGES).bind(this)),(0,i.default)(this,"onConsoleMessages",c(a.RTSubscriptionTypes.CONSOLE_MESSAGES).bind(this)),(0,i.default)(this,"onDeveloperMessage",c(a.RTSubscriptionTypes.DEVELOPER_MESSAGES).bind(this)),this.onMessage=r,this.emitMessage=n,this.subscriptions={}}return(0,s.default)(e,[{key:"initialize",value:function(){var e=this;this.onMessage(a.RTSocketEvents.SUB_READY,(function(t){return e.onSubscriptionReady(t)})),this.onMessage(a.RTSocketEvents.SUB_RES,(function(t){return e.onSubscriptionResponse(t)}))}},{key:"stop",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.subscriptions[t].ready=!1}))}},{key:"reset",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){return e.stopSubscription(t)}))}},{key:"restore",value:function(){var e=this;Object.keys(this.subscriptions).forEach((function(t){e.startSubscription(t)}))}},{key:"hasActivity",value:function(){return!!Object.keys(this.subscriptions).length}},{key:"subscribe",value:function(e,t,r){var n=this,o=r.parser,s=r.onData,i=r.onError,a=r.onStop,c=r.onReady,l=u.default.generateUID();return this.subscriptions[l]={data:{id:l,name:e,options:t},ready:!1,parser:o,onData:s,onError:i,onStop:a,onReady:c},this.startSubscription(l),{isReady:function(){return!!n.subscriptions[l]&&n.subscriptions[l].ready},stop:function(){n.subscriptions[l]&&n.offSubscription(l)}}}},{key:"startSubscription",value:function(e){var t=this.subscriptions[e];this.emitMessage(a.RTSocketEvents.SUB_ON,t.data)}},{key:"stopSubscription",value:function(e){var t=this.subscriptions[e];t&&(t.onStop&&t.onStop(),delete this.subscriptions[e])}},{key:"offSubscription",value:function(e){this.subscriptions[e]&&(this.emitMessage(a.RTSocketEvents.SUB_OFF,{id:e}),this.stopSubscription(e))}},{key:"onSubscriptionReady",value:function(e){var t=e.id,r=this.subscriptions[t];r&&!r.ready&&(r.ready=!0,r.onReady&&r.onReady())}},{key:"onSubscriptionResponse",value:function(e){var t=e.id,r=e.data,n=e.error,o=this.subscriptions[t];o&&(n?(o.onError&&o.onError(n),this.stopSubscription(t)):(o.ready||(o.ready=!0,o.onReady&&o.onReady()),o.onData&&("function"==typeof o.parser&&(r=o.parser(r)),o.onData(r))))}}]),e}();t.default=l},"./src/utils.js":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n={generateUID:function(){for(var e="",t=0;t<8;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e+Date.now()}};t.default=n},"./node_modules/backendless-request/dist/backendless-request.js":function(e,t){var s;"undefined"!=typeof self&&self,s=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.castArray=function(e){return Array.isArray(e)?e:[e]},t.isObject=function(e){return null!=e&&"object"===(void 0===e?"undefined":n(e))},t.isFormData=function(e){return e&&e.constructor&&0===e.constructor.toString().trim().indexOf("function FormData")},t.isStream=function(e){return e instanceof r(6).Stream}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=c(r(3)),i=c(r(4)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(5)),u=r(0);function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=new s.default(6e4),h=function(e){function t(e){l(this,t);var r,n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=502===(r=e).status?"No connection with server":r.body||"Status Code "+r.status+" ("+r.statusText+")";return n.message=o.message||o,n.code=o.code,n.status=e.status,n.headers=e.headers,n.body=e.body,n}return p(t,Error),t}();function y(e){try{return o({},e,{body:JSON.parse(e.body)})}catch(t){return e}}var v=function(e,t,r,n,o,s){return new Promise((function(i,a){var u=new b.XMLHttpRequest;u.timeout=s,o||(u.responseType="arraybuffer"),u.open(t.toUpperCase(),e,!0),u.onload=function(){var e,t,r=(e=u.getAllResponseHeaders(),t={},e?(e.split("\n").forEach((function(e){var r=e.indexOf(":"),n=e.substr(0,r).trim(),o=e.substr(r+1).trim();n&&(t[n]=t[n]?t[n]+", "+o:o)})),t):t),n=u,s={status:n.status,statusText:n.statusText,headers:r};"utf8"===o?s.body=u.response||u.responseText:u.response&&(s.body=new Uint8Array(u.response)),i(s),u=null},u.onerror=function(){a(new Error("Network Error")),u=null},u.ontimeout=function(){a(new Error("Connection aborted due to timeout")),u=null},Object.keys(r).forEach((function(e){u.setRequestHeader(e,r[e])})),u.send(n)}))},m=function(e,t,n,s,i,a){return new Promise((function(c,l){var f=r(7).parse(e),p=(0,u.isFormData)(s)&&s,d="https:"===f.protocol,h={host:f.hostname,port:f.port||(d?443:80),path:f.path,method:t,headers:n,timeout:a},y=function(){var e=r(1).Buffer,t=r(d?8:9).request(h,(function(t){var r=[],n=[],o=0,s="",a=t.statusCode,u=t.statusMessage,f=t.headers;t.on("data",(function(t){e.isBuffer(t)?t.length&&(o+=t.length,n.push(t)):r.push(t)})),t.on("end",(function(){o?(s=e.concat(n,o),null!=i&&(s=s.toString(i))):r.length&&(s=r.join()),c({status:a,statusText:u,headers:f,body:s})})),t.on("error",l)}));if(t.on("error",l),t.on("timeout",(function(){t.destroy(new Error("Connection aborted due to timeout"))})),s){if((0,u.isStream)(s))return void s.pipe(t);t.write(s)}t.end()};if(p)o(h.headers,p.getHeaders()),p.getLength((function(e,t){e||isNaN(t)||(h.headers["content-length"]=t),y()}));else{if(s&&!h.headers["content-length"]){var v=r(1).Buffer;h.headers["content-length"]=v.byteLength(s)}y()}}))};function g(e){if(e.status>=200&&e.status<300)return e;throw new h(e)}var b=function(t){function r(e,t,n){l(this,r);var o=f(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return o.method=t,o.path=e,o.body=n,o.tags=void 0,o.unwrap=!0,o.cacheTTL=0,o.headers={},o.queryParams={},o.encoding="utf8",o.timeout=0,o}return p(r,t),n(r,[{key:"set",value:function(e,t){if((0,u.isObject)(e))for(var r in e)this.set(r,e[r]);else void 0!==t&&(this.headers[e]=t);return this}},{key:"cacheTags",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.tags=t,this}},{key:"query",value:function(e){return o(this.queryParams,e),this}},{key:"form",value:function(t){var r=this;if(t){var n=e.exports.FormData;t instanceof n?this.body=t:function(){var e=new n,o=function(r){r&&(0,u.castArray)(t[r]).forEach((function(t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?e.append(r,t.value,t.options):e.append(r,t)}))};for(var s in t)o(s);r.body=e}()}return this}},{key:"useCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15e3;return this.cacheTTL=e,this}},{key:"resetCache",value:function(e){return e&&this.tags&&d.deleteByTags(this.tags),this}},{key:"type",value:function(e){return this.set("Content-Type",e),this}},{key:"unwrapBody",value:function(e){return this.unwrap=e,this}},{key:"setEncoding",value:function(e){return this.encoding=e,this}},{key:"setTimeout",value:function(e){return this.timeout=e,this}},{key:"send",value:function(e){var t=this;this.emit("request",this);var n=this.path,o=a.stringify(this.queryParams);if(o&&(n+="?"+o),this.cacheTTL){var s=d.get(n);if(void 0!==s)return Promise.resolve(s)}this.headers["Content-Type"]||!(0,u.isObject)(e)||(0,u.isFormData)(e)||this.type("application/json"),e&&(e="application/json"===this.headers["Content-Type"]&&"string"!=typeof e?JSON.stringify(e):e),r.verbose&&console.log(this.method.toUpperCase(),decodeURIComponent(n),e,this.headers);var i=r.send(n,this.method.toUpperCase(),this.headers,e,this.encoding,this.timeout).then(y).then(g).then((function(e){return t.unwrap?e.body:e})).then((function(e){return t.cacheTTL&&d.set(n,e,t.tags,t.cacheTTL),e})).then((function(e){return t.tags&&"get"!==t.method&&d.deleteByTags(t.tags),e}));return i.then((function(e){t.emit("response",e),t.emit("done",null,e)})).catch((function(e){t.emit("error",e),t.emit("done",e)})),i}},{key:"then",value:function(e,t){return this.promise=this.promise||this.send(this.body),this.promise.then(e,t)}},{key:"catch",value:function(e){return this.promise=this.promise||this.send(this.body),this.promise.catch(e)}}]),r}(i.default);Object.defineProperty(b,"FormData",{get:function(){return"undefined"!=typeof FormData?FormData:r(10)}}),b.XMLHttpRequest="undefined"!=typeof XMLHttpRequest?XMLHttpRequest:void 0,b.send=function(e,t,r,n,o,s){return(void 0!==b.XMLHttpRequest?v:m)(e,t,r,n,o,s)},b.verbose=!1,b.methods=["get","post","put","patch","delete"],b.methods.forEach((function(e){b[e]=function(t,r){return new b(t,e,r)}})),e.exports=b},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,s=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw s}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){return{value:e,tags:t,ttl:r}},i=function(){return(new Date).getTime()},a=function(e,t){return!!e.find((function(e){return t.find((function(t){return function(e,t){var r=e==t;return!r&&e instanceof RegExp&&(r=e.test(t)),!r&&t instanceof RegExp&&(r=t.test(e)),r}(e,t)}))}))},u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.flushInterval=t,this.map=new Map}return o(e,[{key:"get",value:function(e){var t=this.map.get(e);if(t){if(t.ttl>i())return t.value;this.map.delete(e)}}},{key:"set",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e4;this.map.set(e,s(t,r,i()+n)),this.flushInterval&&!this.flushTimer&&(this.flushTimer=setInterval(this.flush.bind(this),this.flushInterval),this.flushTimer.unref&&this.flushTimer.unref())}},{key:"delete",value:function(e){this.map.delete(e)}},{key:"deleteByTags",value:function(e){var t=!0,r=!1,o=void 0;try{for(var s,i=this.map[Symbol.iterator]();!(t=(s=i.next()).done);t=!0){var u=n(s.value,2),c=u[0],l=u[1];l.tags&&a(e,l.tags)&&this.delete(c)}}catch(e){r=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(r)throw o}}}},{key:"flush",value:function(){var e=i(),t=!0,r=!1,o=void 0;try{for(var s,a=this.map[Symbol.iterator]();!(t=(s=a.next()).done);t=!0){var u=n(s.value,2),c=u[0];u[1].ttl<e&&this.delete(c)}}catch(e){r=!0,o=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw o}}}}]),e}();t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}}return n(e,[{key:"on",value:function(e,t){return this.events[e]=this.events[e]||[],this.events[e].push(t),this}},{key:"off",value:function(e,t){return e?this.events[e]&&(t?this.events[e]=this.events[e].filter((function(e){return e!==t})):delete this.events[e]):this.events={},this}},{key:"emit",value:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.events[e]&&this.events[e].forEach((function(e){return e.apply(void 0,r)}))}}]),e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=void 0;var n=r(0);t.stringify=function(e){var t=[];return Object.keys(e).forEach((function(r){var o=e[r];void 0!==o&&(0,n.castArray)(o).forEach((function(e){t.push(encodeURIComponent(r)+"="+encodeURIComponent(e))}))})),t.join("&")}},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')},function(e,t){throw new Error('This Backendless JS SDK assembly is not intended for Node.js environment. You should use "lib" folder modules instead. For any questions please contact as at http://support.backendless.com/')}])},"object"==typeof t&&"object"==typeof e?e.exports=s():(n=[],void 0===(o="function"==typeof(r=s)?r.apply(t,n):r)||(e.exports=o))},"./node_modules/backo2/index.js":e=>{function t(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=t,t.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(e){this.ms=e},t.prototype.setMax=function(e){this.max=e},t.prototype.setJitter=function(e){this.jitter=e}},"./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js":(e,t)=>{!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<e.length;n++)r[e.charCodeAt(n)]=n;t.encode=function(t){var r,n=new Uint8Array(t),o=n.length,s="";for(r=0;r<o;r+=3)s+=e[n[r]>>2],s+=e[(3&n[r])<<4|n[r+1]>>4],s+=e[(15&n[r+1])<<2|n[r+2]>>6],s+=e[63&n[r+2]];return o%3==2?s=s.substring(0,s.length-1)+"=":o%3==1&&(s=s.substring(0,s.length-2)+"=="),s},t.decode=function(e){var t,n,o,s,i,a=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l=new ArrayBuffer(a),f=new Uint8Array(l);for(t=0;t<u;t+=4)n=r[e.charCodeAt(t)],o=r[e.charCodeAt(t+1)],s=r[e.charCodeAt(t+2)],i=r[e.charCodeAt(t+3)],f[c++]=n<<2|o>>4,f[c++]=(15&o)<<4|s>>2,f[c++]=(3&s)<<6|63&i;return l}}()},"./node_modules/blob/index.js":(e,t,r)=>{var n=r.g.BlobBuilder||r.g.WebKitBlobBuilder||r.g.MSBlobBuilder||r.g.MozBlobBuilder,o=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),s=o&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),i=n&&n.prototype.append&&n.prototype.getBlob;function a(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}e[t]=n}}}function u(e,t){t=t||{};var r=new n;a(e);for(var o=0;o<e.length;o++)r.append(e[o]);return t.type?r.getBlob(t.type):r.getBlob()}function c(e,t){return a(e),new Blob(e,t||{})}e.exports=o?s?r.g.Blob:c:i?u:void 0},"./node_modules/component-bind/index.js":e=>{var t=[].slice;e.exports=function(e,r){if("string"==typeof r&&(r=e[r]),"function"!=typeof r)throw new Error("bind() requires a function");var n=t.call(arguments,2);return function(){return r.apply(e,n.concat(t.call(arguments)))}}},"./node_modules/component-emitter/index.js":e=>{function t(e){if(e)return function(e){for(var r in t.prototype)e[r]=t.prototype[r];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),r=this._callbacks["$"+e];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},"./node_modules/component-inherit/index.js":e=>{e.exports=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},"./node_modules/debug/src/browser.js":(e,r,n)=>{function o(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==t&&"env"in t&&(e=t.env.DEBUG),e}(r=e.exports=n("./node_modules/debug/src/debug.js")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,s=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(s=o))})),e.splice(s,0,n)}},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=o,r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(o())},"./node_modules/debug/src/debug.js":(e,t,r)=>{var n;function o(e){function r(){if(r.enabled){var e=r,o=+new Date,s=o-(n||o);e.diff=s,e.prev=n,e.curr=o,n=o;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=t.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var u=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;u++;var o=t.formatters[n];if("function"==typeof o){var s=i[u];r=o.call(e,s),i.splice(u,1),u--}return r})),t.formatArgs.call(e,i);var c=r.log||t.log||console.log.bind(console);c.apply(e,i)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=o.debug=o.default=o).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,o=0;o<n;o++)r[o]&&("-"===(e=r[o].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r("./node_modules/ms/index.js"),t.names=[],t.skips=[],t.formatters={}},"./node_modules/engine.io-client/lib/index.js":(e,t,r)=>{e.exports=r("./node_modules/engine.io-client/lib/socket.js"),e.exports.parser=r("./node_modules/engine.io-parser/lib/browser.js")},"./node_modules/engine.io-client/lib/socket.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transports/index.js"),o=r("./node_modules/component-emitter/index.js"),s=r("./node_modules/debug/src/browser.js")("engine.io-client:socket"),i=r("./node_modules/indexof/index.js"),a=r("./node_modules/engine.io-parser/lib/browser.js"),u=r("./node_modules/parseuri/index.js"),c=r("./node_modules/parseqs/index.js");function l(e,t){if(!(this instanceof l))return new l(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=u(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=u(t.host).host),this.secure=null!=t.secure?t.secure:r.g.location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||(r.g.location?location.hostname:"localhost"),this.port=t.port||(r.g.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode;var n="object"==typeof r.g&&r.g;n.global===n&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=l,l.priorWebsocketSuccess=!1,o(l.prototype),l.protocol=a.protocol,l.Socket=l,l.Transport=r("./node_modules/engine.io-client/lib/transport.js"),l.transports=r("./node_modules/engine.io-client/lib/transports/index.js"),l.parser=r("./node_modules/engine.io-parser/lib/browser.js"),l.prototype.createTransport=function(e){s('creating transport "%s"',e);var t=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=a.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new n[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0})},l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},l.prototype.setTransport=function(e){s("setting transport %s",e.name);var t=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},l.prototype.probe=function(e){s('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function o(){if(n.onlyBinaryUpgrades){var o=!this.supportsBinary&&n.transport.supportsBinary;r=r||o}r||(s('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!r)if("pong"===o.type&&"probe"===o.data){if(s('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;l.priorWebsocketSuccess="websocket"===t.name,s('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(s("changing transport and sending upgrade packet"),p(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())}))}else{s('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=t.name,n.emit("upgradeError",i)}})))}function i(){r||(r=!0,p(),t.close(),t=null)}function a(r){var o=new Error("probe error: "+r);o.transport=t.name,i(),s('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",o)}function u(){a("transport closed")}function c(){a("socket closed")}function f(e){t&&e.name!==t.name&&(s('"%s" works - aborting "%s"',e.name,t.name),i())}function p(){t.removeListener("open",o),t.removeListener("error",a),t.removeListener("close",u),n.removeListener("close",c),n.removeListener("upgrading",f)}l.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",a),t.once("close",u),this.once("close",c),this.once("upgrading",f),t.open()},l.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",l.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},l.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(s('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else s('packet received with socket readyState "%s"',this.readyState)},l.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},l.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},l.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){s("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},l.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},l.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(s("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},l.prototype.write=l.prototype.send=function(e,t,r){return this.sendPacket("message",e,t,r),this},l.prototype.sendPacket=function(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var o={type:e,data:t,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},l.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?n():t()})):this.upgrading?n():t()}function t(){e.onClose("forced close"),s("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),t()}function n(){e.once("upgrade",r),e.once("upgradeError",r)}return this},l.prototype.onError=function(e){s("socket error %j",e),l.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},l.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(s('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},l.prototype.filterUpgrades=function(e){for(var t=[],r=0,n=e.length;r<n;r++)~i(this.transports,e[r])&&t.push(e[r]);return t}},"./node_modules/engine.io-client/lib/transport.js":(e,t,r)=>{var n=r("./node_modules/engine.io-parser/lib/browser.js"),o=r("./node_modules/component-emitter/index.js");function s(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=s,o(s.prototype),s.prototype.onError=function(e,t){var r=new Error(e);return r.type="TransportError",r.description=t,this.emit("error",r),this},s.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},s.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},s.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},s.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},s.prototype.onData=function(e){var t=n.decodePacket(e,this.socket.binaryType);this.onPacket(t)},s.prototype.onPacket=function(e){this.emit("packet",e)},s.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},"./node_modules/engine.io-client/lib/transports/index.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/xmlhttprequest.js"),o=r("./node_modules/engine.io-client/lib/transports/polling-xhr.js"),s=r("./node_modules/engine.io-client/lib/transports/polling-jsonp.js"),i=r("./node_modules/engine.io-client/lib/transports/websocket.js");t.polling=function(e){var t=!1,i=!1,a=!1!==e.jsonp;if(r.g.location){var u="https:"===location.protocol,c=location.port;c||(c=u?443:80),t=e.hostname!==location.hostname||c!==e.port,i=e.secure!==u}if(e.xdomain=t,e.xscheme=i,"open"in new n(e)&&!e.forceJSONP)return new o(e);if(!a)throw new Error("JSONP disabled");return new s(e)},t.websocket=i},"./node_modules/engine.io-client/lib/transports/polling-jsonp.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transports/polling.js"),o=r("./node_modules/component-inherit/index.js");e.exports=c;var s,i=/\n/g,a=/\\n/g;function u(){}function c(e){n.call(this,e),this.query=this.query||{},s||(r.g.___eio||(r.g.___eio=[]),s=r.g.___eio),this.index=s.length;var t=this;s.push((function(e){t.onData(e)})),this.query.j=this.index,r.g.document&&r.g.addEventListener&&r.g.addEventListener("beforeunload",(function(){t.script&&(t.script.onerror=u)}),!1)}o(c,n),c.prototype.supportsBinary=!1,c.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},c.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(t,r):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},c.prototype.doWrite=function(e,t){var r=this;if(!this.form){var n,o=document.createElement("form"),s=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=u,o.method="POST",o.setAttribute("accept-charset","utf-8"),s.name="d",o.appendChild(s),document.body.appendChild(o),this.form=o,this.area=s}function c(){l(),t()}function l(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(e){r.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';n=document.createElement(e)}catch(e){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),l(),e=e.replace(a,"\\\n"),this.area.value=e.replace(i,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&c()}:this.iframe.onload=c}},"./node_modules/engine.io-client/lib/transports/polling-xhr.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/xmlhttprequest.js"),o=r("./node_modules/engine.io-client/lib/transports/polling.js"),s=r("./node_modules/component-emitter/index.js"),i=r("./node_modules/component-inherit/index.js"),a=r("./node_modules/debug/src/browser.js")("engine.io-client:polling-xhr");function u(){}function c(e){if(o.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,r.g.location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd=e.hostname!==r.g.location.hostname||n!==e.port,this.xs=e.secure!==t}}function l(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function f(){for(var e in l.requests)l.requests.hasOwnProperty(e)&&l.requests[e].abort()}e.exports=c,e.exports.Request=l,i(c,o),c.prototype.supportsBinary=!0,c.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new l(e)},c.prototype.doWrite=function(e,t){var r="string"!=typeof e&&void 0!==e,n=this.request({method:"POST",data:e,isBinary:r}),o=this;n.on("success",t),n.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=n},c.prototype.doPoll=function(){a("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},s(l.prototype),l.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new n(e),o=this;try{a("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var s in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(s)&&t.setRequestHeader(s,this.extraHeaders[s])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){o.onLoad()},t.onerror=function(){o.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState){var e;try{e=t.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===e&&(t.responseType="arraybuffer")}4===t.readyState&&(200===t.status||1223===t.status?o.onLoad():setTimeout((function(){o.onError(t.status)}),0))},a("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){o.onError(e)}),0)}r.g.document&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},l.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},l.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=u:this.xhr.onreadystatechange=u,e)try{this.xhr.abort()}catch(e){}r.g.document&&delete l.requests[this.index],this.xhr=null}},l.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},l.prototype.hasXDR=function(){return void 0!==r.g.XDomainRequest&&!this.xs&&this.enablesXDR},l.prototype.abort=function(){this.cleanup()},l.requestsCount=0,l.requests={},r.g.document&&(r.g.attachEvent?r.g.attachEvent("onunload",f):r.g.addEventListener&&r.g.addEventListener("beforeunload",f,!1))},"./node_modules/engine.io-client/lib/transports/polling.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/transport.js"),o=r("./node_modules/parseqs/index.js"),s=r("./node_modules/engine.io-parser/lib/browser.js"),i=r("./node_modules/component-inherit/index.js"),a=r("./node_modules/yeast/index.js"),u=r("./node_modules/debug/src/browser.js")("engine.io-client:polling");e.exports=l;var c=null!=new(r("./node_modules/engine.io-client/lib/xmlhttprequest.js"))({xdomain:!1}).responseType;function l(e){var t=e&&e.forceBase64;c&&!t||(this.supportsBinary=!1),n.call(this,e)}i(l,n),l.prototype.name="polling",l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;function r(){u("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(u("we are currently polling - waiting to pause"),n++,this.once("pollComplete",(function(){u("pre-pause polling complete"),--n||r()}))),this.writable||(u("we are currently writing - waiting to pause"),n++,this.once("drain",(function(){u("pre-pause writing complete"),--n||r()})))}else r()},l.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},l.prototype.onData=function(e){var t=this;u("polling got data %s",e),s.decodePayload(e,this.socket.binaryType,(function(e,r,n){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},l.prototype.doClose=function(){var e=this;function t(){u("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},l.prototype.write=function(e){var t=this;this.writable=!1;var r=function(){t.writable=!0,t.emit("drain")};s.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,r)}))},l.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(e[this.timestampParam]=a()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(r=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e}},"./node_modules/engine.io-client/lib/transports/websocket.js":(e,t,r)=>{var n,o=r("./node_modules/engine.io-client/lib/transport.js"),s=r("./node_modules/engine.io-parser/lib/browser.js"),i=r("./node_modules/parseqs/index.js"),a=r("./node_modules/component-inherit/index.js"),u=r("./node_modules/yeast/index.js"),c=r("./node_modules/debug/src/browser.js")("engine.io-client:websocket"),l=r.g.WebSocket||r.g.MozWebSocket;if("undefined"==typeof window)try{n=r("?1bcf")}catch(e){}var f=l;function p(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=l&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(f=n),o.call(this,e)}f||"undefined"!=typeof window||(f=n),e.exports=p,a(p,o),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new f(e,t):new f(e):new f(e,t,r)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},p.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,o=0,i=n;o<i;o++)!function(e){s.encodePacket(e,t.supportsBinary,(function(o){if(!t.usingBrowserWebSocket){var s={};e.options&&(s.compress=e.options.compress),t.perMessageDeflate&&("string"==typeof o?r.g.Buffer.byteLength(o):o.length)<t.perMessageDeflate.threshold&&(s.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(o):t.ws.send(o,s)}catch(e){c("websocket closed before onclose event")}--n||(t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0))}))}(e[o])},p.prototype.onClose=function(){o.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",r="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=u()),this.supportsBinary||(e.b64=1),(e=i.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+e},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}},"./node_modules/engine.io-client/lib/xmlhttprequest.js":(e,t,r)=>{var n=r("./node_modules/has-cors/index.js");e.exports=function(e){var t=e.xdomain,o=e.xscheme,s=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||n))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!o&&s)return new XDomainRequest}catch(e){}if(!t)try{return new(r.g[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}},"./node_modules/engine.io-parser/lib/browser.js":(e,t,r)=>{var n,o=r("./node_modules/engine.io-parser/lib/keys.js"),s=r("./node_modules/has-binary2/index.js"),i=r("./node_modules/arraybuffer.slice/index.js"),a=r("./node_modules/after/index.js"),u=r("./node_modules/engine.io-parser/lib/utf8.js");r.g&&r.g.ArrayBuffer&&(n=r("./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js"));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),l="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=c||l;t.protocol=3;var p=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},d=o(p),h={type:"error",data:"parser error"},y=r("./node_modules/blob/index.js");function v(e,t,r){for(var n=new Array(e.length),o=a(e.length,r),s=function(e,r,o){t(r,(function(t,r){n[e]=r,o(t,n)}))},i=0;i<e.length;i++)s(i,e[i],o)}t.encodePacket=function(e,n,o,s){"function"==typeof n&&(s=n,n=!1),"function"==typeof o&&(s=o,o=null);var i=void 0===e.data?void 0:e.data.buffer||e.data;if(r.g.ArrayBuffer&&i instanceof ArrayBuffer)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var o=e.data,s=new Uint8Array(o),i=new Uint8Array(1+o.byteLength);i[0]=p[e.type];for(var a=0;a<s.length;a++)i[a+1]=s[a];return n(i.buffer)}(e,n,s);if(y&&i instanceof r.g.Blob)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);if(f)return function(e,r,n){if(!r)return t.encodeBase64Packet(e,n);var o=new FileReader;return o.onload=function(){e.data=o.result,t.encodePacket(e,r,!0,n)},o.readAsArrayBuffer(e.data)}(e,r,n);var o=new Uint8Array(1);o[0]=p[e.type];var s=new y([o.buffer,e.data]);return n(s)}(e,n,s);if(i&&i.base64)return function(e,r){var n="b"+t.packets[e.type]+e.data.data;return r(n)}(e,s);var a=p[e.type];return void 0!==e.data&&(a+=o?u.encode(String(e.data),{strict:!1}):String(e.data)),s(""+a)},t.encodeBase64Packet=function(e,n){var o,s="b"+t.packets[e.type];if(y&&e.data instanceof r.g.Blob){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];n(s+e)},i.readAsDataURL(e.data)}try{o=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(t){for(var a=new Uint8Array(e.data),u=new Array(a.length),c=0;c<a.length;c++)u[c]=a[c];o=String.fromCharCode.apply(null,u)}return s+=r.g.btoa(o),n(s)},t.decodePacket=function(e,r,n){if(void 0===e)return h;if("string"==typeof e){if("b"===e.charAt(0))return t.decodeBase64Packet(e.substr(1),r);if(n&&!1===(e=function(e){try{e=u.decode(e,{strict:!1})}catch(e){return!1}return e}(e)))return h;var o=e.charAt(0);return Number(o)==o&&d[o]?e.length>1?{type:d[o],data:e.substring(1)}:{type:d[o]}:h}o=new Uint8Array(e)[0];var s=i(e,1);return y&&"blob"===r&&(s=new y([s])),{type:d[o],data:s}},t.decodeBase64Packet=function(e,t){var r=d[e.charAt(0)];if(!n)return{type:r,data:{base64:!0,data:e.substr(1)}};var o=n.decode(e.substr(1));return"blob"===t&&y&&(o=new y([o])),{type:r,data:o}},t.encodePayload=function(e,r,n){"function"==typeof r&&(n=r,r=null);var o=s(e);return r&&o?y&&!f?t.encodePayloadAsBlob(e,n):t.encodePayloadAsArrayBuffer(e,n):e.length?void v(e,(function(e,n){t.encodePacket(e,!!o&&r,!1,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))})):n("0:")},t.decodePayload=function(e,r,n){if("string"!=typeof e)return t.decodePayloadAsBinary(e,r,n);var o;if("function"==typeof r&&(n=r,r=null),""===e)return n(h,0,1);for(var s,i,a="",u=0,c=e.length;u<c;u++){var l=e.charAt(u);if(":"===l){if(""===a||a!=(s=Number(a)))return n(h,0,1);if(a!=(i=e.substr(u+1,s)).length)return n(h,0,1);if(i.length){if(o=t.decodePacket(i,r,!1),h.type===o.type&&h.data===o.data)return n(h,0,1);if(!1===n(o,u+s,c))return}u+=s,a=""}else a+=l}return""!==a?n(h,0,1):void 0},t.encodePayloadAsArrayBuffer=function(e,r){if(!e.length)return r(new ArrayBuffer(0));v(e,(function(e,r){t.encodePacket(e,!0,!0,(function(e){return r(null,e)}))}),(function(e,t){var n=t.reduce((function(e,t){var r;return e+(r="string"==typeof t?t.length:t.byteLength).toString().length+r+2}),0),o=new Uint8Array(n),s=0;return t.forEach((function(e){var t="string"==typeof e,r=e;if(t){for(var n=new Uint8Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);r=n.buffer}o[s++]=t?0:1;var a=r.byteLength.toString();for(i=0;i<a.length;i++)o[s++]=parseInt(a[i]);for(o[s++]=255,n=new Uint8Array(r),i=0;i<n.length;i++)o[s++]=n[i]})),r(o.buffer)}))},t.encodePayloadAsBlob=function(e,r){v(e,(function(e,r){t.encodePacket(e,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var n=new Uint8Array(e.length),o=0;o<e.length;o++)n[o]=e.charCodeAt(o);e=n.buffer,t[0]=0}var s=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),i=new Uint8Array(s.length+1);for(o=0;o<s.length;o++)i[o]=parseInt(s[o]);if(i[s.length]=255,y){var a=new y([t.buffer,i.buffer,e]);r(null,a)}}))}),(function(e,t){return r(new y(t))}))},t.decodePayloadAsBinary=function(e,r,n){"function"==typeof r&&(n=r,r=null);for(var o=e,s=[];o.byteLength>0;){for(var a=new Uint8Array(o),u=0===a[0],c="",l=1;255!==a[l];l++){if(c.length>310)return n(h,0,1);c+=a[l]}o=i(o,2+c.length),c=parseInt(c);var f=i(o,0,c);if(u)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(e){var p=new Uint8Array(f);for(f="",l=0;l<p.length;l++)f+=String.fromCharCode(p[l])}s.push(f),o=i(o,c)}var d=s.length;s.forEach((function(e,o){n(t.decodePacket(e,r,!0),o,d)}))}},"./node_modules/engine.io-parser/lib/keys.js":e=>{e.exports=Object.keys||function(e){var t=[],r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&t.push(n);return t}},"./node_modules/engine.io-parser/lib/utf8.js":function(e,t,r){var n;e=r.nmd(e),function(o){var s=(e&&e.exports,"object"==typeof r.g&&r.g);s.global!==s&&s.window;var i,a,u,c=String.fromCharCode;function l(e){for(var t,r,n=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function f(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function p(e,t){return c(e>>t&63|128)}function d(e,t){if(0==(4294967168&e))return c(e);var r="";return 0==(4294965248&e)?r=c(e>>6&31|192):0==(4294901760&e)?(f(e,t)||(e=65533),r=c(e>>12&15|224),r+=p(e,6)):0==(4292870144&e)&&(r=c(e>>18&7|240),r+=p(e,12),r+=p(e,6)),r+=c(63&e|128)}function h(){if(u>=a)throw Error("Invalid byte index");var e=255&i[u];if(u++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function y(e){var t,r;if(u>a)throw Error("Invalid byte index");if(u==a)return!1;if(t=255&i[u],u++,0==(128&t))return t;if(192==(224&t)){if((r=(31&t)<<6|h())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if((r=(15&t)<<12|h()<<6|h())>=2048)return f(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var v={version:"2.1.2",encode:function(e,t){for(var r=!1!==(t=t||{}).strict,n=l(e),o=n.length,s=-1,i="";++s<o;)i+=d(n[s],r);return i},decode:function(e,t){var r=!1!==(t=t||{}).strict;i=l(e),a=i.length,u=0;for(var n,o=[];!1!==(n=y(r));)o.push(n);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=c((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=c(t);return o}(o)}};void 0===(n=function(){return v}.call(t,r,t,e))||(e.exports=n)}()},"./node_modules/has-binary2/index.js":(e,t,r)=>{var n=r("./node_modules/isarray/index.js"),o=Object.prototype.toString,s="function"==typeof r.g.Blob||"[object BlobConstructor]"===o.call(r.g.Blob),i="function"==typeof r.g.File||"[object FileConstructor]"===o.call(r.g.File);e.exports=function e(t){if(!t||"object"!=typeof t)return!1;if(n(t)){for(var o=0,a=t.length;o<a;o++)if(e(t[o]))return!0;return!1}if("function"==typeof r.g.Buffer&&r.g.Buffer.isBuffer&&r.g.Buffer.isBuffer(t)||"function"==typeof r.g.ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||i&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)&&e(t[u]))return!0;return!1}},"./node_modules/has-cors/index.js":e=>{try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},"./node_modules/indexof/index.js":e=>{var t=[].indexOf;e.exports=function(e,r){if(t)return e.indexOf(r);for(var n=0;n<e.length;++n)if(e[n]===r)return n;return-1}},"./node_modules/isarray/index.js":e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},"./node_modules/ms/index.js":e=>{var t=1e3,r=6e4,n=60*r,o=24*n;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}e.exports=function(e,i){i=i||{};var a,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(s){var i=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*i;case"days":case"day":case"d":return i*o;case"hours":case"hour":case"hrs":case"hr":case"h":return i*n;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}(e);if("number"===u&&!1===isNaN(e))return i.long?s(a=e,o,"day")||s(a,n,"hour")||s(a,r,"minute")||s(a,t,"second")||a+" ms":function(e){return e>=o?Math.round(e/o)+"d":e>=n?Math.round(e/n)+"h":e>=r?Math.round(e/r)+"m":e>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},"./node_modules/parseqs/index.js":(e,t)=>{t.encode=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){for(var t={},r=e.split("&"),n=0,o=r.length;n<o;n++){var s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},"./node_modules/parseuri/index.js":e=>{var t=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var n=e,o=e.indexOf("["),s=e.indexOf("]");-1!=o&&-1!=s&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,";")+e.substring(s,e.length));for(var i=t.exec(e||""),a={},u=14;u--;)a[r[u]]=i[u]||"";return-1!=o&&-1!=s&&(a.source=n,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},"./node_modules/socket.io-client/lib/index.js":(e,t,r)=>{var n=r("./node_modules/socket.io-client/lib/url.js"),o=r("./src/socket-parser.js"),s=r("./node_modules/socket.io-client/lib/manager.js"),i=r("./node_modules/debug/src/browser.js")("socket.io-client");e.exports=t=u;var a=t.managers={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o=n(e),u=o.source,c=o.id,l=o.path,f=a[c]&&l in a[c].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||f?(i("ignoring socket cache for %s",u),r=s(u,t)):(a[c]||(i("new io instance for %s",u),a[c]=s(u,t)),r=a[c]),o.query&&!t.query&&(t.query=o.query),r.socket(o.path,t)}t.protocol=o.protocol,t.connect=u,t.Manager=r("./node_modules/socket.io-client/lib/manager.js"),t.Socket=r("./node_modules/socket.io-client/lib/socket.js")},"./node_modules/socket.io-client/lib/manager.js":(e,t,r)=>{var n=r("./node_modules/engine.io-client/lib/index.js"),o=r("./node_modules/socket.io-client/lib/socket.js"),s=r("./node_modules/component-emitter/index.js"),i=r("./src/socket-parser.js"),a=r("./node_modules/socket.io-client/lib/on.js"),u=r("./node_modules/component-bind/index.js"),c=r("./node_modules/debug/src/browser.js")("socket.io-client:manager"),l=r("./node_modules/indexof/index.js"),f=r("./node_modules/backo2/index.js"),p=Object.prototype.hasOwnProperty;function d(e,t){if(!(this instanceof d))return new d(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||i;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}e.exports=d,d.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},d.prototype.updateSocketIds=function(){for(var e in this.nsps)p.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},d.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},s(d.prototype),d.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},d.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},d.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},d.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},d.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},d.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},d.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},d.prototype.open=d.prototype.connect=function(e,t){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var s=a(r,"open",(function(){o.onopen(),e&&e()})),i=a(r,"error",(function(t){if(c("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var u=this._timeout;c("connect attempt will timeout after %d",u);var l=setTimeout((function(){c("connect attempt timed out after %d",u),s.destroy(),r.close(),r.emit("error","timeout"),o.emitAll("connect_timeout",u)}),u);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(s),this.subs.push(i),this},d.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(a(e,"data",u(this,"ondata"))),this.subs.push(a(e,"ping",u(this,"onping"))),this.subs.push(a(e,"pong",u(this,"onpong"))),this.subs.push(a(e,"error",u(this,"onerror"))),this.subs.push(a(e,"close",u(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",u(this,"ondecoded")))},d.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},d.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},d.prototype.ondata=function(e){this.decoder.add(e)},d.prototype.ondecoded=function(e){this.emit("packet",e)},d.prototype.onerror=function(e){c("error",e),this.emitAll("error",e)},d.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new o(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",s),r.on("connect",(function(){r.id=n.generateId(e)})),this.autoConnect&&s()}function s(){~l(n.connecting,r)||n.connecting.push(r)}return r},d.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},d.prototype.packet=function(e){c("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(r){for(var n=0;n<r.length;n++)t.engine.write(r[n],e.options);t.encoding=!1,t.processPacketQueue()})))},d.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},d.prototype.cleanup=function(){c("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},d.prototype.close=d.prototype.disconnect=function(){c("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},d.prototype.onclose=function(e){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},d.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();c("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(c("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(c("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(c("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(r)}})}},d.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},"./node_modules/socket.io-client/lib/on.js":e=>{e.exports=function(e,t,r){return e.on(t,r),{destroy:function(){e.removeListener(t,r)}}}},"./node_modules/socket.io-client/lib/socket.js":(e,t,r)=>{var n=r("./src/socket-parser.js"),o=r("./node_modules/component-emitter/index.js"),s=r("./node_modules/to-array/index.js"),i=r("./node_modules/socket.io-client/lib/on.js"),a=r("./node_modules/component-bind/index.js"),u=r("./node_modules/debug/src/browser.js")("socket.io-client:socket"),c=r("./node_modules/parseqs/index.js");e.exports=p;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=o.prototype.emit;function p(e,t,r){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}o(p.prototype),p.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[i(e,"open",a(this,"onopen")),i(e,"packet",a(this,"onpacket")),i(e,"close",a(this,"onclose"))]}},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},p.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},p.prototype.emit=function(e){if(l.hasOwnProperty(e))return f.apply(this,arguments),this;var t=s(arguments),r={type:n.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},p.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},p.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;u("sending connect packet with query %s",e),this.packet({type:n.CONNECT,query:e})}else this.packet({type:n.CONNECT})},p.prototype.onclose=function(e){u("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},p.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},p.prototype.onevent=function(e){var t=e.data||[];u("emitting event %j",t),null!=e.id&&(u("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?f.apply(this,t):this.receiveBuffer.push(t)},p.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var o=s(arguments);u("sending ack %j",o),t.packet({type:n.ACK,id:e,data:o})}}},p.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(u("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):u("bad ack %s",e.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)f.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},p.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},p.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},p.prototype.close=p.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},p.prototype.compress=function(e){return this.flags=this.flags||{},this.flags.compress=e,this}},"./node_modules/socket.io-client/lib/url.js":(e,t,r)=>{var n=r("./node_modules/parseuri/index.js"),o=r("./node_modules/debug/src/browser.js")("socket.io-client:url");e.exports=function(e,t){var s=e;t=t||r.g.location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),o("parse %s",e),s=n(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";var i=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+i+":"+s.port,s.href=s.protocol+"://"+i+(t&&t.port===s.port?"":":"+s.port),s}},"./node_modules/to-array/index.js":e=>{e.exports=function(e,t){for(var r=[],n=(t=t||0)||0;n<e.length;n++)r[n-t]=e[n];return r}},"./node_modules/yeast/index.js":e=>{"use strict";var t,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={},o=0,s=0;function i(e){var t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function a(){var e=i(+new Date);return e!==t?(o=0,t=e):e+"."+i(o++)}for(;s<64;s++)n[r[s]]=s;a.encode=i,a.decode=function(e){var t=0;for(s=0;s<e.length;s++)t=64*t+n[e.charAt(s)];return t},e.exports=a},"?1bcf":()=>{}},s={};function i(t){var r=s[t];if(void 0!==r)return r.exports;var n=s[t]={id:t,loaded:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i("./src/index.js")})(),e.exports=s()}).call(this,r(69))},function(e,t){var r,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new h(e,t)),1!==c.length||l||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){var n=r(28),o=r(35),s=r(19),i=r(30);e.exports=function(e){return n(e)||o(e)||s(e)||i()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(23)),s=r(14),i=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,a=new RegExp("^"+i.source+"(\\s"+i.source+"){1,}"),u=function(e){var t=0,r=function(r){var n=e.substring(t).match(r);return n?(t+=n[0].length,n[0]):null},n=function(){return r(/^\s*/)},i=function(){for(var e,t,s=[];t=r(a)||r(/^(,)/);)","===t?(s.push(e),e=[]):t.split(/\s/g).some(isNaN)||(e||(e=[]),e=[].concat((0,o.default)(e),(0,o.default)(t.split(/\s/g).map(parseFloat)))),n();return e?(s.push(e),s.length?s:null):null};return function(){if(!r(/^(point(\sz)?)/i))return null;if(n(),!r(/^(\()/))return null;n();var e=i();return e&&r(/^(\))/)?{type:s.GeoTypes.POINT,coordinates:e[0]}:null}()||function(){if(!r(/^(linestring(\sz)?)/i))return null;if(n(),!r(/^(\()/))return null;var e=i();return e&&r(/^(\))/)?{type:s.GeoTypes.LINE_STRING,coordinates:e}:null}()||function(){if(!r(/^(polygon(\sz)?)/i))return null;n();var e=function(){n();for(var e,t=0,o=[],s=[o],i=o;e=r(/^(\()/)||r(/^(\))/)||r(/^(,)/)||r(a);){if("("===e)s.push(i),i=[],s[s.length-1].push(i),t++;else if(")"===e){if(0===i.length)return null;if(!(i=s.pop()))return null;if(0===--t)break}else if(","===e)i=[],s[s.length-1].push(i);else{if(e.split(/\s/g).some(isNaN))return null;Array.prototype.push.apply(i,e.split(/\s/g).map(parseFloat))}n()}return 0!==t?null:o}();return e?{type:s.GeoTypes.POLYGON,coordinates:e}:null}()};t.default=u},function(e,t,r){var n=r(29);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0),o=r(9);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(r(1)),i=n(r(2)),a=n(r(12)),u=n(r(7)),c=n(r(8)),l=n(r(5)),f=n(r(10)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=s?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(11));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.default)(e);if(t){var o=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var y=function(e){(0,u.default)(r,e);var t=h(r);function r(){var e;return(0,s.default)(this,r),(e=t.call(this)).groupPageSize=p.PAGING_DEFAULTS.pageSize,e.recordsPageSize=p.PAGING_DEFAULTS.pageSize,e.groupDepth=null,e.groupPath=null,e}return(0,i.default)(r,[{key:"setGroupPageSize",value:function(e){if(e<=0)throw new Error("Group page size must be a positive value.");return this.groupPageSize=e,this}},{key:"getGroupPageSize",value:function(){return this.groupPageSize}},{key:"setRecordsPageSize",value:function(e){if(e<=0)throw new Error("Records page size must be a positive value.");return this.recordsPageSize=e,this}},{key:"getRecordsPageSize",value:function(){return this.recordsPageSize}},{key:"setGroupDepth",value:function(e){if(e<0)throw new Error("Group depth cannot have a negative value.");return this.groupDepth=e,this}},{key:"getGroupDepth",value:function(){return this.groupDepth}},{key:"getGroupPath",value:function(){return this.groupPath}},{key:"addGroupPath",value:function(e){return this.groupPath=(this.groupPath||[]).concat(e),this}},{key:"setGroupPath",value:function(e){return this.groupPath=f.default.castArray(e),this}},{key:"toJSON",value:function(){var e=(0,a.default)((0,l.default)(r.prototype),"toJSON",this).call(this);return e.groupDepth=this.getGroupDepth(),e.groupPath=this.getGroupPath(),e.groupPageSize=this.getGroupPageSize(),e.recordsPageSize=this.getRecordsPageSize(),e}}]),r}(p.default);t.default=y},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(7)),a=n(r(8)),u=n(r(5)),c=n(r(6));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,i.default)(r,e);var t=l(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"getRequestURL",value:function(e,t){if(!t.___class||!t.objectId)throw new Error('"dataObject.___class" and "dataObject.objectId" need to be specified');return this.app.urls.dataObjectPermission(t.___class,e,t.objectId)}}]),r}(n(r(40)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Data.Permissions.{FIND|REMOVE|UPDATE}")},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(77)),i=n(r(9)),a=n(r(4)),u=n(r(1)),c=n(r(2)),l=n(r(78)),f=r(79),p=function(){function e(t){(0,u.default)(this,e),this.app=t,this.Bodyparts=f.Bodyparts,this.PublishOptions=f.PublishOptions,this.DeliveryOptions=f.DeliveryOptions,this.PublishOptionsHeaders=f.PublishOptionsHeaders,this.EmailEnvelope=f.EmailEnvelope}var t,r,n,p,h,y,v,m,g,b;return(0,c.default)(e,[{key:"subscribe",value:function(e){return d(e),new l.default({name:e},this.app)}},{key:"publish",value:(b=(0,a.default)(o.default.mark((function e(t,r,n,a){var u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d(t),u={message:r},!n){e.next=6;break}if(!Array.isArray(n)&&"object"===(0,i.default)(n)){e.next=5;break}throw new Error('"publishOptions" argument must be an object.');case 5:(0,s.default)(u,n);case 6:if(!a){e.next=10;break}if(!Array.isArray(a)&&"object"===(0,i.default)(a)){e.next=9;break}throw new Error('"deliveryOptions" argument must be an object.');case 9:(0,s.default)(u,a);case 10:return e.abrupt("return",this.app.request.post({url:this.app.urls.messagingChannel(t),data:u}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return b.apply(this,arguments)})},{key:"pushWithTemplate",value:(g=(0,a.default)(o.default.mark((function e(t,r){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Push Template Name must be provided and must be a string.");case 2:return n={},r&&(n.templateValues=r),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingPushWithTemplate(t),data:n}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"sendEmail",value:(m=(0,a.default)(o.default.mark((function e(t,r,n,s){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Subject must be provided and must be a string.");case 2:if(r&&!Array.isArray(r)&&"object"===(0,i.default)(r)){e.next=4;break}throw new Error("BodyParts must be an object");case 4:if(r.textmessage||r.htmlmessage){e.next=6;break}throw new Error("BodyParts must contain at least one property of [ textmessage | htmlmessage ]");case 6:if(Array.isArray(n)&&n.length){e.next=8;break}throw new Error("Recipients must be a non empty array.");case 8:return a={subject:t,bodyparts:r,to:n},Array.isArray(s)&&s.length&&(a.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingEmail(),data:a}));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return m.apply(this,arguments)})},{key:"sendEmailFromTemplate",value:(v=(0,a.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Email Template Name must be provided and must be a string.");case 2:if(r instanceof f.EmailEnvelope){e.next=4;break}throw new Error("EmailEnvelope is required and should be instance of Backendless.Messaging.EmailEnvelope");case 4:return(i=r.toJSON())["template-name"]=t,n&&!Array.isArray(n)&&(i["template-values"]=n),Array.isArray(n)&&!s&&(s=n),s&&(i.attachment=s),e.abrupt("return",this.app.request.post({url:this.app.urls.emailTemplateSend(),data:i}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return v.apply(this,arguments)})},{key:"cancel",value:(y=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"registerDevice",value:(h=(0,a.default)(o.default.mark((function e(t,r,n){var s,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this.app.device,i={deviceToken:t,deviceId:s.uuid,os:s.platform,osVersion:s.version},Array.isArray(r)&&(i.channels=r),"number"==typeof n?i.expiration=n:n instanceof Date&&(i.expiration=n.getTime()/1e3),e.abrupt("return",this.app.request.post({url:this.app.urls.messagingRegistrations(),data:i}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return h.apply(this,arguments)})},{key:"getRegistrations",value:(p=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.get({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"unregisterDevice",value:(n=(0,a.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.app.device,e.abrupt("return",this.app.request.delete({url:this.app.urls.messagingRegistrationDevice(t.uuid)}));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getMessageStatus",value:(r=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Message ID must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingMessage(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getPushTemplates",value:(t=(0,a.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error("Device Type must be provided and must be a string.");case 2:return e.abrupt("return",this.app.request.get({url:this.app.urls.messagingPushTemplates(t)}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function d(e){if(!e||"string"!=typeof e)throw new Error("Channel Name must be provided and must be a string.");if(e.indexOf("/")>=0)throw new Error("Channel Name can not contain slash chars")}t.default=p},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i=n(r(1)),a=n(r(2)),u=n(r(12)),c=n(r(7)),l=n(r(8)),f=n(r(5)),p=n(r(41)),d=r(16);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.default)(e);if(t){var o=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var y="MESSAGE",v=(o=d.RTScopeConnector.connectionRequired(),s=function(e){(0,c.default)(r,e);var t=h(r);function r(e,n){var o;return(0,i.default)(this,r),(o=t.call(this,e)).app=n,o.connect(),o}return(0,a.default)(r,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToPubSub}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onPubSubCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendPubSubCommand}},{key:"getScopeOptions",value:function(){return{channel:this.options.name}}},{key:"connect",value:function(){if(this.app)return(0,u.default)((0,f.default)(r.prototype),"connect",this).call(this)}},{key:"publish",value:function(e,t,r){return this.app.Messaging.publish(this.options.name,e,t,r)}},{key:"addMessageListener",value:function(e,t,r){"function"==typeof e&&(r=t,t=e,e=void 0),this.addSubscription(y,this.app.RT.subscriptions.onPubSubMessage,{callback:t,onError:r,params:{selector:e}})}},{key:"removeMessageListener",value:function(e,t){if("function"==typeof e&&(t=e,e=void 0),e&&"string"!=typeof e)throw new Error("Selector must be a string.");if("function"!=typeof t)throw new Error("Callback must be a function.");this.stopSubscription(y,{matcher:function(r){return e?r.params.selector===e&&r.callback===t:r.callback===t}})}},{key:"removeMessageListeners",value:function(e){if("string"!=typeof e)throw new Error("Selector must be a string.");this.stopSubscription(y,{matcher:function(t){return t.params.selector===e}})}},{key:"removeAllMessageListeners",value:function(){this.stopSubscription(y,{})}},{key:"addCommandListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"addUserStatusListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeUserStatusListeners",value:function(e){return(0,u.default)((0,f.default)(r.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,u.default)((0,f.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"send",value:function(e,t){return(0,u.default)((0,f.default)(r.prototype),"send",this).call(this,e,t)}},{key:"join",value:function(){(0,u.default)((0,f.default)(r.prototype),"connect",this).call(this)}},{key:"leave",value:function(){(0,u.default)((0,f.default)(r.prototype),"disconnect",this).call(this)}},{key:"isJoined",value:function(){return(0,u.default)((0,f.default)(r.prototype),"isConnected",this).call(this)}}]),r}(d.RTScopeConnector),(0,p.default)(s.prototype,"addMessageListener",[o],Object.getOwnPropertyDescriptor(s.prototype,"addMessageListener"),s.prototype),s);t.default=v},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PublishOptionsHeaders",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"PublishOptions",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"DeliveryOptions",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Bodyparts",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"EmailEnvelope",{enumerable:!0,get:function(){return u.default}});var o=n(r(80)),s=n(r(81)),i=n(r(82)),a=n(r(83)),u=n(r(84))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={MESSAGE_TAG:"message",IOS_ALERT_TAG:"ios-alert",IOS_BADGE_TAG:"ios-badge",IOS_SOUND_TAG:"ios-sound",ANDROID_TICKER_TEXT_TAG:"android-ticker-text",ANDROID_CONTENT_TITLE_TAG:"android-content-title",ANDROID_CONTENT_TEXT_TAG:"android-content-text",ANDROID_ACTION_TAG:"android-action",WP_TYPE_TAG:"wp-type",WP_TITLE_TAG:"wp-title",WP_TOAST_SUBTITLE_TAG:"wp-subtitle",WP_TOAST_PARAMETER_TAG:"wp-parameter",WP_TILE_BACKGROUND_IMAGE:"wp-backgroundImage",WP_TILE_COUNT:"wp-count",WP_TILE_BACK_TITLE:"wp-backTitle",WP_TILE_BACK_BACKGROUND_IMAGE:"wp-backImage",WP_TILE_BACK_CONTENT:"wp-backContent",WP_RAW_DATA:"wp-raw"};t.default=n},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1));t.default=function e(t){(0,o.default)(this,e),t=t||{},this.publisherId=t.publisherId||void 0,this.headers=t.headers||void 0,this.subtopic=t.subtopic||void 0}},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1));t.default=function e(t){(0,o.default)(this,e),t=t||{},this.publishPolicy=t.publishPolicy||void 0,this.pushBroadcast=t.pushBroadcast||void 0,this.pushSinglecast=t.pushSinglecast||void 0,this.publishAt=t.publishAt||void 0,this.repeatEvery=t.repeatEvery||void 0,this.repeatExpiresAt=t.repeatExpiresAt||void 0}},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1));t.default=function e(t){(0,o.default)(this,e),t=t||{},this.textmessage=t&&t.textmessage,this.htmlmessage=t&&t.htmlmessage}},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(10)),a=function(){function e(t){(0,o.default)(this,e),t=t||{},this.addresses=i.default.castArray(t.addresses),this.ccAddresses=i.default.castArray(t.ccAddresses),this.bccAddresses=i.default.castArray(t.bccAddresses),this.query=t.query||null,this.uniqueEmails=t.uniqueEmails||!1}return(0,s.default)(e,[{key:"setTo",value:function(e){return this.addresses=i.default.castArray(e),this}},{key:"addTo",value:function(e){return this.addresses=this.addresses.concat(i.default.castArray(e)),this}},{key:"getTo",value:function(){return this.addresses}},{key:"setCc",value:function(e){return this.ccAddresses=i.default.castArray(e),this}},{key:"addCc",value:function(e){return this.ccAddresses=this.ccAddresses.concat(i.default.castArray(e)),this}},{key:"getCc",value:function(){return this.ccAddresses}},{key:"setBcc",value:function(e){return this.bccAddresses=i.default.castArray(e),this}},{key:"addBcc",value:function(e){return this.bccAddresses=this.bccAddresses.concat(i.default.castArray(e)),this}},{key:"getBcc",value:function(){return this.bccAddresses}},{key:"setQuery",value:function(e){return this.query=e,this}},{key:"getQuery",value:function(){return this.query}},{key:"setUniqueEmails",value:function(e){return this.uniqueEmails=e,this}},{key:"getUniqueEmails",value:function(){return this.uniqueEmails}},{key:"toJSON",value:function(){var e={};return this.addresses.length>0&&(e.addresses=this.addresses),this.ccAddresses.length>0&&(e["cc-addresses"]=this.ccAddresses),this.bccAddresses.length>0&&(e["bcc-addresses"]=this.bccAddresses),this.query&&(e.criteria=this.query),e.uniqueEmails=this.uniqueEmails,e}}],[{key:"create",value:function(t){return new e(t)}}]),e}();t.default=a},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i=n(r(1)),a=n(r(2)),u=n(r(86)),c=n(r(87)),l=function(){function e(t){(0,i.default)(this,e),this.app=t,this.Permissions={READ:new c.default("READ",t),DELETE:new c.default("DELETE",t),WRITE:new c.default("WRITE",t)}}var t,r,n,l,f,p,d,h,y,v,m,g;return(0,a.default)(e,[{key:"saveFile",value:(g=(0,s.default)(o.default.mark((function e(t,r,n,s){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("File Name must be provided and must be a string.");case 4:return e.next=6,u.default.toBase64(n);case 6:return n=e.sent,i={},"boolean"==typeof s&&(i.overwrite=s),t=u.default.trimSlashesInPath(t),r=u.default.sanitizeFileName(r),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileBinaryPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},query:i,data:n}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return g.apply(this,arguments)})},{key:"upload",value:(m=(0,s.default)(o.default.mark((function e(t,r,n){var s,i,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s={},"boolean"==typeof n&&(s.overwrite=n),r=u.default.trimSlashesInPath(r),(i=u.default.parseFilePath(r)).fileName&&(r=i.filePath,a=i.fileName),"string"!=typeof t){e.next=8;break}return a||(c=u.default.parseFilePath(t),a=c.fileName),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(r),"/").concat(a),query:s,data:{url:t}}));case 8:if(a||(a=u.default.getFileName(t)),a){e.next=11;break}throw new Error("Wrong type of the file source object. Can not get file name");case 11:return a=u.default.sanitizeFileName(a),e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.filePath(r),"/").concat(a),query:s,form:{file:t}}));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"append",value:(v=(0,s.default)(o.default.mark((function e(t,r,n){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(n=r,r=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,r=s.fileName)),r){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if(r=u.default.sanitizeFileName(r),"string"!=typeof n){e.next=9;break}return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),data:{url:n}}));case 9:if(!u.default.isBytesArray(n)){e.next=14;break}return e.next=12,u.default.toBase64(n);case 12:return n=e.sent,e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendBinaryPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},data:n}));case 14:return e.abrupt("return",this.app.request.post({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),form:{file:n}}));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return v.apply(this,arguments)})},{key:"appendText",value:(y=(0,s.default)(o.default.mark((function e(t,r,n){var s,i=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:if(t=u.default.trimSlashesInPath(t),2===i.length&&(n=r,r=void 0,(s=u.default.parseFilePath(t)).fileName&&(t=s.filePath,r=s.fileName)),r){e.next=6;break}throw new Error("Can not resolve target file name");case 6:if("string"==typeof n){e.next=8;break}throw new Error('"textContent" must be a string');case 8:return r=u.default.sanitizeFileName(r),e.abrupt("return",this.app.request.put({url:"".concat(this.app.urls.fileAppendPath(t),"/").concat(r),headers:{"Content-Type":"text/plain"},data:n}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return y.apply(this,arguments)})},{key:"listing",value:(h=(0,s.default)(o.default.mark((function e(t,r,n,s,i){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={},t&&"string"==typeof t){e.next=3;break}throw new Error('"filePath" must be provided and must be a string.');case 3:return t=u.default.trimSlashesInPath(t),r&&"string"==typeof r&&(a.pattern=r),"boolean"==typeof n&&(a.sub=n),"number"==typeof s&&s>=0&&(a.pagesize=s),"number"==typeof i&&i>=0&&(a.offset=i),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:a}));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return h.apply(this,arguments)})},{key:"renameFile",value:(d=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"oldPathName" must be provided and must be a string.');case 2:if(r&&"string"==typeof r){e.next=4;break}throw new Error("New File Name must be provided and must be a string.");case 4:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileRename(),data:{oldPathName:u.default.ensureSlashInPath(t),newName:r}}));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"moveFile",value:(p=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileMove(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(r)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"copyFile",value:(f=(0,s.default)(o.default.mark((function e(t,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.app.request.put({url:this.app.urls.fileCopy(),data:{sourcePath:u.default.ensureSlashInPath(t),targetPath:u.default.ensureSlashInPath(r)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"remove",value:(l=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t.startsWith("http://")||t.startsWith("https://")||(t=this.app.urls.filePath(t)),e.abrupt("return",this.app.request.delete({url:t}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"exists",value:(n=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filePath" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"exists"}}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"removeDirectory",value:(r=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('Directory "path" must be provided and must be a string.');case 2:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.delete({url:this.app.urls.filePath(t)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getFileCount",value:(t=(0,s.default)(o.default.mark((function e(t,r,n,s){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"string"==typeof t){e.next=2;break}throw new Error('"filesPath" must be provided and must be a string.');case 2:if(!r||"string"==typeof r){e.next=4;break}throw new Error("Files Pattern must be provided and must be a string.");case 4:return t=u.default.trimSlashesInPath(t),e.abrupt("return",this.app.request.get({url:this.app.urls.filePath(t),query:{action:"count",pattern:r||"*",sub:!!n,countDirectories:!!s}}));case 6:case"end":return e.stop()}}),e,this)}))),function(e,r,n,o){return t.apply(this,arguments)})}]),e}();t.default=l},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(3)),s=n(r(4)),i={isBytesArray:function(e){return"undefined"!=typeof Buffer&&e instanceof Buffer||("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||Array.isArray(e))},ensureSlashInPath:function(e){return e.startsWith("/")?e:"/".concat(e)},trimSlashesInPath:function(e){return e&&(e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e},parseFilePath:function(e){var t={filePath:e,fileName:null};if(e){var r=e.split("/");r[r.length-1].includes(".")&&(t.fileName=r.pop(),t.filePath=r.join("/"))}return t},sanitizeFileName:function(e){return encodeURIComponent(e).replace(/'/g,"%27").replace(/"/g,"%22")},getFileName:function(e){if(e.name)return e.name;if(e.path){var t=e.path.split("/");return t[t.length-1]}},toBase64:function(e){return(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"==typeof Blob){t.next=3;break}return e instanceof Blob||(e=new Blob([e],{type:""})),t.abrupt("return",new Promise((function(t,r){var n=new FileReader;n.onerror=function(e){return r(e)},n.onload=function(e){return t(e.target.result.split(";base64,")[1])},n.readAsDataURL(e)})));case 3:if("undefined"==typeof Buffer){t.next=5;break}return t.abrupt("return",Buffer.from(e).toString("base64"));case 5:return t.abrupt("return",e);case 6:case"end":return t.stop()}}),t)})))()}};t.default=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(7)),a=n(r(8)),u=n(r(5)),c=n(r(6));function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,u.default)(e);if(t){var o=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}var f=function(e){(0,i.default)(r,e);var t=l(r);function r(){return(0,o.default)(this,r),t.apply(this,arguments)}return(0,s.default)(r,[{key:"getRequestURL",value:function(e,t){return this.app.urls.filePermission(e,t)}}]),r}(n(r(40)).default);t.default=f,(0,c.default)(f,"BACKWARD_COMPATIBILITY_LABEL","Backendless.Files.Permissions.{READ|DELETE|WRITE}")},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(89)),a=function(){function e(t){(0,o.default)(this,e),this.app=t}return(0,s.default)(e,[{key:"connect",value:function(e){return new i.default({name:e},this.app)}}]),e}();t.default=a},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,s,i,a,u,c,l,f,p,d,h=n(r(23)),y=n(r(1)),v=n(r(2)),m=n(r(32)),g=n(r(12)),b=n(r(7)),k=n(r(8)),w=n(r(5)),E=n(r(6)),_=n(r(41)),O=r(16);function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach((function(t){(0,E.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,w.default)(e);if(t){var o=(0,w.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,k.default)(this,r)}}var T="CHANGES",j="CLEARED",C="INVOKE",P=(o=O.RTScopeConnector.connectionRequired(),s=O.RTScopeConnector.connectionRequired(),i=O.RTScopeConnector.connectionRequired(),a=O.RTScopeConnector.connectionRequired(),u=O.RTScopeConnector.connectionRequired(!0),c=O.RTScopeConnector.connectionRequired(!0),l=O.RTScopeConnector.connectionRequired(!0),f=O.RTScopeConnector.connectionRequired(!0),p=O.RTScopeConnector.connectionRequired(!0),d=function(e){(0,b.default)(r,e);var t=R(r);function r(e,n){var o;return(0,y.default)(this,r),o=t.call(this,e),(0,E.default)((0,m.default)(o),"onInvoke",(function(e){var t,r=e.method,n=e.args;A(o.invocationTarget,r),(t=o.invocationTarget)[r].apply(t,(0,h.default)(n))})),o.app=n,o.invocationTarget=null,o.connect(),o}return(0,v.default)(r,[{key:"connectSubscriber",get:function(){return this.app.RT.subscriptions.connectToRSO}},{key:"usersSubscriber",get:function(){return this.app.RT.subscriptions.onRSOUserStatus}},{key:"commandSubscriber",get:function(){return this.app.RT.subscriptions.onRSOCommand}},{key:"commandSender",get:function(){return this.app.RT.methods.sendRSOCommand}},{key:"setInvocationTarget",value:function(e){this.invocationTarget=e}},{key:"connect",value:function(){if(this.app)return(0,g.default)((0,w.default)(r.prototype),"connect",this).call(this)}},{key:"onConnect",value:function(){(0,g.default)((0,w.default)(r.prototype),"onConnect",this).apply(this,arguments),this.addSubscription(C,this.app.RT.subscriptions.onRSOInvoke,{callback:this.onInvoke})}},{key:"onDisconnect",value:function(){this.stopSubscription(C,{callback:this.onInvoke}),(0,g.default)((0,w.default)(r.prototype),"onDisconnect",this).apply(this,arguments)}},{key:"addChangesListener",value:function(e,t){this.addSubscription(T,this.app.RT.subscriptions.onRSOChanges,{callback:e,onError:t})}},{key:"removeChangesListeners",value:function(e){this.stopSubscription(T,{callback:e})}},{key:"addClearListener",value:function(e,t){this.addSubscription(j,this.app.RT.subscriptions.onRSOClear,{callback:e,onError:t})}},{key:"removeClearListeners",value:function(e){this.stopSubscription(j,{callback:e})}},{key:"addCommandListener",value:function(e,t){return(0,g.default)((0,w.default)(r.prototype),"addCommandListener",this).call(this,e,t),this}},{key:"removeCommandListener",value:function(e){return(0,g.default)((0,w.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"removeCommandListeners",value:function(e){return(0,g.default)((0,w.default)(r.prototype),"removeCommandListeners",this).call(this,e),this}},{key:"addUserStatusListener",value:function(e,t){return(0,g.default)((0,w.default)(r.prototype),"addUserStatusListener",this).call(this,e,t),this}},{key:"removeUserStatusListeners",value:function(e){return(0,g.default)((0,w.default)(r.prototype),"removeUserStatusListeners",this).call(this,e),this}},{key:"addConnectListener",value:function(e,t){return(0,g.default)((0,w.default)(r.prototype),"addConnectListener",this).call(this,e,t),this}},{key:"removeConnectListeners",value:function(e,t){return(0,g.default)((0,w.default)(r.prototype),"removeConnectListeners",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(){return(0,g.default)((0,w.default)(r.prototype),"removeAllListeners",this).call(this),this}},{key:"get",value:function(e){return this.app.RT.methods.getRSO(x(x({},this.getScopeOptions()),{},{key:e}))}},{key:"set",value:function(e,t){return this.app.RT.methods.setRSO(x(x({},this.getScopeOptions()),{},{key:e,data:t}))}},{key:"clear",value:function(){return this.app.RT.methods.clearRSO(this.getScopeOptions())}},{key:"invoke",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this.invokeOn.apply(this,[e,void 0].concat(r))}},{key:"invokeOn",value:function(e,t){for(var r=this,n=arguments.length,o=new Array(n>2?n-2:0),s=2;s<n;s++)o[s-2]=arguments[s];return Promise.resolve().then((function(){return A(r.invocationTarget,e)})).then((function(){return r.app.RT.methods.invokeRSOMethod(x(x({},r.getScopeOptions()),{},{method:e,targets:t,args:o}))}))}}]),r}(O.RTScopeConnector),(0,_.default)(d.prototype,"addChangesListener",[o],Object.getOwnPropertyDescriptor(d.prototype,"addChangesListener"),d.prototype),(0,_.default)(d.prototype,"removeChangesListeners",[s],Object.getOwnPropertyDescriptor(d.prototype,"removeChangesListeners"),d.prototype),(0,_.default)(d.prototype,"addClearListener",[i],Object.getOwnPropertyDescriptor(d.prototype,"addClearListener"),d.prototype),(0,_.default)(d.prototype,"removeClearListeners",[a],Object.getOwnPropertyDescriptor(d.prototype,"removeClearListeners"),d.prototype),(0,_.default)(d.prototype,"get",[u],Object.getOwnPropertyDescriptor(d.prototype,"get"),d.prototype),(0,_.default)(d.prototype,"set",[c],Object.getOwnPropertyDescriptor(d.prototype,"set"),d.prototype),(0,_.default)(d.prototype,"clear",[l],Object.getOwnPropertyDescriptor(d.prototype,"clear"),d.prototype),(0,_.default)(d.prototype,"invoke",[f],Object.getOwnPropertyDescriptor(d.prototype,"invoke"),d.prototype),(0,_.default)(d.prototype,"invokeOn",[p],Object.getOwnPropertyDescriptor(d.prototype,"invokeOn"),d.prototype),d);function A(e,t){if(!e)throw new Error('"invocationTarget" is not specified');if("function"!=typeof e[t])throw new Error('Method "'.concat(t,'" of invocationTarget is not function'))}t.default=P},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=n(r(10)),a=n(r(91)),u=n(r(92)),c=function(){function e(t){(0,o.default)(this,e),this.app=t,this.storageName=this.app.appId?"".concat("Backendless","_").concat(this.app.appId):"Backendless";var r=i.default.isLocalStorageSupported?u.default:a.default;this.setStorage(r),this.Keys={USER_TOKEN:"user-token",CURRENT_USER_ID:"current-user-id",STAY_LOGGED_IN:"stayLoggedIn"}}return(0,s.default)(e,[{key:"setStorage",value:function(e){this.storage=new e(this.storageName,"Backendless")}},{key:"set",value:function(e,t){this.storage.set(e,t)}},{key:"get",value:function(e){return this.storage.get(e)}},{key:"remove",value:function(e){this.storage.remove(e)}}]),e}();t.default=c},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2)),i=function(){function e(){(0,o.default)(this,e),this.data={}}return(0,s.default)(e,[{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t}},{key:"remove",value:function(e){delete this.data[e]}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1)),s=n(r(2));var i=function(){function e(t,r){(0,o.default)(this,e),this.storageName=t,function(e,t){if(!localStorage.getItem(e.storageName)){var r=localStorage.getItem(t);r&&(localStorage.setItem(e.storageName,r),localStorage.removeItem(t))}}(this,r)}return(0,s.default)(e,[{key:"getStore",value:function(){try{return JSON.parse(localStorage.getItem(this.storageName))||{}}catch(e){console.warn("Could not parse data from LocalStorage",e)}return{}}},{key:"setStore",value:function(e){localStorage.setItem(this.storageName,JSON.stringify(e))}},{key:"get",value:function(e){return this.getStore()[e]}},{key:"set",value:function(e,t){var r=this.getStore();r[e]=t,this.setStore(r)}},{key:"remove",value:function(e){var t=this.getStore();delete t[e],this.setStore(t)}}]),e}();t.default=i},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t){(0,f.default)(n,t);var r=O(n);function n(t){return(0,c.default)(this,n),r.call(this,t,e)}return(0,l.default)(n,null,[{key:"initFromJSON",value:function(e){var t=new this(e.transactionIsolation);return e.operations.forEach((function(e){g.OperationJSONAdapter[e.operationType](t,e).setOpResultId(e.opResultId)})),t}}]),n}(R)};var o=n(r(3)),s=n(r(9)),i=n(r(4)),a=n(r(31)),u=n(r(6)),c=n(r(1)),l=n(r(2)),f=n(r(7)),p=n(r(8)),d=n(r(5)),h=n(r(94)),y=n(r(10)),v=n(r(11)),m=r(25),g=r(98),b=r(42),k=r(43),w=["meta"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){(0,u.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,d.default)(e);if(t){var o=(0,d.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,p.default)(this,r)}}var S=function(e){(0,f.default)(r,e);var t=O(r);function r(e,n){var o;return(0,c.default)(this,r),(o=t.call(this,e)).operation=n,o}return(0,l.default)(r,[{key:"toJSON",value:function(){return{message:this.message,operation:this.operation}}}]),r}((0,h.default)(Error)),x=function(){function e(t){var r=t.success,n=t.error,o=t.results;(0,c.default)(this,e),this.success=r,this.error=n,this.results=o}return(0,l.default)(e,[{key:"isSuccess",value:function(){return this.success}},{key:"getError",value:function(){return this.error}},{key:"getResults",value:function(){return this.results}}]),e}(),R=function(){function e(t,r){(0,c.default)(this,e),this.app=r,this.payload={isolationLevelEnum:t,operations:[]},this.usedOpIds={}}var t;return(0,l.default)(e,[{key:"getOpResultById",value:function(e){return this.payload.operations.find((function(t){return t.meta.opResult.getOpResultId()===e})).meta.opResult}},{key:"setIsolationLevel",value:function(e){this.payload.isolationLevelEnum=e}},{key:"getOpStackName",value:function(e,t){return"".concat(e.toLowerCase()).concat(t)}},{key:"getNextOpResultIndex",value:function(e){return this.usedOpIds[e]||(this.usedOpIds[e]=0),++this.usedOpIds[e]}},{key:"addOperations",value:function(e,t,r){Array.isArray(r)?r=r.map((function(e){return delete e.___jsonclass,e})):delete r.___jsonclass;var n=new b.OpResult(this,{operationType:e,table:t,payload:r});return this.payload.operations.push({operationType:e,table:t,payload:r,meta:{opResult:n}}),n}},{key:"composePayload",value:function(){return _(_({},this.payload),{},{operations:this.payload.operations.map((function(e){var t=e.meta;return _(_({},(0,a.default)(e,w)),{},{opResultId:t.opResult.getOpResultId()})}))})}},{key:"execute",value:(t=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.app.request.post({url:this.app.urls.transactions(),data:this.composePayload()});case 2:return t=e.sent,e.abrupt("return",this.setResult(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setResult",value:function(e){if(e.results&&this.payload.operations.forEach((function(t){var r=t.meta.opResult.getOpResultId();e.results[r]&&t.meta.opResult.setResult(e.results[r].result)})),e.error){var t=this.payload.operations.find((function(t){return e.error.operation.opResultId===t.meta.opResult.getOpResultId()}));e.error=new S(e.error.message,t.meta.opResult),t.meta.opResult.setError(e.error)}return new x(e)}},{key:"find",value:function(e,t){var r=t instanceof v.default?t.toJSON():t||{};if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if("object"!==(0,s.default)(r)||Array.isArray(r))throw new Error("Invalid arguments");var n={queryOptions:{}};return r.pageSize>0&&(n.pageSize=r.pageSize),r.offset>0&&(n.offset=r.offset),r.properties&&(n.properties=r.properties),r.excludeProps&&(n.excludeProps=r.excludeProps),r.excludeProps&&(n.excludeProps=r.excludeProps),r.where&&(n.whereClause=r.where),r.having&&(n.havingClause=r.having),r.groupBy&&(n.groupBy=r.groupBy),r.sortBy&&(n.queryOptions.sortBy=r.sortBy),r.relations&&(n.queryOptions.related=r.relations),r.relationsDepth&&(n.queryOptions.relationsDepth=r.relationsDepth),r.relationsPageSize>0&&(n.queryOptions.relationsPageSize=r.relationsPageSize),this.addOperations(m.OperationType.FIND,e,n)}},{key:"upsert",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPSERT,e,t)}},{key:"create",value:function(){var e,t;if(1===arguments.length)e=y.default.getClassName(arguments.length<=0?void 0:arguments[0]),t=arguments.length<=0?void 0:arguments[0];else{if(2!==arguments.length)throw new Error("Invalid arguments");e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1]}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");if(!t||"object"!==(0,s.default)(t)||Array.isArray(t))throw new Error("Invalid arguments");return this.addOperations(m.OperationType.CREATE,e,t)}},{key:"update",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)e=y.default.getClassName(n[0]),t=n[0];else if(2===n.length&&"string"==typeof n[0])e=n[0],t=n[1];else{if(!(n[0]instanceof b.OpResult||n[0]instanceof k.OpResultValueReference))throw new Error("Invalid arguments");if(e=n[0].getTableName(),t={objectId:n[0]},3===n.length&&"string"==typeof n[1])t[n[1]]=n[2];else{if(2!==n.length)throw new Error("Invalid arguments");t=_(_({},t),n[1])}}if(!e||"string"!=typeof e)throw new Error("Invalid arguments");return this.addOperations(m.OperationType.UPDATE,e,t)}},{key:"delete",value:function(){for(var e,t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)n[0]instanceof b.OpResult||n[0]instanceof k.OpResultValueReference?(e=n[0].getTableName(),t=n[0]):n[0]&&"object"===(0,s.default)(n[0])&&!Array.isArray(n[0])&&(e=y.default.getClassName(n[0]),t=n[0].objectId);else{if(2!==n.length)throw new Error("Invalid arguments");e=n[0],t=n[1]&&n[1].objectId||n[1]}if(!t||Array.isArray(t)||"string"!=typeof t&&"object"!==(0,s.default)(t))throw new Error("Invalid arguments");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE,e,t)}},{key:"bulkUpsert",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPSERT_BULK,e,t)}},{key:"bulkCreate",value:function(e,t){if(Array.isArray(e)&&(t=e,e=y.default.getClassName(t[0])),!t||!Array.isArray(t))throw new Error("Objects must be an array of objects.");if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.CREATE_BULK,e,t)}},{key:"bulkUpdate",value:function(){for(var e,t={},r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(2===n.length)t.changes=n[1],"string"==typeof n[0]?(e=y.default.getClassName(n[1]),t.conditional=n[0]):n[0]instanceof b.OpResult&&(e=n[0].getTableName(),t.unconditional=n[0]);else{if(3!==n.length)throw new Error("Invalid arguments");if(e=n[0],t.changes=n[2],"string"==typeof n[1])t.conditional=n[1];else{if(!Array.isArray(n[1]))throw new Error("Invalid arguments");t.unconditional=n[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.UPDATE_BULK,e,t)}},{key:"bulkDelete",value:function(){for(var e,t={},r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];if(1===n.length)if(n[0]instanceof b.OpResult)e=n[0].getTableName(),t.unconditional=n[0];else{if(!Array.isArray(n[0]))throw new Error("Invalid arguments");e=y.default.getClassName(n[0][0]),t.unconditional=n[0].map((function(e){return e.objectId}))}else{if(2!==n.length)throw new Error("Invalid arguments");if(e=n[0],"string"==typeof n[1])t.conditional=n[1];else{if(!Array.isArray(n[1]))throw new Error("Invalid arguments");t.unconditional=n[1].map((function(e){return e.objectId||e}))}}if(!e||"string"!=typeof e)throw new Error("Table Name must be a string.");return this.addOperations(m.OperationType.DELETE_BULK,e,t)}},{key:"addToRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.ADD_RELATION,t)}},{key:"setRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.SET_RELATION,t)}},{key:"deleteRelation",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.relationsOperation(m.OperationType.DELETE_RELATION,t)}},{key:"relationsOperation",value:function(e,t){var r,n,o,i,a,u;if(3===t.length)if(o=t[0],n=t[1],u=t[2],o instanceof b.OpResult||o instanceof k.OpResultValueReference)r=o.getTableName();else{if(!o||"object"!==(0,s.default)(o))throw new Error("Invalid the first argument, it must be an instance of [OpResult|OpResultValueReference|Object]");r=y.default.getClassName(o)}else{if(4!==t.length)throw new Error("Invalid arguments");if(r=t[0],n=t[2],u=t[3],"string"==typeof t[1])o=t[1];else{if(!t[1]||"object"!==(0,s.default)(t[1]))throw new Error("Invalid the second argument, it must be an Object or objectId");o=t[1]}}if(o&&o.objectId&&(o=o.objectId),"string"==typeof u?i=u:u instanceof b.OpResult&&u.isCollectionRef()?a=u:(Array.isArray(u)||(u=[u]),a=u.map((function(e){if(e){if(e instanceof b.OpResult||e instanceof k.OpResultValueReference)return e;if("string"==typeof e)return e;if(e.objectId)return e.objectId}throw new Error("Invalid child argument, it must be an instance of [OpResult|OpResultValueReference|Object] or objectId")}))),!n||"string"!=typeof n)throw new Error('Invalid "relationColumn" parameter, check passed arguments');if(!a&&!i)throw new Error('Neither "unconditional" nor "conditional" parameter is specified, check passed arguments');if(!r||"string"!=typeof r)throw new Error("Table Name must be a string.");var c={parentObject:o,relationColumn:n};return i?c.conditional=i:c.unconditional=a,this.addOperations(e,r,c)}}]),e}();(0,u.default)(R,"IsolationLevelEnum",m.IsolationLevelEnum),(0,u.default)(R,"OpResult",b.OpResult),(0,u.default)(R,"OpResultValueReference",k.OpResultValueReference)},function(e,t,r){var n=r(5),o=r(20),s=r(95),i=r(96);function a(t){var r="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!s(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return i(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.default=e.exports,e.exports.__esModule=!0,a(t)}e.exports=a,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(20),o=r(97);function s(t,r,i){return o()?(e.exports=s=Reflect.construct,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=s=function(e,t,r){var o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return r&&n(s,r.prototype),s},e.exports.default=e.exports,e.exports.__esModule=!0),s.apply(null,arguments)}e.exports=s,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.OperationJSONAdapter=void 0;var o=n(r(9)),s=r(25),i=r(42);function a(e,t){if(Array.isArray(t))return t.map((function(t){return a(e,t)}));if(t&&"object"===(0,o.default)(t)){if(t.___ref){var r=e.getOpResultById(t.opResultId);return void 0!==t.resultIndex?r.resolveTo(t.resultIndex,t.propName):void 0!==t.propName?r.resolveTo(t.propName):r}var n={};for(var s in t)n[s]=a(e,t[s]);return n}return t}var u={CREATE:function(e,t){var r=t.table,n=t.payload;return e.create.call(e,r,a(e,n))},DELETE:function(e,t){var r=t.table,n=t.payload;return e.delete.call(e,r,a(e,n))},UPDATE:function(e,t){var r=t.table,n=t.payload;return e.update.call(e,r,a(e,n))},UPSERT:function(e,t){var r=t.table,n=t.payload;return e.upsert.call(e,r,a(e,n))},UPDATE_BULK:function(e,t){var r=t.table,n=t.payload,o=c(e,{table:r,payload:n});return o.push(a(e,n.changes)),e.bulkUpdate.apply(e,o)},DELETE_BULK:function(e,t){var r=c(e,{table:t.table,payload:t.payload});return e.bulkDelete.apply(e,r)},CREATE_BULK:function(e,t){var r=t.table,n=t.payload;return e.bulkCreate.call(e,r,a(e,n))},UPSERT_BULK:function(e,t){var r=t.table,n=t.payload;return e.bulkUpsert.call(e,r,a(e,n))},SET_RELATION:function(e,t){return l(e,"setRelation",{table:t.table,payload:t.payload})},DELETE_RELATION:function(e,t){return l(e,"deleteRelation",{table:t.table,payload:t.payload})},ADD_RELATION:function(e,t){return l(e,"addToRelation",{table:t.table,payload:t.payload})},FIND:function(e,t){var r=t.table,n=t.payload;return e.addOperations(s.OperationType.FIND,r,n)}};function c(e,t){var r=t.table,n=t.payload,o=[];if(n.conditional)o.push(r),o.push(n.conditional);else{var s=a(e,n.unconditional);s instanceof i.OpResult||o.push(r),o.push(s)}return o}function l(e,t,r){var n=r.table,o=r.payload,s=[n];return"string"==typeof o.parentObject?s.push({objectId:o.parentObject}):s.push(a(e,o.parentObject)),s.push(o.relationColumn),s.push(o.conditional||a(e,o.unconditional)),e[t].apply(e,s)}t.OperationJSONAdapter=u},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(1));t.default=function e(t){if((0,o.default)(this,e),!(t&&t.uuid&&t.platform&&t.version))throw new Error('Device properties object must consist of fields "uuid", "platform" and "version".');this.uuid=t.uuid,this.platform=t.platform.toUpperCase(),this.version=t.version}},function(e,t,r){"use strict";var n=r(0);Object.defineProperty(t,"__esModule",{value:!0}),t.getUserAgent=function(){var e="NodeJS";o.default.isBrowser&&(e=navigator.userAgent?navigator.userAgent.toLowerCase():"hybrid-app");var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],r={browser:t[1]||"",version:t[2]||"0"},n={};r.browser&&(n[r.browser]=!0,n.version=r.version);return n};var o=n(r(10))}])}));