-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfleetbase.js
More file actions
2 lines (2 loc) · 209 KB
/
Copy pathfleetbase.js
File metadata and controls
2 lines (2 loc) · 209 KB
1
2
"use strict";function t(t,e){this.v=t,this.k=e}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function n(t){if(Array.isArray(t))return t}function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(e){var n={},r=!1;function i(n,i){return r=!0,i=new Promise((function(t){t(e[n](i))})),{done:!1,value:new t(i,1)}}return n["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},n.next=function(t){return r?(r=!1,t):i("next",t)},"function"==typeof e.throw&&(n.throw=function(t){if(r)throw r=!1,t;return i("throw",t)}),"function"==typeof e.return&&(n.return=function(t){return r?(r=!1,t):i("return",t)}),n}function o(t){var e,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new a(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function a(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return a=function(t){this.s=t,this.n=t.next},a.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new a(t)}function s(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){s(o,r,i,a,u,"next",t)}function u(t){s(o,r,i,a,u,"throw",t)}a(void 0)}))}}function c(e){return new t(e,0)}function l(t,e,n){return e=y(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return r(t)}(t,m()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e,n){if(m())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&O(i,n.prototype),i}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,j(r.key),r)}}function v(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function p(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function g(t,e,n){return(e=j(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function b(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}function m(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(m=function(){return!!t})()}function w(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(){E=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return i(a,"_invoke",{value:S(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",v="executing",p="completed",g={};function y(){}function b(){}function m(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(L([])));x&&x!==n&&r.call(x,a)&&(w=x);var A=m.prototype=y.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,o,a,s){var u=h(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function S(e,n,r){var i=f;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=j(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?p:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=p,r.method="throw",r.arg=c.arg)}}}function j(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=m,i(A,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:b,configurable:!0}),b.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},O(R.prototype),c(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new R(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(A),c(A,u,"Generator"),c(A,a,(function(){return this})),c(A,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function O(t,e){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},O(t,e)}function R(t,e){return n(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||_(t,e)||k()}function S(t){return function(t){if(Array.isArray(t))return e(t)}(t)||w(t)||_(t)||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.")}()}function j(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function _(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function P(t){return function(){return new L(t.apply(this,arguments))}}function L(e){var n,r;function i(n,r){try{var a=e[n](r),s=a.value,u=s instanceof t;Promise.resolve(u?s.v:s).then((function(t){if(u){var r="return"===n?"return":"next";if(!s.k||t.done)return i(r,t);t=e[r](t).value}o(a.done?"return":"normal",t)}),(function(t){i("throw",t)}))}catch(t){o("throw",t)}}function o(t,e){switch(t){case"return":n.resolve({value:e,done:!0});break;case"throw":n.reject(e);break;default:n.resolve({value:e,done:!1})}(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(t,e){return new Promise((function(o,a){var s={key:t,arg:e,resolve:o,reject:a,next:null};r?r=r.next=s:(n=r=s,i(t,e))}))},"function"!=typeof e.return&&(this.return=void 0)}function C(t){var e="function"==typeof Map?new Map:void 0;return C=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return f(t,arguments,y(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,t)},C(t)}Object.defineProperty(exports,"__esModule",{value:!0}),L.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},L.prototype.next=function(t){return this._invoke("next",t)},L.prototype.throw=function(t){return this._invoke("throw",t)},L.prototype.return=function(t){return this._invoke("return",t)};var N=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];h(this,t),g(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),g(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),g(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),g(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),g(this,"idSuffix",new RegExp("(_ids|_id)$","g")),g(this,"underbar",new RegExp("_","g")),g(this,"spaceOrUnderbar",new RegExp("[ _]","g")),g(this,"uppercase",new RegExp("([A-Z])","g")),g(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return v(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i<e.length;i++)if(t.match(e[i][0])){t=t.replace(e[i][0],e[i][1]);break}return this.str=t,!0===this.chain?this:t}},{key:"pluralize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r<n.length;r++){for(var i=n[r].split("_"),o=e&&r+1===n.length?1:0;o<i.length;o++)i[o]=i[o].charAt(0).toUpperCase()+i[o].substring(1);n[r]=i.join("")}if(t=n.join("::"),!0===e){var a=t.charAt(0).toLowerCase(),s=t.slice(1);t=a+s}return this.str=t,!0===this.chain?this:t}},{key:"underscore",value:function(t){for(var e=(t=t||this.str).split("::"),n=0;n<e.length;n++)e[n]=e[n].replace(this.uppercase,"_$1"),e[n]=e[n].replace(this.underbarPrefix,"");return t=e.join("/").toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"humanize",value:function(t,e){return t=(t=(t=(t=t||this.str).toLowerCase()).replace(this.idSuffix,"")).replace(this.underbar," "),e||(t=this.capitalize(t)),this.str=t,!0===this.chain?this:t}},{key:"capitalize",value:function(t){return t=(t=(t=t||this.str).toLowerCase()).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"dasherize",value:function(t){return t=(t=(t=t||this.str).replace(this.spaceOrUnderbar,"-")).toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"normify",value:function(t,e){t=t||this.str,!0===e?(t=this.camelize(t),t=this.underscore(t)):t=t.toLowerCase();for(var n=(t=t.replace(this.underbar," ")).split(" "),r=0;r<n.length;r++){for(var i=n[r].split("-"),o=0;o<i.length;o++)this.nonTitlecasedWords.indexOf(i[o].toLowerCase())<0&&(i[o]=this.capitalize(i[o]));n[r]=i.join("-")}return t=(t=n.join(" ")).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"demodulize",value:function(t){var e=(t=t||this.str).split("::");return t=e[e.length-1],this.str=t,!0===this.chain?this:t}},{key:"tableize",value:function(t){t=t||this.str;var e=this.chain;return this.chain=!1,t=this.pluralize(this.underscore(t)),this.chain=e,this.str=t,!0===this.chain?this:t}},{key:"classify",value:function(t){t=t||this.str,t=(t="".concat(t).trim()).replace(/[\s\-_]+/g,"_");var e=this.chain;return this.chain=!1,t=this.singularize(t),t=this.camelize(t,!1),this.chain=e,this.str=t,this.chain?this:t}},{key:"foreignKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n<e.length;n++){var r=parseInt(e[n]);if(isNaN(r)){var i=e[n].substring(e[n].length-2),o=e[n].substring(e[n].length-1),a="th";"11"!=i&&"12"!=i&&"13"!=i&&("1"===o?a="st":"2"===o?a="nd":"3"===o&&(a="rd")),e[n]+=a}}return t=e.join(" "),this.str=t,!0===this.chain?this:t}}],[{key:"invoke",value:function(){var e=Object.values(arguments),n=new t(null,!1),r=arguments[0];return e.shift(),"function"==typeof n[r]?n[r].apply(n,e):null}}])}(),F=function(){var t=["pluralize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},D=function(){var t=["singularize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},$=function(){var t=["classify"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},U={resources:{},adapters:{},storse:{},actions:{}};function z(t,e,n){var r=F(t);U[r]||(U[r]={}),U[r][e]=n}function B(t,e){var n=F(t);if(!U[n])throw new Error("Unknown type: ".concat(D(t)));if(!U[n][e])throw new Error("No ".concat(D(t)," named '").concat(e,"' registered."));for(var r=U[n][e],i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];return f(r,o)}function q(){return B.apply(void 0,["store","Store"].concat(Array.prototype.slice.call(arguments)))}var I=function(){return v((function t(){return h(this,t),this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return B.apply(void 0,[t,e].concat(r))}}])}();function M(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return B.apply(void 0,[t,$(e)].concat(r))}function H(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return M.apply(void 0,["resource",$(t)].concat(n))}var J=Array.isArray,W=6e4;function K(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(J(t))if(r.length<=W)t.splice.apply(t,[e,n].concat(S(r)));else{t.splice(e,n);for(var i=0;i<r.length;i+=W){var o=r.slice(i,i+W);t.splice.apply(t,[e+i,0].concat(S(o)))}}else V(t)&&t.replace(e,n,r)}function G(t){return t}function V(t){return t instanceof nt}function X(t,e){return J(t)?t[e]:V(t)?t.objectAt(e):null}function Q(t,e){return 2===arguments.length?function(n){return e===n[t]}:function(e){return Boolean(e[t])}}function Y(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i<r;i++){if(e(X(t,i),i,t))return i}return-1}function Z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;return n<0&&(n+=i),Y(t,r&&e!=e?function(t){return t!=t}:function(t){return t===e},n)}function tt(t,e,n){return K(t,e,0,[n]),n}function et(){return f(nt,Array.prototype.slice.call(arguments))}var nt=function(){function t(){return h(this,t),r(J(arguments[0])?l(this,t,S(arguments[0])):l(this,t,arguments))}return b(t,C(Array)),v(t,[{key:"notEmpty",get:function(){return this.length>0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return X(this,0)}},{key:"last",get:function(){return X(this,this.length-1)}},{key:"replace",value:function(t,e){return K(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return X(e,t)}))}},{key:"objectAt",value:function(t){return X(this,t)}},{key:"indexOf",value:function(t,e){return Z(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(X(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==Z(this,t,e,!0)}},{key:"findBy",value:function(){return t=this,e=Q.apply(void 0,arguments),-1===(r=Y(t,e.bind(n),0))?void 0:X(t,r);var t,e,n,r}},{key:"findIndexBy",value:function(){return Y(this,Q.apply(void 0,arguments))}},{key:"isEvery",value:function(){return t=this,e=Q.apply(void 0,arguments),r=e.bind(n),-1===Y(t,(function(t,e,n){return!r(t,e,n)}),0);var t,e,n,r}},{key:"isAny",value:function(){return t=this,e=Q.apply(void 0,arguments),-1!==Y(t,e.bind(n),0);var t,e,n}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=[];return this.forEach((function(e){var r;return i.push(null===(r=e[t])||void 0===r?void 0:r.call.apply(r,[e].concat(n)))})),i}},{key:"toArray",value:function(){return this.map((function(t){return t}))}},{key:"compact",value:function(){return this.filter((function(t){return null!=t}))}},{key:"sortBy",value:function(){var t=arguments;return this.sort((function(e,n){var r,i=p(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=e[o],s=n[o],u=compare(a,s);if(u)return u}}catch(t){i.e(t)}finally{i.f()}return 0}))}},{key:"uniqBy",value:function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return tt(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return K(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=X(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=X(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return tt(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;){X(this,e)===t&&this.removeAt(e)}return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}])}();function rt(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=T(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1}function it(){var t,e,n;return!("undefined"==typeof process||"object"!==T(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(n=window)||void 0===n||null===(n=n.navigator)||void 0===n?void 0:n.product))}function ot(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return it()?M("adapter","NodeAdapter",t):M("adapter","BrowserAdapter",t)}var at=function(){return v((function t(e){h(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}),[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){var t,e=p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(J(n)){var r=n[0],i=n[1];if(this.has(r))return this.get(r,i)}else if(this.has(n))return this.get(n)}}catch(t){e.e(t)}finally{e.f()}return null}},{key:"has",value:function(t){return t in this.components}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=A(A({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}(),st=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;h(this,t),this.type="Point",this.coordinates=[n,e]}return v(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=R(e.coordinates,2),r=n[0];return new t(n[1],r)}}])}();function ut(t,e){var n=t();return Array.isArray(n)||"object"===T(n)?ct(n,e):null}function ct(t,e){var n,r=t,i=T(t),o="object"===i,a="function"===i,s=Array.isArray(t),u="string"===T(e)&&e.includes(".")?e.split("."):[e];if(s||o){for(var c=0;c<u.length;c++){if(r&&void 0===r[u[c]])return null;if(r){if(r=r[u[c]],"object"===T(n=r)&&!rt(null==n?void 0:n.attributes)&&"object"===T(null==n?void 0:n.attributes)&&void 0!==u[c+1]){var l=u.slice(c+1).join(".");return ct(r.attributes,l)}if("function"==typeof r)return ut(r,u.slice(c+1).join("."))}}return r}if(a)return ut(t,e)}function lt(t,e,n){var r=t,i="object"===T(t),o=Array.isArray(t),a="string"===T(e)&&e.includes(".")?e.split("."):[e],s=a.length;if(o||i){for(var u=0;u<s-1;u++)r[a[u]]||(r[a[u]]={}),r=r[a[u]];r[a[s-1]]=n}return n}function ht(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=J(e)?e:[e],!J(e))return e instanceof ft&&e.extend(t),t;var n,r=p(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.extendActions(i)}}catch(t){r.e(t)}finally{r.f()}}var ft=function(){return v((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;h(this,t),this.actions=e,this.bind=n}),[{key:"extend",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||this.bind;if(!t)return this;if(null!=this&&this.actions&&"object"===T(this.actions))for(var e in this.actions){var n=this.actions[e];"function"==typeof n?lt(t,e,n.bind(t)):lt(t,e,n)}return this}}])}();function dt(t){return t instanceof vt}var vt=function(){return v((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};h(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}),[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=q(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r<t.length;r++){var i=t[r];if("string"!=typeof i||!n.includes(i))throw new Error("".concat(i," is not a valid flag!"));this[i]=e}return this}},{key:"reset",value:function(){return this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isReloading=!1,this}},{key:"empty",value:function(){return this.reset(),this.attribues={},this}},{key:"save",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return rt(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n<t.length;n++){var r=t[n];e[r]=this.getAttribute(r)}return this.update(e)}},{key:"meta",get:function(){return this.getAttribute("meta",{})}},{key:"createdAt",get:function(){return this.isAttributeFilled("created_at")?new Date(this.getAttribute("created_at")):null}},{key:"updatedAt",get:function(){return this.isAttributeFilled("updated_at")?new Date(this.getAttribute("updated_at")):null}},{key:"isLoaded",get:function(){return this.hasAttributes(["created_at","id"])}},{key:"isEmpty",get:function(){return 0===Object.values(null==this?void 0:this.attributes).length}},{key:"isNew",get:function(){return!this.id}},{key:"isSaved",get:function(){return!this.isNew&&this.isLoaded}},{key:"isDeleted",get:function(){return this.hasAttributes(["deleted","time"])}},{key:"eachAttribute",value:function(t){var e,n=this;return"function"!=typeof t||Object.keys(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{}).forEach((function(e){var r=n.getAttribute(e);t.call(n,r,e)})),this}},{key:"changes",value:function(){return this.changes}},{key:"getDirtyAttributes",value:function(){return this.dirtyAttributes}},{key:"isDirty",value:function(t){return t in this.dirtyAttributes}},{key:"hasDirtyAttributes",value:function(){var t;return Object.keys(null!==(t=null==this?void 0:this.dirtyAttributes)&&void 0!==t?t:{}).length>0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===T(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return lt(this.attributes,t,n),lt(this.dirtyAttributes,t,r),J(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=ct(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(J(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return J(t)?this.hasAttribute(t)&&t.every((function(t){return!rt(e.getAttribute(t))})):this.hasAttribute(t)&&!rt(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!J(t))throw new Error("No attribute properties provided!");var n,r=p(t);try{for(r.s();!(n=r.n()).done;){var i,o,a=n.value;if("string"==typeof a){var s=this.getAttribute(a);"object"!==T(null===(i=s)||void 0===i?void 0:i.attributes)||J(null===(o=s)||void 0===o?void 0:o.attributes)||(s=s.attributes),e[a]=s}}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"serialize",value:function(){return this.getAttributes()}},{key:"mergeAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=A(A({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}])}();z("resource","Resource",vt);var pt=function(){return v((function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};h(this,t),this.resource=e,this.adapter=n||ot(),this.namespace=F(e),this.storage=et(),this.options=r,this.extendActions(r.actions)}),[{key:"extendActions",value:function(){return ht(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return M("resource",$(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),J(e)){var n,r=[],i=p(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(t.afterFetch(o))}}catch(t){i.e(t)}finally{i.f()}return et.apply(void 0,r)}var a=t.serialize(e);return t.deposit(a)}(this,t)}},{key:"create",value:(a=u(E().mark((function t(){var e,n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.post("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"update",value:(o=u(E().mark((function t(e){var n,r,i,o=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.next=4,this.adapter.put("".concat(this.namespace,"/").concat(e),n,r);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"findRecord",value:(i=u(E().mark((function t(e){var n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,this.adapter.get("".concat(this.namespace,"/").concat(e),{},n);case 3:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"findAll",value:(r=u(E().mark((function t(){var e,n,r=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.adapter.get("".concat(this.namespace),{},e);case 3:return n=t.sent,t.abrupt("return",this.afterFetch(n));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"query",value:(n=u(E().mark((function t(){var e,n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.get("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"queryRecord",value:(e=u(E().mark((function t(){var e,n,r,i=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},(e=i.length>0&&void 0!==i[0]?i[0]:{}).single=!0,t.next=5,this.adapter.get("".concat(this.namespace),e,n);case 5:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:(t=u(E().mark((function t(e){var n,r,i,o=arguments;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=dt(e)?e.getAttribute("id"):e,t.next=4,this.adapter.delete("".concat(this.namespace,"/").concat(r),{},n);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})}]);var t,e,n,r,i,o,a}();z("store","Store",pt);var gt=new ft({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),e,n)},getNextActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/next-activity"),e,n)},dispatch:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/dispatch"),e,n).then(this.afterFetch.bind(this))},start:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/start"),e,n).then(this.afterFetch.bind(this))},updateActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/update-activity"),e,n).then(this.afterFetch.bind(this))},setDestination:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/set-destination/").concat(e),n,r).then(this.afterFetch.bind(this))},captureQrCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-qr").concat(e?"/"+e:""),n,r)},captureSignature:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return dt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-signature").concat(e?"/"+e:""),n,r)},complete:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/complete"),e,n).then(this.afterFetch.bind(this))},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/cancel"),e,n).then(this.afterFetch.bind(this))}}),yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"order",A({actions:gt},r)])}return b(t,vt),v(t,[{key:"getDistanceAndTime",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getDistanceAndTime(this.id,t,e)}},{key:"dispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.dispatch(this.id,t,e)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.start(this.id,t,e)}},{key:"setDestination",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.setDestination(this.id,t,e,n)}},{key:"captureQrCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureQrCode(this.id,t,e,n)}},{key:"captureSignature",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureSignature(this.id,t,e,n)}},{key:"getNextActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getNextActivity(this.id,t,e)}},{key:"updateActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.updateActivity(this.id,t,e)}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.cancel(this.id,t,e)}},{key:"complete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.complete(this.id,t,e)}},{key:"isDispatched",get:function(){return null!==this.getAttribute("dispatched_at")}},{key:"isNotDispatched",get:function(){return null==this.getAttribute("dispatched_at")}},{key:"isStarted",get:function(){return null!==this.getAttribute("started_at")}},{key:"isNotStarted",get:function(){return null==this.getAttribute("started_at")}},{key:"isCompleted",get:function(){return"completed"==this.getAttribute("status")}},{key:"isCanceled",get:function(){return"canceled"==this.getAttribute("status")}},{key:"isEnroute",get:function(){return"driver_enroute"==this.getAttribute("status")||"enroute"===this.getAttribute("status")}},{key:"isInProgress",get:function(){return this.isStarted&&!this.isCanceled&&!this.isCompleted}},{key:"scheduledAt",get:function(){return this.isAttributeFilled("scheduled_at")?new Date(this.getAttribute("scheduled_at")):null}},{key:"startedAt",get:function(){return this.isAttributeFilled("started_at")?new Date(this.getAttribute("started_at")):null}},{key:"dispatchedAt",get:function(){return this.isAttributeFilled("dispatched_at")?new Date(this.getAttribute("dispatched_at")):null}},{key:"status",get:function(){return this.getAttribute("status")}}])}();z("resource","Order",yt);var bt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"payload",r])}return b(t,vt),v(t,[{key:"attach",value:function(t){}},{key:"entities",get:function(){var t=this;return et(this.entities.map((function(e){return H("Entity",e,t.adapter)})))}},{key:"dropoff",get:function(){return this.dropoff?H("Place",this.dropoff,this.adapter):null}},{key:"pickup",get:function(){return this.pickup?H("Place",this.pickup,this.adapter):null}},{key:"waypoints",get:function(){var t=this;return et(this.waypoints.map((function(e){return H("Waypoint",e,t.adapter)})))}}])}();z("resource","Payload",bt);var mt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"entity",r])}return b(t,vt),v(t)}();z("resource","Entity",mt);var wt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"place",r])}return b(t,vt),v(t,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return dt(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=R(e.getAttribute("coordinates"),2),o=i[0],a=i[1];return new t({name:null,address:e.getAttribute("address"),location:new st(o,a),street1:e.getAttribute("address"),street2:null,city:e.getAttribute("city"),province:e.getAttribute("stateLong"),postal_code:e.getAttribute("postalCode"),neighborhood:e.get("neighborhood"),district:e.getAttribute("county"),building:e.get("building"),country:e.getAttribute("countryShort"),phone:null,security_access_code:null},n,r)}}])}();z("resource","Place",wt);var kt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"waypoint",r])}return b(t,wt),v(t)}();z("resource","Waypoint",kt);var xt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"tracking-status",r])}return b(t,vt),v(t)}();function At(t,e){this.v=t,this.k=e}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ot(t){if(Array.isArray(t))return t}function Rt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function St(t){var e={},n=!1;function r(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new At(r,1)}}return e["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},e.next=function(t){return n?(n=!1,t):r("next",t)},"function"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return r("throw",t)}),"function"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):r("return",t)}),e}function jt(t){var e,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new Tt(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Tt(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return Tt=function(t){this.s=t,this.n=t.next},Tt.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new Tt(t)}function _t(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Pt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){_t(o,r,i,a,s,"next",t)}function s(t){_t(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Lt(t){return new At(t,0)}function Ct(t,e,n){return e=Bt(e),function(t,e){if(e&&("object"==T(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Rt(t)}(t,It()?Reflect.construct(e,n||[],Bt(t).constructor):e.apply(t,n))}function Nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ft(t,e,n){if(It())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Gt(i,n.prototype),i}function Dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qt(r.key),r)}}function $t(t,e,n){return e&&Dt(t.prototype,e),n&&Dt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ut(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Zt(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function zt(t,e,n){return(e=Qt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bt(t){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bt(t)}function qt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gt(t,e)}function It(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(It=function(){return!!t})()}function Mt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Ht(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(n),!0).forEach((function(e){zt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kt(){Kt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return i(a,"_invoke",{value:R(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",v="executing",p="completed",g={};function y(){}function b(){}function m(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(L([])));x&&x!==n&&r.call(x,a)&&(w=x);var A=m.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,o,a,s){var u=h(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==T(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function R(e,n,r){var i=f;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=S(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?p:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=p,r.method="throw",r.arg=c.arg)}}}function S(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(T(e)+" is not iterable")}return b.prototype=m,i(A,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:b,configurable:!0}),b.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},E(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(A),c(A,u,"Generator"),c(A,a,(function(){return this})),c(A,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Gt(t,e){return Gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gt(t,e)}function Vt(t,e){return Ot(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||Zt(t,e)||Ht()}function Xt(t){return function(t){if(Array.isArray(t))return Et(t)}(t)||Mt(t)||Zt(t)||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.")}()}function Qt(t){var e=function(t){if("object"!=T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T(e)?e:e+""}function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==T(Symbol.iterator)?function(t){return T(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":T(t)},Yt(t)}function Zt(t,e){if(t){if("string"==typeof t)return Et(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Et(t,e):void 0}}function te(t){return function(){return new ee(t.apply(this,arguments))}}function ee(t){var e,n;function r(e,n){try{var o=t[e](n),a=o.value,s=a instanceof At;Promise.resolve(s?a.v:a).then((function(n){if(s){var u="return"===e?"return":"next";if(!a.k||n.done)return r(u,n);n=t[u](n).value}i(o.done?"return":"normal",n)}),(function(t){r("throw",t)}))}catch(t){i("throw",t)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,i){return new Promise((function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,i))}))},"function"!=typeof t.return&&(this.return=void 0)}function ne(t){var e="function"==typeof Map?new Map:void 0;return ne=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return Ft(t,arguments,Bt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Gt(n,t)},ne(t)}z("resource","TrackingStatus",xt),ee.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ee.prototype.next=function(t){return this._invoke("next",t)},ee.prototype.throw=function(t){return this._invoke("throw",t)},ee.prototype.return=function(t){return this._invoke("return",t)};var re=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Nt(this,t),zt(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),zt(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),zt(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),zt(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),zt(this,"idSuffix",new RegExp("(_ids|_id)$","g")),zt(this,"underbar",new RegExp("_","g")),zt(this,"spaceOrUnderbar",new RegExp("[ _]","g")),zt(this,"uppercase",new RegExp("([A-Z])","g")),zt(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return $t(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i<e.length;i++)if(t.match(e[i][0])){t=t.replace(e[i][0],e[i][1]);break}return this.str=t,!0===this.chain?this:t}},{key:"pluralize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r<n.length;r++){for(var i=n[r].split("_"),o=e&&r+1===n.length?1:0;o<i.length;o++)i[o]=i[o].charAt(0).toUpperCase()+i[o].substring(1);n[r]=i.join("")}if(t=n.join("::"),!0===e){var a=t.charAt(0).toLowerCase(),s=t.slice(1);t=a+s}return this.str=t,!0===this.chain?this:t}},{key:"underscore",value:function(t){for(var e=(t=t||this.str).split("::"),n=0;n<e.length;n++)e[n]=e[n].replace(this.uppercase,"_$1"),e[n]=e[n].replace(this.underbarPrefix,"");return t=e.join("/").toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"humanize",value:function(t,e){return t=(t=(t=(t=t||this.str).toLowerCase()).replace(this.idSuffix,"")).replace(this.underbar," "),e||(t=this.capitalize(t)),this.str=t,!0===this.chain?this:t}},{key:"capitalize",value:function(t){return t=(t=(t=t||this.str).toLowerCase()).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"dasherize",value:function(t){return t=(t=(t=t||this.str).replace(this.spaceOrUnderbar,"-")).toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"normify",value:function(t,e){t=t||this.str,!0===e?(t=this.camelize(t),t=this.underscore(t)):t=t.toLowerCase();for(var n=(t=t.replace(this.underbar," ")).split(" "),r=0;r<n.length;r++){for(var i=n[r].split("-"),o=0;o<i.length;o++)this.nonTitlecasedWords.indexOf(i[o].toLowerCase())<0&&(i[o]=this.capitalize(i[o]));n[r]=i.join("-")}return t=(t=n.join(" ")).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"demodulize",value:function(t){var e=(t=t||this.str).split("::");return t=e[e.length-1],this.str=t,!0===this.chain?this:t}},{key:"tableize",value:function(t){t=t||this.str;var e=this.chain;return this.chain=!1,t=this.pluralize(this.underscore(t)),this.chain=e,this.str=t,!0===this.chain?this:t}},{key:"classify",value:function(t){t=t||this.str,t=(t="".concat(t).trim()).replace(/[\s\-_]+/g,"_");var e=this.chain;return this.chain=!1,t=this.singularize(t),t=this.camelize(t,!1),this.chain=e,this.str=t,this.chain?this:t}},{key:"foreignKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n<e.length;n++){var r=parseInt(e[n]);if(isNaN(r)){var i=e[n].substring(e[n].length-2),o=e[n].substring(e[n].length-1),a="th";"11"!=i&&"12"!=i&&"13"!=i&&("1"===o?a="st":"2"===o?a="nd":"3"===o&&(a="rd")),e[n]+=a}}return t=e.join(" "),this.str=t,!0===this.chain?this:t}}],[{key:"invoke",value:function(){var e=Object.values(arguments),n=new t(null,!1),r=arguments[0];return e.shift(),"function"==typeof n[r]?n[r].apply(n,e):null}}])}(),ie=function(){var t=["pluralize"].concat(Array.prototype.slice.call(arguments));return re.invoke.apply(re,Xt(t))},oe=function(){var t=["singularize"].concat(Array.prototype.slice.call(arguments));return re.invoke.apply(re,Xt(t))},ae=function(){var t=["classify"].concat(Array.prototype.slice.call(arguments));return re.invoke.apply(re,Xt(t))},se={resources:{},adapters:{},storse:{},actions:{}};function ue(t,e,n){var r=ie(t);se[r]||(se[r]={}),se[r][e]=n}function ce(t,e){var n=ie(t);if(!se[n])throw new Error("Unknown type: ".concat(oe(t)));if(!se[n][e])throw new Error("No ".concat(oe(t)," named '").concat(e,"' registered."));for(var r=se[n][e],i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];return Ft(r,o)}function le(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return ce.apply(void 0,[t,ae(e)].concat(r))}function he(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return le.apply(void 0,["resource",ae(t)].concat(n))}$t((function t(){return Nt(this,t),this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return ce.apply(void 0,[t,e].concat(r))}}]);var fe=Array.isArray,de=6e4;function ve(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(fe(t))if(r.length<=de)t.splice.apply(t,[e,n].concat(Xt(r)));else{t.splice(e,n);for(var i=0;i<r.length;i+=de){var o=r.slice(i,i+de);t.splice.apply(t,[e+i,0].concat(Xt(o)))}}else ge(t)&&t.replace(e,n,r)}function pe(t){return t}function ge(t){return t instanceof Ae}function ye(t,e){return fe(t)?t[e]:ge(t)?t.objectAt(e):null}function be(t,e){return 2===arguments.length?function(n){return e===n[t]}:function(e){return Boolean(e[t])}}function me(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i<r;i++)if(e(ye(t,i),i,t))return i;return-1}function we(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;return n<0&&(n+=i),me(t,r&&e!=e?function(t){return t!=t}:function(t){return t===e},n)}function ke(t,e,n){return ve(t,e,0,[n]),n}function xe(){return Ft(Ae,Array.prototype.slice.call(arguments))}var Ae=function(){function t(){return Nt(this,t),Rt(fe(arguments[0])?Ct(this,t,Xt(arguments[0])):Ct(this,t,arguments))}return qt(t,ne(Array)),$t(t,[{key:"notEmpty",get:function(){return this.length>0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return ye(this,0)}},{key:"last",get:function(){return ye(this,this.length-1)}},{key:"replace",value:function(t,e){return ve(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return ye(e,t)}))}},{key:"objectAt",value:function(t){return ye(this,t)}},{key:"indexOf",value:function(t,e){return we(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(ye(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==we(this,t,e,!0)}},{key:"findBy",value:function(){return-1===(t=me(this,be.apply(void 0,arguments).bind(undefined),0))?void 0:ye(this,t);var t}},{key:"findIndexBy",value:function(){return me(this,be.apply(void 0,arguments))}},{key:"isEvery",value:function(){return t=be.apply(void 0,arguments),e=t.bind(undefined),-1===me(this,(function(t,n,r){return!e(t,n,r)}),0);var t,e}},{key:"isAny",value:function(){return-1!==me(this,be.apply(void 0,arguments).bind(undefined),0)}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=[];return this.forEach((function(e){var r;return i.push(null===(r=e[t])||void 0===r?void 0:r.call.apply(r,[e].concat(n)))})),i}},{key:"toArray",value:function(){return this.map((function(t){return t}))}},{key:"compact",value:function(){return this.filter((function(t){return null!=t}))}},{key:"sortBy",value:function(){var t=arguments;return this.sort((function(e,n){var r,i=Ut(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=e[o],s=n[o],u=compare(a,s);if(u)return u}}catch(t){i.e(t)}finally{i.f()}return 0}))}},{key:"uniqBy",value:function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return ke(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return ve(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=ye(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=ye(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return ke(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)ye(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}])}();function Ee(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=Yt(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1}function Oe(){var t,e,n;return!("undefined"==typeof process||"object"!==Yt(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(n=window)||void 0===n||null===(n=n.navigator)||void 0===n?void 0:n.product))}function Re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Oe()?le("adapter","NodeAdapter",t):le("adapter","BrowserAdapter",t)}$t((function t(e){Nt(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}),[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){var t,e=Ut(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(fe(n)){var r=n[0],i=n[1];if(this.has(r))return this.get(r,i)}else if(this.has(n))return this.get(n)}}catch(t){e.e(t)}finally{e.f()}return null}},{key:"has",value:function(t){return t in this.components}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=Wt(Wt({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}]);var Se=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Nt(this,t),this.type="Point",this.coordinates=[n,e]}return $t(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=Vt(e.coordinates,2),r=n[0];return new t(n[1],r)}}])}();function je(t,e){var n=t();return Array.isArray(n)||"object"===Yt(n)?Te(n,e):null}function Te(t,e){var n,r=t,i=Yt(t),o="object"===i,a="function"===i,s=Array.isArray(t),u="string"===Yt(e)&&e.includes(".")?e.split("."):[e];if(s||o){for(var c=0;c<u.length;c++){if(r&&void 0===r[u[c]])return null;if(r){if("object"===Yt(n=r=r[u[c]])&&!Ee(null==n?void 0:n.attributes)&&"object"===Yt(null==n?void 0:n.attributes)&&void 0!==u[c+1]){var l=u.slice(c+1).join(".");return Te(r.attributes,l)}if("function"==typeof r)return je(r,u.slice(c+1).join("."))}}return r}if(a)return je(t,e)}function _e(t,e,n){var r=t,i="object"===Yt(t),o=Array.isArray(t),a="string"===Yt(e)&&e.includes(".")?e.split("."):[e],s=a.length;if(o||i){for(var u=0;u<s-1;u++)r[a[u]]||(r[a[u]]={}),r=r[a[u]];r[a[s-1]]=n}return n}var Pe=$t((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Nt(this,t),this.actions=e,this.bind=n}),[{key:"extend",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||this.bind;if(!t)return this;if(null!=this&&this.actions&&"object"===Yt(this.actions))for(var e in this.actions){var n=this.actions[e];_e(t,e,"function"==typeof n?n.bind(t):n)}return this}}]);function Le(t){return t instanceof Ce}var Ce=$t((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Nt(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}),[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=function(){return ce.apply(void 0,["store","Store"].concat(Array.prototype.slice.call(arguments)))}(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r<t.length;r++){var i=t[r];if("string"!=typeof i||!n.includes(i))throw new Error("".concat(i," is not a valid flag!"));this[i]=e}return this}},{key:"reset",value:function(){return this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isReloading=!1,this}},{key:"empty",value:function(){return this.reset(),this.attribues={},this}},{key:"save",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return Ee(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n<t.length;n++){var r=t[n];e[r]=this.getAttribute(r)}return this.update(e)}},{key:"meta",get:function(){return this.getAttribute("meta",{})}},{key:"createdAt",get:function(){return this.isAttributeFilled("created_at")?new Date(this.getAttribute("created_at")):null}},{key:"updatedAt",get:function(){return this.isAttributeFilled("updated_at")?new Date(this.getAttribute("updated_at")):null}},{key:"isLoaded",get:function(){return this.hasAttributes(["created_at","id"])}},{key:"isEmpty",get:function(){return 0===Object.values(null==this?void 0:this.attributes).length}},{key:"isNew",get:function(){return!this.id}},{key:"isSaved",get:function(){return!this.isNew&&this.isLoaded}},{key:"isDeleted",get:function(){return this.hasAttributes(["deleted","time"])}},{key:"eachAttribute",value:function(t){var e,n=this;return"function"!=typeof t||Object.keys(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{}).forEach((function(e){var r=n.getAttribute(e);t.call(n,r,e)})),this}},{key:"changes",value:function(){return this.changes}},{key:"getDirtyAttributes",value:function(){return this.dirtyAttributes}},{key:"isDirty",value:function(t){return t in this.dirtyAttributes}},{key:"hasDirtyAttributes",value:function(){var t;return Object.keys(null!==(t=null==this?void 0:this.dirtyAttributes)&&void 0!==t?t:{}).length>0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===Yt(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return _e(this.attributes,t,n),_e(this.dirtyAttributes,t,r),fe(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=Te(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(fe(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return fe(t)?this.hasAttribute(t)&&t.every((function(t){return!Ee(e.getAttribute(t))})):this.hasAttribute(t)&&!Ee(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!fe(t))throw new Error("No attribute properties provided!");var n,r=Ut(t);try{for(r.s();!(n=r.n()).done;){var i,o,a=n.value;if("string"==typeof a){var s=this.getAttribute(a);"object"!==Yt(null===(i=s)||void 0===i?void 0:i.attributes)||fe(null===(o=s)||void 0===o?void 0:o.attributes)||(s=s.attributes),e[a]=s}}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"serialize",value:function(){return this.getAttributes()}},{key:"mergeAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=Wt(Wt({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]);ue("resource","Resource",Ce);var Ne=function(){return $t((function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Nt(this,t),this.resource=e,this.adapter=n||Re(),this.namespace=ie(e),this.storage=xe(),this.options=r,this.extendActions(r.actions)}),[{key:"extendActions",value:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=fe(e)?e:[e],!fe(e))return e instanceof Pe&&e.extend(t),t;var n,r=Ut(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.extendActions(i)}}catch(t){r.e(t)}finally{r.f()}}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return le("resource",ae(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),fe(e)){var n,r=[],i=Ut(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(t.afterFetch(o))}}catch(t){i.e(t)}finally{i.f()}return xe.apply(void 0,r)}var a=t.serialize(e);return t.deposit(a)}(this,t)}},{key:"create",value:(a=Pt(Kt().mark((function t(){var e,n,r,i=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.post("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"update",value:(o=Pt(Kt().mark((function t(e){var n,r,i,o=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.next=4,this.adapter.put("".concat(this.namespace,"/").concat(e),n,r);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"findRecord",value:(i=Pt(Kt().mark((function t(e){var n,r,i=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,this.adapter.get("".concat(this.namespace,"/").concat(e),{},n);case 3:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"findAll",value:(r=Pt(Kt().mark((function t(){var e,n,r=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.adapter.get("".concat(this.namespace),{},e);case 3:return n=t.sent,t.abrupt("return",this.afterFetch(n));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"query",value:(n=Pt(Kt().mark((function t(){var e,n,r,i=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.get("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"queryRecord",value:(e=Pt(Kt().mark((function t(){var e,n,r,i=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},(e=i.length>0&&void 0!==i[0]?i[0]:{}).single=!0,t.next=5,this.adapter.get("".concat(this.namespace),e,n);case 5:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:(t=Pt(Kt().mark((function t(e){var n,r,i,o=arguments;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=Le(e)?e.getAttribute("id"):e,t.next=4,this.adapter.delete("".concat(this.namespace,"/").concat(r),{},n);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})}]);var t,e,n,r,i,o,a}();ue("store","Store",Ne);var Fe=new Pe({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),e,n)},getNextActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/next-activity"),e,n)},dispatch:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/dispatch"),e,n).then(this.afterFetch.bind(this))},start:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/start"),e,n).then(this.afterFetch.bind(this))},updateActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/update-activity"),e,n).then(this.afterFetch.bind(this))},setDestination:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Le(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/set-destination/").concat(e),n,r).then(this.afterFetch.bind(this))},captureQrCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Le(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-qr").concat(e?"/"+e:""),n,r)},captureSignature:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Le(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-signature").concat(e?"/"+e:""),n,r)},complete:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/complete"),e,n).then(this.afterFetch.bind(this))},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/cancel"),e,n).then(this.afterFetch.bind(this))}}),De=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"order",Wt({actions:Fe},r)])}return qt(t,Ce),$t(t,[{key:"getDistanceAndTime",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getDistanceAndTime(this.id,t,e)}},{key:"dispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.dispatch(this.id,t,e)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.start(this.id,t,e)}},{key:"setDestination",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.setDestination(this.id,t,e,n)}},{key:"captureQrCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureQrCode(this.id,t,e,n)}},{key:"captureSignature",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureSignature(this.id,t,e,n)}},{key:"getNextActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getNextActivity(this.id,t,e)}},{key:"updateActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.updateActivity(this.id,t,e)}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.cancel(this.id,t,e)}},{key:"complete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.complete(this.id,t,e)}},{key:"isDispatched",get:function(){return null!==this.getAttribute("dispatched_at")}},{key:"isNotDispatched",get:function(){return null==this.getAttribute("dispatched_at")}},{key:"isStarted",get:function(){return null!==this.getAttribute("started_at")}},{key:"isNotStarted",get:function(){return null==this.getAttribute("started_at")}},{key:"isCompleted",get:function(){return"completed"==this.getAttribute("status")}},{key:"isCanceled",get:function(){return"canceled"==this.getAttribute("status")}},{key:"isEnroute",get:function(){return"driver_enroute"==this.getAttribute("status")||"enroute"===this.getAttribute("status")}},{key:"isInProgress",get:function(){return this.isStarted&&!this.isCanceled&&!this.isCompleted}},{key:"scheduledAt",get:function(){return this.isAttributeFilled("scheduled_at")?new Date(this.getAttribute("scheduled_at")):null}},{key:"startedAt",get:function(){return this.isAttributeFilled("started_at")?new Date(this.getAttribute("started_at")):null}},{key:"dispatchedAt",get:function(){return this.isAttributeFilled("dispatched_at")?new Date(this.getAttribute("dispatched_at")):null}},{key:"status",get:function(){return this.getAttribute("status")}}])}();ue("resource","Order",De);var $e=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"payload",r])}return qt(t,Ce),$t(t,[{key:"attach",value:function(t){}},{key:"entities",get:function(){var t=this;return xe(this.entities.map((function(e){return he("Entity",e,t.adapter)})))}},{key:"dropoff",get:function(){return this.dropoff?he("Place",this.dropoff,this.adapter):null}},{key:"pickup",get:function(){return this.pickup?he("Place",this.pickup,this.adapter):null}},{key:"waypoints",get:function(){var t=this;return xe(this.waypoints.map((function(e){return he("Waypoint",e,t.adapter)})))}}])}();ue("resource","Payload",$e);var Ue=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"entity",r])}return qt(t,Ce),$t(t)}();ue("resource","Entity",Ue);var ze=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"place",r])}return qt(t,Ce),$t(t,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new Se))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new Se))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return Le(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Vt(e.getAttribute("coordinates"),2),o=i[0],a=i[1];return new t({name:null,address:e.getAttribute("address"),location:new Se(o,a),street1:e.getAttribute("address"),street2:null,city:e.getAttribute("city"),province:e.getAttribute("stateLong"),postal_code:e.getAttribute("postalCode"),neighborhood:e.get("neighborhood"),district:e.getAttribute("county"),building:e.get("building"),country:e.getAttribute("countryShort"),phone:null,security_access_code:null},n,r)}}])}();ue("resource","Place",ze);var Be=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"waypoint",r])}return qt(t,ze),$t(t)}();ue("resource","Waypoint",Be);var qe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"tracking-status",r])}return qt(t,Ce),$t(t)}();ue("resource","TrackingStatus",qe);var Ie=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"vehicle",r])}return qt(t,Ce),$t(t)}();ue("resource","Vehicle",Ie);var Me=new Pe({current:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/current"),t,e)}}),He=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"organization",Wt({actions:Me},r)])}return qt(t,Ce),$t(t)}();ue("resource","Organization",He);var Je=function(t,e){return fe(t)?t.map((function(t){return new He(t,e)})):new He(t,e)},We=new Pe({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("drivers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("drivers/login",Wt({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/verify-code",Wt({identity:t,code:e},n)).then(this.afterFetch.bind(this))},track:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/track"),e,n).then(this.afterFetch.bind(this))},listOrganizations:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/organizations"),n,r).then((function(t){return Je(t,e.adapter)}))},switchOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/switch-organization"),n,r).then((function(t){return Je(t,e.adapter)}))},currentOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/current-organization"),n,r).then((function(t){return Je(t,e.adapter)}))},retrieve:function(t){return this.findRecord(t)},syncDevice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/register-device"),e,n)}}),Ke=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"driver",Wt({actions:We},r)])}return qt(t,Ce),$t(t,[{key:"token",get:function(){return this.getAttribute("token")}},{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new Se))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new Se))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"track",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.track(this.id,t,e)}},{key:"syncDevice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.syncDevice(this.id,t,e)}},{key:"listOrganizations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.listOrganizations(this.id,t,e)}},{key:"switchOrganization",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.switchOrganization(this.id,{next:t},e)}},{key:"currentOrganization",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.currentOrganization(this.id,t,e)}}])}();ue("resource","Driver",Ke);var Ge=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"vendor",r])}return qt(t,Ce),$t(t)}();ue("resource","Vendor",Ge);var Ve=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"contact",r])}return qt(t,Ce),$t(t)}();ue("resource","Contact",Ve);var Xe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"zone",r])}return qt(t,Ce),$t(t)}();ue("resource","Zone",Xe);var Qe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"service-area",r])}return qt(t,Ce),$t(t)}();ue("resource","ServiceArea",Qe);var Ye=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"service-rate",r])}return qt(t,Ce),$t(t)}();ue("resource","ServiceRate",Ye);var Ze=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"service-quote",r])}return qt(t,Ce),$t(t,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}])}();ue("resource","ServiceQuote",Ze);var tn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nt(this,t),Ct(this,t,[e,n,"fleet",r])}return qt(t,Ce),$t(t)}();ue("resource","Fleet",tn);var en=$t((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Nt(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}}));ue("adapter","Adapter",en);var nn=function(){function t(e){var n;return Nt(this,t),(n=Ct(this,t,[e])).setHeaders({Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),n}return qt(t,en),$t(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=Wt(Wt({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){t.json().then((function(n){e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,a){fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),Wt({method:n,mode:i.mode||"cors",headers:new Headers(Wt(Wt({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){if(t.ok)return o(t.json);a(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){a(t)}))}))}},{key:"get",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Ee(e=n)||"string"==typeof e&&!1===/\S/.test(e)?"":new URLSearchParams(n).toString();return this.request("".concat(t).concat(i?"?".concat(i):""),"GET",{},r)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}])}();function rn(t,e){return function(){return t.apply(e,arguments)}}ue("adapter","BrowserAdapter",nn);var on,an=Object.prototype.toString,sn=Object.getPrototypeOf,un=(on=Object.create(null),function(t){var e=an.call(t);return on[e]||(on[e]=e.slice(8,-1).toLowerCase())}),cn=function(t){return t=t.toLowerCase(),function(e){return un(e)===t}},ln=function(t){return function(e){return Yt(e)===t}},hn=Array.isArray,fn=ln("undefined"),dn=cn("ArrayBuffer"),vn=ln("string"),pn=ln("function"),gn=ln("number"),yn=function(t){return null!==t&&"object"===Yt(t)},bn=function(t){if("object"!==un(t))return!1;var e=sn(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},mn=cn("Date"),wn=cn("File"),kn=cn("Blob"),xn=cn("FileList"),An=cn("URLSearchParams"),En=Vt(["ReadableStream","Request","Response","Headers"].map(cn),4),On=En[0],Rn=En[1],Sn=En[2],jn=En[3];function Tn(t,e){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,o=void 0!==i&&i;if(null!=t)if("object"!==Yt(t)&&(t=[t]),hn(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{var a,s=o?Object.getOwnPropertyNames(t):Object.keys(t),u=s.length;for(n=0;n<u;n++)a=s[n],e.call(null,t[a],a,t)}}function _n(t,e){e=e.toLowerCase();for(var n,r=Object.keys(t),i=r.length;i-- >0;)if(e===(n=r[i]).toLowerCase())return n;return null}var Pn,Ln,Cn,Nn,Fn,Dn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$n=function(t){return!fn(t)&&t!==Dn},Un=(Pn="undefined"!=typeof Uint8Array&&sn(Uint8Array),function(t){return Pn&&t instanceof Pn}),zn=cn("HTMLFormElement"),Bn=function(){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),qn=cn("RegExp"),In=function(t,e){var n=Object.getOwnPropertyDescriptors(t),r={};Tn(n,(function(n,i){var o;!1!==(o=e(n,i,t))&&(r[i]=o||n)})),Object.defineProperties(t,r)},Mn="abcdefghijklmnopqrstuvwxyz",Hn="0123456789",Jn={DIGIT:Hn,ALPHA:Mn,ALPHA_DIGIT:Mn+Mn.toUpperCase()+Hn},Wn=cn("AsyncFunction"),Kn=(Ln="function"==typeof setImmediate,Cn=pn(Dn.postMessage),Ln?setImmediate:Cn?(Nn="axios@".concat(Math.random()),Fn=[],Dn.addEventListener("message",(function(t){var e=t.source,n=t.data;e===Dn&&n===Nn&&Fn.length&&Fn.shift()()}),!1),function(t){Fn.push(t),Dn.postMessage(Nn,"*")}):function(t){return setTimeout(t)}),Gn="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Dn):"undefined"!=typeof process&&process.nextTick||Kn,Vn={isArray:hn,isArrayBuffer:dn,isBuffer:function(t){return null!==t&&!fn(t)&&null!==t.constructor&&!fn(t.constructor)&&pn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:function(t){var e;return t&&("function"==typeof FormData&&t instanceof FormData||pn(t.append)&&("formdata"===(e=un(t))||"object"===e&&pn(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&dn(t.buffer)},isString:vn,isNumber:gn,isBoolean:function(t){return!0===t||!1===t},isObject:yn,isPlainObject:bn,isReadableStream:On,isRequest:Rn,isResponse:Sn,isHeaders:jn,isUndefined:fn,isDate:mn,isFile:wn,isBlob:kn,isRegExp:qn,isFunction:pn,isStream:function(t){return yn(t)&&pn(t.pipe)},isURLSearchParams:An,isTypedArray:Un,isFileList:xn,forEach:Tn,merge:function t(){for(var e=($n(this)&&this||{}).caseless,n={},r=function(r,i){var o=e&&_n(n,i)||i;bn(n[o])&&bn(r)?n[o]=t(n[o],r):bn(r)?n[o]=t({},r):hn(r)?n[o]=r.slice():n[o]=r},i=0,o=arguments.length;i<o;i++)arguments[i]&&Tn(arguments[i],r);return n},extend:function(t,e,n){return Tn(e,(function(e,r){n&&pn(e)?t[r]=rn(e,n):t[r]=e}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,n,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:function(t,e,n,r){var i,o,a,s={};if(e=e||{},null==t)return e;do{for(o=(i=Object.getOwnPropertyNames(t)).length;o-- >0;)a=i[o],r&&!r(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==n&&sn(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:un,kindOfTest:cn,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;if(hn(t))return t;var e=t.length;if(!gn(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},forEachEntry:function(t,e){for(var n,r=(t&&t[Symbol.iterator]).call(t);(n=r.next())&&!n.done;){var i=n.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:zn,hasOwnProperty:Bn,hasOwnProp:Bn,reduceDescriptors:In,freezeMethods:function(t){In(t,(function(e,n){if(pn(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=t[n];pn(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(t,e){var n={},r=function(t){t.forEach((function(t){n[t]=!0}))};return hn(t)?r(t):r(String(t).split(e)),n},toCamelCase:function(t){return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(t,e){return null!=t&&Number.isFinite(t=+t)?t:e},findKey:_n,global:Dn,isContextDefined:$n,ALPHABET:Jn,generateString:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn.ALPHA_DIGIT,n="",r=e.length;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&pn(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:function(t){var e=new Array(10),n=function(t,r){if(yn(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;var i=hn(t)?[]:{};return Tn(t,(function(t,e){var o=n(t,r+1);!fn(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:Wn,isThenable:function(t){return t&&(yn(t)||pn(t))&&pn(t.then)&&pn(t.catch)},setImmediate:Kn,asap:Gn};function Xn(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Vn.inherits(Xn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Vn.toJSONObject(this.config),code:this.code,status:this.status}}});var Qn=Xn.prototype,Yn={};function Zn(t){return Vn.isPlainObject(t)||Vn.isArray(t)}function tr(t){return Vn.endsWith(t,"[]")?t.slice(0,-2):t}function er(t,e,n){return t?t.concat(e).map((function(t,e){return t=tr(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(t){Yn[t]={value:t}})),Object.defineProperties(Xn,Yn),Object.defineProperty(Qn,"isAxiosError",{value:!0}),Xn.from=function(t,e,n,r,i,o){var a=Object.create(Qn);return Vn.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(function(t){return"isAxiosError"!==t})),Xn.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};var nr=Vn.toFlatObject(Vn,{},null,(function(t){return/^is[A-Z]/.test(t)}));function rr(t,e,n){if(!Vn.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;var r=(n=Vn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Vn.isUndefined(e[t])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Vn.isSpecCompliantForm(e);if(!Vn.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(Vn.isDate(t))return t.toISOString();if(!s&&Vn.isBlob(t))throw new Xn("Blob is not supported. Use a Buffer instead.");return Vn.isArrayBuffer(t)||Vn.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){var s=t;if(t&&!i&&"object"===Yt(t))if(Vn.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Vn.isArray(t)&&function(t){return Vn.isArray(t)&&!t.some(Zn)}(t)||(Vn.isFileList(t)||Vn.endsWith(n,"[]"))&&(s=Vn.toArray(t)))return n=tr(n),s.forEach((function(t,r){!Vn.isUndefined(t)&&null!==t&&e.append(!0===a?er([n],r,o):null===a?n:n+"[]",u(t))})),!1;return!!Zn(t)||(e.append(er(i,n,o),u(t)),!1)}var l=[],h=Object.assign(nr,{defaultVisitor:c,convertValue:u,isVisitable:Zn});if(!Vn.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Vn.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Vn.forEach(n,(function(n,o){!0===(!(Vn.isUndefined(n)||null===n)&&i.call(e,n,Vn.isString(o)?o.trim():o,r,h))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function ir(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function or(t,e){this._pairs=[],t&&rr(t,this,e)}var ar=or.prototype;function sr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ur(t,e,n){if(!e)return t;var r=n&&n.encode||sr;Vn.isFunction(n)&&(n={serialize:n});var i,o=n&&n.serialize;if(i=o?o(e,n):Vn.isURLSearchParams(e)?e.toString():new or(e,n).toString(r)){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}ar.append=function(t,e){this._pairs.push([t,e])},ar.toString=function(t){var e=t?function(e){return t.call(this,e,ir)}:ir;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var cr=$t((function t(){Nt(this,t),this.handlers=[]}),[{key:"use",value:function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(t){this.handlers[t]&&(this.handlers[t]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(t){Vn.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}]),lr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},hr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:or,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},fr="undefined"!=typeof window&&"undefined"!=typeof document,dr="object"===("undefined"==typeof navigator?"undefined":Yt(navigator))&&navigator||void 0,vr=fr&&(!dr||["ReactNative","NativeScript","NS"].indexOf(dr.product)<0),pr="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gr=fr&&window.location.href||"http://localhost",yr=Wt(Wt({},Object.freeze({__proto__:null,hasBrowserEnv:fr,hasStandardBrowserEnv:vr,hasStandardBrowserWebWorkerEnv:pr,navigator:dr,origin:gr})),hr);function br(t){function e(t,n,r,i){var o=t[i++];if("__proto__"===o)return!0;var a=Number.isFinite(+o),s=i>=t.length;return o=!o&&Vn.isArray(r)?r.length:o,s?(Vn.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&Vn.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&Vn.isArray(r[o])&&(r[o]=function(t){var e,n,r={},i=Object.keys(t),o=i.length;for(e=0;e<o;e++)r[n=i[e]]=t[n];return r}(r[o])),!a)}if(Vn.isFormData(t)&&Vn.isFunction(t.entries)){var n={};return Vn.forEachEntry(t,(function(t,r){e(function(t){return Vn.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),r,n,0)})),n}return null}var mr={transitional:lr,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){var n,r=e.getContentType()||"",i=r.indexOf("application/json")>-1,o=Vn.isObject(t);if(o&&Vn.isHTMLForm(t)&&(t=new FormData(t)),Vn.isFormData(t))return i?JSON.stringify(br(t)):t;if(Vn.isArrayBuffer(t)||Vn.isBuffer(t)||Vn.isStream(t)||Vn.isFile(t)||Vn.isBlob(t)||Vn.isReadableStream(t))return t;if(Vn.isArrayBufferView(t))return t.buffer;if(Vn.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return rr(t,new yr.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return yr.isNode&&Vn.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((n=Vn.isFileList(t))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return rr(n?{"files[]":t}:t,a&&new a,this.formSerializer)}}return o||i?(e.setContentType("application/json",!1),function(t){if(Vn.isString(t))try{return(0,JSON.parse)(t),Vn.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||mr.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Vn.isResponse(t)||Vn.isReadableStream(t))return t;if(t&&Vn.isString(t)&&(n&&!this.responseType||r)){var i=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw Xn.from(t,Xn.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yr.classes.FormData,Blob:yr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vn.forEach(["delete","get","head","post","put","patch"],(function(t){mr.headers[t]={}}));var wr=Vn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kr=Symbol("internals");function xr(t){return t&&String(t).trim().toLowerCase()}function Ar(t){return!1===t||null==t?t:Vn.isArray(t)?t.map(Ar):String(t)}function Er(t,e,n,r,i){return Vn.isFunction(r)?r.call(this,e,n):(i&&(e=n),Vn.isString(e)?Vn.isString(r)?-1!==e.indexOf(r):Vn.isRegExp(r)?r.test(e):void 0:void 0)}var Or=$t((function t(e){Nt(this,t),e&&this.set(e)}),[{key:"set",value:function(t,e,n){var r=this;function i(t,e,n){var i=xr(e);if(!i)throw new Error("header name must be a non-empty string");var o=Vn.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=Ar(t))}var o=function(t,e){return Vn.forEach(t,(function(t,n){return i(t,n,e)}))};if(Vn.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Vn.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o(function(t){var e,n,r,i={};return t&&t.split("\n").forEach((function(t){r=t.indexOf(":"),e=t.substring(0,r).trim().toLowerCase(),n=t.substring(r+1).trim(),!e||i[e]&&wr[e]||("set-cookie"===e?i[e]?i[e].push(n):i[e]=[n]:i[e]=i[e]?i[e]+", "+n:n)})),i}(t),e);else if(Vn.isHeaders(t)){var a,s=Ut(t.entries());try{for(s.s();!(a=s.n()).done;){var u=Vt(a.value,2),c=u[0];i(u[1],c,n)}}catch(t){s.e(t)}finally{s.f()}}else null!=t&&i(e,t,n);return this}},{key:"get",value:function(t,e){if(t=xr(t)){var n=Vn.findKey(this,t);if(n){var r=this[n];if(!e)return r;if(!0===e)return function(t){for(var e,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;e=r.exec(t);)n[e[1]]=e[2];return n}(r);if(Vn.isFunction(e))return e.call(this,r,n);if(Vn.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(t,e){if(t=xr(t)){var n=Vn.findKey(this,t);return!(!n||void 0===this[n]||e&&!Er(0,this[n],n,e))}return!1}},{key:"delete",value:function(t,e){var n=this,r=!1;function i(t){if(t=xr(t)){var i=Vn.findKey(n,t);!i||e&&!Er(0,n[i],i,e)||(delete n[i],r=!0)}}return Vn.isArray(t)?t.forEach(i):i(t),r}},{key:"clear",value:function(t){for(var e=Object.keys(this),n=e.length,r=!1;n--;){var i=e[n];t&&!Er(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(t){var e=this,n={};return Vn.forEach(this,(function(r,i){var o=Vn.findKey(n,i);if(o)return e[o]=Ar(r),void delete e[i];var a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))}(i):String(i).trim();a!==i&&delete e[i],e[a]=Ar(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.constructor).concat.apply(t,[this].concat(n))}},{key:"toJSON",value:function(t){var e=Object.create(null);return Vn.forEach(this,(function(n,r){null!=n&&!1!==n&&(e[r]=t&&Vn.isArray(n)?n.join(", "):n)})),e}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(t){var e=Vt(t,2);return e[0]+": "+e[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(t){return t instanceof this?t:new this(t)}},{key:"concat",value:function(t){for(var e=new this(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(t){return e.set(t)})),e}},{key:"accessor",value:function(t){var e=(this[kr]=this[kr]={accessors:{}}).accessors,n=this.prototype;function r(t){var r=xr(t);e[r]||(function(t,e){var n=Vn.toCamelCase(" "+e);["get","set","has"].forEach((function(r){Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return Vn.isArray(t)?t.forEach(r):r(t),this}}]);function Rr(t,e){var n=this||mr,r=e||n,i=Or.from(r.headers),o=r.data;return Vn.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function Sr(t){return!(!t||!t.__CANCEL__)}function jr(t,e,n){Xn.call(this,null==t?"canceled":t,Xn.ERR_CANCELED,e,n),this.name="CanceledError"}function Tr(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Xn("Request failed with status code "+n.status,[Xn.ERR_BAD_REQUEST,Xn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Or.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vn.reduceDescriptors(Or.prototype,(function(t,e){var n=t.value,r=e[0].toUpperCase()+e.slice(1);return{get:function(){return n},set:function(t){this[r]=t}}})),Vn.freezeMethods(Or),Vn.inherits(jr,Xn,{__CANCEL__:!0});var _r=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(t,e){t=t||10;var n,r=new Array(t),i=new Array(t),o=0,a=0;return e=void 0!==e?e:1e3,function(s){var u=Date.now(),c=i[a];n||(n=u),r[o]=s,i[o]=u;for(var l=a,h=0;l!==o;)h+=r[l++],l%=t;if((o=(o+1)%t)===a&&(a=(a+1)%t),!(u-n<e)){var f=c&&u-c;return f?Math.round(1e3*h/f):void 0}}}(50,250);return function(t,e){var n,r,i=0,o=1e3/e,a=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=o,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[function(){for(var t=Date.now(),e=t-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];e>=o?a(u,t):(n=u,r||(r=setTimeout((function(){r=null,a(n)}),o-e)))},function(){return n&&a(n)}]}((function(n){var o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o;var c=zt({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a},e?"download":"upload",!0);t(c)}),n)},Pr=function(t,e){var n=null!=t;return[function(r){return e[0]({lengthComputable:n,total:t,loaded:r})},e[1]]},Lr=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Vn.asap((function(){return t.apply(void 0,n)}))}},Cr=yr.hasStandardBrowserEnv?function(t,e){return function(n){return n=new URL(n,yr.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)}}(new URL(yr.origin),yr.navigator&&/(msie|trident)/i.test(yr.navigator.userAgent)):function(){return!0},Nr=yr.hasStandardBrowserEnv?{write:function(t,e,n,r,i,o){var a=[t+"="+encodeURIComponent(e)];Vn.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Vn.isString(r)&&a.push("path="+r),Vn.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Fr(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var Dr=function(t){return t instanceof Or?Wt({},t):t};function $r(t,e){e=e||{};var n={};function r(t,e,n,r){return Vn.isPlainObject(t)&&Vn.isPlainObject(e)?Vn.merge.call({caseless:r},t,e):Vn.isPlainObject(e)?Vn.merge({},e):Vn.isArray(e)?e.slice():e}function i(t,e,n,i){return Vn.isUndefined(e)?Vn.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function o(t,e){if(!Vn.isUndefined(e))return r(void 0,e)}function a(t,e){return Vn.isUndefined(e)?Vn.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(t,e,n){return i(Dr(t),Dr(e),0,!0)}};return Vn.forEach(Object.keys(Object.assign({},t,e)),(function(r){var o=u[r]||i,a=o(t[r],e[r],r);Vn.isUndefined(a)&&o!==s||(n[r]=a)})),n}var Ur,zr,Br=function(t){var e,n,r=$r({},t),i=r.data,o=r.withXSRFToken,a=r.xsrfHeaderName,s=r.xsrfCookieName,u=r.headers,c=r.auth;if(r.headers=u=Or.from(u),r.url=ur(Fr(r.baseURL,r.url),t.params,t.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Vn.isFormData(i))if(yr.hasStandardBrowserEnv||yr.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(!1!==(e=u.getContentType())){var l=e?e.split(";").map((function(t){return t.trim()})).filter(Boolean):[],h=Ot(n=l)||Mt(n)||Zt(n)||Ht(),f=h[0],d=h.slice(1);u.setContentType([f||"multipart/form-data"].concat(Xt(d)).join("; "))}if(yr.hasStandardBrowserEnv&&(o&&Vn.isFunction(o)&&(o=o(r)),o||!1!==o&&Cr(r.url))){var v=a&&s&&Nr.read(s);v&&u.set(a,v)}return r},qr="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){var r,i,o,a,s,u=Br(t),c=u.data,l=Or.from(u.headers).normalize(),h=u.responseType,f=u.onUploadProgress,d=u.onDownloadProgress;function v(){a&&a(),s&&s(),u.cancelToken&&u.cancelToken.unsubscribe(r),u.signal&&u.signal.removeEventListener("abort",r)}var p=new XMLHttpRequest;function g(){if(p){var r=Or.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());Tr((function(t){e(t),v()}),(function(t){n(t),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:t,request:p}),p=null}}if(p.open(u.method.toUpperCase(),u.url,!0),p.timeout=u.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(n(new Xn("Request aborted",Xn.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new Xn("Network Error",Xn.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||lr;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),n(new Xn(e,r.clarifyTimeoutError?Xn.ETIMEDOUT:Xn.ECONNABORTED,t,p)),p=null},void 0===c&&l.setContentType(null),"setRequestHeader"in p&&Vn.forEach(l.toJSON(),(function(t,e){p.setRequestHeader(e,t)})),Vn.isUndefined(u.withCredentials)||(p.withCredentials=!!u.withCredentials),h&&"json"!==h&&(p.responseType=u.responseType),d){var y=Vt(_r(d,!0),2);o=y[0],s=y[1],p.addEventListener("progress",o)}if(f&&p.upload){var b=Vt(_r(f),2);i=b[0],a=b[1],p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",a)}(u.cancelToken||u.signal)&&(r=function(e){p&&(n(!e||e.type?new jr(null,t,p):e),p.abort(),p=null)},u.cancelToken&&u.cancelToken.subscribe(r),u.signal&&(u.signal.aborted?r():u.signal.addEventListener("abort",r)));var m,w,k=(m=u.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m))&&w[1]||"");k&&-1===yr.protocols.indexOf(k)?n(new Xn("Unsupported protocol "+k+":",Xn.ERR_BAD_REQUEST,t)):p.send(c||null)}))},Ir=function(t,e){var n=(t=t?t.filter(Boolean):[]).length;if(e||n){var r,i=new AbortController,o=function(t){if(!r){r=!0,s();var e=t instanceof Error?t:this.reason;i.abort(e instanceof Xn?e:new jr(e instanceof Error?e.message:e))}},a=e&&setTimeout((function(){a=null,o(new Xn("timeout ".concat(e," of ms exceeded"),Xn.ETIMEDOUT))}),e),s=function(){t&&(a&&clearTimeout(a),a=null,t.forEach((function(t){t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((function(t){return t.addEventListener("abort",o)}));var u=i.signal;return u.unsubscribe=function(){return Vn.asap(s)},u}},Mr=Kt().mark((function t(e,n){var r,i,o;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.byteLength,n&&!(r<n)){t.next=5;break}return t.next=4,e;case 4:return t.abrupt("return");case 5:i=0;case 6:if(!(i<r)){t.next=13;break}return o=i+n,t.next=10,e.slice(i,o);case 10:i=o,t.next=6;break;case 13:case"end":return t.stop()}}),t)})),Hr=function(){var t=te(Kt().mark((function t(e,n){var r,i,o,a,s,u;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!1,i=!1,t.prev=2,a=jt(Jr(e));case 4:return t.next=6,Lt(a.next());case 6:if(!(r=!(s=t.sent).done)){t.next=12;break}return u=s.value,t.delegateYield(St(jt(Mr(u,n))),"t0",9);case 9:r=!1,t.next=4;break;case 12:t.next=18;break;case 14:t.prev=14,t.t1=t.catch(2),i=!0,o=t.t1;case 18:if(t.prev=18,t.prev=19,!r||null==a.return){t.next=23;break}return t.next=23,Lt(a.return());case 23:if(t.prev=23,!i){t.next=26;break}throw o;case 26:return t.finish(23);case 27:return t.finish(18);case 28:case"end":return t.stop()}}),t,null,[[2,14,18,28],[19,,23,27]])})));return function(e,n){return t.apply(this,arguments)}}(),Jr=function(){var t=te(Kt().mark((function t(e){var n,r,i,o;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e[Symbol.asyncIterator]){t.next=3;break}return t.delegateYield(St(jt(e)),"t0",2);case 2:return t.abrupt("return");case 3:n=e.getReader(),t.prev=4;case 5:return t.next=7,Lt(n.read());case 7:if(r=t.sent,i=r.done,o=r.value,!i){t.next=12;break}return t.abrupt("break",16);case 12:return t.next=14,o;case 14:t.next=5;break;case 16:return t.prev=16,t.next=19,Lt(n.cancel());case 19:return t.finish(16);case 20:case"end":return t.stop()}}),t,null,[[4,,16,20]])})));return function(e){return t.apply(this,arguments)}}(),Wr=function(t,e,n,r){var i,o=Hr(t,e),a=0,s=function(t){i||(i=!0,r&&r(t))};return new ReadableStream({pull:function(t){return Pt(Kt().mark((function e(){var r,i,u,c,l;return Kt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.next();case 3:if(r=e.sent,i=r.done,u=r.value,!i){e.next=10;break}return s(),t.close(),e.abrupt("return");case 10:c=u.byteLength,n&&(l=a+=c,n(l)),t.enqueue(new Uint8Array(u)),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),s(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))()},cancel:function(t){return s(t),o.return()}},{highWaterMark:2})},Kr="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Gr=Kr&&"function"==typeof ReadableStream,Vr=Kr&&("function"==typeof TextEncoder?(Ur=new TextEncoder,function(t){return Ur.encode(t)}):function(){var t=Pt(Kt().mark((function t(e){return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,new Response(e).arrayBuffer();case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Xr=function(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!!t.apply(void 0,n)}catch(t){return!1}},Qr=Gr&&Xr((function(){var t=!1,e=new Request(yr.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Yr=Gr&&Xr((function(){return Vn.isReadableStream(new Response("").body)})),Zr={stream:Yr&&function(t){return t.body}};Kr&&(zr=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((function(t){!Zr[t]&&(Zr[t]=Vn.isFunction(zr[t])?function(e){return e[t]()}:function(e,n){throw new Xn("Response type '".concat(t,"' is not supported"),Xn.ERR_NOT_SUPPORT,n)})})));var ti=function(){var t=Pt(Kt().mark((function t(e){var n;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",0);case 2:if(!Vn.isBlob(e)){t.next=4;break}return t.abrupt("return",e.size);case 4:if(!Vn.isSpecCompliantForm(e)){t.next=9;break}return n=new Request(yr.origin,{method:"POST",body:e}),t.next=8,n.arrayBuffer();case 8:case 15:return t.abrupt("return",t.sent.byteLength);case 9:if(!Vn.isArrayBufferView(e)&&!Vn.isArrayBuffer(e)){t.next=11;break}return t.abrupt("return",e.byteLength);case 11:if(Vn.isURLSearchParams(e)&&(e+=""),!Vn.isString(e)){t.next=16;break}return t.next=15,Vr(e);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ei=function(){var t=Pt(Kt().mark((function t(e,n){var r;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Vn.toFiniteNumber(e.getContentLength()),t.abrupt("return",null==r?ti(n):r);case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),ni=Kr&&function(){var t=Pt(Kt().mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,d,v,p,g,y,b,m,w,k,x,A,E,O,R,S,j,T,_,P,L,C,N,F;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=Br(e),r=n.url,i=n.method,o=n.data,a=n.signal,s=n.cancelToken,u=n.timeout,c=n.onDownloadProgress,l=n.onUploadProgress,h=n.responseType,f=n.headers,d=n.withCredentials,v=void 0===d?"same-origin":d,p=n.fetchOptions,h=h?(h+"").toLowerCase():"text",g=Ir([a,s&&s.toAbortSignal()],u),b=g&&g.unsubscribe&&function(){g.unsubscribe()},t.prev=4,t.t0=l&&Qr&&"get"!==i&&"head"!==i,!t.t0){t.next=11;break}return t.next=9,ei(f,o);case 9:t.t1=m=t.sent,t.t0=0!==t.t1;case 11:if(!t.t0){t.next=15;break}w=new Request(r,{method:"POST",body:o,duplex:"half"}),Vn.isFormData(o)&&(k=w.headers.get("content-type"))&&f.setContentType(k),w.body&&(x=Pr(m,_r(Lr(l))),A=Vt(x,2),E=A[0],O=A[1],o=Wr(w.body,65536,E,O));case 15:return Vn.isString(v)||(v=v?"include":"omit"),R="credentials"in Request.prototype,y=new Request(r,Wt(Wt({},p),{},{signal:g,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",credentials:R?v:void 0})),t.next=20,fetch(y);case 20:return S=t.sent,j=Yr&&("stream"===h||"response"===h),Yr&&(c||j&&b)&&(T={},["status","statusText","headers"].forEach((function(t){T[t]=S[t]})),_=Vn.toFiniteNumber(S.headers.get("content-length")),P=c&&Pr(_,_r(Lr(c),!0))||[],L=Vt(P,2),C=L[0],N=L[1],S=new Response(Wr(S.body,65536,C,(function(){N&&N(),b&&b()})),T)),h=h||"text",t.next=26,Zr[Vn.findKey(Zr,h)||"text"](S,e);case 26:return F=t.sent,!j&&b&&b(),t.next=30,new Promise((function(t,n){Tr(t,n,{data:F,headers:Or.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:y})}));case 30:return t.abrupt("return",t.sent);case 33:if(t.prev=33,t.t2=t.catch(4),b&&b(),!t.t2||"TypeError"!==t.t2.name||!/fetch/i.test(t.t2.message)){t.next=38;break}throw Object.assign(new Xn("Network Error",Xn.ERR_NETWORK,e,y),{cause:t.t2.cause||t.t2});case 38:throw Xn.from(t.t2,t.t2&&t.t2.code,e,y);case 39:case"end":return t.stop()}}),t,null,[[4,33]])})));return function(e){return t.apply(this,arguments)}}(),ri={http:null,xhr:qr,fetch:ni};Vn.forEach(ri,(function(t,e){if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));var ii=function(t){return"- ".concat(t)},oi=function(t){return Vn.isFunction(t)||null===t||!1===t},ai=function(t){for(var e,n,r=(t=Vn.isArray(t)?t:[t]).length,i={},o=0;o<r;o++){var a=void 0;if(n=e=t[o],!oi(e)&&void 0===(n=ri[(a=String(e)).toLowerCase()]))throw new Xn("Unknown adapter '".concat(a,"'"));if(n)break;i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(t){var e=Vt(t,2),n=e[0],r=e[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));throw new Xn("There is no suitable adapter to dispatch the request "+(r?s.length>1?"since :\n"+s.map(ii).join("\n"):" "+ii(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function si(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new jr(null,t)}function ui(t){return si(t),t.headers=Or.from(t.headers),t.data=Rr.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ai(t.adapter||mr.adapter)(t).then((function(e){return si(t),e.data=Rr.call(t,t.transformResponse,e),e.headers=Or.from(e.headers),e}),(function(e){return Sr(e)||(si(t),e&&e.response&&(e.response.data=Rr.call(t,t.transformResponse,e.response),e.response.headers=Or.from(e.response.headers))),Promise.reject(e)}))}var ci={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){ci[t]=function(n){return Yt(n)===t||"a"+(e<1?"n ":" ")+t}}));var li={};ci.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.9] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,i,o){if(!1===t)throw new Xn(r(i," has been removed"+(e?" in "+e:"")),Xn.ERR_DEPRECATED);return e&&!li[i]&&(li[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}},ci.spelling=function(t){return function(e,n){return console.warn("".concat(n," is likely a misspelling of ").concat(t)),!0}};var hi={assertOptions:function(t,e,n){if("object"!==Yt(t))throw new Xn("options must be an object",Xn.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new Xn("option "+o+" must be "+u,Xn.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Xn("Unknown option "+o,Xn.ERR_BAD_OPTION)}},validators:ci},fi=hi.validators,di=function(){return $t((function t(e){Nt(this,t),this.defaults=e,this.interceptors={request:new cr,response:new cr}}),[{key:"request",value:(t=Pt(Kt().mark((function t(e,n){var r,i;return Kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._request(e,n);case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack?r.stack.replace(/^.+\n/,""):"";try{t.t0.stack?i&&!String(t.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.t0.stack+="\n"+i):t.t0.stack=i}catch(t){}}throw t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{};var n=e=$r(this.defaults,e),r=n.transitional,i=n.paramsSerializer,o=n.headers;void 0!==r&&hi.assertOptions(r,{silentJSONParsing:fi.transitional(fi.boolean),forcedJSONParsing:fi.transitional(fi.boolean),clarifyTimeoutError:fi.transitional(fi.boolean)},!1),null!=i&&(Vn.isFunction(i)?e.paramsSerializer={serialize:i}:hi.assertOptions(i,{encode:fi.function,serialize:fi.function},!0)),hi.assertOptions(e,{baseUrl:fi.spelling("baseURL"),withXsrfToken:fi.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();var a=o&&Vn.merge(o.common,o[e.method]);o&&Vn.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete o[t]})),e.headers=Or.concat(a,o);var s=[],u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));var c,l=[];this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));var h,f=0;if(!u){var d=[ui.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,l),h=d.length,c=Promise.resolve(e);f<h;)c=c.then(d[f++],d[f++]);return c}h=s.length;var v=e;for(f=0;f<h;){var p=s[f++],g=s[f++];try{v=p(v)}catch(t){g.call(this,t);break}}try{c=ui.call(this,v)}catch(t){return Promise.reject(t)}for(f=0,h=l.length;f<h;)c=c.then(l[f++],l[f++]);return c}},{key:"getUri",value:function(t){return ur(Fr((t=$r(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}]);var t}();Vn.forEach(["delete","get","head","options"],(function(t){di.prototype[t]=function(e,n){return this.request($r(n||{},{method:t,url:e,data:(n||{}).data}))}})),Vn.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request($r(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}di.prototype[t]=e(),di.prototype[t+"Form"]=e(!0)}));var vi=function(){function t(e){if(Nt(this,t),"function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){for(var e=r._listeners.length;e-- >0;)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},e((function(t,e,i){r.reason||(r.reason=new jr(t,e,i),n(r.reason))}))}return $t(t,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}},{key:"unsubscribe",value:function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}}},{key:"toAbortSignal",value:function(){var t=this,e=new AbortController,n=function(t){e.abort(t)};return this.subscribe(n),e.signal.unsubscribe=function(){return t.unsubscribe(n)},e.signal}}],[{key:"source",value:function(){var e;return{token:new t((function(t){e=t})),cancel:e}}}])}(),pi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pi).forEach((function(t){var e=Vt(t,2),n=e[0],r=e[1];pi[r]=n}));var gi=function t(e){var n=new di(e),r=rn(di.prototype.request,n);return Vn.extend(r,di.prototype,n,{allOwnKeys:!0}),Vn.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t($r(e,n))},r}(mr);gi.Axios=di,gi.CanceledError=jr,gi.CancelToken=vi,gi.isCancel=Sr,gi.VERSION="1.7.9",gi.toFormData=rr,gi.AxiosError=Xn,gi.Cancel=gi.CanceledError,gi.all=function(t){return Promise.all(t)},gi.spread=function(t){return function(e){return t.apply(null,e)}},gi.isAxiosError=function(t){return Vn.isObject(t)&&!0===t.isAxiosError},gi.mergeConfig=$r,gi.AxiosHeaders=Or,gi.formToJSON=function(t){return br(Vn.isHTMLForm(t)?new FormData(t):t)},gi.getAdapter=ai,gi.HttpStatusCode=pi,gi.default=gi,gi.Axios,gi.AxiosError,gi.CanceledError,gi.isCancel,gi.CancelToken,gi.VERSION,gi.all,gi.Cancel,gi.isAxiosError,gi.spread,gi.toFormData,gi.AxiosHeaders,gi.HttpStatusCode,gi.formToJSON,gi.getAdapter,gi.mergeConfig;var yi=function(){function t(e){var n;return Nt(this,t),(n=Ct(this,t,[e])).axiosInstance=gi.create({baseURL:"".concat(n.host,"/").concat(n.namespace),headers:{Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),n.axiosInstance.interceptors.response.use((function(t){return t.data}),(function(t){if(t.response){var e=t.response.data;if(fe(e.errors)&&e.errors.length)throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t})),n}return qt(t,en),$t(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.axiosInstance.defaults.headers.common=Wt(Wt({},this.axiosInstance.defaults.headers.common),t),this}},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axiosInstance.request(Wt({method:t,url:e},n))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("GET",t,Wt({params:e},n))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",t,Wt({data:e},n))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",t,Wt({data:e},n))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",t,e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",t,Wt({data:e},n))}}])}();ue("adapter","NodeAdapter",yi);var bi=function(){function t(){return Nt(this,t),Ct(this,t,arguments)}return qt(t,en),$t(t)}();ue("adapter","EmberJsAdapter",bi),function(){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Nt(this,t),this.version=null!==(n=o.version)&&void 0!==n?n:"v1",this.options={version:this.version,host:null!==(r=o.host)&&void 0!==r?r:"https://api.fleetbase.io",namespace:null!==(i=o.namespace)&&void 0!==i?i:this.version,debug:a,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!Oe()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=o.adapter||Re(this.options),this.orders=new Ne("order",this.adapter).extendActions(Fe),this.entities=new Ne("entity",this.adapter),this.places=new Ne("place",this.adapter),this.drivers=new Ne("driver",this.adapter).extendActions(We),this.vehicles=new Ne("vehicle",this.adapter),this.vendors=new Ne("vendor",this.adapter),this.contacts=new Ne("contact",this.adapter),this.serviceAreas=new Ne("service-area",this.adapter),this.zones=new Ne("zone",this.adapter),this.fleets=new Ne("fleet",this.adapter),this.organizations=new Ne("organization",this.adapter).extendActions(Me)}$t(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return Ft(t,Array.prototype.slice.call(arguments))}}])}();var mi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"vehicle",r])}return b(t,vt),v(t,[{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new Se))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new Se))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}}])}();z("resource","Vehicle",mi);var wi=new ft({current:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/current"),t,e)}}),ki=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"organization",A({actions:wi},r)])}return b(t,vt),v(t)}();z("resource","Organization",ki);var xi=function(t,e){return J(t)?t.map((function(t){return new ki(t,e)})):new ki(t,e)},Ai=new ft({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("drivers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("drivers/login",A({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/verify-code",A({identity:t,code:e},n)).then(this.afterFetch.bind(this))},track:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/track"),e,n).then(this.afterFetch.bind(this))},listOrganizations:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/organizations"),n,r).then((function(t){return xi(t,e.adapter)}))},switchOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/switch-organization"),n,r).then((function(t){return xi(t,e.adapter)}))},currentOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/current-organization"),n,r).then((function(t){return xi(t,e.adapter)}))},retrieve:function(t){return this.findRecord(t)},syncDevice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/register-device"),e,n)}}),Ei=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"driver",A({actions:Ai},r)])}return b(t,vt),v(t,[{key:"token",get:function(){return this.getAttribute("token")}},{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new st))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"track",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.track(this.id,t,e)}},{key:"syncDevice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.syncDevice(this.id,t,e)}},{key:"listOrganizations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.listOrganizations(this.id,t,e)}},{key:"switchOrganization",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.switchOrganization(this.id,{next:t},e)}},{key:"currentOrganization",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.currentOrganization(this.id,t,e)}}])}();z("resource","Driver",Ei);var Oi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"vendor",r])}return b(t,vt),v(t)}();z("resource","Vendor",Oi);var Ri=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"contact",r])}return b(t,vt),v(t)}();z("resource","Contact",Ri);var Si=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"zone",r])}return b(t,vt),v(t)}();z("resource","Zone",Si);var ji=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"service-area",r])}return b(t,vt),v(t)}();z("resource","ServiceArea",ji);var Ti=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"service-rate",r])}return b(t,vt),v(t)}();z("resource","ServiceRate",Ti),new ft({fromPayload:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return dt(t)&&(t=t.id),this.adapter.get("".concat(this.namespace),A({payload:t},e)).then(this.afterFetch.bind(this))},fromPreliminary:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("".concat(this.namespace,"/preliminary"),A({},t)).then(this.afterFetch.bind(this))}});var _i=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"service-quote",r])}return b(t,vt),v(t,[{key:"fromPreliminary",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.fromPreliminary(t)}},{key:"fromPayload",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.fromPayload(t,e)}}])}();z("resource","ServiceQuote",_i);var Pi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return h(this,t),l(this,t,[e,n,"fleet",r])}return b(t,vt),v(t)}();z("resource","Fleet",Pi);var Li=v((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}}));z("adapter","Adapter",Li);var Ci=function(){function t(e){var n;return h(this,t),(n=l(this,t,[e])).setHeaders({Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),n}return b(t,Li),v(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=A(A({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){t.json().then((function(n){e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,a){fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),A({method:n,mode:i.mode||"cors",headers:new Headers(A(A({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){if(t.ok)return o(t.json);a(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){a(t)}))}))}},{key:"get",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=rt(e=n)||"string"==typeof e&&!1===/\S/.test(e)?"":new URLSearchParams(n).toString();return this.request("".concat(t).concat(i?"?".concat(i):""),"GET",{},r)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}])}();function Ni(t,e){return function(){return t.apply(e,arguments)}}z("adapter","BrowserAdapter",Ci);var Fi,Di=Object.prototype.toString,$i=Object.getPrototypeOf,Ui=(Fi=Object.create(null),function(t){var e=Di.call(t);return Fi[e]||(Fi[e]=e.slice(8,-1).toLowerCase())}),zi=function(t){return t=t.toLowerCase(),function(e){return Ui(e)===t}},Bi=function(t){return function(e){return T(e)===t}},qi=Array.isArray,Ii=Bi("undefined");var Mi=zi("ArrayBuffer");var Hi=Bi("string"),Ji=Bi("function"),Wi=Bi("number"),Ki=function(t){return null!==t&&"object"===T(t)},Gi=function(t){if("object"!==Ui(t))return!1;var e=$i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Vi=zi("Date"),Xi=zi("File"),Qi=zi("Blob"),Yi=zi("FileList"),Zi=zi("URLSearchParams"),to=R(["ReadableStream","Request","Response","Headers"].map(zi),4),eo=to[0],no=to[1],ro=to[2],io=to[3];function oo(t,e){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,o=void 0!==i&&i;if(null!=t)if("object"!==T(t)&&(t=[t]),qi(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{var a,s=o?Object.getOwnPropertyNames(t):Object.keys(t),u=s.length;for(n=0;n<u;n++)a=s[n],e.call(null,t[a],a,t)}}function ao(t,e){e=e.toLowerCase();for(var n,r=Object.keys(t),i=r.length;i-- >0;)if(e===(n=r[i]).toLowerCase())return n;return null}var so="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,uo=function(t){return!Ii(t)&&t!==so};var co,lo=(co="undefined"!=typeof Uint8Array&&$i(Uint8Array),function(t){return co&&t instanceof co}),ho=zi("HTMLFormElement"),fo=function(){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),vo=zi("RegExp"),po=function(t,e){var n=Object.getOwnPropertyDescriptors(t),r={};oo(n,(function(n,i){var o;!1!==(o=e(n,i,t))&&(r[i]=o||n)})),Object.defineProperties(t,r)},go="abcdefghijklmnopqrstuvwxyz",yo="0123456789",bo={DIGIT:yo,ALPHA:go,ALPHA_DIGIT:go+go.toUpperCase()+yo};var mo,wo,ko,xo,Ao=zi("AsyncFunction"),Eo=(mo="function"==typeof setImmediate,wo=Ji(so.postMessage),mo?setImmediate:wo?(ko="axios@".concat(Math.random()),xo=[],so.addEventListener("message",(function(t){var e=t.source,n=t.data;e===so&&n===ko&&xo.length&&xo.shift()()}),!1),function(t){xo.push(t),so.postMessage(ko,"*")}):function(t){return setTimeout(t)}),Oo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(so):"undefined"!=typeof process&&process.nextTick||Eo,Ro={isArray:qi,isArrayBuffer:Mi,isBuffer:function(t){return null!==t&&!Ii(t)&&null!==t.constructor&&!Ii(t.constructor)&&Ji(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:function(t){var e;return t&&("function"==typeof FormData&&t instanceof FormData||Ji(t.append)&&("formdata"===(e=Ui(t))||"object"===e&&Ji(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Mi(t.buffer)},isString:Hi,isNumber:Wi,isBoolean:function(t){return!0===t||!1===t},isObject:Ki,isPlainObject:Gi,isReadableStream:eo,isRequest:no,isResponse:ro,isHeaders:io,isUndefined:Ii,isDate:Vi,isFile:Xi,isBlob:Qi,isRegExp:vo,isFunction:Ji,isStream:function(t){return Ki(t)&&Ji(t.pipe)},isURLSearchParams:Zi,isTypedArray:lo,isFileList:Yi,forEach:oo,merge:function t(){for(var e=(uo(this)&&this||{}).caseless,n={},r=function(r,i){var o=e&&ao(n,i)||i;Gi(n[o])&&Gi(r)?n[o]=t(n[o],r):Gi(r)?n[o]=t({},r):qi(r)?n[o]=r.slice():n[o]=r},i=0,o=arguments.length;i<o;i++)arguments[i]&&oo(arguments[i],r);return n},extend:function(t,e,n){return oo(e,(function(e,r){n&&Ji(e)?t[r]=Ni(e,n):t[r]=e}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,n,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:function(t,e,n,r){var i,o,a,s={};if(e=e||{},null==t)return e;do{for(o=(i=Object.getOwnPropertyNames(t)).length;o-- >0;)a=i[o],r&&!r(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==n&&$i(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:Ui,kindOfTest:zi,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;if(qi(t))return t;var e=t.length;if(!Wi(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},forEachEntry:function(t,e){for(var n,r=(t&&t[Symbol.iterator]).call(t);(n=r.next())&&!n.done;){var i=n.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:ho,hasOwnProperty:fo,hasOwnProp:fo,reduceDescriptors:po,freezeMethods:function(t){po(t,(function(e,n){if(Ji(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=t[n];Ji(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(t,e){var n={},r=function(t){t.forEach((function(t){n[t]=!0}))};return qi(t)?r(t):r(String(t).split(e)),n},toCamelCase:function(t){return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(t,e){return null!=t&&Number.isFinite(t=+t)?t:e},findKey:ao,global:so,isContextDefined:uo,ALPHABET:bo,generateString:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bo.ALPHA_DIGIT,n="",r=e.length;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&Ji(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:function(t){var e=new Array(10),n=function(t,r){if(Ki(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;var i=qi(t)?[]:{};return oo(t,(function(t,e){var o=n(t,r+1);!Ii(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:Ao,isThenable:function(t){return t&&(Ki(t)||Ji(t))&&Ji(t.then)&&Ji(t.catch)},setImmediate:Eo,asap:Oo};function So(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Ro.inherits(So,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ro.toJSONObject(this.config),code:this.code,status:this.status}}});var jo=So.prototype,To={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(t){To[t]={value:t}})),Object.defineProperties(So,To),Object.defineProperty(jo,"isAxiosError",{value:!0}),So.from=function(t,e,n,r,i,o){var a=Object.create(jo);return Ro.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(function(t){return"isAxiosError"!==t})),So.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};function _o(t){return Ro.isPlainObject(t)||Ro.isArray(t)}function Po(t){return Ro.endsWith(t,"[]")?t.slice(0,-2):t}function Lo(t,e,n){return t?t.concat(e).map((function(t,e){return t=Po(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}var Co=Ro.toFlatObject(Ro,{},null,(function(t){return/^is[A-Z]/.test(t)}));function No(t,e,n){if(!Ro.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;var r=(n=Ro.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Ro.isUndefined(e[t])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ro.isSpecCompliantForm(e);if(!Ro.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(Ro.isDate(t))return t.toISOString();if(!s&&Ro.isBlob(t))throw new So("Blob is not supported. Use a Buffer instead.");return Ro.isArrayBuffer(t)||Ro.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){var s=t;if(t&&!i&&"object"===T(t))if(Ro.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Ro.isArray(t)&&function(t){return Ro.isArray(t)&&!t.some(_o)}(t)||(Ro.isFileList(t)||Ro.endsWith(n,"[]"))&&(s=Ro.toArray(t)))return n=Po(n),s.forEach((function(t,r){!Ro.isUndefined(t)&&null!==t&&e.append(!0===a?Lo([n],r,o):null===a?n:n+"[]",u(t))})),!1;return!!_o(t)||(e.append(Lo(i,n,o),u(t)),!1)}var l=[],h=Object.assign(Co,{defaultVisitor:c,convertValue:u,isVisitable:_o});if(!Ro.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Ro.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Ro.forEach(n,(function(n,o){!0===(!(Ro.isUndefined(n)||null===n)&&i.call(e,n,Ro.isString(o)?o.trim():o,r,h))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function Fo(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function Do(t,e){this._pairs=[],t&&No(t,this,e)}var $o=Do.prototype;function Uo(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function zo(t,e,n){if(!e)return t;var r=n&&n.encode||Uo;Ro.isFunction(n)&&(n={serialize:n});var i,o=n&&n.serialize;if(i=o?o(e,n):Ro.isURLSearchParams(e)?e.toString():new Do(e,n).toString(r)){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}$o.append=function(t,e){this._pairs.push([t,e])},$o.toString=function(t){var e=t?function(e){return t.call(this,e,Fo)}:Fo;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var Bo=function(){return v((function t(){h(this,t),this.handlers=[]}),[{key:"use",value:function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(t){this.handlers[t]&&(this.handlers[t]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(t){Ro.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}])}(),qo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Io={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Do,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Mo="undefined"!=typeof window&&"undefined"!=typeof document,Ho="object"===("undefined"==typeof navigator?"undefined":T(navigator))&&navigator||void 0,Jo=Mo&&(!Ho||["ReactNative","NativeScript","NS"].indexOf(Ho.product)<0),Wo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ko=Mo&&window.location.href||"http://localhost",Go=A(A({},Object.freeze({__proto__:null,hasBrowserEnv:Mo,hasStandardBrowserEnv:Jo,hasStandardBrowserWebWorkerEnv:Wo,navigator:Ho,origin:Ko})),Io);function Vo(t){function e(t,n,r,i){var o=t[i++];if("__proto__"===o)return!0;var a=Number.isFinite(+o),s=i>=t.length;return o=!o&&Ro.isArray(r)?r.length:o,s?(Ro.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&Ro.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&Ro.isArray(r[o])&&(r[o]=function(t){var e,n,r={},i=Object.keys(t),o=i.length;for(e=0;e<o;e++)r[n=i[e]]=t[n];return r}(r[o])),!a)}if(Ro.isFormData(t)&&Ro.isFunction(t.entries)){var n={};return Ro.forEachEntry(t,(function(t,r){e(function(t){return Ro.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),r,n,0)})),n}return null}var Xo={transitional:qo,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){var n,r=e.getContentType()||"",i=r.indexOf("application/json")>-1,o=Ro.isObject(t);if(o&&Ro.isHTMLForm(t)&&(t=new FormData(t)),Ro.isFormData(t))return i?JSON.stringify(Vo(t)):t;if(Ro.isArrayBuffer(t)||Ro.isBuffer(t)||Ro.isStream(t)||Ro.isFile(t)||Ro.isBlob(t)||Ro.isReadableStream(t))return t;if(Ro.isArrayBufferView(t))return t.buffer;if(Ro.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return No(t,new Go.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return Go.isNode&&Ro.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((n=Ro.isFileList(t))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return No(n?{"files[]":t}:t,a&&new a,this.formSerializer)}}return o||i?(e.setContentType("application/json",!1),function(t,e){if(Ro.isString(t))try{return(e||JSON.parse)(t),Ro.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||Xo.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Ro.isResponse(t)||Ro.isReadableStream(t))return t;if(t&&Ro.isString(t)&&(n&&!this.responseType||r)){var i=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw So.from(t,So.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Go.classes.FormData,Blob:Go.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ro.forEach(["delete","get","head","post","put","patch"],(function(t){Xo.headers[t]={}}));var Qo=Ro.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Yo=Symbol("internals");function Zo(t){return t&&String(t).trim().toLowerCase()}function ta(t){return!1===t||null==t?t:Ro.isArray(t)?t.map(ta):String(t)}function ea(t,e,n,r,i){return Ro.isFunction(r)?r.call(this,e,n):(i&&(e=n),Ro.isString(e)?Ro.isString(r)?-1!==e.indexOf(r):Ro.isRegExp(r)?r.test(e):void 0:void 0)}var na=function(){return v((function t(e){h(this,t),e&&this.set(e)}),[{key:"set",value:function(t,e,n){var r=this;function i(t,e,n){var i=Zo(e);if(!i)throw new Error("header name must be a non-empty string");var o=Ro.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=ta(t))}var o=function(t,e){return Ro.forEach(t,(function(t,n){return i(t,n,e)}))};if(Ro.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Ro.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o(function(t){var e,n,r,i={};return t&&t.split("\n").forEach((function(t){r=t.indexOf(":"),e=t.substring(0,r).trim().toLowerCase(),n=t.substring(r+1).trim(),!e||i[e]&&Qo[e]||("set-cookie"===e?i[e]?i[e].push(n):i[e]=[n]:i[e]=i[e]?i[e]+", "+n:n)})),i}(t),e);else if(Ro.isHeaders(t)){var a,s=p(t.entries());try{for(s.s();!(a=s.n()).done;){var u=R(a.value,2),c=u[0];i(u[1],c,n)}}catch(t){s.e(t)}finally{s.f()}}else null!=t&&i(e,t,n);return this}},{key:"get",value:function(t,e){if(t=Zo(t)){var n=Ro.findKey(this,t);if(n){var r=this[n];if(!e)return r;if(!0===e)return function(t){for(var e,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;e=r.exec(t);)n[e[1]]=e[2];return n}(r);if(Ro.isFunction(e))return e.call(this,r,n);if(Ro.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(t,e){if(t=Zo(t)){var n=Ro.findKey(this,t);return!(!n||void 0===this[n]||e&&!ea(0,this[n],n,e))}return!1}},{key:"delete",value:function(t,e){var n=this,r=!1;function i(t){if(t=Zo(t)){var i=Ro.findKey(n,t);!i||e&&!ea(0,n[i],i,e)||(delete n[i],r=!0)}}return Ro.isArray(t)?t.forEach(i):i(t),r}},{key:"clear",value:function(t){for(var e=Object.keys(this),n=e.length,r=!1;n--;){var i=e[n];t&&!ea(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(t){var e=this,n={};return Ro.forEach(this,(function(r,i){var o=Ro.findKey(n,i);if(o)return e[o]=ta(r),void delete e[i];var a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))}(i):String(i).trim();a!==i&&delete e[i],e[a]=ta(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.constructor).concat.apply(t,[this].concat(n))}},{key:"toJSON",value:function(t){var e=Object.create(null);return Ro.forEach(this,(function(n,r){null!=n&&!1!==n&&(e[r]=t&&Ro.isArray(n)?n.join(", "):n)})),e}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(t){var e=R(t,2);return e[0]+": "+e[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(t){return t instanceof this?t:new this(t)}},{key:"concat",value:function(t){for(var e=new this(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(t){return e.set(t)})),e}},{key:"accessor",value:function(t){var e=(this[Yo]=this[Yo]={accessors:{}}).accessors,n=this.prototype;function r(t){var r=Zo(t);e[r]||(!function(t,e){var n=Ro.toCamelCase(" "+e);["get","set","has"].forEach((function(r){Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return Ro.isArray(t)?t.forEach(r):r(t),this}}])}();function ra(t,e){var n=this||Xo,r=e||n,i=na.from(r.headers),o=r.data;return Ro.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function ia(t){return!(!t||!t.__CANCEL__)}function oa(t,e,n){So.call(this,null==t?"canceled":t,So.ERR_CANCELED,e,n),this.name="CanceledError"}function aa(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new So("Request failed with status code "+n.status,[So.ERR_BAD_REQUEST,So.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}na.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ro.reduceDescriptors(na.prototype,(function(t,e){var n=t.value,r=e[0].toUpperCase()+e.slice(1);return{get:function(){return n},set:function(t){this[r]=t}}})),Ro.freezeMethods(na),Ro.inherits(oa,So,{__CANCEL__:!0});var sa=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(t,e){t=t||10;var n,r=new Array(t),i=new Array(t),o=0,a=0;return e=void 0!==e?e:1e3,function(s){var u=Date.now(),c=i[a];n||(n=u),r[o]=s,i[o]=u;for(var l=a,h=0;l!==o;)h+=r[l++],l%=t;if((o=(o+1)%t)===a&&(a=(a+1)%t),!(u-n<e)){var f=c&&u-c;return f?Math.round(1e3*h/f):void 0}}}(50,250);return function(t,e){var n,r,i=0,o=1e3/e,a=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=o,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[function(){for(var t=Date.now(),e=t-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];e>=o?a(u,t):(n=u,r||(r=setTimeout((function(){r=null,a(n)}),o-e)))},function(){return n&&a(n)}]}((function(n){var o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o;var c=g({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a},e?"download":"upload",!0);t(c)}),n)},ua=function(t,e){var n=null!=t;return[function(r){return e[0]({lengthComputable:n,total:t,loaded:r})},e[1]]},ca=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ro.asap((function(){return t.apply(void 0,n)}))}},la=Go.hasStandardBrowserEnv?function(t,e){return function(n){return n=new URL(n,Go.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)}}(new URL(Go.origin),Go.navigator&&/(msie|trident)/i.test(Go.navigator.userAgent)):function(){return!0},ha=Go.hasStandardBrowserEnv?{write:function(t,e,n,r,i,o){var a=[t+"="+encodeURIComponent(e)];Ro.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Ro.isString(r)&&a.push("path="+r),Ro.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function fa(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var da=function(t){return t instanceof na?A({},t):t};function va(t,e){e=e||{};var n={};function r(t,e,n,r){return Ro.isPlainObject(t)&&Ro.isPlainObject(e)?Ro.merge.call({caseless:r},t,e):Ro.isPlainObject(e)?Ro.merge({},e):Ro.isArray(e)?e.slice():e}function i(t,e,n,i){return Ro.isUndefined(e)?Ro.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function o(t,e){if(!Ro.isUndefined(e))return r(void 0,e)}function a(t,e){return Ro.isUndefined(e)?Ro.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(t,e,n){return i(da(t),da(e),0,!0)}};return Ro.forEach(Object.keys(Object.assign({},t,e)),(function(r){var o=u[r]||i,a=o(t[r],e[r],r);Ro.isUndefined(a)&&o!==s||(n[r]=a)})),n}var pa,ga,ya=function(t){var e,r=va({},t),i=r.data,o=r.withXSRFToken,a=r.xsrfHeaderName,s=r.xsrfCookieName,u=r.headers,c=r.auth;if(r.headers=u=na.from(u),r.url=zo(fa(r.baseURL,r.url),t.params,t.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Ro.isFormData(i))if(Go.hasStandardBrowserEnv||Go.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(!1!==(e=u.getContentType())){var l=e?e.split(";").map((function(t){return t.trim()})).filter(Boolean):[],h=function(t){return n(t)||w(t)||_(t)||k()}(l),f=h[0],d=h.slice(1);u.setContentType([f||"multipart/form-data"].concat(S(d)).join("; "))}if(Go.hasStandardBrowserEnv&&(o&&Ro.isFunction(o)&&(o=o(r)),o||!1!==o&&la(r.url))){var v=a&&s&&ha.read(s);v&&u.set(a,v)}return r},ba="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){var r,i,o,a,s,u=ya(t),c=u.data,l=na.from(u.headers).normalize(),h=u.responseType,f=u.onUploadProgress,d=u.onDownloadProgress;function v(){a&&a(),s&&s(),u.cancelToken&&u.cancelToken.unsubscribe(r),u.signal&&u.signal.removeEventListener("abort",r)}var p=new XMLHttpRequest;function g(){if(p){var r=na.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());aa((function(t){e(t),v()}),(function(t){n(t),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:t,request:p}),p=null}}if(p.open(u.method.toUpperCase(),u.url,!0),p.timeout=u.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(n(new So("Request aborted",So.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new So("Network Error",So.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||qo;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),n(new So(e,r.clarifyTimeoutError?So.ETIMEDOUT:So.ECONNABORTED,t,p)),p=null},void 0===c&&l.setContentType(null),"setRequestHeader"in p&&Ro.forEach(l.toJSON(),(function(t,e){p.setRequestHeader(e,t)})),Ro.isUndefined(u.withCredentials)||(p.withCredentials=!!u.withCredentials),h&&"json"!==h&&(p.responseType=u.responseType),d){var y=R(sa(d,!0),2);o=y[0],s=y[1],p.addEventListener("progress",o)}if(f&&p.upload){var b=R(sa(f),2);i=b[0],a=b[1],p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",a)}(u.cancelToken||u.signal)&&(r=function(e){p&&(n(!e||e.type?new oa(null,t,p):e),p.abort(),p=null)},u.cancelToken&&u.cancelToken.subscribe(r),u.signal&&(u.signal.aborted?r():u.signal.addEventListener("abort",r)));var m,w,k=(m=u.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m))&&w[1]||"");k&&-1===Go.protocols.indexOf(k)?n(new So("Unsupported protocol "+k+":",So.ERR_BAD_REQUEST,t)):p.send(c||null)}))},ma=function(t,e){var n=(t=t?t.filter(Boolean):[]).length;if(e||n){var r,i=new AbortController,o=function(t){if(!r){r=!0,s();var e=t instanceof Error?t:this.reason;i.abort(e instanceof So?e:new oa(e instanceof Error?e.message:e))}},a=e&&setTimeout((function(){a=null,o(new So("timeout ".concat(e," of ms exceeded"),So.ETIMEDOUT))}),e),s=function(){t&&(a&&clearTimeout(a),a=null,t.forEach((function(t){t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((function(t){return t.addEventListener("abort",o)}));var u=i.signal;return u.unsubscribe=function(){return Ro.asap(s)},u}},wa=E().mark((function t(e,n){var r,i,o;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.byteLength,n&&!(r<n)){t.next=5;break}return t.next=4,e;case 4:return t.abrupt("return");case 5:i=0;case 6:if(!(i<r)){t.next=13;break}return o=i+n,t.next=10,e.slice(i,o);case 10:i=o,t.next=6;break;case 13:case"end":return t.stop()}}),t)})),ka=function(){var t=P(E().mark((function t(e,n){var r,a,s,u,l,h;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!1,a=!1,t.prev=2,u=o(xa(e));case 4:return t.next=6,c(u.next());case 6:if(!(r=!(l=t.sent).done)){t.next=12;break}return h=l.value,t.delegateYield(i(o(wa(h,n))),"t0",9);case 9:r=!1,t.next=4;break;case 12:t.next=18;break;case 14:t.prev=14,t.t1=t.catch(2),a=!0,s=t.t1;case 18:if(t.prev=18,t.prev=19,!r||null==u.return){t.next=23;break}return t.next=23,c(u.return());case 23:if(t.prev=23,!a){t.next=26;break}throw s;case 26:return t.finish(23);case 27:return t.finish(18);case 28:case"end":return t.stop()}}),t,null,[[2,14,18,28],[19,,23,27]])})));return function(e,n){return t.apply(this,arguments)}}(),xa=function(){var t=P(E().mark((function t(e){var n,r,a,s;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e[Symbol.asyncIterator]){t.next=3;break}return t.delegateYield(i(o(e)),"t0",2);case 2:return t.abrupt("return");case 3:n=e.getReader(),t.prev=4;case 5:return t.next=7,c(n.read());case 7:if(r=t.sent,a=r.done,s=r.value,!a){t.next=12;break}return t.abrupt("break",16);case 12:return t.next=14,s;case 14:t.next=5;break;case 16:return t.prev=16,t.next=19,c(n.cancel());case 19:return t.finish(16);case 20:case"end":return t.stop()}}),t,null,[[4,,16,20]])})));return function(e){return t.apply(this,arguments)}}(),Aa=function(t,e,n,r){var i,o=ka(t,e),a=0,s=function(t){i||(i=!0,r&&r(t))};return new ReadableStream({pull:function(t){return u(E().mark((function e(){var r,i,u,c,l;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.next();case 3:if(r=e.sent,i=r.done,u=r.value,!i){e.next=10;break}return s(),t.close(),e.abrupt("return");case 10:c=u.byteLength,n&&(l=a+=c,n(l)),t.enqueue(new Uint8Array(u)),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),s(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))()},cancel:function(t){return s(t),o.return()}},{highWaterMark:2})},Ea="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Oa=Ea&&"function"==typeof ReadableStream,Ra=Ea&&("function"==typeof TextEncoder?(pa=new TextEncoder,function(t){return pa.encode(t)}):function(){var t=u(E().mark((function t(e){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,new Response(e).arrayBuffer();case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Sa=function(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!!t.apply(void 0,n)}catch(t){return!1}},ja=Oa&&Sa((function(){var t=!1,e=new Request(Go.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Ta=Oa&&Sa((function(){return Ro.isReadableStream(new Response("").body)})),_a={stream:Ta&&function(t){return t.body}};Ea&&(ga=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((function(t){!_a[t]&&(_a[t]=Ro.isFunction(ga[t])?function(e){return e[t]()}:function(e,n){throw new So("Response type '".concat(t,"' is not supported"),So.ERR_NOT_SUPPORT,n)})})));var Pa=function(){var t=u(E().mark((function t(e){var n;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",0);case 2:if(!Ro.isBlob(e)){t.next=4;break}return t.abrupt("return",e.size);case 4:if(!Ro.isSpecCompliantForm(e)){t.next=9;break}return n=new Request(Go.origin,{method:"POST",body:e}),t.next=8,n.arrayBuffer();case 8:case 15:return t.abrupt("return",t.sent.byteLength);case 9:if(!Ro.isArrayBufferView(e)&&!Ro.isArrayBuffer(e)){t.next=11;break}return t.abrupt("return",e.byteLength);case 11:if(Ro.isURLSearchParams(e)&&(e+=""),!Ro.isString(e)){t.next=16;break}return t.next=15,Ra(e);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),La=function(){var t=u(E().mark((function t(e,n){var r;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Ro.toFiniteNumber(e.getContentLength()),t.abrupt("return",null==r?Pa(n):r);case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),Ca=Ea&&function(){var t=u(E().mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,d,v,p,g,y,b,m,w,k,x,O,S,j,T,_,P,L,C,N,F,D,$,U;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=ya(e),r=n.url,i=n.method,o=n.data,a=n.signal,s=n.cancelToken,u=n.timeout,c=n.onDownloadProgress,l=n.onUploadProgress,h=n.responseType,f=n.headers,d=n.withCredentials,v=void 0===d?"same-origin":d,p=n.fetchOptions,h=h?(h+"").toLowerCase():"text",g=ma([a,s&&s.toAbortSignal()],u),b=g&&g.unsubscribe&&function(){g.unsubscribe()},t.prev=4,t.t0=l&&ja&&"get"!==i&&"head"!==i,!t.t0){t.next=11;break}return t.next=9,La(f,o);case 9:t.t1=m=t.sent,t.t0=0!==t.t1;case 11:if(!t.t0){t.next=15;break}w=new Request(r,{method:"POST",body:o,duplex:"half"}),Ro.isFormData(o)&&(k=w.headers.get("content-type"))&&f.setContentType(k),w.body&&(x=ua(m,sa(ca(l))),O=R(x,2),S=O[0],j=O[1],o=Aa(w.body,65536,S,j));case 15:return Ro.isString(v)||(v=v?"include":"omit"),T="credentials"in Request.prototype,y=new Request(r,A(A({},p),{},{signal:g,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",credentials:T?v:void 0})),t.next=20,fetch(y);case 20:return _=t.sent,P=Ta&&("stream"===h||"response"===h),Ta&&(c||P&&b)&&(L={},["status","statusText","headers"].forEach((function(t){L[t]=_[t]})),C=Ro.toFiniteNumber(_.headers.get("content-length")),N=c&&ua(C,sa(ca(c),!0))||[],F=R(N,2),D=F[0],$=F[1],_=new Response(Aa(_.body,65536,D,(function(){$&&$(),b&&b()})),L)),h=h||"text",t.next=26,_a[Ro.findKey(_a,h)||"text"](_,e);case 26:return U=t.sent,!P&&b&&b(),t.next=30,new Promise((function(t,n){aa(t,n,{data:U,headers:na.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:y})}));case 30:return t.abrupt("return",t.sent);case 33:if(t.prev=33,t.t2=t.catch(4),b&&b(),!t.t2||"TypeError"!==t.t2.name||!/fetch/i.test(t.t2.message)){t.next=38;break}throw Object.assign(new So("Network Error",So.ERR_NETWORK,e,y),{cause:t.t2.cause||t.t2});case 38:throw So.from(t.t2,t.t2&&t.t2.code,e,y);case 39:case"end":return t.stop()}}),t,null,[[4,33]])})));return function(e){return t.apply(this,arguments)}}(),Na={http:null,xhr:ba,fetch:Ca};Ro.forEach(Na,(function(t,e){if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));var Fa=function(t){return"- ".concat(t)},Da=function(t){return Ro.isFunction(t)||null===t||!1===t},$a=function(t){for(var e,n,r=(t=Ro.isArray(t)?t:[t]).length,i={},o=0;o<r;o++){var a=void 0;if(n=e=t[o],!Da(e)&&void 0===(n=Na[(a=String(e)).toLowerCase()]))throw new So("Unknown adapter '".concat(a,"'"));if(n)break;i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(t){var e=R(t,2),n=e[0],r=e[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));throw new So("There is no suitable adapter to dispatch the request "+(r?s.length>1?"since :\n"+s.map(Fa).join("\n"):" "+Fa(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Ua(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new oa(null,t)}function za(t){return Ua(t),t.headers=na.from(t.headers),t.data=ra.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),$a(t.adapter||Xo.adapter)(t).then((function(e){return Ua(t),e.data=ra.call(t,t.transformResponse,e),e.headers=na.from(e.headers),e}),(function(e){return ia(e)||(Ua(t),e&&e.response&&(e.response.data=ra.call(t,t.transformResponse,e.response),e.response.headers=na.from(e.response.headers))),Promise.reject(e)}))}var Ba="1.7.9",qa={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){qa[t]=function(n){return T(n)===t||"a"+(e<1?"n ":" ")+t}}));var Ia={};qa.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.9] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,i,o){if(!1===t)throw new So(r(i," has been removed"+(e?" in "+e:"")),So.ERR_DEPRECATED);return e&&!Ia[i]&&(Ia[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}},qa.spelling=function(t){return function(e,n){return console.warn("".concat(n," is likely a misspelling of ").concat(t)),!0}};var Ma={assertOptions:function(t,e,n){if("object"!==T(t))throw new So("options must be an object",So.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new So("option "+o+" must be "+u,So.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new So("Unknown option "+o,So.ERR_BAD_OPTION)}},validators:qa},Ha=Ma.validators,Ja=function(){return v((function t(e){h(this,t),this.defaults=e,this.interceptors={request:new Bo,response:new Bo}}),[{key:"request",value:(t=u(E().mark((function t(e,n){var r,i;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._request(e,n);case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack?r.stack.replace(/^.+\n/,""):"";try{t.t0.stack?i&&!String(t.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.t0.stack+="\n"+i):t.t0.stack=i}catch(t){}}throw t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{};var n=e=va(this.defaults,e),r=n.transitional,i=n.paramsSerializer,o=n.headers;void 0!==r&&Ma.assertOptions(r,{silentJSONParsing:Ha.transitional(Ha.boolean),forcedJSONParsing:Ha.transitional(Ha.boolean),clarifyTimeoutError:Ha.transitional(Ha.boolean)},!1),null!=i&&(Ro.isFunction(i)?e.paramsSerializer={serialize:i}:Ma.assertOptions(i,{encode:Ha.function,serialize:Ha.function},!0)),Ma.assertOptions(e,{baseUrl:Ha.spelling("baseURL"),withXsrfToken:Ha.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();var a=o&&Ro.merge(o.common,o[e.method]);o&&Ro.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete o[t]})),e.headers=na.concat(a,o);var s=[],u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));var c,l=[];this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));var h,f=0;if(!u){var d=[za.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,l),h=d.length,c=Promise.resolve(e);f<h;)c=c.then(d[f++],d[f++]);return c}h=s.length;var v=e;for(f=0;f<h;){var p=s[f++],g=s[f++];try{v=p(v)}catch(t){g.call(this,t);break}}try{c=za.call(this,v)}catch(t){return Promise.reject(t)}for(f=0,h=l.length;f<h;)c=c.then(l[f++],l[f++]);return c}},{key:"getUri",value:function(t){return zo(fa((t=va(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}]);var t}();Ro.forEach(["delete","get","head","options"],(function(t){Ja.prototype[t]=function(e,n){return this.request(va(n||{},{method:t,url:e,data:(n||{}).data}))}})),Ro.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(va(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ja.prototype[t]=e(),Ja.prototype[t+"Form"]=e(!0)}));var Wa=function(){function t(e){if(h(this,t),"function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){for(var e=r._listeners.length;e-- >0;)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},e((function(t,e,i){r.reason||(r.reason=new oa(t,e,i),n(r.reason))}))}return v(t,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}},{key:"unsubscribe",value:function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}}},{key:"toAbortSignal",value:function(){var t=this,e=new AbortController,n=function(t){e.abort(t)};return this.subscribe(n),e.signal.unsubscribe=function(){return t.unsubscribe(n)},e.signal}}],[{key:"source",value:function(){var e,n=new t((function(t){e=t}));return{token:n,cancel:e}}}])}();var Ka={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ka).forEach((function(t){var e=R(t,2),n=e[0],r=e[1];Ka[r]=n}));var Ga=function t(e){var n=new Ja(e),r=Ni(Ja.prototype.request,n);return Ro.extend(r,Ja.prototype,n,{allOwnKeys:!0}),Ro.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(va(e,n))},r}(Xo);Ga.Axios=Ja,Ga.CanceledError=oa,Ga.CancelToken=Wa,Ga.isCancel=ia,Ga.VERSION=Ba,Ga.toFormData=No,Ga.AxiosError=So,Ga.Cancel=Ga.CanceledError,Ga.all=function(t){return Promise.all(t)},Ga.spread=function(t){return function(e){return t.apply(null,e)}},Ga.isAxiosError=function(t){return Ro.isObject(t)&&!0===t.isAxiosError},Ga.mergeConfig=va,Ga.AxiosHeaders=na,Ga.formToJSON=function(t){return Vo(Ro.isHTMLForm(t)?new FormData(t):t)},Ga.getAdapter=$a,Ga.HttpStatusCode=Ka,Ga.default=Ga,Ga.Axios,Ga.AxiosError,Ga.CanceledError,Ga.isCancel,Ga.CancelToken,Ga.VERSION,Ga.all,Ga.Cancel,Ga.isAxiosError,Ga.spread,Ga.toFormData,Ga.AxiosHeaders,Ga.HttpStatusCode,Ga.formToJSON,Ga.getAdapter,Ga.mergeConfig;var Va=function(){function t(e){var n;return h(this,t),(n=l(this,t,[e])).axiosInstance=Ga.create({baseURL:"".concat(n.host,"/").concat(n.namespace),headers:{Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),n.axiosInstance.interceptors.response.use((function(t){return t.data}),(function(t){if(t.response){var e=t.response.data;if(J(e.errors)&&e.errors.length)throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t})),n}return b(t,Li),v(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.axiosInstance.defaults.headers.common=A(A({},this.axiosInstance.defaults.headers.common),t),this}},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axiosInstance.request(A({method:t,url:e},n))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("GET",t,A({params:e},n))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",t,A({data:e},n))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",t,A({data:e},n))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",t,e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",t,A({data:e},n))}}])}();z("adapter","NodeAdapter",Va);var Xa=function(){function t(){return h(this,t),l(this,t,arguments)}return b(t,Li),v(t)}();z("adapter","EmberJsAdapter",Xa);var Qa=function(){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(h(this,t),this.version=null!==(n=o.version)&&void 0!==n?n:"v1",this.options={version:this.version,host:null!==(r=o.host)&&void 0!==r?r:"https://api.fleetbase.io",namespace:null!==(i=o.namespace)&&void 0!==i?i:this.version,debug:a,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!it()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=o.adapter||ot(this.options),this.orders=new pt("order",this.adapter).extendActions(gt),this.entities=new pt("entity",this.adapter),this.places=new pt("place",this.adapter),this.drivers=new pt("driver",this.adapter).extendActions(Ai),this.vehicles=new pt("vehicle",this.adapter),this.vendors=new pt("vendor",this.adapter),this.contacts=new pt("contact",this.adapter),this.serviceAreas=new pt("service-area",this.adapter),this.serviceQuotes=new pt("service-quote",this.adapter),this.zones=new pt("zone",this.adapter),this.fleets=new pt("fleet",this.adapter),this.organizations=new pt("organization",this.adapter).extendActions(wi)}return v(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return f(t,Array.prototype.slice.call(arguments))}}])}();exports.Adapter=Li,exports.BrowserAdapter=Ci,exports.Collection=nt,exports.Contact=Ri,exports.Driver=Ei,exports.EmberJsAdapter=Xa,exports.Entity=mt,exports.Fleet=Pi,exports.GoogleAddress=at,exports.NodeAdapter=Va,exports.Order=yt,exports.Organization=ki,exports.Payload=bt,exports.Place=wt,exports.Point=st,exports.Resolver=I,exports.Resource=vt,exports.ServiceArea=ji,exports.ServiceQuote=_i,exports.ServiceRate=Ti,exports.Store=pt,exports.StoreActions=ft,exports.TrackingStatus=xt,exports.Vehicle=mi,exports.Vendor=Oi,exports.Waypoint=kt,exports.Zone=Si,exports.camelize=function(){var t=["camelize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},exports.classify=$,exports.createCollection=et,exports.createResource=function(){return B.apply(void 0,["resource","Resource"].concat(Array.prototype.slice.call(arguments)))},exports.createStore=q,exports.createStoreActions=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=f(ft,n);return z("action",t,i),i},exports.dasherize=function(){var t=["dasherize"].concat(Array.prototype.slice.call(arguments));return N.invoke.apply(N,S(t))},exports.default=Qa,exports.detectAdapter=ot,exports.extendStoreActions=ht,exports.isLatitude=function(t){return isFinite(t)&&Math.abs(t)<=90},exports.isLongitude=function(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90},exports.isNodeEnvironment=it,exports.isResource=dt,exports.lookup=M,exports.pluralize=F,exports.register=z,exports.resolve=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return B.apply(void 0,[t,$(e)].concat(r))},exports.resolveResource=H,exports.singularize=D;
//# sourceMappingURL=fleetbase.js.map