@converse/skeletor 0.0.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,74 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).skeletor=e()}(this,(function(){"use strict";var t="object"==typeof global&&global&&global.Object===Object&&global,e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")(),r=n.Symbol,i=Object.prototype,o=i.hasOwnProperty,s=i.toString,c=r?r.toStringTag:void 0;var u=Object.prototype.toString;var a=r?r.toStringTag:void 0;function l(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?function(t){var e=o.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[c]=n:delete t[c]),i}(t):function(t){return u.call(t)}(t)}function h(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function f(t){if(!h(t))return!1;var e=l(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var d,p=n["__core-js_shared__"],v=(d=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"";var g=Function.prototype.toString;function y(t){if(null!=t){try{return g.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var b=/^\[object .+?Constructor\]$/,_=Function.prototype,m=Object.prototype,j=_.toString,A=m.hasOwnProperty,w=RegExp("^"+j.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $(t){return!(!h(t)||(e=t,v&&v in e))&&(f(t)?w:b).test(y(t));var e}function x(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return $(n)?n:void 0}var O=function(){try{var t=x(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function E(t,e,n){"__proto__"==e&&O?O(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function S(t,e){return t===e||t!=t&&e!=e}var I=Object.prototype.hasOwnProperty;function M(t,e,n){var r=t[e];I.call(t,e)&&S(r,n)&&(void 0!==n||e in t)||E(t,e,n)}function P(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var c=e[o],u=r?r(n[c],t[c],c,n,t):void 0;void 0===u&&(u=t[c]),i?E(n,c,u):M(n,c,u)}return n}function H(t){return null!=t&&"object"==typeof t}function N(t){return H(t)&&"[object Arguments]"==l(t)}var k=Object.prototype,T=k.hasOwnProperty,C=k.propertyIsEnumerable,R=N(function(){return arguments}())?N:function(t){return H(t)&&T.call(t,"callee")&&!C.call(t,"callee")},z=Array.isArray;var U="object"==typeof exports&&exports&&!exports.nodeType&&exports,L=U&&"object"==typeof module&&module&&!module.nodeType&&module,B=L&&L.exports===U?n.Buffer:void 0,F=(B?B.isBuffer:void 0)||function(){return!1},D=/^(?:0|[1-9]\d*)$/;function W(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&D.test(t))&&t>-1&&t%1==0&&t<e}function V(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var q={};function J(t){return function(e){return t(e)}}q["[object Float32Array]"]=q["[object Float64Array]"]=q["[object Int8Array]"]=q["[object Int16Array]"]=q["[object Int32Array]"]=q["[object Uint8Array]"]=q["[object Uint8ClampedArray]"]=q["[object Uint16Array]"]=q["[object Uint32Array]"]=!0,q["[object Arguments]"]=q["[object Array]"]=q["[object ArrayBuffer]"]=q["[object Boolean]"]=q["[object DataView]"]=q["[object Date]"]=q["[object Error]"]=q["[object Function]"]=q["[object Map]"]=q["[object Number]"]=q["[object Object]"]=q["[object RegExp]"]=q["[object Set]"]=q["[object String]"]=q["[object WeakMap]"]=!1;var G="object"==typeof exports&&exports&&!exports.nodeType&&exports,Z=G&&"object"==typeof module&&module&&!module.nodeType&&module,K=Z&&Z.exports===G&&t.process,Q=function(){try{var t=Z&&Z.require&&Z.require("util").types;return t||K&&K.binding&&K.binding("util")}catch(t){}}(),X=Q&&Q.isTypedArray,Y=X?J(X):function(t){return H(t)&&V(t.length)&&!!q[l(t)]},tt=Object.prototype.hasOwnProperty;function et(t,e){var n=z(t),r=!n&&R(t),i=!n&&!r&&F(t),o=!n&&!r&&!i&&Y(t),s=n||r||i||o,c=s?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=c.length;for(var a in t)!e&&!tt.call(t,a)||s&&("length"==a||i&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||W(a,u))||c.push(a);return c}var nt=Object.prototype;function rt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nt)}function it(t,e){return function(n){return t(e(n))}}var ot=it(Object.keys,Object),st=Object.prototype.hasOwnProperty;function ct(t){if(!rt(t))return ot(t);var e=[];for(var n in Object(t))st.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ut(t){return null!=t&&V(t.length)&&!f(t)}function at(t){return ut(t)?et(t):ct(t)}function lt(t,e){return t&&P(e,at(e),t)}var ht=Object.create,ft=function(){function t(){}return function(e){if(!h(e))return{};if(ht)return ht(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function dt(t){return t}function pt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var vt=Math.max;function gt(t,e,n){return e=vt(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=vt(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];i=-1;for(var c=Array(e+1);++i<e;)c[i]=r[i];return c[e]=n(s),pt(t,this,c)}}function yt(t){return function(){return t}}var bt=O?function(t,e){return O(t,"toString",{configurable:!0,enumerable:!1,value:yt(e),writable:!0})}:dt,_t=Date.now;var mt,jt,At,wt=(mt=bt,jt=0,At=0,function(){var t=_t(),e=16-(t-At);if(At=t,e>0){if(++jt>=800)return arguments[0]}else jt=0;return mt.apply(void 0,arguments)});function $t(t,e){return wt(gt(t,e,dt),t+"")}function xt(t,e,n){if(!h(n))return!1;var r=typeof e;return!!("number"==r?ut(n)&&W(e,n.length):"string"==r&&e in n)&&S(n[e],t)}var Ot=Object.prototype.hasOwnProperty;function Et(t){if(!h(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=rt(t),n=[];for(var r in t)("constructor"!=r||!e&&Ot.call(t,r))&&n.push(r);return n}function St(t){return ut(t)?et(t,!0):Et(t)}var It,Mt=(It=function(t,e){P(e,St(e),t)},$t((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=It.length>3&&"function"==typeof i?(r--,i):void 0,o&&xt(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var s=e[n];s&&It(t,s,n,i)}return t}))),Pt=Object.prototype.hasOwnProperty;function Ht(t,e){return null!=t&&Pt.call(t,e)}function Nt(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==l(t)}var kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tt=/^\w*$/;function Ct(t,e){if(z(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Nt(t))||(Tt.test(t)||!kt.test(t)||null!=e&&t in Object(e))}var Rt=x(Object,"create");var zt=Object.prototype.hasOwnProperty;var Ut=Object.prototype.hasOwnProperty;function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Bt(t,e){for(var n=t.length;n--;)if(S(t[n][0],e))return n;return-1}Lt.prototype.clear=function(){this.__data__=Rt?Rt(null):{},this.size=0},Lt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Lt.prototype.get=function(t){var e=this.__data__;if(Rt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return zt.call(e,t)?e[t]:void 0},Lt.prototype.has=function(t){var e=this.__data__;return Rt?void 0!==e[t]:Ut.call(e,t)},Lt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Rt&&void 0===e?"__lodash_hash_undefined__":e,this};var Ft=Array.prototype.splice;function Dt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Dt.prototype.clear=function(){this.__data__=[],this.size=0},Dt.prototype.delete=function(t){var e=this.__data__,n=Bt(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ft.call(e,n,1),--this.size,!0)},Dt.prototype.get=function(t){var e=this.__data__,n=Bt(e,t);return n<0?void 0:e[n][1]},Dt.prototype.has=function(t){return Bt(this.__data__,t)>-1},Dt.prototype.set=function(t,e){var n=this.__data__,r=Bt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Wt=x(n,"Map");function Vt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function qt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qt.prototype.clear=function(){this.size=0,this.__data__={hash:new Lt,map:new(Wt||Dt),string:new Lt}},qt.prototype.delete=function(t){var e=Vt(this,t).delete(t);return this.size-=e?1:0,e},qt.prototype.get=function(t){return Vt(this,t).get(t)},qt.prototype.has=function(t){return Vt(this,t).has(t)},qt.prototype.set=function(t,e){var n=Vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Jt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Jt.Cache||qt),n}Jt.Cache=qt;var Gt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zt=/\\(\\)?/g,Kt=function(t){var e=Jt(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Gt,(function(t,n,r,i){e.push(r?i.replace(Zt,"$1"):n||t)})),e}));function Qt(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Xt=r?r.prototype:void 0,Yt=Xt?Xt.toString:void 0;function te(t){if("string"==typeof t)return t;if(z(t))return Qt(t,te)+"";if(Nt(t))return Yt?Yt.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ee(t){return null==t?"":te(t)}function ne(t,e){return z(t)?t:Ct(t,e)?[t]:Kt(ee(t))}function re(t){if("string"==typeof t||Nt(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ie(t,e,n){for(var r=-1,i=(e=ne(e,t)).length,o=!1;++r<i;){var s=re(e[r]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&V(i)&&W(s,i)&&(z(t)||R(t))}function oe(t,e){return null!=t&&ie(t,e,Ht)}function se(t,e,n){var r=-1,i=(e=ne(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[re(e[r])];void 0===o&&(r=i,o=n),t=f(o)?o.call(t):o}return t}function ce(t,e){const n=this;let r;return r=t&&oe(t,"constructor")?t.constructor:function(){return n.apply(this,arguments)},Mt(r,n,e),r.prototype=function(t,e){var n=ft(t);return null==e?n:lt(n,e)}(n.prototype,t),r.prototype.constructor=r,r.__super__=n.prototype,r}function ue(){const t={isResolved:!1,isPending:!0,isRejected:!1},e=new Promise((e,n)=>{t.resolve=e,t.reject=n});return Object.assign(e,t),e.then((function(t){return e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t}),(function(t){throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t})),e}function ae(){throw new Error('A "url" property or function must be specified')}function le(t,e){const n=e.error;e.error=function(r){n&&n.call(e.context,t,r,e),t.trigger("error",t,r,e)}}const he={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function fe(t){const e=se(t,"browserStorage")||se(t.collection,"browserStorage");return e?e.sync():de}function de(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=he[t],i={type:r,dataType:"json"};n.url||(i.url=se(e,"url")||ae()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(i.contentType="application/json",i.data=JSON.stringify(n.attrs||e.toJSON(n))),"GET"!==i.type&&(i.processData=!1);const o=n.error;n.error=function(t,e,r){n.textStatus=e,n.errorThrown=r,o&&o.call(n.context,t,e,r)};const s=n.xhr=pe(Mt(i,n));return e.trigger("request",e,s,n),s}function pe(){return fetch.apply(this,arguments)}var ve=x(n,"DataView"),ge=x(n,"Promise"),ye=x(n,"Set"),be=x(n,"WeakMap"),_e=y(ve),me=y(Wt),je=y(ge),Ae=y(ye),we=y(be),$e=l;(ve&&"[object DataView]"!=$e(new ve(new ArrayBuffer(1)))||Wt&&"[object Map]"!=$e(new Wt)||ge&&"[object Promise]"!=$e(ge.resolve())||ye&&"[object Set]"!=$e(new ye)||be&&"[object WeakMap]"!=$e(new be))&&($e=function(t){var e=l(t),n="[object Object]"==e?t.constructor:void 0,r=n?y(n):"";if(r)switch(r){case _e:return"[object DataView]";case me:return"[object Map]";case je:return"[object Promise]";case Ae:return"[object Set]";case we:return"[object WeakMap]"}return e});var xe=$e,Oe=Object.prototype.hasOwnProperty;function Ee(t){if(null==t)return!0;if(ut(t)&&(z(t)||"string"==typeof t||"function"==typeof t.splice||F(t)||Y(t)||R(t)))return!t.length;var e=xe(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(rt(t))return!ct(t).length;for(var n in t)if(Oe.call(t,n))return!1;return!0}var Se=/\s/;var Ie=/^\s+/;function Me(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Se.test(t.charAt(e)););return e}(t)+1).replace(Ie,""):t}var Pe=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Ne=/^0o[0-7]+$/i,ke=parseInt;function Te(t){return t?(t=function(t){if("number"==typeof t)return t;if(Nt(t))return NaN;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Me(t);var n=He.test(t);return n||Ne.test(t)?ke(t.slice(2),n?2:8):Pe.test(t)?NaN:+t}(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Ce(t){var e=Te(t),n=e%1;return e==e?n?e-n:e:0}function Re(t){return function(t,e){var n;if("function"!=typeof e)throw new TypeError("Expected a function");return t=Ce(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}(2,t)}var ze=0;function Ue(t){var e=++ze;return ee(t)+e}const Le={},Be=/\s+/;let Fe;const De=function(t,e,n,r,i){let o,s=0;if(n&&"object"==typeof n){void 0!==r&&"context"in i&&void 0===i.context&&(i.context=r);for(o=at(n);s<o.length;s++)e=De(t,e,o[s],n[o[s]],i)}else if(n&&Be.test(n))for(o=n.split(Be);s<o.length;s++)e=t(e,o[s],r,i);else e=t(e,n,r,i);return e};Le.on=function(t,e,n){if(this._events=De(We,this._events||{},t,e,{context:n,ctx:this,listening:Fe}),Fe){(this._listeners||(this._listeners={}))[Fe.id]=Fe,Fe.interop=!1}return this},Le.listenTo=function(t,e,n){if(!t)return this;const r=t._listenId||(t._listenId=Ue("l")),i=this._listeningTo||(this._listeningTo={});let o=Fe=i[r];o||(this._listenId||(this._listenId=Ue("l")),o=Fe=i[r]=new Ke(this,t));const s=Ve(t,e,n,this);if(Fe=void 0,s)throw s;return o.interop&&o.on(e,n),this};const We=function(t,e,n,r){if(n){const i=t[e]||(t[e]=[]),o=r.context,s=r.ctx,c=r.listening;c&&c.count++,i.push({callback:n,context:o,ctx:o||s,listening:c})}return t},Ve=function(t,e,n,r){try{t.on(e,n,r)}catch(t){return t}};Le.off=function(t,e,n){return this._events?(this._events=De(qe,this._events,t,e,{context:n,listeners:this._listeners}),this):this},Le.stopListening=function(t,e,n){const r=this._listeningTo;if(!r)return this;const i=t?[t._listenId]:at(r);for(let t=0;t<i.length;t++){const o=r[i[t]];if(!o)break;o.obj.off(e,n,this),o.interop&&o.off(e,n)}return Ee(r)&&(this._listeningTo=void 0),this};const qe=function(t,e,n,r){if(!t)return;const i=r.context,o=r.listeners;let s,c=0;if(e||i||n){for(s=e?[e]:at(t);c<s.length;c++){const r=t[e=s[c]];if(!r)break;const o=[];for(let t=0;t<r.length;t++){const s=r[t];if(n&&n!==s.callback&&n!==s.callback._callback||i&&i!==s.context)o.push(s);else{const t=s.listening;t&&t.off(e,n)}}o.length?t[e]=o:delete t[e]}return t}for(s=at(o);c<s.length;c++)o[s[c]].cleanup()};Le.once=function(t,e,n){const r=De(Je,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(r,e,n)},Le.listenToOnce=function(t,e,n){const r=De(Je,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,r)};const Je=function(t,e,n,r){if(n){const i=t[e]=Re((function(){r(e,i),n.apply(this,arguments)}));i._callback=n}return t};Le.trigger=function(t){if(!this._events)return this;const e=Math.max(0,arguments.length-1),n=Array(e);for(let t=0;t<e;t++)n[t]=arguments[t+1];return De(Ge,this._events,t,void 0,n),this};const Ge=function(t,e,n,r){if(t){const n=t[e];let i=t.all;n&&i&&(i=i.slice()),n&&Ze(n,r),i&&Ze(i,[e].concat(r))}return t},Ze=function(t,e){let n,r=-1;const i=t.length,o=e[0],s=e[1],c=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,s,c);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}},Ke=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};Ke.prototype.on=Le.on,Ke.prototype.off=function(t,e){let n;this.interop?(this._events=De(qe,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},Ke.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},Le.bind=Le.on,Le.unbind=Le.off;function Qe(t){var e=this.__data__=new Dt(t);this.size=e.size}Qe.prototype.clear=function(){this.__data__=new Dt,this.size=0},Qe.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Qe.prototype.get=function(t){return this.__data__.get(t)},Qe.prototype.has=function(t){return this.__data__.has(t)},Qe.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dt){var r=n.__data__;if(!Wt||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qt(r)}return n.set(t,e),this.size=n.size,this};var Xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ye=Xe&&"object"==typeof module&&module&&!module.nodeType&&module,tn=Ye&&Ye.exports===Xe?n.Buffer:void 0,en=tn?tn.allocUnsafe:void 0;function nn(){return[]}var rn=Object.prototype.propertyIsEnumerable,on=Object.getOwnPropertySymbols,sn=on?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(on(t),(function(e){return rn.call(t,e)})))}:nn;function cn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var un=it(Object.getPrototypeOf,Object),an=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)cn(e,sn(t)),t=un(t);return e}:nn;function ln(t,e,n){var r=e(t);return z(t)?r:cn(r,n(t))}function hn(t){return ln(t,at,sn)}function fn(t){return ln(t,St,an)}var dn=Object.prototype.hasOwnProperty;var pn=n.Uint8Array;function vn(t){var e=new t.constructor(t.byteLength);return new pn(e).set(new pn(t)),e}var gn=/\w*$/;var yn=r?r.prototype:void 0,bn=yn?yn.valueOf:void 0;function _n(t,e,n){var r,i=t.constructor;switch(e){case"[object ArrayBuffer]":return vn(t);case"[object Boolean]":case"[object Date]":return new i(+t);case"[object DataView]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var n=e?vn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,gn.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Set]":return new i;case"[object Symbol]":return r=t,bn?Object(bn.call(r)):{}}}var mn=Q&&Q.isMap,jn=mn?J(mn):function(t){return H(t)&&"[object Map]"==xe(t)};var An=Q&&Q.isSet,wn=An?J(An):function(t){return H(t)&&"[object Set]"==xe(t)},$n={};function xn(t,e,n,r,i,o){var s,c=1&e,u=2&e,a=4&e;if(n&&(s=i?n(t,r,i,o):n(t)),void 0!==s)return s;if(!h(t))return t;var l=z(t);if(l){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&dn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!c)return function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(t,s)}else{var f=xe(t),d="[object Function]"==f||"[object GeneratorFunction]"==f;if(F(t))return function(t,e){if(e)return t.slice();var n=t.length,r=en?en(n):new t.constructor(n);return t.copy(r),r}(t,c);if("[object Object]"==f||"[object Arguments]"==f||d&&!i){if(s=u||d?{}:function(t){return"function"!=typeof t.constructor||rt(t)?{}:ft(un(t))}(t),!c)return u?function(t,e){return P(t,an(t),e)}(t,function(t,e){return t&&P(e,St(e),t)}(s,t)):function(t,e){return P(t,sn(t),e)}(t,lt(s,t))}else{if(!$n[f])return i?t:{};s=_n(t,f,c)}}o||(o=new Qe);var p=o.get(t);if(p)return p;o.set(t,s),wn(t)?t.forEach((function(r){s.add(xn(r,e,n,r,t,o))})):jn(t)&&t.forEach((function(r,i){s.set(i,xn(r,e,n,i,t,o))}));var v=l?void 0:(a?u?fn:hn:u?St:at)(t);return function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););}(v||t,(function(r,i){v&&(r=t[i=r]),M(s,i,xn(r,e,n,i,t,o))})),s}$n["[object Arguments]"]=$n["[object Array]"]=$n["[object ArrayBuffer]"]=$n["[object DataView]"]=$n["[object Boolean]"]=$n["[object Date]"]=$n["[object Float32Array]"]=$n["[object Float64Array]"]=$n["[object Int8Array]"]=$n["[object Int16Array]"]=$n["[object Int32Array]"]=$n["[object Map]"]=$n["[object Number]"]=$n["[object Object]"]=$n["[object RegExp]"]=$n["[object Set]"]=$n["[object String]"]=$n["[object Symbol]"]=$n["[object Uint8Array]"]=$n["[object Uint8ClampedArray]"]=$n["[object Uint16Array]"]=$n["[object Uint32Array]"]=!0,$n["[object Error]"]=$n["[object Function]"]=$n["[object WeakMap]"]=!1;function On(t){return xn(t,4)}var En=Object.prototype,Sn=En.hasOwnProperty,In=$t((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&xt(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=St(o),c=-1,u=s.length;++c<u;){var a=s[c],l=t[a];(void 0===l||S(l,En[a])&&!Sn.call(t,a))&&(t[a]=o[a])}return t}));var Mn=$t((function(t,e){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,1,e)}));var Pn,Hn=(Pn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},function(t){return null==Pn?void 0:Pn[t]}),Nn=/[&<>"']/g,kn=RegExp(Nn.source);var Tn,Cn=function(t,e,n){for(var r=-1,i=Object(t),o=n(t),s=o.length;s--;){var c=o[Tn?s:++r];if(!1===e(i[c],c,i))break}return t};function Rn(t,e){return t&&Cn(t,e,at)}var zn,Un,Ln=Object.prototype.toString,Bn=(zn=function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ln.call(e)),t[e]=n},Un=yt(dt),function(t,e){return function(t,e,n,r){return Rn(t,(function(t,i,o){e(r,n(t),i,o)})),r}(t,zn,Un(e),{})});function Fn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new qt;++e<n;)this.add(t[e])}function Dn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Wn(t,e){return t.has(e)}Fn.prototype.add=Fn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(t){return this.__data__.has(t)};function Vn(t,e,n,r,i,o){var s=1&n,c=t.length,u=e.length;if(c!=u&&!(s&&u>c))return!1;var a=o.get(t),l=o.get(e);if(a&&l)return a==e&&l==t;var h=-1,f=!0,d=2&n?new Fn:void 0;for(o.set(t,e),o.set(e,t);++h<c;){var p=t[h],v=e[h];if(r)var g=s?r(v,p,h,e,t,o):r(p,v,h,t,e,o);if(void 0!==g){if(g)continue;f=!1;break}if(d){if(!Dn(e,(function(t,e){if(!Wn(d,e)&&(p===t||i(p,t,n,r,o)))return d.push(e)}))){f=!1;break}}else if(p!==v&&!i(p,v,n,r,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function qn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Jn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Gn=r?r.prototype:void 0,Zn=Gn?Gn.valueOf:void 0;var Kn=Object.prototype.hasOwnProperty;var Qn=Object.prototype.hasOwnProperty;function Xn(t,e,n,r,i,o){var s=z(t),c=z(e),u=s?"[object Array]":xe(t),a=c?"[object Array]":xe(e),l="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),h="[object Object]"==(a="[object Arguments]"==a?"[object Object]":a),f=u==a;if(f&&F(t)){if(!F(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new Qe),s||Y(t)?Vn(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new pn(t),new pn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return S(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var c=qn;case"[object Set]":var u=1&r;if(c||(c=Jn),t.size!=e.size&&!u)return!1;var a=s.get(t);if(a)return a==e;r|=2,s.set(t,e);var l=Vn(c(t),c(e),r,i,o,s);return s.delete(t),l;case"[object Symbol]":if(Zn)return Zn.call(t)==Zn.call(e)}return!1}(t,e,u,n,r,i,o);if(!(1&n)){var d=l&&Qn.call(t,"__wrapped__"),p=h&&Qn.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new Qe),i(v,g,n,r,o)}}return!!f&&(o||(o=new Qe),function(t,e,n,r,i,o){var s=1&n,c=hn(t),u=c.length;if(u!=hn(e).length&&!s)return!1;for(var a=u;a--;){var l=c[a];if(!(s?l in e:Kn.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=s;++a<u;){var v=t[l=c[a]],g=e[l];if(r)var y=s?r(g,v,l,e,t,o):r(v,g,l,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o))}function Yn(t,e,n,r,i){return t===e||(null==t||null==e||!H(t)&&!H(e)?t!=t&&e!=e:Xn(t,e,n,r,Yn,i))}function tr(t,e){return Yn(t,e)}function er(t){return t==t&&!h(t)}function nr(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function rr(t){var e=function(t){for(var e=at(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,er(i)]}return e}(t);return 1==e.length&&e[0][2]?nr(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=Object(t);i--;){var c=n[i];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<o;){var u=(c=n[i])[0],a=t[u],l=c[1];if(s&&c[2]){if(void 0===a&&!(u in t))return!1}else{var h=new Qe;if(r)var f=r(a,l,u,t,e,h);if(!(void 0===f?Yn(l,a,3,r,h):f))return!1}}return!0}(n,t,e)}}function ir(t,e){for(var n=0,r=(e=ne(e,t)).length;null!=t&&n<r;)t=t[re(e[n++])];return n&&n==r?t:void 0}function or(t,e){return null!=t&&e in Object(t)}function sr(t,e){return null!=t&&ie(t,e,or)}function cr(t,e){return Ct(t)&&er(e)?nr(re(t),e):function(n){var r=function(t,e,n){var r=null==t?void 0:ir(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?sr(n,t):Yn(e,r,3)}}function ur(t){return Ct(t)?(e=re(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return ir(e,t)}}(t);var e}function ar(t){return"function"==typeof t?t:null==t?dt:"object"==typeof t?z(t)?cr(t[0],t[1]):rr(t):ur(t)}function lr(t,e){return e.length<2?t:ir(t,function(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}(e,0,-1))}function hr(t,e){return null==(t=lr(t,e=ne(e,t)))||delete t[re((n=e,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}var fr=Function.prototype,dr=Object.prototype,pr=fr.toString,vr=dr.hasOwnProperty,gr=pr.call(Object);function yr(t){if(!H(t)||"[object Object]"!=l(t))return!1;var e=un(t);if(null===e)return!0;var n=vr.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&pr.call(n)==gr}function br(t){return yr(t)?void 0:t}var _r=r?r.isConcatSpreadable:void 0;function mr(t){return z(t)||R(t)||!!(_r&&t&&t[_r])}function jr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=mr),i||(i=[]);++o<s;){var c=t[o];e>0&&n(c)?e>1?jr(c,e-1,n,r,i):cn(i,c):r||(i[i.length]=c)}return i}function Ar(t){return(null==t?0:t.length)?jr(t,1):[]}function wr(t){return wt(gt(t,void 0,Ar),t+"")}var $r=wr((function(t,e){var n={};if(null==t)return n;var r=!1;e=Qt(e,(function(e){return e=ne(e,t),r||(r=e.length>1),e})),P(t,fn(t),n),r&&(n=xn(n,7,br));for(var i=e.length;i--;)hr(n,e[i]);return n}));function xr(t,e,n,r){if(!h(t))return t;for(var i=-1,o=(e=ne(e,t)).length,s=o-1,c=t;null!=c&&++i<o;){var u=re(e[i]),a=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=s){var l=c[u];void 0===(a=r?r(l,u,c):void 0)&&(a=h(l)?l:W(e[i+1])?[]:{})}M(c,u,a),c=c[u]}return t}function Or(t,e){return function(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var s=e[r],c=ir(t,s);n(c,s)&&xr(o,ne(s,t),c)}return o}(t,e,(function(e,n){return sr(t,n)}))}var Er=wr((function(t,e){return null==t?{}:Or(t,e)}));const Sr=function(t,e){let n=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=Ue(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});const r=se(this,"defaults");n=In(Mt({},r,n),r),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};function Ir(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}Sr.extend=ce,Object.assign(Sr.prototype,Le,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return On(this.attributes)},sync:function(t,e,n){return fe(this)(t,e,n)},get:function(t){return this.attributes[t]},keys:function(){return Object.keys(this.attributes)},values:function(){return Object.values(this.attributes)},pairs:function(){return this.entries()},entries:function(){return Object.entries(this.attributes)},invert:function(){return Bn(this.attributes)},pick:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),Er(this.attributes,e)},omit:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),$r(this.attributes,e)},isEmpty:function(){return Ee(this.attributes)},escape:function(t){return(e=ee(e=this.get(t)))&&kn.test(e)?e.replace(Nn,Hn):e;var e},has:function(t){return null!=this.get(t)},matches:function(t){return!!function(t){return ar("function"==typeof t?t:xn(t,1))}(t)(this.attributes)},set:function(t,e,n){if(null==t)return this;let r;if("object"==typeof t?(r=t,n=e):(r={})[t]=e,n||(n={}),!this._validate(r,n))return!1;const i=n.unset,o=n.silent,s=[],c=this._changing;this._changing=!0,c||(this._previousAttributes=On(this.attributes),this.changed={});const u=this.attributes,a=this.changed,l=this._previousAttributes;for(const t in r)e=r[t],tr(u[t],e)||s.push(t),tr(l[t],e)?delete a[t]:a[t]=e,i?delete u[t]:u[t]=e;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){s.length&&(this._pending=n);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],n)}if(c)return this;if(!o)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,Mt({},e,{unset:!0}))},clear:function(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Mt({},t,{unset:!0}))},hasChanged:function(t){return null==t?!Ee(this.changed):oe(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&On(this.changed);const e=this._changing?this._previousAttributes:this.attributes,n={};let r;for(const i in t){const o=t[i];tr(e[i],o)||(n[i]=o,r=!0)}return!!r&&n},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return On(this._previousAttributes)},fetch:function(t){t=Mt({parse:!0},t);const e=this,n=t.success;return t.success=function(r){const i=t.parse?e.parse(r,t):r;if(!e.set(i,t))return!1;n&&n.call(t.context,e,r,t),e.trigger("sync",e,r,t)},le(this,t),this.sync("read",this,t)},save:function(t,e,n){let r;null==t||"object"==typeof t?(r=t,n=e):(r={})[t]=e;const i=(n=Mt({validate:!0,parse:!0},n)).wait,o=n.promise,s=o&&ue();if(r&&!i){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;const c=this,u=n.success,a=n.error,l=this.attributes;n.success=function(t){c.attributes=l;let e=n.parse?c.parse(t,n):t;if(i&&(e=Mt({},r,e)),e&&!c.set(e,n))return!1;u&&u.call(n.context,c,t,n),c.trigger("sync",c,t,n),o&&s.resolve()},n.error=function(t,e,n){a&&a.call(n.context,t,e,n),o&&s.reject(e)},le(this,n),r&&i&&(this.attributes=Mt({},l,r));const h=this.isNew()?"create":n.patch?"patch":"update";"patch"!==h||n.attrs||(n.attrs=r);const f=this.sync(h,this,n);return this.attributes=l,o?s:f},destroy:function(t){t=t?On(t):{};const e=this,n=t.success,r=t.wait,i=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(o){r&&i(),n&&n.call(t.context,e,o,t),e.isNew()||e.trigger("sync",e,o,t)};let o=!1;return this.isNew()?Mn(t.success):(le(this,t),o=this.sync("delete",this,t)),r||i(),o},url:function(){const t=se(this,"urlRoot")||se(this.collection,"url")||ae();if(this.isNew())return t;const e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},Mt({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=Mt({},this.attributes,t);const n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,Mt(e,{validationError:n})),!1)}});var Mr=function(t,e){return function(n,r){if(null==n)return n;if(!ut(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++o<i)&&!1!==r(s[o],o,s););return n}}(Rn);function Pr(t,e,n,r){return Mr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Hr(t,e){return function(n,r){var i=z(n)?Ir:Pr,o=e?e():{};return i(n,t,ar(r),o)}}var Nr=Object.prototype.hasOwnProperty,kr=Hr((function(t,e,n){Nr.call(t,n)?++t[n]:E(t,n,1)}));function Tr(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Cr(t){return t!=t}function Rr(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Tr(t,Cr,n)}function zr(t,e){return!!(null==t?0:t.length)&&Rr(t,e,0)>-1}function Ur(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Lr(t){return H(t)&&ut(t)}var Br=$t((function(t,e){return Lr(t)?function(t,e,n,r){var i=-1,o=zr,s=!0,c=t.length,u=[],a=e.length;if(!c)return u;n&&(e=Qt(e,J(n))),r?(o=Ur,s=!1):e.length>=200&&(o=Wn,s=!1,e=new Fn(e));t:for(;++i<c;){var l=t[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,s&&h==h){for(var f=a;f--;)if(e[f]===h)continue t;u.push(l)}else o(e,h,r)||u.push(l)}return u}(t,jr(e,1,Lr,!0)):[]}));function Fr(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Dr(t,e){var n=!0;return Mr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}var Wr=Math.max;var Vr=Math.max,qr=Math.min;var Jr=Object.prototype.hasOwnProperty,Gr=Hr((function(t,e,n){Jr.call(t,n)?t[n].push(e):E(t,n,[e])})),Zr=Math.max;function Kr(t){return"string"==typeof t||!z(t)&&H(t)&&"[object String]"==l(t)}var Qr=Hr((function(t,e,n){E(t,n,e)}));var Xr=Math.max,Yr=Math.min;function ti(t,e){var n;return Mr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ei(t,e,n){var r=z(t)?Dn:ti;return n&&xt(t,e,n)&&(e=void 0),r(t,ar(e))}function ni(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Nt(t),s=void 0!==e,c=null===e,u=e==e,a=Nt(e);if(!c&&!a&&!o&&t>e||o&&s&&u&&!c&&!a||r&&s&&u||!n&&u||!i)return 1;if(!r&&!o&&!a&&t<e||a&&n&&i&&!r&&!o||c&&n&&i||!s&&i||!u)return-1}return 0}function ri(t,e,n){e=e.length?Qt(e,(function(t){return z(t)?function(e){return ir(e,1===t.length?t[0]:t)}:t})):[dt];var r=-1;return e=Qt(e,J(ar)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(function(t,e){var n=-1,r=ut(t)?Array(t.length):[];return Mr(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}(t,(function(t,n,i){return{criteria:Qt(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,c=n.length;++r<s;){var u=ni(i[r],o[r]);if(u)return r>=c?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}var ii=$t((function(t,e){if(null==t)return[];var n=e.length;return n>1&&xt(t,e[0],e[1])?e=[]:n>2&&xt(e[0],e[1],e[2])&&(e=[e[0]]),ri(t,jr(e,1),[])}));const oi=Array.prototype.slice,si=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,Mt({silent:!0},e))};si.extend=ce;const ci={add:!0,remove:!0,merge:!0},ui={add:!0,remove:!1},ai=function(t,e,n){n=Math.min(Math.max(n,0),t.length);const r=Array(t.length-n),i=e.length;let o;for(o=0;o<r.length;o++)r[o]=t[o+n];for(o=0;o<i;o++)t[o+n]=e[o];for(o=0;o<r.length;o++)t[o+i+n]=r[o]};Object.assign(si.prototype,Le,{model:Sr,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(t,e,n){return fe(this)(t,e,n)},add:function(t,e){return this.set(t,Mt({merge:!1},e,ui))},remove:function(t,e){e=Mt({},e);const n=!Array.isArray(t);t=n?[t]:t.slice();const r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),n?r[0]:r},set:function(t,e){if(null==t)return;(e=Mt({},ci,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const n=!Array.isArray(t);t=n?[t]:t.slice();let r=e.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const i=[],o=[],s=[],c=[],u={},a=e.add,l=e.merge,h=e.remove;let f=!1;const d=this.comparator&&null==r&&!1!==e.sort,p=Kr(this.comparator)?this.comparator:null;let v,g;for(g=0;g<t.length;g++){v=t[g];const n=this.get(v);if(n){if(l&&v!==n){let t=this._isModel(v)?v.attributes:v;e.parse&&(t=n.parse(t,e)),n.set(t,e),s.push(n),d&&!f&&(f=n.hasChanged(p))}u[n.cid]||(u[n.cid]=!0,i.push(n)),t[g]=n}else a&&(v=t[g]=this._prepareModel(v,e),v&&(o.push(v),this._addReference(v,e),u[v.cid]=!0,i.push(v)))}if(h){for(g=0;g<this.length;g++)v=this.models[g],u[v.cid]||c.push(v);c.length&&this._removeModels(c,e)}let y=!1;const b=!d&&a&&h;if(i.length&&b?(y=this.length!==i.length||ei(this.models,(t,e)=>t!==i[e]),this.models.length=0,ai(this.models,i,0),this.length=this.models.length):o.length&&(d&&(f=!0),ai(this.models,o,null==r?this.length:r),this.length=this.models.length),f&&this.sort({silent:!0}),!e.silent){for(g=0;g<o.length;g++)null!=r&&(e.index=r+g),v=o[g],v.trigger("add",v,this,e);(f||y)&&this.trigger("sort",this,e),(o.length||c.length||s.length)&&(e.changes={added:o,removed:c,merged:s},this.trigger("update",this,e))}return n?t[0]:t},clearStore:async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t=>t;await Promise.all(this.models.filter(e).map(e=>new Promise(n=>{e.destroy(Object.assign(t,{success:n,error:(t,e)=>{console.error(e),n()}}))}))),await this.browserStorage.clear(),this.reset()},reset:function(t,e){e=e?On(e):{};for(let t=0;t<this.models.length;t++)this._removeReference(this.models[t],e);return e.previousModels=this.models,this._reset(),t=this.add(t,Mt({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,Mt({at:this.length},e))},pop:function(t){const e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,Mt({at:0},e))},shift:function(t){const e=this.at(0);return this.remove(e,t)},slice:function(){return oi.apply(this.models,arguments)},filter:function(t,e){return this.models.filter(f(t)?t:e=>e.matches(t),e)},every:function(t){return function(t,e,n){var r=z(t)?Fr:Dr;return n&&xt(t,e,n)&&(e=void 0),r(t,ar(e))}(this.models.map(t=>t.attributes),t)},difference:function(t){return Br(this.models,t)},max:function(){return Math.max.apply(Math,this.models)},min:function(){return Math.min.apply(Math,this.models)},drop:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.models.slice(t)},some:function(t){return ei(this.models.map(t=>t.attributes),t)},sortBy:function(t){return ii(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},isEmpty:function(){return Ee(this.models)},keyBy:function(t){return Qr(this.models,t)},each:function(t,e){return this.forEach(t,e)},forEach:function(t,e){return this.models.forEach(t,e)},includes:function(t){return this.models.includes(t)},size:function(){return this.models.length},countBy:function(t){return kr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},groupBy:function(t){return Gr(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},indexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ce(n);return i<0&&(i=Zr(r+i,0)),Rr(t,e,i)}(this.models,t)},findLastIndex:function(t,e){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=Ce(n),i=n<0?Vr(r+i,0):qr(i,r-1)),Tr(t,ar(e),i,!0)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},lastIndexOf:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=Ce(n))<0?Xr(r+i,0):Yr(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Tr(t,Cr,i,!0)}(this.models,t)},findIndex:function(t){return function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Ce(n);return i<0&&(i=Wr(r+i,0)),Tr(t,ar(e),i)}(this.models,f(t)?t:e=>Kr(t)?e.get(t):e.matches(t))},last:function(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0},head:function(){return this.models[0]},first:function(){return this.head()},map:function(t,e){return this.models.map(f(t)?t:e=>Kr(t)?e.get(t):e.matches(t),e)},reduce:function(t,e){return this.models.reduce(t,e||this.models[0])},reduceRight:function(t,e){return this.models.reduceRight(t,e||this.models[0])},toArray:function(){return Array.from(this.models)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},find:function(t,e){const n=f(t)?t:e=>e.matches(t);return this.models.find(n,e)},sort:function(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});const n=e.length;return f(e)&&(e=e.bind(this)),1===n||Kr(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){const e=(t=Mt({parse:!0},t)).success,n=this,r=t.promise&&ue();return t.success=function(i){const o=t.reset?"reset":"set";n[o](i,t),e&&e.call(t.context,n,i,t),r&&r.resolve(),n.trigger("sync",n,i,t)},le(this,t),r||this.sync("read",this,t)},create:function(t,e){const n=(e=e?On(e):{}).wait,r=e.promise,i=r&&ue();if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);const o=this,s=e.success,c=e.error;return e.success=function(t,e,c){n&&o.add(t,c),s&&s.call(c.context,t,e,c),r&&i.resolve(t)},e.error=function(t,e,n){c&&c.call(n.context,t,e,n),r&&i.reject(e)},t.save(null,Object.assign(e,{promise:!1})),r?i:t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){var e;return t[(null===(e=this.model.prototype)||void 0===e?void 0:e.idAttribute)||"id"]},values:function(){return new hi(this,fi)},keys:function(){return new hi(this,di)},entries:function(){return new hi(this,pi)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?On(e):{}).collection=this;const n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){const n=[];for(let r=0;r<t.length;r++){const i=this.get(t[r]);if(!i)continue;const o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];const s=this.modelId(i.attributes);null!=s&&delete this._byId[s],e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}return n},_isModel:function(t){return t instanceof Sr},_addReference:function(t,e){this._byId[t.cid]=t;const n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];const n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"change"===t){const t=this.modelId(e.previousAttributes()),n=this.modelId(e.attributes);t!==n&&(null!=t&&delete this._byId[t],null!=n&&(this._byId[n]=e))}}this.trigger.apply(this,arguments)}});const li="function"==typeof Symbol&&Symbol.iterator;li&&(si.prototype[li]=si.prototype.values);const hi=function(t,e){this._collection=t,this._kind=e,this._index=0},fi=1,di=2,pi=3;li&&(hi.prototype[li]=function(){return this}),hi.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);let e;if(this._index++,this._kind===fi)e=t;else{const n=this._collection.modelId(t.attributes);e=this._kind===di?n:[n,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};const vi=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)};vi.extend=ce;const gi=/^[#\/]|\s+$/g,yi=/^\/+|\/+$/g,bi=/#.*$/;vi.started=!1,Object.assign(vi.prototype,Le,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){const t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){const e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){const t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(gi,"")},start:function(t){if(vi.started)throw new Error("history has already been started");if(vi.started=!0,this.options=Mt({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(yi,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){const t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;const t=document.body,e=t.insertBefore(this.iframe,t.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}if(this._usePushState?addEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?addEventListener("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){this._usePushState?removeEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&removeEventListener("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),vi.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){let e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),ei(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!vi.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");let n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");const r=n+t;t=t.replace(bi,"");const i=this.decodeFragment(t);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){const n=this.iframe.contentWindow;e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){const n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}});var _i=Q&&Q.isRegExp,mi=_i?J(_i):function(t){return H(t)&&"[object RegExp]"==l(t)};const ji=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.history=t.history||new vi,this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};ji.extend=ce;const Ai=/\((.*?)\)/g,wi=/(\(\?)?:\w+/g,$i=/\*\w+/g,xi=/[\-{}\[\]+?.,\\\^$|#\s]/g;
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).skeletor={})}(this,function(t){var e=Object.prototype;function r(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}function n(t,e){return function(r){return t(e(r))}}var o=n(Object.keys,Object),i=Object.prototype.hasOwnProperty;function s(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}var a="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,c=a||u||Function("return this")(),l=c.Symbol,f=Object.prototype,h=f.hasOwnProperty,d=f.toString,v=l?l.toStringTag:void 0;var p=Object.prototype.toString;var y=l?l.toStringTag:void 0;function b(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":y&&y in Object(t)?function(t){var e=h.call(t,v),r=t[v];try{t[v]=void 0;var n=!0}catch(t){}var o=d.call(t);return n&&(e?t[v]=r:delete t[v]),o}(t):function(t){return p.call(t)}(t)}function g(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function m(t){if(!g(t))return!1;var e=b(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var _,w=c["__core-js_shared__"],j=(_=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"";var I=Function.prototype.toString;function S(t){if(null!=t){try{return I.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var O=/^\[object .+?Constructor\]$/,A=Function.prototype,x=Object.prototype,E=A.toString,N=x.hasOwnProperty,k=RegExp("^"+E.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B(t){return!(!g(t)||(e=t,j&&j in e))&&(m(t)?k:O).test(S(t));var e}function R(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return B(r)?r:void 0}var P=R(c,"DataView"),z=R(c,"Map"),D=R(c,"Promise"),T=R(c,"Set"),C=R(c,"WeakMap"),M="[object Map]",F="[object Promise]",U="[object Set]",L="[object WeakMap]",q="[object DataView]",W=S(P),J=S(z),K=S(D),V=S(T),Q=S(C),G=b;function H(t){return null!=t&&"object"==typeof t}(P&&G(new P(new ArrayBuffer(1)))!=q||z&&G(new z)!=M||D&&G(D.resolve())!=F||T&&G(new T)!=U||C&&G(new C)!=L)&&(G=function(t){var e=b(t),r="[object Object]"==e?t.constructor:void 0,n=r?S(r):"";if(n)switch(n){case W:return q;case J:return M;case K:return F;case V:return U;case Q:return L}return e});function $(t){return H(t)&&"[object Arguments]"==b(t)}var X=Object.prototype,Y=X.hasOwnProperty,Z=X.propertyIsEnumerable,tt=$(function(){return arguments}())?$:function(t){return H(t)&&Y.call(t,"callee")&&!Z.call(t,"callee")},et=Array.isArray;function rt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function nt(t){return null!=t&&rt(t.length)&&!m(t)}var ot="object"==typeof t&&t&&!t.nodeType&&t,it=ot&&"object"==typeof module&&module&&!module.nodeType&&module,st=it&&it.exports===ot?c.Buffer:void 0,at=(st?st.isBuffer:void 0)||function(){return!1},ut={};function ct(t){return function(e){return t(e)}}ut["[object Float32Array]"]=ut["[object Float64Array]"]=ut["[object Int8Array]"]=ut["[object Int16Array]"]=ut["[object Int32Array]"]=ut["[object Uint8Array]"]=ut["[object Uint8ClampedArray]"]=ut["[object Uint16Array]"]=ut["[object Uint32Array]"]=!0,ut["[object Arguments]"]=ut["[object Array]"]=ut["[object ArrayBuffer]"]=ut["[object Boolean]"]=ut["[object DataView]"]=ut["[object Date]"]=ut["[object Error]"]=ut["[object Function]"]=ut["[object Map]"]=ut["[object Number]"]=ut["[object Object]"]=ut["[object RegExp]"]=ut["[object Set]"]=ut["[object String]"]=ut["[object WeakMap]"]=!1;var lt="object"==typeof t&&t&&!t.nodeType&&t,ft=lt&&"object"==typeof module&&module&&!module.nodeType&&module,ht=ft&&ft.exports===lt&&a.process,dt=function(){try{var t=ft&&ft.require&&ft.require("util").types;return t||ht&&ht.binding&&ht.binding("util")}catch(t){}}(),vt=dt&&dt.isTypedArray,pt=vt?ct(vt):function(t){return H(t)&&rt(t.length)&&!!ut[b(t)]},yt=Object.prototype.hasOwnProperty;function bt(t){if(null==t)return!0;if(nt(t)&&(et(t)||"string"==typeof t||"function"==typeof t.splice||at(t)||pt(t)||tt(t)))return!t.length;var e=G(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(r(t))return!s(t).length;for(var n in t)if(yt.call(t,n))return!1;return!0}var gt=/^(?:0|[1-9]\d*)$/;function mt(t,e){var r=typeof t;return!!(e=e??9007199254740991)&&("number"==r||"symbol"!=r&&gt.test(t))&&t>-1&&t%1==0&&t<e}var _t=Object.prototype.hasOwnProperty;function wt(t,e){var r=et(t),n=!r&&tt(t),o=!r&&!n&&at(t),i=!r&&!n&&!o&&pt(t),s=r||n||o||i,a=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],u=a.length;for(var c in t)!e&&!_t.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mt(c,u))||a.push(c);return a}function jt(t){return nt(t)?wt(t):s(t)}function It(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function St(t){return"symbol"==typeof t||H(t)&&"[object Symbol]"==b(t)}var Ot=l?l.prototype:void 0,At=Ot?Ot.toString:void 0;function xt(t){if("string"==typeof t)return t;if(et(t))return It(t,xt)+"";if(St(t))return At?At.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Et(t){return null==t?"":xt(t)}var Nt=0;function kt(t){var e=++Nt;return Et(t)+e}var Bt=/\s/;var Rt=/^\s+/;function Pt(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Bt.test(t.charAt(e)););return e}(t)+1).replace(Rt,""):t}var zt=/^[-+]0x[0-9a-f]+$/i,Dt=/^0b[01]+$/i,Tt=/^0o[0-7]+$/i,Ct=parseInt;var Mt=1/0;function Ft(t){return t?(t=function(t){if("number"==typeof t)return t;if(St(t))return NaN;if(g(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=g(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Pt(t);var r=Dt.test(t);return r||Tt.test(t)?Ct(t.slice(2),r?2:8):zt.test(t)?NaN:+t}(t))===Mt||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function Ut(t,e){var r;if("function"!=typeof e)throw new TypeError("Expected a function");return t=function(t){var e=Ft(t),r=e%1;return e==e?r?e-r:e:0}(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}const Lt=/\s+/;function qt(t,e,r,n,o){let i,s=0;if(r&&"object"==typeof r){void 0!==n&&"context"in o&&void 0===o.context&&(o.context=n);for(i=Object.keys(r);s<i.length;s++)e=qt(t,e,i[s],r[i[s]],o)}else if(r&&"string"==typeof r&&Lt.test(r))for(i=r.split(Lt);s<i.length;s++){const r=t(e,i[s],n,o);void 0!==r&&(e=r)}else e=t(e,r,n,o);return e}function Wt(t,e,r,n){if(r){const o=t[e]||(t[e]=[]),i=n.context,s=n.ctx,a=n.listening;a&&a.count++,o.push({callback:r,context:i,ctx:i||s,listening:a})}return t}function Jt(t,e,r,n){if(!t)return;const o=n.context,i=n.listeners;let s,a=0;if(e||o||r){for(s=e?[e]:Object.keys(t);a<s.length;a++){const e=s[a],n=t[e];if(!n)continue;const i=[];for(let t=0;t<n.length;t++){const s=n[t];if(r&&r!==s.callback&&r!==s.callback._callback||o&&o!==s.context)i.push(s);else{const t=s.listening;t&&t.stop(e,r)}}i.length?t[e]=i:delete t[e]}return t}if(i)for(s=Object.keys(i);a<s.length;a++)i[s[a]].cleanup()}function Kt(t,e,r,n){if(r){const o=Ut(2,function(...t){n(e,o),r.apply(this,t)});t[e]=o,o._callback=r}return t}function Vt(t,e,r,n){if(t){const r=t[e];let o=t.all;r&&o&&(o=o.slice()),r&&Qt(r,n),o&&Qt(o,[e].concat(n))}return t}function Qt(t,e){let r,n=-1;const o=t.length,i=e[0],s=e[1],a=e[2];switch(e.length){case 0:for(;++n<o;)(r=t[n]).callback.call(r.ctx);return;case 1:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i);return;case 2:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s);return;case 3:for(;++n<o;)(r=t[n]).callback.call(r.ctx,i,s,a);return;default:for(;++n<o;)(r=t[n]).callback.apply(r.ctx,e);return}}class Gt{constructor(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0}start(t,e,r,n){const o={context:this.obj,ctx:r,listening:n};if(this._events=qt(Wt,this._events||{},t,e,o),n){(this.obj._listeners||(this.obj._listeners={}))[this.id]=this,this.interop=!1}return this}stop(t,e){let r;this.interop?(this._events=qt(Jt,this._events,t,e,{context:void 0,listeners:void 0}),r=!this._events):(this.count--,r=0===this.count),r&&this.cleanup()}cleanup(){this.listener._listeningTo&&delete this.listener._listeningTo[this.obj._listenId],!this.interop&&this.obj._listeners&&delete this.obj._listeners[this.id]}}
2
2
  /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- var Oi;Object.assign(ji.prototype,Le,{preinitialize:function(){},initialize:function(){},route:function(t,e,n){return mi(t)||(t=this._routeToRegExp(t)),f(e)&&(n=e,e=""),n||(n=this[e]),this.history.route(t,r=>{const i=this._extractParameters(t,r);!1!==this.execute(n,i,e)&&(this.trigger.apply(this,["route:"+e].concat(i)),this.trigger("route",e,i),this.history.trigger("route",this,e,i))}),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,e){return this.history.navigate(t,e),this},_bindRoutes:function(){if(!this.routes)return;let t;this.routes=se(this,"routes");const e=at(this.routes);for(;null!=(t=e.pop());)this.route(t,this.routes[t])},_routeToRegExp:function(t){return t=t.replace(xi,"\\$&").replace(Ai,"(?:$1)?").replace(wi,(function(t,e){return e?t:"([^/?]+)"})).replace($i,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){const n=t.exec(e).slice(1);return n.map((function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null}))}});const Ei=window,Si=Ei.trustedTypes,Ii=Si?Si.createPolicy("lit-html",{createHTML:t=>t}):void 0,Mi=`lit$${(Math.random()+"").slice(9)}$`,Pi="?"+Mi,Hi=`<${Pi}>`,Ni=document,ki=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ni.createComment(t)},Ti=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Ci=Array.isArray,Ri=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zi=/-->/g,Ui=/>/g,Li=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),Bi=/'/g,Fi=/"/g,Di=/^(?:script|style|textarea|title)$/i,Wi=Symbol.for("lit-noChange"),Vi=Symbol.for("lit-nothing"),qi=new WeakMap,Ji=Ni.createTreeWalker(Ni,129,null,!1),Gi=(t,e)=>{const n=t.length-1,r=[];let i,o=2===e?"<svg>":"",s=Ri;for(let e=0;e<n;e++){const n=t[e];let c,u,a=-1,l=0;for(;l<n.length&&(s.lastIndex=l,u=s.exec(n),null!==u);)l=s.lastIndex,s===Ri?"!--"===u[1]?s=zi:void 0!==u[1]?s=Ui:void 0!==u[2]?(Di.test(u[2])&&(i=RegExp("</"+u[2],"g")),s=Li):void 0!==u[3]&&(s=Li):s===Li?">"===u[0]?(s=null!=i?i:Ri,a=-1):void 0===u[1]?a=-2:(a=s.lastIndex-u[2].length,c=u[1],s=void 0===u[3]?Li:'"'===u[3]?Fi:Bi):s===Fi||s===Bi?s=Li:s===zi||s===Ui?s=Ri:(s=Li,i=void 0);const h=s===Li&&t[e+1].startsWith("/>")?" ":"";o+=s===Ri?n+Hi:a>=0?(r.push(c),n.slice(0,a)+"$lit$"+n.slice(a)+Mi+h):n+Mi+(-2===a?(r.push(void 0),e):h)}const c=o+(t[n]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==Ii?Ii.createHTML(c):c,r]};class Zi{constructor(t,e){let n,{strings:r,_$litType$:i}=t;this.parts=[];let o=0,s=0;const c=r.length-1,u=this.parts,[a,l]=Gi(r,i);if(this.el=Zi.createElement(a,e),Ji.currentNode=this.el.content,2===i){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=Ji.nextNode())&&u.length<c;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(Mi)){const r=l[s++];if(t.push(e),void 0!==r){const t=n.getAttribute(r.toLowerCase()+"$lit$").split(Mi),e=/([.?@])?(.*)/.exec(r);u.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?to:"?"===e[1]?no:"@"===e[1]?ro:Yi})}else u.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(Di.test(n.tagName)){const t=n.textContent.split(Mi),e=t.length-1;if(e>0){n.textContent=Si?Si.emptyScript:"";for(let r=0;r<e;r++)n.append(t[r],ki()),Ji.nextNode(),u.push({type:2,index:++o});n.append(t[e],ki())}}}else if(8===n.nodeType)if(n.data===Pi)u.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(Mi,t+1));)u.push({type:7,index:o}),t+=Mi.length-1}o++}}static createElement(t,e){const n=Ni.createElement("template");return n.innerHTML=t,n}}function Ki(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;var i,o,s,c;if(e===Wi)return e;let u=void 0!==r?null===(i=n._$Co)||void 0===i?void 0:i[r]:n._$Cl;const a=Ti(e)?void 0:e._$litDirective$;return(null==u?void 0:u.constructor)!==a&&(null===(o=null==u?void 0:u._$AO)||void 0===o||o.call(u,!1),void 0===a?u=void 0:(u=new a(t),u._$AT(t,n,r)),void 0!==r?(null!==(s=(c=n)._$Co)&&void 0!==s?s:c._$Co=[])[r]=u:n._$Cl=u),void 0!==u&&(e=Ki(t,u._$AS(t,e.values),u,r)),e}class Qi{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:n},parts:r}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:Ni).importNode(n,!0);Ji.currentNode=i;let o=Ji.nextNode(),s=0,c=0,u=r[0];for(;void 0!==u;){if(s===u.index){let e;2===u.type?e=new Xi(o,o.nextSibling,this,t):1===u.type?e=new u.ctor(o,u.name,u.strings,this,t):6===u.type&&(e=new io(o,this,t)),this.u.push(e),u=r[++c]}s!==(null==u?void 0:u.index)&&(o=Ji.nextNode(),s++)}return i}p(t){let e=0;for(const n of this.u)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class Xi{constructor(t,e,n,r){var i;this.type=2,this._$AH=Vi,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cm=null===(i=null==r?void 0:r.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t){t=Ki(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),Ti(t)?t===Vi||null==t||""===t?(this._$AH!==Vi&&this._$AR(),this._$AH=Vi):t!==this._$AH&&t!==Wi&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>Ci(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._$AB;return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==Vi&&Ti(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ni.createTextNode(t)),this._$AH=t}$(t){var e;const{values:n,_$litType$:r}=t,i="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Zi.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(n);else{const t=new Qi(i,this),e=t.v(this.options);t.p(n),this.T(e),this._$AH=t}}_$AC(t){let e=qi.get(t.strings);return void 0===e&&qi.set(t.strings,e=new Zi(t)),e}k(t){Ci(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const i of t)r===e.length?e.push(n=new Xi(this.O(ki()),this.O(ki()),this,this.options)):n=e[r],n._$AI(i),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Yi{constructor(t,e,n,r,i){this.type=1,this._$AH=Vi,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Vi}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=this.strings;let o=!1;if(void 0===i)t=Ki(this,t,e,0),o=!Ti(t)||t!==this._$AH&&t!==Wi,o&&(this._$AH=t);else{const r=t;let s,c;for(t=i[0],s=0;s<i.length-1;s++)c=Ki(this,r[n+s],e,s),c===Wi&&(c=this._$AH[s]),o||(o=!Ti(c)||c!==this._$AH[s]),c===Vi?t=Vi:t!==Vi&&(t+=(null!=c?c:"")+i[s+1]),this._$AH[s]=c}o&&!r&&this.j(t)}j(t){t===Vi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class to extends Yi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Vi?void 0:t}}const eo=Si?Si.emptyScript:"";class no extends Yi{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Vi?this.element.setAttribute(this.name,eo):this.element.removeAttribute(this.name)}}class ro extends Yi{constructor(t,e,n,r,i){super(t,e,n,r,i),this.type=5}_$AI(t){var e;if((t=null!==(e=Ki(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0))&&void 0!==e?e:Vi)===Wi)return;const n=this._$AH,r=t===Vi&&n!==Vi||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==Vi&&(n===Vi||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this._$AH.handleEvent(t)}}class io{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Ki(this,t)}}const oo=Ei.litHtmlPolyfillSupport;null==oo||oo(Zi,Xi),(null!==(Oi=Ei.litHtmlVersions)&&void 0!==Oi?Oi:Ei.litHtmlVersions=[]).push("2.6.1");const so=/^\s*</,co=function(t){this.cid=Ue("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Mt(this,Er(t,ao)),this._ensureElement(),this.initialize.apply(this,arguments)};co.extend=ce;const uo=/^(\S+)\s*(.*)$/,ao=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(co.prototype,Le,{tagName:"div",$:function(t){return this.el.querySelectorAll(t)},preinitialize:function(){},initialize:function(){},render:function(){return f(this.beforeRender)&&this.beforeRender(),f(this.toHTML)&&((t,e,n)=>{var r,i;const o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e;let s=o._$litPart$;if(void 0===s){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=s=new Xi(e.insertBefore(ki(),t),t,void 0,null!=n?n:{})}s._$AI(t)})(this.toHTML(),this.el),f(this.afterRender)&&this.afterRender(),this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){if("string"==typeof t)if(so.test(t)){const e=document.createElement("div");e.innerHTML=t,this.el=e.firstChild}else this.el=document.querySelector(t);else t&&(!H(e=t)||1!==e.nodeType||yr(e))&&t.length?this.el=t[0]:this.el=t;var e},delegateEvents:function(t){if(t||(t=se(this,"events")),!t)return this;this.undelegateEvents();for(const e in t){let n=t[e];if(f(n)||(n=this[n]),!n)continue;const r=e.match(uo);this.delegate(r[1],r[2],n.bind(this))}return this},delegate:function(t,e,n){const r=this.el;if(!r)return this;if("function"==typeof e&&(n=e,e=null),-1!==["focus","blur"].indexOf(t)){const r=this.el.querySelectorAll(e);for(let e=0,i=r.length;e<i;e++){const i=r[e];i.addEventListener(t,n,!1),this._domEvents.push({el:i,eventName:t,handler:n})}return n}const i=e?function(t){let i=t.target||t.srcElement;for(;i&&i!=r;i=i.parentNode)i.matches(e)&&(t.delegateTarget=i,n(t))}:n;return this.el.addEventListener(t,i,!1),this._domEvents.push({el:this.el,eventName:t,handler:i,listener:n,selector:e}),this},undelegateEvents:function(){if(this.el){for(let t=0,e=this._domEvents.length;t<e;t++){const e=this._domEvents[t];e.el.removeEventListener(e.eventName,e.handler,!1)}this._domEvents.length=0}return this},undelegate:function(t,e,n){if("function"==typeof e&&(n=e,e=null),this.el){const r=this._domEvents.slice();let i=r.length;for(;i--;){const o=r[i];!(o.eventName!==t||n&&o.listener!==n||e&&o.selector!==e)&&(o.el.removeEventListener(o.eventName,o.handler,!1),this._domEvents.splice(i,1))}}return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(se(this,"el"));else{const t=Mt({},se(this,"attributes"));this.id&&(t.id=se(this,"id")),this.className&&(t.class=se(this,"className")),this.setElement(this._createElement(se(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){for(const e in t)e in this.el?this.el[e]=t[e]:this.el.setAttribute(e,t[e])}});const lo={Collection:si,Events:Le,History:vi,Model:Sr,Router:ji,View:co,ajax:pe,sync:de};Object.assign(lo,Le);const ho="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;lo.VERSION="0.0.1";const fo=ho.Skeletor;return lo.noConflict=function(){return ho.Skeletor=fo,this},ho.Skeletor=lo,lo}));
3
+ * @copyright 2010-2019 Jeremy Ashkenas and DocumentCloud
4
+ * @copyright 2023 JC Brand
5
+ */let Ht;function $t(t){return class extends t{on(t,e,r){if(this._events=qt(Wt,this._events||{},t,e,{context:r,ctx:this,listening:Ht}),Ht){(this._listeners||(this._listeners={}))[Ht.id]=Ht,Ht.interop=!1}return this}listenTo(t,e,r){if(!t)return this;const n=t._listenId||(t._listenId=kt("l")),o=this._listeningTo||(this._listeningTo={});let i=Ht=o[n];i||(this._listenId||(this._listenId=kt("l")),i=Ht=o[n]=new Gt(this,t));const s=function(t,e,r,n){try{t.on(e,r,n)}catch(t){return t}}(t,e,r,this);if(Ht=void 0,s)throw s;return i.interop&&i.start(e,r,this,Ht),this}off(t,e,r){return this._events?(this._events=qt(Jt,this._events,t,e,{context:r,listeners:this._listeners}),this):this}stopListening(t,e,r){const n=this._listeningTo;if(!n)return this;const o=t?[t._listenId]:jt(n);for(let t=0;t<o.length;t++){const i=n[o[t]];if(!i)break;i.obj.off(e,r,this),i.interop&&i.stop(e,r)}return bt(n)&&(this._listeningTo=void 0),this}once(t,e,r){const n=qt(Kt,{},t,e,this.off.bind(this));return"string"==typeof t&&null==r&&(e=void 0),this.on(n,e,r)}listenToOnce(t,e,r){const n=qt(Kt,{},e,r,this.stopListening.bind(this,t));return this.listenTo(t,n)}trigger(t,...e){return this._events?(qt(Vt,this._events,t,void 0,e),this):this}}}const Xt=$t(Object);
6
+ /*! *****************************************************************************
7
+ Copyright (c) Microsoft Corporation.
8
+
9
+ Permission to use, copy, modify, and/or distribute this software for any
10
+ purpose with or without fee is hereby granted.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
+ PERFORMANCE OF THIS SOFTWARE.
19
+ ***************************************************************************** */var Yt=/^~~local_forage_type~([^~]+)~/,Zt=Object.prototype.toString;function te(t){var e=.75*t.length,r=t.length;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);for(var n=new ArrayBuffer(e),o=new Uint8Array(n),i=0,s=0;i<r;i+=4){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+1]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+2]),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t[i+3]);o[s++]=a<<2|u>>4,o[s++]=(15&u)<<4|c>>2,o[s++]=(3&c)<<6|63&l}return n}function ee(t){for(var e=new Uint8Array(t),r="",n=0;n<e.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&e[n])<<4|e[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&e[n+1])<<2|e[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&e[n+2]];return e.length%3==2?r=r.substring(0,r.length-1)+"=":e.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function re(t){var e,r;if(null===t||"object"!=typeof t||"isActiveClone"in t)return t;var n=t instanceof Date?new Date(t):t.constructor();try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
20
+ /*!
21
+ MIT License
22
+
23
+ Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a copy
26
+ of this software and associated documentation files (the "Software"), to deal
27
+ in the Software without restriction, including without limitation the rights
28
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
+ copies of the Software, and to permit persons to whom the Software is
30
+ furnished to do so, subject to the following conditions:
31
+
32
+ The above copyright notice and this permission notice shall be included in all
33
+ copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
+ SOFTWARE.
42
+
43
+ */(Object.keys(t)),i=o.next();!i.done;i=o.next()){var s=i.value;Object.prototype.hasOwnProperty.call(t,s)&&(t.isActiveClone=null,n[s]=re(t[s]),delete t.isActiveClone)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function ne(t,e){return(t.name||e.name)+"/"+(t.storeName||e.storeName)+"/"}function oe(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function ie(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function se(t,e){var r=this;if(e=ie.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}return{promise:t.name?new Promise(function(e){t.storeName?e(ne(t,r._defaultConfig)):e(t.name+"/")}):Promise.reject("Invalid arguments"),callback:e}}function ae(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}var ue={bufferToString:ee,deserialize:function(t){if("__lfsc__:"!==t.substring(0,9))return JSON.parse(t);var e,r=t.substring(13),n=t.substring(9,13);if("blob"===n&&Yt.test(r)){var o=r.match(Yt);e=o[1],r=r.substring(o[0].length)}var i=te(r);switch(n){case"arbf":return i;case"blob":return function(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}([i],{type:e});case"si08":return new Int8Array(i);case"ui08":return new Uint8Array(i);case"uic8":return new Uint8ClampedArray(i);case"si16":return new Int16Array(i);case"ur16":return new Uint16Array(i);case"si32":return new Int32Array(i);case"ui32":return new Uint32Array(i);case"fl32":return new Float32Array(i);case"fl64":return new Float64Array(i);default:throw new Error("Unkown type: "+n)}},serialize:function(t,e){var r="";if(t&&(r=Zt.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===Zt.call(t.buffer))){var n=void 0,o="__lfsc__:";t instanceof ArrayBuffer?(n=t,o+="arbf"):(n=t.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":e(new Error("Failed to get type for BinaryArray"))),e(o+ee(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+t.type+"~"+ee(this.result);e("__lfsc__:blob"+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}},stringToBuffer:te},ce="localforage-driver-memory",le={},fe=function(){function t(t){this.kp=t,this.data={}}return t.resolve=function(e){return le[e]||(le[e]=new t(e)),le[e]},t.prototype.clear=function(){this.data={}},t.prototype.drop=function(){this.clear(),delete le[this.kp]},t.prototype.get=function(t){return this.data[t]},t.prototype.key=function(t){return this.keys()[t]},t.prototype.keys=function(){return Object.keys(this.data)},t.prototype.rm=function(t){delete this.data[t]},t.prototype.set=function(t,e){this.data[t]=e},t}();
44
+ /*!
45
+ MIT License
46
+
47
+ Copyright (c) 2018 Arturas Molcanovas <a.molcanovas@gmail.com>
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in all
57
+ copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
+ SOFTWARE.
66
+
67
+ */var he=Object.freeze({__proto__:null,_driver:ce,_initStorage:function(t){var e=t?re(t):{},r=ne(e,this._defaultConfig),n=fe.resolve(r);return this._dbInfo=e,this._dbInfo.serializer=ue,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},_support:!0,clear:function(t){var e=this,r=this.ready().then(function(){e._dbInfo.mStore.clear()});return oe(r,t),r},dropInstance:function(t,e){var r=se.apply(this,arguments),n=r.promise,o=r.callback;return oe(n.then(function(t){fe.resolve(t).drop()}),o),n},getItem:function(t,e){var r=this;t=ae(t);var n=this.ready().then(function(){var e=r._dbInfo.mStore.get(t);return null==e?null:r._dbInfo.serializer.deserialize(e)});return oe(n,e),n},iterate:function(t,e){var r=this,n=this.ready().then(function(){for(var e=r._dbInfo.mStore,n=e.keys(),o=0;o<n.length;o++){var i=e.get(n[o]);if(i&&(i=r._dbInfo.serializer.deserialize(i)),void 0!==(i=t(i,n[o],o+1)))return i}});return oe(n,e),n},key:function(t,e){var r=this,n=this.ready().then(function(){var e;try{void 0===(e=r._dbInfo.mStore.key(t))&&(e=null)}catch(t){e=null}return e});return oe(n,e),n},keys:function(t){var e=this,r=this.ready().then(function(){return e._dbInfo.mStore.keys()});return oe(r,t),r},length:function(t){var e=this.keys().then(function(t){return t.length});return oe(e,t),e},removeItem:function(t,e){var r=this;t=ae(t);var n=this.ready().then(function(){r._dbInfo.mStore.rm(t)});return oe(n,e),n},setItem:function(t,e,r){var n=this;t=ae(t);var o=this.ready().then(function(){void 0===e&&(e=null);var r=e;return new Promise(function(o,i){n._dbInfo.serializer.serialize(e,function(e,s){if(s)i(s);else try{n._dbInfo.mStore.set(t,e),o(r)}catch(t){i(t)}})})});return oe(o,r),o}});function de(t,e){return t===e||t!=t&&e!=e}function ve(t,e){for(var r=t.length;r--;)if(de(t[r][0],e))return r;return-1}var pe=Array.prototype.splice;function ye(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ye.prototype.clear=function(){this.__data__=[],this.size=0},ye.prototype.delete=function(t){var e=this.__data__,r=ve(e,t);return!(r<0)&&(r==e.length-1?e.pop():pe.call(e,r,1),--this.size,!0)},ye.prototype.get=function(t){var e=this.__data__,r=ve(e,t);return r<0?void 0:e[r][1]},ye.prototype.has=function(t){return ve(this.__data__,t)>-1},ye.prototype.set=function(t,e){var r=this.__data__,n=ve(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var be=R(Object,"create");var ge=Object.prototype.hasOwnProperty;var me=Object.prototype.hasOwnProperty;function _e(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function we(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function je(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_e.prototype.clear=function(){this.__data__=be?be(null):{},this.size=0},_e.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_e.prototype.get=function(t){var e=this.__data__;if(be){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ge.call(e,t)?e[t]:void 0},_e.prototype.has=function(t){var e=this.__data__;return be?void 0!==e[t]:me.call(e,t)},_e.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=be&&void 0===e?"__lodash_hash_undefined__":e,this},je.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(z||ye),string:new _e}},je.prototype.delete=function(t){var e=we(this,t).delete(t);return this.size-=e?1:0,e},je.prototype.get=function(t){return we(this,t).get(t)},je.prototype.has=function(t){return we(this,t).has(t)},je.prototype.set=function(t,e){var r=we(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ie(t){var e=this.__data__=new ye(t);this.size=e.size}Ie.prototype.clear=function(){this.__data__=new ye,this.size=0},Ie.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Ie.prototype.get=function(t){return this.__data__.get(t)},Ie.prototype.has=function(t){return this.__data__.has(t)},Ie.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ye){var n=r.__data__;if(!z||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new je(n)}return r.set(t,e),this.size=r.size,this};var Se=function(){try{var t=R(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Oe(t,e,r){"__proto__"==e&&Se?Se(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Ae=Object.prototype.hasOwnProperty;function xe(t,e,r){var n=t[e];Ae.call(t,e)&&de(n,r)&&(void 0!==r||e in t)||Oe(t,e,r)}function Ee(t,e,r,n){var o=!r;r||(r={});for(var i=-1,s=e.length;++i<s;){var a=e[i],u=void 0;void 0===u&&(u=t[a]),o?Oe(r,a,u):xe(r,a,u)}return r}var Ne=Object.prototype.hasOwnProperty;function ke(t){if(!g(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=r(t),n=[];for(var o in t)("constructor"!=o||!e&&Ne.call(t,o))&&n.push(o);return n}function Be(t){return nt(t)?wt(t,!0):ke(t)}var Re="object"==typeof t&&t&&!t.nodeType&&t,Pe=Re&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Pe&&Pe.exports===Re?c.Buffer:void 0,De=ze?ze.allocUnsafe:void 0;function Te(t,e){if(e)return t.slice();var r=t.length,n=De?De(r):new t.constructor(r);return t.copy(n),n}function Ce(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function Me(){return[]}var Fe=Object.prototype.propertyIsEnumerable,Ue=Object.getOwnPropertySymbols,Le=Ue?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var s=t[r];e(s,r,t)&&(i[o++]=s)}return i}(Ue(t),function(e){return Fe.call(t,e)}))}:Me;function qe(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}var We=n(Object.getPrototypeOf,Object),Je=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)qe(e,Le(t)),t=We(t);return e}:Me;function Ke(t,e,r){var n=e(t);return et(t)?n:qe(n,r(t))}function Ve(t){return Ke(t,jt,Le)}function Qe(t){return Ke(t,Be,Je)}var Ge=Object.prototype.hasOwnProperty;var He=c.Uint8Array;function $e(t){var e=new t.constructor(t.byteLength);return new He(e).set(new He(t)),e}var Xe=/\w*$/;var Ye=l?l.prototype:void 0,Ze=Ye?Ye.valueOf:void 0;function tr(t,e){var r=e?$e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function er(t,e,r){var n,o=t.constructor;switch(e){case"[object ArrayBuffer]":return $e(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?$e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return tr(t,r);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Xe.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return n=t,Ze?Object(Ze.call(n)):{}}}var rr=Object.create,nr=function(){function t(){}return function(e){if(!g(e))return{};if(rr)return rr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function or(t){return"function"!=typeof t.constructor||r(t)?{}:nr(We(t))}var ir=dt&&dt.isMap,sr=ir?ct(ir):function(t){return H(t)&&"[object Map]"==G(t)};var ar=dt&&dt.isSet,ur=ar?ct(ar):function(t){return H(t)&&"[object Set]"==G(t)},cr="[object Arguments]",lr="[object Function]",fr="[object Object]",hr={};function dr(t,e,r,n,o,i){var s,a=1&e,u=2&e,c=4&e;if(r&&(s=o?r(t,n,o,i):r(t)),void 0!==s)return s;if(!g(t))return t;var l=et(t);if(l){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Ge.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!a)return Ce(t,s)}else{var f=G(t),h=f==lr||"[object GeneratorFunction]"==f;if(at(t))return Te(t,a);if(f==fr||f==cr||h&&!o){if(s=u||h?{}:or(t),!a)return u?function(t,e){return Ee(t,Je(t),e)}(t,function(t,e){return t&&Ee(e,Be(e),t)}(s,t)):function(t,e){return Ee(t,Le(t),e)}(t,function(t,e){return t&&Ee(e,jt(e),t)}(s,t))}else{if(!hr[f])return o?t:{};s=er(t,f,a)}}i||(i=new Ie);var d=i.get(t);if(d)return d;i.set(t,s),ur(t)?t.forEach(function(n){s.add(dr(n,e,r,n,t,i))}):sr(t)&&t.forEach(function(n,o){s.set(o,dr(n,e,r,o,t,i))});var v=l?void 0:(c?u?Qe:Ve:u?Be:jt)(t);return function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););}(v||t,function(n,o){v&&(n=t[o=n]),xe(s,o,dr(n,e,r,o,t,i))}),s}hr[cr]=hr["[object Array]"]=hr["[object ArrayBuffer]"]=hr["[object DataView]"]=hr["[object Boolean]"]=hr["[object Date]"]=hr["[object Float32Array]"]=hr["[object Float64Array]"]=hr["[object Int8Array]"]=hr["[object Int16Array]"]=hr["[object Int32Array]"]=hr["[object Map]"]=hr["[object Number]"]=hr[fr]=hr["[object RegExp]"]=hr["[object Set]"]=hr["[object String]"]=hr["[object Symbol]"]=hr["[object Uint8Array]"]=hr["[object Uint8ClampedArray]"]=hr["[object Uint16Array]"]=hr["[object Uint32Array]"]=!0,hr["[object Error]"]=hr[lr]=hr["[object WeakMap]"]=!1;function vr(t){return"string"==typeof t||!et(t)&&H(t)&&"[object String]"==b(t)}var pr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function br(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gr,mr={exports:{}};
68
+ /*!
69
+ localForage -- Offline Storage, Improved
70
+ Version 1.10.0
71
+ https://localforage.github.io/localForage
72
+ (c) 2013-2017 Mozilla, Apache License 2.0
73
+ */function _r(){return gr||(gr=1,function(t){t.exports=function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){if(!a&&br)return br(s);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){var r=e[s][1][t];return o(r||t)},c,c.exports,t,e,r,n)}return r[s].exports}for(var i=br,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,r){(function(t){var r,n,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,s=new o(l),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var u=new t.MessageChannel;u.port1.onmessage=l,r=function(){u.port2.postMessage(0)}}var c=[];function l(){var t,e;n=!0;for(var r=c.length;r;){for(e=c,c=[],t=-1;++t<r;)e[t]();r=c.length}n=!1}function f(t){1!==c.push(t)||n||r()}e.exports=f}).call(this,void 0!==pr?pr:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,r){var n=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==o&&d(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(t,e,r){n(function(){var n;try{n=e(r)}catch(e){return i.reject(t,e)}n===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,n)})}function h(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var r=!1;function n(e){r||(r=!0,i.reject(t,e))}function o(e){r||(r=!0,i.resolve(t,e))}function s(){e(o,n)}var a=v(s);"error"===a.status&&n(a.value)}function v(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}function p(t){return t instanceof this?t:i.resolve(new this(o),t)}function y(t){var e=new this(o);return i.reject(e,t)}function b(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,u=-1,c=new this(o);++u<r;)l(t[u],u);return c;function l(t,o){function u(t){s[o]=t,++a!==r||n||(n=!0,i.resolve(c,s))}e.resolve(t).then(u,function(t){n||(n=!0,i.reject(c,t))})}}function g(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var r=t.length,n=!1;if(!r)return this.resolve([]);for(var s=-1,a=new this(o);++s<r;)u(t[s]);return a;function u(t){e.resolve(t).then(function(t){n||(n=!0,i.resolve(a,t))},function(t){n||(n=!0,i.reject(a,t))})}}e.exports=c,c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var r=new this.constructor(o);return this.state!==u?f(r,this.state===a?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){f(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){i.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){f(this.promise,this.onRejected,t)},i.resolve=function(t,e){var r=v(h,e);if("error"===r.status)return i.reject(t,r.value);var n=r.value;if(n)d(t,n);else{t.state=a,t.outcome=e;for(var o=-1,s=t.queue.length;++o<s;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=s,t.outcome=e;for(var r=-1,n=t.queue.length;++r<n;)t.queue[r].callRejected(e);return t},c.resolve=p,c.reject=y,c.all=b,c.race=g},{1:1}],3:[function(t,e,r){(function(e){"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==pr?pr:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,r){var n="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};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}var s=i();function a(){try{if(!s||!s.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}function u(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var c=Promise;function l(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function f(t,e,r){"function"==typeof e&&t.then(e),"function"==typeof r&&t.catch(r)}function h(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function d(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var v="local-forage-detect-blob-support",p=void 0,y={},b=Object.prototype.toString,g="readonly",m="readwrite";function _(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;o<e;o++)n[o]=t.charCodeAt(o);return r}function w(t){return new c(function(e){var r=t.transaction(v,m),n=u([""]);r.objectStore(v).put(n,"key"),r.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},r.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);e(r||!t||parseInt(t[1],10)>=43)}}).catch(function(){return!1})}function j(t){return"boolean"==typeof p?c.resolve(p):w(t).then(function(t){return p=t})}function I(t){var e=y[t.name],r={};r.promise=new c(function(t,e){r.resolve=t,r.reject=e}),e.deferredOperations.push(r),e.dbReady?e.dbReady=e.dbReady.then(function(){return r.promise}):e.dbReady=r.promise}function S(t){var e=y[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function O(t,e){var r=y[t.name].deferredOperations.pop();if(r)return r.reject(e),r.promise}function A(t,e){return new c(function(r,n){if(y[t.name]=y[t.name]||T(),t.db){if(!e)return r(t.db);I(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var i=s.open.apply(s,o);e&&(i.onupgradeneeded=function(e){var r=i.result;try{r.createObjectStore(t.storeName),e.oldVersion<=1&&r.createObjectStore(v)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),i.onerror=function(t){t.preventDefault(),n(i.error)},i.onsuccess=function(){var e=i.result;e.onversionchange=function(t){t.target.close()},r(e),S(t)}})}function x(t){return A(t,!1)}function E(t){return A(t,!0)}function N(t,e){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,o=t.version>t.db.version;if(n&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),o||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1}function k(t){return new c(function(e,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:t.type})},n.readAsBinaryString(t)})}function B(t){return u([_(atob(t.data))],{type:t.type})}function R(t){return t&&t.__local_forage_encoded_blob}function P(t){var e=this,r=e._initReady().then(function(){var t=y[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady});return f(r,t,t),r}function z(t){I(t);for(var e=y[t.name],r=e.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return t.db=null,x(t).then(function(e){return t.db=e,N(t)?E(t):e}).then(function(n){t.db=e.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n}).catch(function(e){throw O(t,e),e})}function D(t,e,r,n){void 0===n&&(n=1);try{var o=t.db.transaction(t.storeName,e);r(null,o)}catch(o){if(n>0&&(!t.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return c.resolve().then(function(){if(!t.db||"NotFoundError"===o.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),E(t)}).then(function(){return z(t).then(function(){D(t,e,r,n-1)})}).catch(r);r(o)}}function T(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function C(t){var e=this,r={db:null};if(t)for(var n in t)r[n]=t[n];var o=y[r.name];o||(o=T(),y[r.name]=o),o.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=P);var i=[];function s(){return c.resolve()}for(var a=0;a<o.forages.length;a++){var u=o.forages[a];u!==e&&i.push(u._initReady().catch(s))}var l=o.forages.slice(0);return c.all(i).then(function(){return r.db=o.db,x(r)}).then(function(t){return r.db=t,N(r,e._defaultConfig.version)?E(r):t}).then(function(t){r.db=o.db=t,e._dbInfo=r;for(var n=0;n<l.length;n++){var i=l[n];i!==e&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}})}function M(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){D(r._dbInfo,g,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).get(t);s.onsuccess=function(){var t=s.result;void 0===t&&(t=null),R(t)&&(t=B(t)),e(t)},s.onerror=function(){n(s.error)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function F(t,e){var r=this,n=new c(function(e,n){r.ready().then(function(){D(r._dbInfo,g,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var r=s.result;if(r){var n=r.value;R(n)&&(n=B(n));var o=t(n,r.key,a++);void 0!==o?e(o):r.continue()}else e()},s.onerror=function(){n(s.error)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function U(t,e,r){var n=this;t=h(t);var o=new c(function(r,o){var i;n.ready().then(function(){return i=n._dbInfo,"[object Blob]"===b.call(e)?j(i.db).then(function(t){return t?e:k(e)}):e}).then(function(e){D(n._dbInfo,m,function(i,s){if(i)return o(i);try{var a=s.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var u=a.put(e,t);s.oncomplete=function(){void 0===e&&(e=null),r(e)},s.onabort=s.onerror=function(){var t=u.error?u.error:u.transaction.error;o(t)}}catch(t){o(t)}})}).catch(o)});return l(o,r),o}function L(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){D(r._dbInfo,m,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName).delete(t);i.oncomplete=function(){e()},i.onerror=function(){n(s.error)},i.onabort=function(){var t=s.error?s.error:s.transaction.error;n(t)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function q(t){var e=this,r=new c(function(t,r){e.ready().then(function(){D(e._dbInfo,m,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).clear();o.oncomplete=function(){t()},o.onabort=o.onerror=function(){var t=i.error?i.error:i.transaction.error;r(t)}}catch(t){r(t)}})}).catch(r)});return l(r,t),r}function W(t){var e=this,r=new c(function(t,r){e.ready().then(function(){D(e._dbInfo,g,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).count();i.onsuccess=function(){t(i.result)},i.onerror=function(){r(i.error)}}catch(t){r(t)}})}).catch(r)});return l(r,t),r}function J(t,e){var r=this,n=new c(function(e,n){t<0?e(null):r.ready().then(function(){D(r._dbInfo,g,function(o,i){if(o)return n(o);try{var s=i.objectStore(r._dbInfo.storeName),a=!1,u=s.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===t||a?e(r.key):(a=!0,r.advance(t)):e(null)},u.onerror=function(){n(u.error)}}catch(t){n(t)}})}).catch(n)});return l(n,e),n}function K(t){var e=this,r=new c(function(t,r){e.ready().then(function(){D(e._dbInfo,g,function(n,o){if(n)return r(n);try{var i=o.objectStore(e._dbInfo.storeName).openKeyCursor(),s=[];i.onsuccess=function(){var e=i.result;e?(s.push(e.key),e.continue()):t(s)},i.onerror=function(){r(i.error)}}catch(t){r(t)}})}).catch(r)});return l(r,t),r}function V(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;if(t.name){var i=t.name===r.name&&o._dbInfo.db?c.resolve(o._dbInfo.db):x(t).then(function(e){var r=y[t.name],n=r.forages;r.db=e;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=e;return e});n=t.storeName?i.then(function(e){if(e.objectStoreNames.contains(t.storeName)){var r=e.version+1;I(t);var n=y[t.name],o=n.forages;e.close();for(var i=0;i<o.length;i++){var a=o[i];a._dbInfo.db=null,a._dbInfo.version=r}var u=new c(function(e,n){var o=s.open(t.name,r);o.onerror=function(t){o.result.close(),n(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}});return u.then(function(t){n.db=t;for(var e=0;e<o.length;e++){var r=o[e];r._dbInfo.db=t,S(r._dbInfo)}}).catch(function(e){throw(O(t,e)||c.resolve()).catch(function(){}),e})}}):i.then(function(e){I(t);var r=y[t.name],n=r.forages;e.close();for(var o=0;o<n.length;o++)n[o]._dbInfo.db=null;var i=new c(function(e,r){var n=s.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},n.onsuccess=function(){var t=n.result;t&&t.close(),e(t)}});return i.then(function(t){r.db=t;for(var e=0;e<n.length;e++)S(n[e]._dbInfo)}).catch(function(e){throw(O(t,e)||c.resolve()).catch(function(){}),e})})}else n=c.reject("Invalid arguments");return l(n,e),n}var Q={_driver:"asyncStorage",_initStorage:C,_support:a(),iterate:F,getItem:M,setItem:U,removeItem:L,clear:q,length:W,key:J,keys:K,dropInstance:V};function G(){return"function"==typeof openDatabase}var H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$="~~local_forage_type~",X=/^~~local_forage_type~([^~]+)~/,Y="__lfsc__:",Z=Y.length,tt="arbf",et="blob",rt="si08",nt="ui08",ot="uic8",it="si16",st="si32",at="ur16",ut="ui32",ct="fl32",lt="fl64",ft=Z+tt.length,ht=Object.prototype.toString;function dt(t){var e,r,n,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),l=new Uint8Array(c);for(e=0;e<a;e+=4)r=H.indexOf(t[e]),n=H.indexOf(t[e+1]),o=H.indexOf(t[e+2]),i=H.indexOf(t[e+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|o>>2,l[u++]=(3&o)<<6|63&i;return c}function vt(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=H[r[e]>>2],n+=H[(3&r[e])<<4|r[e+1]>>4],n+=H[(15&r[e+1])<<2|r[e+2]>>6],n+=H[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function pt(t,e){var r="";if(t&&(r=ht.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===ht.call(t.buffer))){var n,o=Y;t instanceof ArrayBuffer?(n=t,o+=tt):(n=t.buffer,"[object Int8Array]"===r?o+=rt:"[object Uint8Array]"===r?o+=nt:"[object Uint8ClampedArray]"===r?o+=ot:"[object Int16Array]"===r?o+=it:"[object Uint16Array]"===r?o+=at:"[object Int32Array]"===r?o+=st:"[object Uint32Array]"===r?o+=ut:"[object Float32Array]"===r?o+=ct:"[object Float64Array]"===r?o+=lt:e(new Error("Failed to get type for BinaryArray"))),e(o+vt(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=$+t.type+"~"+vt(this.result);e(Y+et+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}}function yt(t){if(t.substring(0,Z)!==Y)return JSON.parse(t);var e,r=t.substring(ft),n=t.substring(Z,ft);if(n===et&&X.test(r)){var o=r.match(X);e=o[1],r=r.substring(o[0].length)}var i=dt(r);switch(n){case tt:return i;case et:return u([i],{type:e});case rt:return new Int8Array(i);case nt:return new Uint8Array(i);case ot:return new Uint8ClampedArray(i);case it:return new Int16Array(i);case at:return new Uint16Array(i);case st:return new Int32Array(i);case ut:return new Uint32Array(i);case ct:return new Float32Array(i);case lt:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}var bt={serialize:pt,deserialize:yt,stringToBuffer:dt,bufferToString:vt};function gt(t,e,r,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function mt(t){var e=this,r={db:null};if(t)for(var n in t)r[n]="string"!=typeof t[n]?t[n].toString():t[n];var o=new c(function(t,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(t){return n(t)}r.db.transaction(function(o){gt(o,r,function(){e._dbInfo=r,t()},function(t,e){n(e)})},n)});return r.serializer=bt,o}function _t(t,e,r,n,o,i){t.executeSql(r,n,o,function(t,s){s.code===s.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],function(t,a){a.rows.length?i(t,s):gt(t,e,function(){t.executeSql(r,n,o,i)},i)},i):i(t,s)},i)}function wt(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[t],function(t,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),e(n)},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function jt(t,e){var r=this,n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"SELECT * FROM "+o.storeName,[],function(r,n){for(var i=n.rows,s=i.length,a=0;a<s;a++){var u=i.item(a),c=u.value;if(c&&(c=o.serializer.deserialize(c)),void 0!==(c=t(c,u.key,a+1)))return void e(c)}e()},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function It(t,e,r,n){var o=this;t=h(t);var i=new c(function(i,s){o.ready().then(function(){void 0===e&&(e=null);var a=e,u=o._dbInfo;u.serializer.serialize(e,function(e,c){c?s(c):u.db.transaction(function(r){_t(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[t,e],function(){i(a)},function(t,e){s(e)})},function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void i(It.apply(o,[t,a,r,n-1]));s(e)}})})}).catch(s)});return l(i,r),i}function St(t,e,r){return It.apply(this,[t,e,r,1])}function Ot(t,e){var r=this;t=h(t);var n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[t],function(){e()},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function At(t){var e=this,r=new c(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){_t(e,n,"DELETE FROM "+n.storeName,[],function(){t()},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function xt(t){var e=this,r=new c(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){_t(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(e,r){var n=r.rows.item(0).c;t(n)},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function Et(t,e){var r=this,n=new c(function(e,n){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(r){_t(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,r){var n=r.rows.length?r.rows.item(0).key:null;e(n)},function(t,e){n(e)})})}).catch(n)});return l(n,e),n}function Nt(t){var e=this,r=new c(function(t,r){e.ready().then(function(){var n=e._dbInfo;n.db.transaction(function(e){_t(e,n,"SELECT key FROM "+n.storeName,[],function(e,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);t(n)},function(t,e){r(e)})})}).catch(r)});return l(r,t),r}function kt(t){return new c(function(e,r){t.transaction(function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);e({db:t,storeNames:o})},function(t,e){r(e)})},function(t){r(t)})})}function Bt(t,e){e=d.apply(this,arguments);var r=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||r.name,t.storeName=t.storeName||r.storeName);var n,o=this;return l(n=t.name?new c(function(e){var n;n=t.name===r.name?o._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(kt(n))}).then(function(t){return new c(function(e,r){t.db.transaction(function(n){function o(t){return new c(function(e,r){n.executeSql("DROP TABLE IF EXISTS "+t,[],function(){e()},function(t,e){r(e)})})}for(var i=[],s=0,a=t.storeNames.length;s<a;s++)i.push(o(t.storeNames[s]));c.all(i).then(function(){e()}).catch(function(t){r(t)})},function(t){r(t)})})}):c.reject("Invalid arguments"),e),n}var Rt={_driver:"webSQLStorage",_initStorage:mt,_support:G(),iterate:jt,getItem:wt,setItem:St,removeItem:Ot,clear:At,length:xt,key:Et,keys:Nt,dropInstance:Bt};function Pt(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function zt(t,e){var r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}function Dt(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}function Tt(){return!Dt()||localStorage.length>0}function Ct(t){var e=this,r={};if(t)for(var n in t)r[n]=t[n];return r.keyPrefix=zt(t,e._defaultConfig),Tt()?(e._dbInfo=r,r.serializer=bt,c.resolve()):c.reject()}function Mt(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(t)&&localStorage.removeItem(n)}});return l(r,t),r}function Ft(t,e){var r=this;t=h(t);var n=r.ready().then(function(){var e=r._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n});return l(n,e),n}function Ut(t,e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=e.keyPrefix,o=n.length,i=localStorage.length,s=1,a=0;a<i;a++){var u=localStorage.key(a);if(0===u.indexOf(n)){var c=localStorage.getItem(u);if(c&&(c=e.serializer.deserialize(c)),void 0!==(c=t(c,u.substring(o),s++)))return c}}});return l(n,e),n}function Lt(t,e){var r=this,n=r.ready().then(function(){var e,n=r._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(n.keyPrefix.length)),e});return l(n,e),n}function qt(t){var e=this,r=e.ready().then(function(){for(var t=e._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(t.keyPrefix)&&n.push(i.substring(t.keyPrefix.length))}return n});return l(r,t),r}function Wt(t){var e=this.keys().then(function(t){return t.length});return l(e,t),e}function Jt(t,e){var r=this;t=h(t);var n=r.ready().then(function(){var e=r._dbInfo;localStorage.removeItem(e.keyPrefix+t)});return l(n,e),n}function Kt(t,e,r){var n=this;t=h(t);var o=n.ready().then(function(){void 0===e&&(e=null);var r=e;return new c(function(o,i){var s=n._dbInfo;s.serializer.serialize(e,function(e,n){if(n)i(n);else try{localStorage.setItem(s.keyPrefix+t,e),o(r)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||i(t),i(t)}})})});return l(o,r),o}function Vt(t,e){if(e=d.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var r=this.config();t.name=t.name||r.name,t.storeName=t.storeName||r.storeName}var n,o=this;return n=t.name?new c(function(e){t.storeName?e(zt(t,o._defaultConfig)):e(t.name+"/")}).then(function(t){for(var e=localStorage.length-1;e>=0;e--){var r=localStorage.key(e);0===r.indexOf(t)&&localStorage.removeItem(r)}}):c.reject("Invalid arguments"),l(n,e),n}var Qt={_driver:"localStorageWrapper",_initStorage:Ct,_support:Pt(),iterate:Ut,getItem:Ft,setItem:Kt,removeItem:Jt,clear:Mt,length:Wt,key:Lt,keys:qt,dropInstance:Vt},Gt=function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},Ht=function(t,e){for(var r=t.length,n=0;n<r;){if(Gt(t[n],e))return!0;n++}return!1},$t=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Xt={},Yt={},Zt={INDEXEDDB:Q,WEBSQL:Rt,LOCALSTORAGE:Qt},te=[Zt.INDEXEDDB._driver,Zt.WEBSQL._driver,Zt.LOCALSTORAGE._driver],ee=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ee),ne={description:"",driver:te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oe(t,e){t[e]=function(){var r=arguments;return t.ready().then(function(){return t[e].apply(t,r)})}}function ie(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var r in e)e.hasOwnProperty(r)&&($t(e[r])?arguments[0][r]=e[r].slice():arguments[0][r]=e[r])}return arguments[0]}var se=function(){function t(e){for(var r in o(this,t),Zt)if(Zt.hasOwnProperty(r)){var n=Zt[r],i=n._driver;this[r]=i,Xt[i]||this.defineDriver(n)}this._defaultConfig=ie({},ne),this._config=ie({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":n(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,r){var n=new c(function(e,r){try{var n=t._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void r(o);for(var i=re.concat("_initStorage"),s=0,a=i.length;s<a;s++){var u=i[s];if((!Ht(ee,u)||t[u])&&"function"!=typeof t[u])return void r(o)}var f=function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),r=c.reject(e);return l(r,arguments[arguments.length-1]),r}},r=0,n=ee.length;r<n;r++){var o=ee[r];t[o]||(t[o]=e(o))}};f();var h=function(r){Xt[n]&&console.info("Redefining LocalForage driver: "+n),Xt[n]=t,Yt[n]=r,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(h,r):h(!!t._support):h(!0)}catch(t){r(t)}});return f(n,e,r),n},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,r){var n=Xt[t]?c.resolve(Xt[t]):c.reject(new Error("Driver not found."));return f(n,e,r),n},t.prototype.getSerializer=function(t){var e=c.resolve(bt);return f(e,t),e},t.prototype.ready=function(t){var e=this,r=e._driverSet.then(function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready});return f(r,t,t),r},t.prototype.setDriver=function(t,e,r){var n=this;$t(t)||(t=[t]);var o=this._getSupportedDrivers(t);function i(){n._config.driver=n.driver()}function s(t){return n._extend(t),i(),n._ready=n._initStorage(n._config),n._ready}function a(t){return function(){var e=0;function r(){for(;e<t.length;){var o=t[e];return e++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(s).catch(r)}i();var a=new Error("No available storage method found.");return n._driverSet=c.reject(a),n._driverSet}return r()}}var u=null!==this._driverSet?this._driverSet.catch(function(){return c.resolve()}):c.resolve();return this._driverSet=u.then(function(){var t=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(t).then(function(t){n._driver=t._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=a(o)})}).catch(function(){i();var t=new Error("No available storage method found.");return n._driverSet=c.reject(t),n._driverSet}),f(this._driverSet,e,r),this._driverSet},t.prototype.supports=function(t){return!!Yt[t]},t.prototype._extend=function(t){ie(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t[r];this.supports(o)&&e.push(o)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=re.length;t<e;t++)oe(this,re[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),ae=new se;e.exports=ae},{3:3}]},{},[4])(4)}(mr)),mr.exports}var wr=yr(_r());function jr(t,e,r){(void 0!==r&&!de(t[e],r)||void 0===r&&!(e in t))&&Oe(t,e,r)}var Ir=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),s=i.length;s--;){var a=i[++n];if(!1===e(o[a],a,o))break}return t};var Sr=Function.prototype,Or=Object.prototype,Ar=Sr.toString,xr=Or.hasOwnProperty,Er=Ar.call(Object);function Nr(t){if(!H(t)||"[object Object]"!=b(t))return!1;var e=We(t);if(null===e)return!0;var r=xr.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ar.call(r)==Er}function kr(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Br(t,e,r,n,o,i,s){var a=kr(t,r),u=kr(e,r),c=s.get(u);if(c)jr(t,r,c);else{var l,f=i?i(a,u,r+"",t,e,s):void 0,h=void 0===f;if(h){var d=et(u),v=!d&&at(u),p=!d&&!v&&pt(u);f=u,d||v||p?et(a)?f=a:H(l=a)&&nt(l)?f=Ce(a):v?(h=!1,f=Te(u,!0)):p?(h=!1,f=tr(u,!0)):f=[]:Nr(u)||tt(u)?(f=a,tt(a)?f=function(t){return Ee(t,Be(t))}(a):g(a)&&!m(a)||(f=or(u))):h=!1}h&&(s.set(u,f),o(f,u,n,i,s),s.delete(u)),jr(t,r,f)}}function Rr(t,e,r,n,o){t!==e&&Ir(e,function(i,s){if(o||(o=new Ie),g(i))Br(t,e,s,r,Rr,n,o);else{var a=n?n(kr(t,s),i,s+"",t,e,o):void 0;void 0===a&&(a=i),jr(t,s,a)}},Be)}function Pr(t){return t}var zr=Math.max;function Dr(t,e,r){return e=zr(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=zr(n.length-e,0),s=Array(i);++o<i;)s[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=r(s),function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}(t,this,a)}}function Tr(t){return function(){return t}}var Cr=Se?function(t,e){return Se(t,"toString",{configurable:!0,enumerable:!1,value:Tr(e),writable:!0})}:Pr,Mr=Date.now;var Fr,Ur,Lr,qr=(Fr=Cr,Ur=0,Lr=0,function(){var t=Mr(),e=16-(t-Lr);if(Lr=t,e>0){if(++Ur>=800)return arguments[0]}else Ur=0;return Fr.apply(void 0,arguments)});function Wr(t,e){return qr(Dr(t,e,Pr),t+"")}function Jr(t,e,r){if(!g(r))return!1;var n=typeof e;return!!("number"==n?nt(r)&&mt(e,r.length):"string"==n&&e in r)&&de(r[e],t)}function Kr(t){return Wr(function(e,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,s&&Jr(r[0],r[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var a=r[n];a&&t(e,a,n,i)}return e})}var Vr=Kr(function(t,e,r){Rr(t,e,r)}),Qr=Kr(function(t,e,r,n){Rr(t,e,r,n)});function Gr(){let t,e=()=>{},r=()=>{};if("function"==typeof Promise.withResolvers){const{promise:n,resolve:o,reject:i}=Promise.withResolvers();t=n,e=o,r=i}else t=new Promise((t,n)=>{e=t,r=n});return Object.assign(t,{isResolved:!1,isPending:!0,isRejected:!1,resolve:e,reject:r}),t.then(e=>(t.isResolved=!0,t.isPending=!1,t.isRejected=!1,e),e=>{throw t.isResolved=!1,t.isPending=!1,t.isRejected=!0,e}),t}const Hr=Math.max,$r=Math.min;function Xr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?0:e}return 0}function Yr(t,e,r={}){let n,o,i,s,a,u,c=0,l=!1,f=r.promise?Gr():null;if("function"!=typeof t)throw new TypeError("Expected a function");function h(e){const i=n,a=o,u=f;return n=o=void 0,c=e,s=t.apply(a,i),r.promise&&(u.resolve(s),f=Gr()),r.promise?u:s}function d(t){const r=t-u;return void 0===u||r>=e||r<0||l&&t-c>=i}function v(){const t=Date.now();if(d(t))return p(t);a=setTimeout(v,function(t){const r=e-(t-u);return l?$r(r,i-(t-c)):r}(t))}function p(t){return a=void 0,n?h(t):(n=o=void 0,r.promise?f:s)}function y(t,e){if(Array.isArray(t)&&Array.isArray(e))return r?.dedupeArrays?t.concat(e.filter(e=>-1===t.indexOf(e))):t.concat(e)}function b(){const t=Date.now(),i=d(t);var p;if(p=Array.from(arguments),n=n?.length?p.length?r?.concatArrays||r?.dedupeArrays?Qr(n,p,y):Vr(n,p):n:p||[],o=this,u=t,i){if(void 0===a)return function(t){return c=t,a=setTimeout(v,e),r.promise?f:s}(u);if(l)return clearTimeout(a),a=setTimeout(v,e),h(u)}return void 0===a&&(a=setTimeout(v,e)),r.promise?f:s}return e=Xr(e)||0,function(t){const e=typeof t;return null!=t&&("object"===e||"function"===e)}(r)&&(l="maxWait"in r,i=l?Hr(Xr(r.maxWait)||0,e):i),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=u=o=a=void 0},b.flush=function(){return void 0===a?s:p(Date.now())},b}function Zr(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function tn(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function en(t){return"string"!=typeof t&&(console.warn(`${t} used as a key, but it is not a string.`),t=String(t)),t}var rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nn=/^~~local_forage_type~([^~]+)~/,on="__lfsc__:",sn="arbf",an="blob",un="si08",cn="ui08",ln="uic8",fn="si16",hn="si32",dn="ur16",vn="ui32",pn="fl32",yn="fl64",bn=Object.prototype.toString;function gn(t){var e,r=new Uint8Array(t),n="";for(e=0;e<r.length;e+=3)n+=rn[r[e]>>2],n+=rn[(3&r[e])<<4|r[e+1]>>4],n+=rn[(15&r[e+1])<<2|r[e+2]>>6],n+=rn[63&r[e+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function mn(t,e){let r=t.name+"/";return t.storeName!==e.storeName&&(r+=t.storeName+"/"),r}const _n={keyPrefix:"",serializer:{serialize:function(t,e){var r="";if(t&&(r=bn.call(t)),t&&("[object ArrayBuffer]"===r||t.buffer&&"[object ArrayBuffer]"===bn.call(t.buffer))){var n,o=on;t instanceof ArrayBuffer?(n=t,o+=sn):(n=t.buffer,"[object Int8Array]"===r?o+=un:"[object Uint8Array]"===r?o+=cn:"[object Uint8ClampedArray]"===r?o+=ln:"[object Int16Array]"===r?o+=fn:"[object Uint16Array]"===r?o+=dn:"[object Int32Array]"===r?o+=hn:"[object Uint32Array]"===r?o+=vn:"[object Float32Array]"===r?o+=pn:"[object Float64Array]"===r?o+=yn:e(new Error("Failed to get type for BinaryArray"))),e(o+gn(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r="~~local_forage_type~"+t.type+"~"+gn(this.result);e(on+an+r)},i.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(r){console.error("Couldn't convert value into a JSON string: ",t),e(null,r)}},deserialize:function(t){if(t.substring(0,9)!==on)return JSON.parse(t);var e,r=t.substring(13),n=t.substring(9,13);if(n===an&&nn.test(r)){var o=r.match(nn);e=o[1],r=r.substring(o[0].length)}var i=function(t){var e,r,n,o,i,s=.75*t.length,a=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var c=new ArrayBuffer(s),l=new Uint8Array(c);for(e=0;e<a;e+=4)r=rn.indexOf(t[e]),n=rn.indexOf(t[e+1]),o=rn.indexOf(t[e+2]),i=rn.indexOf(t[e+3]),l[u++]=r<<2|n>>4,l[u++]=(15&n)<<4|o>>2,l[u++]=(3&o)<<6|63&i;return c}(r);switch(n){case sn:return i;case an:return function(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)r.append(t[n]);return r.getBlob(e.type)}}([i],{type:e});case un:return new Int8Array(i);case cn:return new Uint8Array(i);case ln:return new Uint8ClampedArray(i);case fn:return new Int16Array(i);case dn:return new Uint16Array(i);case hn:return new Int32Array(i);case vn:return new Uint32Array(i);case pn:return new Float32Array(i);case yn:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}}};const wn={_driver:"sessionStorageWrapper",_initStorage:function(t){if(_n.keyPrefix=mn(t,this._defaultConfig),t)for(const e in t)_n[e]=t[e]},_support:function(){try{if(sessionStorage&&"setItem"in sessionStorage)return!0}catch(t){console.log(t)}return!1}(),iterate:function(t,e){const r=this.ready().then(function(){const e=_n.keyPrefix,r=e.length,n=sessionStorage.length;let o=1;for(let i=0;i<n;i++){const n=sessionStorage.key(i);if(!n||0!==n.indexOf(e))continue;const s=sessionStorage.getItem(n),a=s?_n.serializer.deserialize(s):s,u=t(a,n.substring(r),o++);if(void 0!==u)return u}});return Zr(r,e),r},getItem:function(t,e){t=en(t);const r=this.ready().then(function(){const e=sessionStorage.getItem(_n.keyPrefix+t);return e?_n.serializer.deserialize(e):null});return Zr(r,e),r},setItem:async function(t,e,r){t=en(t),await this.ready();const n=e=e??null;return new Promise((o,i)=>{_n.serializer.serialize(e,(e,s)=>{if(s)return i(s),void Zr(Promise.reject(s),r);try{sessionStorage.setItem(_n.keyPrefix+t,e),o(n),Zr(Promise.resolve(n),r)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||console.error("Your sessionStorage capacity is used up."),i(t),Zr(Promise.reject(t),r)}})})},removeItem:function(t,e){t=en(t);const r=this.ready().then(function(){sessionStorage.removeItem(_n.keyPrefix+t)});return Zr(r,e),r},clear:function(t){const e=this.ready().then(function(){const t=_n.keyPrefix;for(let e=sessionStorage.length-1;e>=0;e--){const r=sessionStorage.key(e);r&&0===r.indexOf(t)&&sessionStorage.removeItem(r)}});return Zr(e,t),e},length:function(t){const e=this.keys().then(function(t){return t.length});return Zr(e,t),e},key:function(t,e){const r=this.ready().then(function(){let e;try{e=sessionStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(_n.keyPrefix.length)),e});return Zr(r,e),r},keys:function(t){const e=this.ready().then(function(){const t=sessionStorage.length,e=[];for(let r=0;r<t;r++){const t=sessionStorage.key(r);t&&0===t.indexOf(_n.keyPrefix)&&e.push(t.substring(_n.keyPrefix.length))}return e});return Zr(e,t),e},dropInstance:function(t,e){if(e=tn.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){const e=this.config();t.name=t.name||e.name,t.storeName=t.storeName||e.storeName}const r=this;let n;return n=t.name?new Promise(function(e){t.storeName?e(mn(t,r._defaultConfig)):e(`${t.name}/`)}).then(function(t){for(let e=sessionStorage.length-1;e>=0;e--){const r=sessionStorage.key(e);r&&0===r.indexOf(t)&&sessionStorage.removeItem(r)}}):Promise.reject(new Error("Invalid arguments")),Zr(n,e),n}};var jn,In={exports:{}};var Sn=(jn||(jn=1,function(t,e){!function(t,e){function r(t){return r.result?r.result:t&&"function"==typeof t.getSerializer?(r.result=t.getSerializer(),r.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function n(t,e){e&&t.then(function(t){e(null,t)},function(t){e(t)})}function o(t,e,r,n){function o(t,e){var r=t||e;return t&&"function"==typeof t||"string"!=typeof r||(t=function(t){return t[r]}),t}var i=[];if("[object Array]"===Object.prototype.toString.call(t)){e=o(e,"key"),r=o(r,"value");for(var s=0,a=t.length;s<a;s++){var u=t[s];i.push(n(e(u),r(u)))}}else for(var c in t)t.hasOwnProperty(c)&&i.push(n(c,t[c]));return i}function i(t,e,r,i){var s=this,a=s.ready().then(function(){return new Promise(function(n,i){var a,u=s._dbInfo,c=u.db.transaction(u.storeName,"readwrite"),l=c.objectStore(u.storeName);function f(t){var e=t.target||this;a=e.error||e.transaction.error,i(a)}c.oncomplete=function(){n(t)},c.onabort=c.onerror=function(t){i(a||t.target)},o(t,e,r,function(t,e){null===e&&(e=void 0),l.put(e,t).onerror=f})})});return n(a,i),a}function s(t,e,i,s){var a=this,u=new Promise(function(n,s){a.ready().then(function(){return r(a)}).then(function(r){var u=a._dbInfo;u.db.transaction(function(a){var c="INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",l=o(t,e,i,function(t,e){return new Promise(function(n,o){r.serialize(e,function(e,r){r?o(r):a.executeSql(c,[t,e],function(){n()},function(t,e){o(e)})})})});Promise.all(l).then(function(){n(t)},s)},function(t){s(t)})}).catch(s)});return n(u,s),u}function a(t,e,r,i){var s=this,a=o(t,e,r,function(t,e){return s.setItem(t,e)}),u=Promise.all(a);return n(u,i),u}function u(t,e,r,n){var o=this,u=o.driver();return u===o.INDEXEDDB?i.call(o,t,e,r,n):u===o.WEBSQL?s.call(o,t,e,r,n):a.call(o,t,e,r,n)}function c(t){var e=Object.getPrototypeOf(t);e&&(e.setItems=u,e.setItems.indexedDB=function(){return i.apply(this,arguments)},e.setItems.websql=function(){return s.apply(this,arguments)},e.setItems.generic=function(){return a.apply(this,arguments)})}var l=c(e="default"in e?e.default:e);t.setItemsGeneric=a,t.localforageSetItems=u,t.extendPrototype=c,t.extendPrototypeResult=l,Object.defineProperty(t,"__esModule",{value:!0})}(e,_r())}(0,In.exports)),In.exports);function On(t){return On.result?On.result:t&&"function"==typeof t.getSerializer?(On.result=t.getSerializer(),On.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function An(t,e){return e&&t.then(function(t){e(null,t)},function(t){e(t)}),t}function xn(t,e){var r=this.getItem(t).then(function(e){return{key:t,value:e}});return An(r,e),r}function En(t){var e=this,r=new Promise(function(r,n){for(var o=[],i=0,s=t.length;i<s;i++)o.push(xn.call(e,t[i]));Promise.all(o).then(function(t){for(var e={},n=0,o=t.length;n<o;n++){var i=t[n];e[i.key]=i.value}r(e)}).catch(n)});return r}function Nn(){var t={};return this.iterate(function(e,r){t[r]=e}).then(function(){return t})}var kn="undefined"!=typeof IDBKeyRange?IDBKeyRange:"undefined"!=typeof webkitIDBKeyRange?webkitIDBKeyRange:"undefined"!=typeof mozIDBKeyRange?mozIDBKeyRange:void 0;function Bn(t){t=t.slice();var e=this;function r(t,e){return t<e?-1:t>e?1:0}var n=new Promise(function(n,o){e.ready().then(function(){var i,s=e._dbInfo,a=s.db.transaction(s.storeName,"readonly").objectStore(s.storeName),u=t.sort(r),c=kn.bound(t[0],t[t.length-1],!1,!1);if("getAll"in a)(i=a.getAll(c)).onsuccess=function(){var t=i.result;void 0===t&&(t=null),n(t)};else{i=a.openCursor(c);var l={},f=0;i.onsuccess=function(){var t=i.result;if(t){for(var e=t.key;e>u[f];)if(++f===u.length)return void n(l);if(e===u[f]){var r=t.value;void 0===r&&(r=null),l[e]=r,t.continue()}else t.continue(u[f])}else n(l)}}i.onerror=function(){o(i.error)}}).catch(o)});return n}function Rn(t){var e=this,r=new Promise(function(r,n){e.ready().then(function(){return On(e)}).then(function(o){var i=e._dbInfo;i.db.transaction(function(e){for(var s=new Array(t.length),a=0,u=t.length;a<u;a++)s[a]="?";e.executeSql("SELECT * FROM "+i.storeName+" WHERE (key IN ("+s.join(",")+"))",t,function(t,e){for(var n={},i=e.rows,s=0,a=i.length;s<a;s++){var u=i.item(s),c=u.value;c&&(c=o.deserialize(c)),n[u.key]=c}r(n)},function(t,e){n(e)})})}).catch(n)});return r}function Pn(t,e){var r,n=this;if(arguments.length&&null!==t){var o=n.driver();r=o===n.INDEXEDDB?Bn.apply(n,arguments):o===n.WEBSQL?Rn.apply(n,arguments):En.apply(n,arguments)}else r=Nn.apply(n);return An(r,e),r}function zn(t){var e=Object.getPrototypeOf(t);e&&(e.getItems=Pn,e.getItems.indexedDB=function(){return Bn.apply(this,arguments)},e.getItems.websql=function(){return Rn.apply(this,arguments)},e.getItems.generic=function(){return En.apply(this,arguments)})}zn(wr);var Dn=Object.prototype.hasOwnProperty;function Tn(t,e){return null!=t&&Dn.call(t,e)}var Cn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mn=/^\w*$/;function Fn(t,e){if(et(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!St(t))||(Mn.test(t)||!Cn.test(t)||null!=e&&t in Object(e))}function Un(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(Un.Cache||je),r}Un.Cache=je;var Ln=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qn=/\\(\\)?/g,Wn=function(t){var e=Un(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ln,function(t,r,n,o){e.push(n?o.replace(qn,"$1"):r||t)}),e});function Jn(t,e){return et(t)?t:Fn(t,e)?[t]:Wn(Et(t))}function Kn(t){if("string"==typeof t||St(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Vn(t,e,r){for(var n=-1,o=(e=Jn(e,t)).length,i=!1;++n<o;){var s=Kn(e[n]);if(!(i=null!=t&&r(t,s)))break;t=t[s]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&rt(o)&&mt(s,o)&&(et(t)||tt(t))}function Qn(t,e,r){var n=-1,o=(e=Jn(e,t)).length;for(o||(o=1,t=void 0);++n<o;){var i=null==t?void 0:t[Kn(e[n])];void 0===i&&(n=o,i=r),t=m(i)?i.call(t):i}return t}function Gn(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Hn(){const t={isResolved:!1,isPending:!0,isRejected:!1,resolve:null,reject:null},e=new Promise((e,r)=>{t.resolve=e,t.reject=r});return Object.assign(e,t),e.then(function(t){return e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t},function(t){throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t}),e}function $n(){throw new Error('A "url" property or function must be specified')}function Xn(t,e){const r=e.error;e.error=function(n){r&&r.call(e.context,t,n,e),t.trigger("error",t,n,e)}}const Yn={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function Zn(t){const e=Qn(t,"browserStorage")||Qn(t.collection,"browserStorage");return e?e.sync():to}function to(t,e,r={}){let n=r.data;null!=n||!e||"create"!==t&&"update"!==t&&"patch"!==t||(n=r.attrs||e.toJSON());const o={method:Yn[t],body:n?JSON.stringify(n):"",headers:{"Content-Type":"application/json"},success:r.success,error:r.error},i=r.url||Qn(e,"url")||$n(),s=fetch(i,o);return r&&(r.xhr=s),e.trigger("request",e,s,{...o,xhr:s}),s}const eo=ce;wr.defineDriver(he),Sn.extendPrototype(wr),zn(wr);class ro{constructor(t,e,r=!1){if("local"===e&&!window.localStorage)throw new Error("Skeletor.storage: Environment does not support localStorage.");if("session"===e&&!window.sessionStorage)throw new Error("Skeletor.storage: Environment does not support sessionStorage.");vr(e)?this.storeInitialized=this.initStore(e,r):(this.store=e,r&&(this.store.debouncedSetItems=Yr(t=>this.store.setItems(t),50,{promise:!0})),this.storeInitialized=Promise.resolve()),this.name=t}async initStore(t,e){if("session"===t)await wr.setDriver(wn._driver);else if("local"===t)await wr.config({driver:wr.LOCALSTORAGE});else if("in_memory"===t)await wr.config({driver:eo});else if("indexed"!==t)throw new Error("Skeletor.storage: No storage type was specified");this.store=wr,e&&(this.store.debouncedSetItems=Yr(t=>this.store.setItems(t),50,{promise:!0}))}flush(){this.store.debouncedSetItems&&"function"==typeof this.store.debouncedSetItems.flush&&this.store.debouncedSetItems.flush()}async clear(){await this.store.removeItem(this.name).catch(t=>console.error(t));const t=new RegExp(`^${this.name}-`),e=(await this.store.keys()).filter(e=>t.test(e));await Promise.all(e.map(t=>this.store.removeItem(t).catch(t=>console.error(t))))}sync(){const t=this;async function e(e,r,n){let o,i,s,a;const u=r.collection;["patch","update"].includes(e)&&(a=dr(r.attributes,5)),await t.storeInitialized;try{const i=r.attributes;switch(e){case"read":o=void 0!==r.id?await t.find(r):await t.findAll();break;case"create":o=await t.create(r,n);break;case"patch":case"update":n.wait&&(r.attributes=a),s=t.update(r),n.wait&&(r.attributes=i),o=await s;break;case"delete":o=await t.destroy(r,u)}}catch(e){const r=await t.getStorageSize();i=22===e.code&&0===r?"Private browsing is unsupported":e.message}if(o){if(n&&n.success){const t="read"===e?o:null;n.success(t,n)}}else i=i||"Record Not Found",n&&n.error&&n.error(i)}return e.__name__="localSync",e}removeCollectionReference(t,e){if(!e)return;const r=e.filter(e=>e.id!==t.id).map(t=>this.getItemName(t.id));return this.store.setItem(this.name,r)}addCollectionReference(t,e){if(!e)return;const r=e.map(t=>this.getItemName(t.id)),n=this.getItemName(t.id);return r.includes(n)||r.push(n),this.store.setItem(this.name,r)}getCollectionReferenceData(t){if(!t.collection)return{};const e=t.collection.map(t=>this.getItemName(t.id)),r=this.getItemName(t.id);e.includes(r)||e.push(r);const n={};return n[this.name]=e,n}async save(t){if(this.store.setItems){const e={};return e[this.getItemName(t.id)]=t.toJSON(),Object.assign(e,this.getCollectionReferenceData(t)),this.store.debouncedSetItems?this.store.debouncedSetItems(e):this.store.setItems(e)}{const e=this.getItemName(t.id),r=await this.store.setItem(e,t.toJSON());return await this.addCollectionReference(t,t.collection),r}}create(t,e){return t.id||(t.id=Gn()+Gn()+"-"+Gn()+"-"+Gn()+"-"+Gn()+"-"+Gn()+Gn()+Gn(),t.set(t.idAttribute,t.id,e)),this.save(t)}update(t){return this.save(t)}find(t){return this.store.getItem(this.getItemName(t.id))}async findAll(){const t=await this.store.getItem(this.name);if(t?.length){const e=await this.store.getItems(t);return Object.values(e)}return[]}async destroy(t,e){return await this.flush(),await this.store.removeItem(this.getItemName(t.id)),await this.removeCollectionReference(t,e),t}async getStorageSize(){return await this.store.length()}getItemName(t){return this.name+"-"+t}}ro.sessionStorageInitialized=wr.defineDriver(wn),ro.localForage=wr;function no(t){return dr(t,4)}function oo(t,e,r,n){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(n,s,r(s),t)}return n}function io(t,e){return t&&Ir(t,e,jt)}var so,ao=(so=io,function(t,e){if(null==t)return t;if(!nt(t))return so(t,e);for(var r=t.length,n=-1,o=Object(t);++n<r&&!1!==e(o[n],n,o););return t});function uo(t,e,r,n){return ao(t,function(t,o,i){e(n,t,r(t),i)}),n}function co(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new je;++e<r;)this.add(t[e])}function lo(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function fo(t,e){return t.has(e)}co.prototype.add=co.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},co.prototype.has=function(t){return this.__data__.has(t)};function ho(t,e,r,n,o,i){var s=1&r,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,d=2&r?new co:void 0;for(i.set(t,e),i.set(e,t);++f<a;){var v=t[f],p=e[f];if(n)var y=s?n(p,v,f,e,t,i):n(v,p,f,t,e,i);if(void 0!==y){if(y)continue;h=!1;break}if(d){if(!lo(e,function(t,e){if(!fo(d,e)&&(v===t||o(v,t,r,n,i)))return d.push(e)})){h=!1;break}}else if(v!==p&&!o(v,p,r,n,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function vo(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function po(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var yo=l?l.prototype:void 0,bo=yo?yo.valueOf:void 0;var go=Object.prototype.hasOwnProperty;var mo="[object Arguments]",_o="[object Array]",wo="[object Object]",jo=Object.prototype.hasOwnProperty;function Io(t,e,r,n,o,i){var s=et(t),a=et(e),u=s?_o:G(t),c=a?_o:G(e),l=(u=u==mo?wo:u)==wo,f=(c=c==mo?wo:c)==wo,h=u==c;if(h&&at(t)){if(!at(e))return!1;s=!0,l=!1}if(h&&!l)return i||(i=new Ie),s||pt(t)?ho(t,e,r,n,o,i):function(t,e,r,n,o,i,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new He(t),new He(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return de(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=vo;case"[object Set]":var u=1&n;if(a||(a=po),t.size!=e.size&&!u)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var l=ho(a(t),a(e),n,o,i,s);return s.delete(t),l;case"[object Symbol]":if(bo)return bo.call(t)==bo.call(e)}return!1}(t,e,u,r,n,o,i);if(!(1&r)){var d=l&&jo.call(t,"__wrapped__"),v=f&&jo.call(e,"__wrapped__");if(d||v){var p=d?t.value():t,y=v?e.value():e;return i||(i=new Ie),o(p,y,r,n,i)}}return!!h&&(i||(i=new Ie),function(t,e,r,n,o,i){var s=1&r,a=Ve(t),u=a.length;if(u!=Ve(e).length&&!s)return!1;for(var c=u;c--;){var l=a[c];if(!(s?l in e:go.call(e,l)))return!1}var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var d=!0;i.set(t,e),i.set(e,t);for(var v=s;++c<u;){var p=t[l=a[c]],y=e[l];if(n)var b=s?n(y,p,l,e,t,i):n(p,y,l,t,e,i);if(!(void 0===b?p===y||o(p,y,r,n,i):b)){d=!1;break}v||(v="constructor"==l)}if(d&&!v){var g=t.constructor,m=e.constructor;g==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m||(d=!1)}return i.delete(t),i.delete(e),d}(t,e,r,n,o,i))}function So(t,e,r,n,o){return t===e||(null==t||null==e||!H(t)&&!H(e)?t!=t&&e!=e:Io(t,e,r,n,So,o))}function Oo(t){return t==t&&!g(t)}function Ao(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function xo(t){var e=function(t){for(var e=jt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Oo(o)]}return e}(t);return 1==e.length&&e[0][2]?Ao(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o;if(null==t)return!i;for(t=Object(t);o--;){var s=r[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var a=(s=r[o])[0],u=t[a],c=s[1];if(s[2]){if(void 0===u&&!(a in t))return!1}else if(!So(c,u,3,n,new Ie))return!1}return!0}(r,0,e)}}function Eo(t,e){for(var r=0,n=(e=Jn(e,t)).length;null!=t&&r<n;)t=t[Kn(e[r++])];return r&&r==n?t:void 0}function No(t,e){return null!=t&&e in Object(t)}function ko(t,e){return null!=t&&Vn(t,e,No)}function Bo(t,e){return Fn(t)&&Oo(e)?Ao(Kn(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Eo(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?ko(r,t):So(e,n,3)}}function Ro(t){return Fn(t)?function(t){return function(e){return null==e?void 0:e[t]}}(Kn(t)):function(t){return function(e){return Eo(e,t)}}(t)}function Po(t){return"function"==typeof t?t:null==t?Pr:"object"==typeof t?et(t)?Bo(t[0],t[1]):xo(t):Ro(t)}function zo(t,e){return function(e,r){return(et(e)?oo:uo)(e,t,Po(r),{})}}var Do=Object.prototype.hasOwnProperty,To=zo(function(t,e,r){Do.call(t,r)?++t[r]:Oe(t,r,1)}),Co=Object.prototype.hasOwnProperty,Mo=zo(function(t,e,r){Co.call(t,r)?t[r].push(e):Oe(t,r,[e])}),Fo=zo(function(t,e,r){Oe(t,r,e)}),Uo=l?l.isConcatSpreadable:void 0;function Lo(t){return et(t)||tt(t)||!!(Uo&&t&&t[Uo])}function qo(t,e,r,n,o){var i=-1,s=t.length;for(r||(r=Lo),o||(o=[]);++i<s;){var a=t[i];r(a)?qe(o,a):o[o.length]=a}return o}function Wo(t,e){if(t!==e){var r=void 0!==t,n=null===t,o=t==t,i=St(t),s=void 0!==e,a=null===e,u=e==e,c=St(e);if(!a&&!c&&!i&&t>e||i&&s&&u&&!a&&!c||n&&s&&u||!r&&u||!o)return 1;if(!n&&!i&&!c&&t<e||c&&r&&o&&!n&&!i||a&&r&&o||!s&&o||!u)return-1}return 0}function Jo(t,e,r){e=e.length?It(e,function(t){return et(t)?function(e){return Eo(e,1===t.length?t[0]:t)}:t}):[Pr];var n=-1;e=It(e,ct(Po));var o=function(t,e){var r=-1,n=nt(t)?Array(t.length):[];return ao(t,function(t,o,i){n[++r]=e(t,o,i)}),n}(t,function(t,r,o){var i=It(e,function(e){return e(t)});return{criteria:i,index:++n,value:t}});return function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(o,function(t,e){return function(t,e,r){for(var n=-1,o=t.criteria,i=e.criteria,s=o.length,a=r.length;++n<s;){var u=Wo(o[n],i[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})}var Ko=Wr(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Jr(t,e[0],e[1])?e=[]:r>2&&Jr(e[0],e[1],e[2])&&(e=[e[0]]),Jo(t,qo(e),[])}),Vo=Object.prototype,Qo=Vo.hasOwnProperty,Go=Wr(function(t,e){t=Object(t);var r=-1,n=e.length,o=n>2?e[2]:void 0;for(o&&Jr(e[0],e[1],o)&&(n=1);++r<n;)for(var i=e[r],s=Be(i),a=-1,u=s.length;++a<u;){var c=s[a],l=t[c];(void 0===l||de(l,Vo[c])&&!Qo.call(t,c))&&(t[c]=i[c])}return t});var Ho=Wr(function(t,e){return function(t,e,r){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout(function(){t.apply(void 0,r)},e)}(t,1,e)});var $o,Xo,Yo=Object.prototype.toString,Zo=($o=function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Yo.call(e)),t[e]=r},Xo=Tr(Pr),function(t,e){return function(t,e,r,n){return io(t,function(t,o,i){e(n,r(t),o,i)}),n}(t,$o,Xo(e),{})});function ti(t,e){return So(t,e)}function ei(t,e){return e.length<2?t:Eo(t,function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}(e,0,-1))}function ri(t,e){return null==(t=ei(t,e=Jn(e,t)))||delete t[Kn(function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}(e))]}function ni(t){return Nr(t)?void 0:t}function oi(t){return(null==t?0:t.length)?qo(t):[]}function ii(t){return qr(Dr(t,void 0,oi),t+"")}var si=ii(function(t,e){var r={};if(null==t)return r;var n=!1;e=It(e,function(e){return e=Jn(e,t),n||(n=e.length>1),e}),Ee(t,Qe(t),r),n&&(r=dr(r,7,ni));for(var o=e.length;o--;)ri(r,e[o]);return r});function ai(t,e,r,n){if(!g(t))return t;for(var o=-1,i=(e=Jn(e,t)).length,s=i-1,a=t;null!=a&&++o<i;){var u=Kn(e[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=s){var l=a[u];void 0===(c=void 0)&&(c=g(l)?l:mt(e[o+1])?[]:{})}xe(a,u,c),a=a[u]}return t}function ui(t,e){return function(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var s=e[n],a=Eo(t,s);r(a,s)&&ai(i,Jn(s,t),a)}return i}(t,e,function(e,r){return ko(t,r)})}var ci,li=ii(function(t,e){return null==t?{}:ui(t,e)});class fi extends Xt{constructor(t,e){super(),this._changing=!1,this._pending=!1,this._url="",this.changed={},this.validationError=null;let r=t||{};e=e||{},this.preinitialize.apply(this,arguments),this.cid=kt(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});const n=Qn(this,"defaults");r=Go(Object.assign({},n,r),n),this.set(r,e),this.initialize.apply(this,arguments),this.changed={}}set browserStorage(t){this._browserStorage=t}get browserStorage(){return this._browserStorage}get idAttribute(){return"id"}get cidPrefix(){return"c"}preinitialize(...t){}initialize(t,e){}validate(t,e){return null}defaults(){return{}}toJSON(){return no(this.attributes)}sync(t,e,r){return Zn(e)(t,e,r)}get(t){return this.attributes[t]}keys(){return Object.keys(this.attributes)}values(){return Object.values(this.attributes)}pairs(){return this.entries()}entries(){return Object.entries(this.attributes)}invert(){return Zo(this.attributes)}pick(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),li(this.attributes,t)}omit(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),si(this.attributes,t)}isEmpty(){return bt(this.attributes)}has(t){return null!=this.get(t)}matches(t){return!!function(t){return Po("function"==typeof t?t:dr(t,1))}(t)(this.attributes)}set(t,e,r){if(null==t)return this;let n;if("object"==typeof t?(n=t,r=e):(n={},n[t]=e),r=r||{},!this._validate(n,r))return!1;const o=r.unset,i=r.silent,s=[],a=this._changing;this._changing=!0,a||(this._previousAttributes=no(this.attributes),this.changed={});const u=this.attributes,c=this.changed,l=this._previousAttributes;for(const t in n)e=n[t],ti(u[t],e)||s.push(t),ti(l[t],e)?delete c[t]:c[t]=e,o?delete u[t]:u[t]=e;if(this.idAttribute in n&&(this.id=this.get(this.idAttribute)),!i){s.length&&(this._pending=r);for(let t=0;t<s.length;t++)this.trigger("change:"+s[t],this,u[s[t]],r)}if(a)return!0;if(!i)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this}unset(t,e){return this.set(t,void 0,Object.assign({},e,{unset:!0}))}clear(t){const e={};for(const t in this.attributes)e[t]=void 0;return this.set(e,Object.assign({},t,{unset:!0}))}hasChanged(t){return null==t?!bt(this.changed):(e=this.changed,r=t,null!=e&&Vn(e,r,Tn));var e,r}changedAttributes(t){if(!t)return!!this.hasChanged()&&no(this.changed);const e=this._changing?this._previousAttributes:this.attributes,r={};let n=!1;for(const o in t){const i=t[o];ti(e[o],i)||(r[o]=i,n=!0)}return!!n&&r}previous(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null}previousAttributes(){return this._previousAttributes?no(this._previousAttributes):void 0}fetch(t={}){const e=(t=Object.assign({parse:!0},t)).success;return t.success=r=>{const n=t.parse?this.parse(r,t):r;if(!this.set(n,t))return!1;e&&e.call(t.context,this,r,t),this.trigger("sync",this,r,t)},Xn(this,t),this.sync("read",this,t)}save(t,e,r){let n;null==t||"object"==typeof t?(n=t,r=e):(n={},n[t]=e);const o=(r=Object.assign({validate:!0,parse:!0},r)).wait,i=r.promise,s=i&&Hn();if(n&&!o){if(!this.set(n,r))return!1}else if(!this._validate(n||{},r))return!1;const a=r.success,u=r.error,c=this.attributes;r.success=t=>{this.attributes=c;let e=r.parse?this.parse(t,r):t;if(o&&(e=Object.assign({},n,e)),e&&!this.set(e,r))return!1;a&&a.call(r.context,this,t,r),this.trigger("sync",this,t,r),i&&s.resolve()},r.error=(t,e,r)=>{u&&u.call(r.context,t,e,r),i&&s.reject(e)},Xn(this,r),n&&o&&(this.attributes=Object.assign({},c,n));const l=this.isNew()?"create":r.patch?"patch":"update";"patch"!==l||r.attrs||(r.attrs=n);const f=this.sync(l,this,r);return this.attributes=c,i?s:f}destroy(t){const e=(t=t?no(t):{}).success,r=t.wait,n=()=>{this.stopListening(),this.trigger("destroy",this,this.collection,t)};t.success=o=>{r&&n(),e&&e.call(t.context,this,o,t),this.isNew()||this.trigger("sync",this,o,t)};let o=!1;return this.isNew()?Ho(t.success):(Xn(this,t),o=this.sync("delete",this,t)),r||n(),o}get urlRoot(){return this._urlRoot}set urlRoot(t){this._urlRoot=t}get url(){if(this._url)return this._url;const t=Qn(this,"urlRoot")||Qn(this.collection,"url")||$n();if(this.isNew())return t;const e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(String(e))}set url(t){this._url=t}parse(t,e){return t}isNew(){return!this.has(this.idAttribute)}isValid(t){return this._validate({},Object.assign({},t,{validate:!0}))}_validate(t,e){if(!e?.validate||!this.validate)return!0;t=Object.assign({},this.attributes,t);const r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,Object.assign(e,{validationError:r})),!1)}}const hi={add:!0,remove:!0,merge:!0},di={add:!0,remove:!1};class vi extends Xt{constructor(t,e){super(),this._url="",this[ci]=this.values,e=e||{},this.preinitialize.apply(this,arguments),e.model&&(this._model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,Object.assign({silent:!0},e)),this[Symbol.iterator]=this.values}get comparator(){return this._comparator}set comparator(t){this._comparator=t}set browserStorage(t){this._browserStorage=t}get browserStorage(){return this._browserStorage}get model(){return this._model??fi}set model(t){this._model=t}get length(){return this.models.length}get url(){return this._url}set url(t){this._url=t}preinitialize(...t){}initialize(...t){}toJSON(){return this.map(function(t){return t.toJSON()})}sync(t,e,r){return Zn(this)(t,e,r)}add(t,e){return this.set(t,Object.assign({merge:!1},e,di))}remove(t,e){e=Object.assign({},e);const r=!Array.isArray(t),n=r?[t]:t.slice(),o=this._removeModels(n,e);return!e.silent&&o.length&&(e.changes={added:[],merged:[],removed:o},this.trigger("update",this,e)),r?o[0]:o}set(t,e){if(null==t)return;(e=Object.assign({},hi,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);const r=!Array.isArray(t);t=r?[t]:t.slice();let n=e.at;null!=n&&(n=+n),n>this.length&&(n=this.length),n<0&&(n+=this.length+1);const o=[],i=[],s=[],a=[],u={},c=e.add,l=e.merge,f=e.remove;let h=!1;const d=this.comparator&&null==n&&!1!==e.sort,v=vr(this.comparator)?this.comparator:null;let p,y;for(y=0;y<t.length;y++){p=t[y];const r=this.get(p);if(r){if(l&&p!==r){let t=this._isModel(p)?p.attributes:p;e.parse&&(t=r.parse(t,e)),r.set(t,e),s.push(r),d&&!h&&(h=r.hasChanged(v))}u[r.cid]||(u[r.cid]=!0,o.push(r)),t[y]=r}else c&&(p=t[y]=this._prepareModel(p,e),p&&(i.push(p),this._addReference(p,e),u[p.cid]=!0,o.push(p)))}if(f){for(y=0;y<this.length;y++)p=this.models[y],u[p.cid]||a.push(p);a.length&&this._removeModels(a,e)}let b=!1;const g=!d&&c&&f;if(o.length&&g)b=this.length!==o.length||this.models.some((t,e)=>t!==o[e]),this.models.length=0,this.models.splice(0,0,...o);else if(i.length){d&&(h=!0);let t=n??this.length;t=Math.min(Math.max(t,0),this.models.length),this.models.splice(t,0,...i)}if(h&&this.sort({silent:!0}),!e.silent){for(y=0;y<i.length;y++)null!=n&&(e.index=n+y),p=i[y],p.trigger("add",p,this,e);(h||b)&&this.trigger("sort",this,e),(i.length||a.length||s.length)&&(e.changes={added:i,removed:a,merged:s},this.trigger("update",this,e))}return r?t[0]:t}async clearStore(t={},e=()=>!0){await Promise.all(this.models.filter(e).map(e=>new Promise(r=>{e.destroy(Object.assign(t,{success:r,error:(t,e)=>{console.error(e),r()}}))}))),await(this.browserStorage?.clear()),this.reset()}reset(t,e){e=e?no(e):{};for(let t=0;t<this.models.length;t++)this._removeReference(this.models[t],e);return e.previousModels=this.models,this._reset(),t=this.add(t,Object.assign({silent:!0},e)),e.silent||this.trigger("reset",this,e),t}push(t,e){return this.add(t,Object.assign({at:this.length},e))}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,Object.assign({at:0},e))}shift(t){const e=this.at(0);return this.remove(e,t)}slice(t,e){return this.models.slice(t,e)}filter(t,e){return this.models.filter(m(t)?t:e=>e.matches(t),e)}every(t){return m(t)?this.models.map(t=>t.attributes).every(t):this.models.every(e=>e.matches(t))}difference(t){return this.models.filter(e=>!t.includes(e))}max(){return Math.max.apply(Math,this.models)}min(){return Math.min.apply(Math,this.models)}drop(t=1){return this.models.slice(t)}some(t){return m(t)?this.models.map(t=>t.attributes).some(t):this.models.some(e=>e.matches(t))}sortBy(t){return Ko(this.models,m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}isEmpty(){return!this.models.length}keyBy(t){return Fo(this.models,t)}each(t,e){return this.forEach(t,e)}forEach(t,e){return this.models.forEach(t,e)}includes(t){return this.models.includes(t)}size(){return this.models.length}countBy(t){return To(this.models,m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}groupBy(t){return Mo(this.models,m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}indexOf(t,e){return this.models.indexOf(t,e)}findLastIndex(t,e){return this.models.findLastIndex(m(t)?t:e=>vr(t)?e.get(t):e.matches(t),e)}lastIndexOf(t,e){return this.models.lastIndexOf(t,e)}findIndex(t){return this.models.findIndex(m(t)?t:e=>vr(t)?e.get(t):e.matches(t))}last(){const t=null==this.models?0:this.models.length;return t?this.models[t-1]:void 0}head(){return this.models[0]}first(){return this.head()}map(t,e){return this.models.map(m(t)?t:e=>vr(t)?e.get(t):e.matches(t),e)}reduce(t,e){return this.models.reduce(t,e||this.models[0])}reduceRight(t,e){return this.models.reduceRight(t,e||this.models[0])}toArray(){return Array.from(this.models)}get(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.models[t]}where(t,e){return this[e?"find":"filter"](t)}findWhere(t){return this.where(t,!0)}find(t,e){const r=m(t)?t:e=>e.matches(t);return this.models.find(r,e)}sort(t){let e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t=t||{};const r=m(e)?e.length:0;return m(e)&&(e=e.bind(this)),1===r||vr(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this}pluck(t){return this.map(t+"")}fetch(t){const e=(t=Object.assign({parse:!0},t)).success,r=this,n=t.promise&&Hn();return t.success=function(o){const i=t.reset?"reset":"set";r[i](o,t),e&&e.call(t.context,r,o,t),n&&n.resolve(),r.trigger("sync",r,o,t)},Xn(this,t),n||this.sync("read",this,t)}create(t,e){const r=(e=e?no(e):{}).wait,n=e.promise,o=n&&Hn(),i=this._prepareModel(t,e);if(!i)return!1;r||this.add(i,e);const s=this,a=e.success,u=e.error;return e.success=function(t,e,i){r&&s.add(t,i),a&&a.call(i.context,t,e,i),n&&o.resolve(t)},e.error=function(t,e,r){u&&u.call(r.context,t,e,r),n&&o.reject(e)},i.save(null,Object.assign(e,{promise:!1})),n?o:i}parse(t,e){return t}modelId(t){return t[this.model.prototype?.idAttribute||"id"]}values(){return new gi(this,pi)}keys(){return new gi(this,yi)}entries(){return new gi(this,bi)}_reset(){this.models=[],this._byId={}}createModel(t,e){return new(0,this.model)(t,e)}_prepareModel(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?no(e):{}).collection=this;const r=this.createModel(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),null):r}_removeModels(t,e){const r=[];for(let n=0;n<t.length;n++){const o=this.get(t[n]);if(!o)continue;const i=this.indexOf(o);this.models.splice(i,1),delete this._byId[o.cid];const s=this.modelId(o.attributes);null!=s&&delete this._byId[s],e?.silent||((e=e||{}).index=i,o.trigger("remove",o,this,e)),r.push(o),this._removeReference(o,e)}return r}_isModel(t){return t instanceof fi}_addReference(t,e){this._byId[t.cid]=t;const r=this.modelId(t.attributes);null!=r&&(this._byId[r]=t),t.on("all",this._onModelEvent,this)}_removeReference(t,e){delete this._byId[t.cid];const r=this.modelId(t.attributes);null!=r&&delete this._byId[r],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)}_onModelEvent(t,e,r,n){if(e){if(("add"===t||"remove"===t)&&r!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){const t=this.modelId(e.previousAttributes()),r=this.modelId(e.attributes);t!==r&&(null!=t&&delete this._byId[t],null!=r&&(this._byId[r]=e))}}this.trigger.apply(this,arguments)}}ci=Symbol.iterator;const pi=1,yi=2,bi=3;class gi{constructor(t,e){this._collection=t,this._kind=e,this._index=0}next(){if(this._collection){if(this._index<this._collection.length){const t=this._collection.at(this._index);if(this._index++,!t)return{value:void 0,done:!0};let e;if(this._kind===pi)e=t;else{const r=this._collection.modelId(t.attributes);e=this._kind===yi?r:[r,t]}return{value:e,done:!1}}this._collection=void 0}return{value:void 0,done:!0}}[Symbol.iterator](){return this}}const mi={Collection:vi,EventEmitter:$t,Model:fi,sync:to},_i="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;mi.VERSION="0.0.1";const wi=_i.Skeletor;function ji(){return _i.Skeletor=wi,this}mi.noConflict=ji,_i.Skeletor=mi,t.Collection=vi,t.EventEmitter=$t,t.Model=fi,t.Storage=ro,t.default=mi,t.noConflict=ji,t.sync=to,Object.defineProperty(t,"__esModule",{value:!0})});
8
74
  //# sourceMappingURL=skeletor.min.js.map
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@converse/skeletor",
3
- "description": "Modernized Backbone with web components",
3
+ "description": "Models and Collections for modern web apps",
4
4
  "url": "https://github.com/conversejs/skeletor",
5
+ "type": "module",
6
+ "main": "dist/skeletor.js",
7
+ "module": "src/index.ts",
8
+ "types": "dist/skeletor.d.ts",
5
9
  "browser": "dist/skeletor.js",
6
10
  "keywords": [
7
11
  "model",
@@ -16,14 +20,42 @@
16
20
  "contributors": [
17
21
  "JC Brand"
18
22
  ],
23
+ "version": "1.0.0",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/conversejs/skeletor.git"
28
+ },
29
+ "scripts": {
30
+ "clean": "rm -rf dist",
31
+ "prebuild": "npm run clean && mkdir -p dist/defs",
32
+ "build": "npm run prebuild && npm run build:declarations && rollup -c",
33
+ "build:types": "tsc -p tsconfig.declarations.json",
34
+ "build:declarations": "npm run build:types && api-extractor run --local && rm -rf dist/defs",
35
+ "check": "npm run check:types && npm run test && npm run lint",
36
+ "check:types": "tsc --noEmit",
37
+ "dev": "karma start --single-run=false",
38
+ "lint": "eslint src/*.ts test/*.ts",
39
+ "prettier": "prettier --write src/**/*.js test/**/*.js src/**/*.ts test/**/*.ts",
40
+ "test": "karma start && karma start --mocha-only"
41
+ },
42
+ "files": [
43
+ "LICENSE",
44
+ "dist/skeletor.js",
45
+ "dist/skeletor.min.js",
46
+ "dist/skeletor.d.ts",
47
+ "dist/skeletor.d.ts.map",
48
+ "src/"
49
+ ],
19
50
  "dependencies": {
20
51
  "@converse/localforage-getitems": "1.4.3",
21
- "lit-html": "^2.0.0-rc.2",
52
+ "@types/lodash-es": "^4.17.12",
53
+ "lit-html": "^3.2.1",
22
54
  "localforage": "^1.10.0",
23
55
  "localforage-driver-memory": "^1.0.5",
24
56
  "localforage-setitems": "^1.4.0",
25
57
  "lodash-es": "^4.17.21",
26
- "mergebounce": "0.1.1"
58
+ "mergebounce": "0.1.3"
27
59
  },
28
60
  "devDependencies": {
29
61
  "@babel/core": "^7.10.2",
@@ -31,44 +63,38 @@
31
63
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
32
64
  "@babel/plugin-proposal-optional-chaining": "^7.13.12",
33
65
  "@babel/preset-env": "^7.9.5",
34
- "@rollup/plugin-babel": "^5.0.3",
35
- "@rollup/plugin-node-resolve": "^8.0.1",
66
+ "@microsoft/api-extractor": "^7.53.2",
67
+ "@rollup/plugin-babel": "^6.0.4",
68
+ "@rollup/plugin-commonjs": "^28.0.3",
69
+ "@rollup/plugin-node-resolve": "^16.0.1",
70
+ "@rollup/plugin-terser": "^0.4.4",
71
+ "@rollup/plugin-typescript": "^12.1.4",
72
+ "@types/chai": "^5.2.3",
73
+ "@types/mocha": "^10.0.10",
74
+ "@types/qunit": "^2.19.13",
75
+ "@types/sinon": "^17.0.4",
76
+ "@typescript-eslint/eslint-plugin": "^8.29.0",
77
+ "@typescript-eslint/parser": "^8.29.0",
36
78
  "babel-eslint": "^10.1.0",
37
- "babel-loader": "^8.2.2",
79
+ "babel-loader": "^9.2.1",
38
80
  "chai": "^4.2.0",
39
- "eslint": "^7.2.0",
81
+ "eslint": "^8.57.0",
40
82
  "karma": "^6.3.16",
41
83
  "karma-chrome-launcher": "^3.1.0",
42
84
  "karma-firefox-launcher": "^1.2.0",
43
85
  "karma-mocha": "^2.0.1",
44
86
  "karma-qunit": "^4.1.1",
45
- "karma-webpack": "^4.0.2",
46
- "mocha": "^7.2.0",
87
+ "karma-webpack": "^5.0.1",
88
+ "mocha": "^10.2.0",
89
+ "prettier": "^3.0.0",
47
90
  "qunit": "^2.10.0",
48
- "rollup": "^1.32.1",
49
- "rollup-plugin-sourcemaps": "^0.6.2",
50
- "rollup-plugin-terser": "^5.3.0",
91
+ "rollup": "^4.39.0",
92
+ "rollup-plugin-summary": "^3.0.0",
51
93
  "sinon": "^9.0.2",
52
- "webpack": "^4.43.0",
53
- "webpack-cli": "^3.3.11",
94
+ "ts-loader": "^9.5.4",
95
+ "typescript": "^5.8.3",
96
+ "webpack": "^5.98.0",
97
+ "webpack-cli": "^6.0.1",
54
98
  "window-or-global": "^1.0.1"
55
- },
56
- "scripts": {
57
- "test": "karma start && karma start karma.mocha.conf && npm run lint",
58
- "dev": "karma start --single-run=false",
59
- "build": "rollup -c",
60
- "lint": "eslint src/*.js test/*.js"
61
- },
62
- "module": "src/main.js",
63
- "version": "0.0.8",
64
- "license": "MIT",
65
- "repository": {
66
- "type": "git",
67
- "url": "https://github.com/conversejs/skeletor.git"
68
- },
69
- "files": [
70
- "LICENSE",
71
- "dist/",
72
- "src/"
73
- ]
99
+ }
74
100
  }