this.webpackChunk([3],{214:function(e,t,n){"use strict";n.r(t);var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)l(e,i)&&(t[i]=j(e[i]));return t}function K(e,t,n,r){return n=n||{},r=r||"",i(e).forEach(function(i){if(l(t,i)){var o=e[i],u=t[i];"object"==typeof o&&"object"==typeof u&&o&&u&&""+o.constructor==""+u.constructor?K(o,u,n,r+i+"."):o!==u&&(n[r+i]=t[i])}else n[r+i]=void 0}),i(t).forEach(function(i){l(e,i)||(n[r+i]=t[i])}),n}var C="undefined"!=typeof Symbol&&Symbol.iterator,A=C?function(e){var t;return null!=e&&(t=e[C])&&t.apply(e)}:function(){return null},S={};function I(e){var t,n,r,i;if(1===arguments.length){if(o(e))return e.slice();if(this===S&&"string"==typeof e)return[e];if(i=A(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var T="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function D(e,t){T=e,B=t}var B=function(){return!0},R=!new Error("").stack;function F(){if(R)try{throw new Error}catch(e){return e}return new Error}function q(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(B).map(function(e){return"\n"+e}).join("")):""}var M=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],N=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(M),U={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function V(e,t){this._e=F(),this.name=e,this.message=t}function W(e,t){return e+". Errors: "+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join("\n")}function z(e,t,n,r){this._e=F(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=W(e,t)}function L(e,t){this._e=F(),this.name="BulkError",this.failures=t,this.message=W(e,t)}d(V).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+q(this._e,2))}},toString:function(){return this.name+": "+this.message}}),d(z).from(V),d(L).from(V);var Y=N.reduce(function(e,t){return e[t]=t+"Error",e},{}),G=V,H=N.reduce(function(e,t){var n=t+"Error";function r(e,r){this._e=F(),this.name=n,e?"string"==typeof e?(this.message=e+(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=U[t]||n,this.inner=null)}return d(r).from(G),e[t]=r,e},{});H.Syntax=SyntaxError,H.Type=TypeError,H.Range=RangeError;var Q=M.reduce(function(e,t){return e[t+"Error"]=H[t],e},{});var X=N.reduce(function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=H[t]),e},{});function J(){}function $(e){return e}function Z(e,t){return null==e||e===$?t:function(n){return t(e(n))}}function ee(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function te(e,t){return e===J?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?ee(r,this.onsuccess):r),i&&(this.onerror=this.onerror?ee(i,this.onerror):i),void 0!==o?o:n}}function ne(e,t){return e===J?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?ee(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ee(r,this.onerror):r)}}function re(e,t){return e===J?t:function(n){var r=e.apply(this,arguments);a(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var u=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?ee(i,this.onsuccess):i),o&&(this.onerror=this.onerror?ee(o,this.onerror):o),void 0===r?void 0===u?void 0:u:a(r,u)}}function ie(e,t){return e===J?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function oe(e,t){return e===J?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then(function(){return t.apply(r,o)})}return t.apply(this,arguments)}}X.ModifyError=z,X.DexieError=V,X.BulkError=L;var ue={},ae=100,se=7,ce=function(){try{return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var e=u.Promise;return e?[e.resolve(),e.prototype,e.resolve()]:[]}}(),le=ce[0],fe=ce[1],he=ce[2],pe=fe&&fe.then,de=le&&le.constructor,ye=ce[3],ve=!!he,me=!1,ge=he?function(){he.then(Me)}:u.setImmediate?setImmediate.bind(null,Me):u.MutationObserver?function(){var e=document.createElement("div");new MutationObserver(function(){Me(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(Me,0)},be=function(e,t){Ke.push([e,t]),we&&(ge(),we=!1)},_e=!0,we=!0,ke=[],xe=[],Oe=null,Pe=$,Ee={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:st,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(function(e){try{st(e[0],e[1])}catch(e){}})}},je=Ee,Ke=[],Ce=0,Ae=[];function Se(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=J,this._lib=!1;var t=this._PSD=je;if(T&&(this._stackHolder=F(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ue)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&De(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(null===t._state){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var r=t._lib&&Ne();n&&"function"==typeof n.then?e(t,function(e,t){n instanceof Se?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,Be(t)),r&&Ue()}},De.bind(null,t))}catch(e){De(t,e)}}(this,e)}var Ie={get:function(){var e=je,t=Qe;function n(n,r){var i=this,o=!e.global&&(e!==je||t!==Qe);o&&Ze();var u=new Se(function(t,u){Re(i,new Te(ot(n,e,o),ot(r,e,o),t,u,e))});return T&&qe(u,this),u}return n.prototype=ue,n},set:function(e){p(this,"then",e&&e.prototype===ue?Ie:{get:function(){return e},set:Ie.set})}};function Te(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function De(e,t){if(xe.push(t),null===e._state){var n=e._lib&&Ne();t=Pe(t),e._state=!1,e._value=t,T&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}(function(){var n=function e(t,n){var r;return y(t,n)||(r=s(t))&&e(r,n)}(t,"stack");t._promise=e,p(t,"stack",{get:function(){return me?n&&(n.get?n.get.apply(t):n.value):e.stack}})}),function(e){ke.some(function(t){return t._value===e._value})||ke.push(e)}(e),Be(e),n&&Ue()}}function Be(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n0;)for(e=Ke,Ke=[],n=e.length,t=0;t0);_e=!0,we=!0}function Ve(){var e=ke;ke=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=Ae.slice(0),n=t.length;n;)t[--n]()}function We(e){return new Se(ue,!1,e)}function ze(e,t){var n=je;return function(){var r=Ne(),i=je;try{return nt(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{nt(i,!1),r&&Ue()}}}f(Se.prototype,{then:Ie,_then:function(e,t){Re(this,new Te(null,null,e,t,je))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,function(e){return e instanceof t?n(e):We(e)}):this.then(null,function(e){return e&&e.name===t?n(e):We(e)})},finally:function(e){return this.then(function(t){return e(),t},function(t){return e(),We(t)})},stack:{get:function(){if(this._stack)return this._stack;try{me=!0;var e=function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var o,u,a=t._value;null!=a?(o=a.name||"Error",u=a.message||a,i=q(a,0)):(o=a,u=""),n.push(o+(u?": "+u:"")+i)}T&&((i=q(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r));return n}(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{me=!1}}},timeout:function(e,t){var n=this;return e<1/0?new Se(function(r,i){var o=setTimeout(function(){return i(new H.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&p(Se.prototype,Symbol.toStringTag,"Promise"),Ee.env=rt(),f(Se,{all:function(){var e=I.apply(null,arguments).map(et);return new Se(function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(function(i,o){return Se.resolve(i).then(function(n){e[o]=n,--r||t(e)},n)})})},resolve:function(e){if(e instanceof Se)return e;if(e&&"function"==typeof e.then)return new Se(function(t,n){e.then(t,n)});var t=new Se(ue,!0,e);return qe(t,Oe),t},reject:We,race:function(){var e=I.apply(null,arguments).map(et);return new Se(function(t,n){e.map(function(e){return Se.resolve(e).then(t,n)})})},PSD:{get:function(){return je},set:function(e){return je=e}},newPSD:Je,usePSD:it,scheduler:{get:function(){return be},set:function(e){be=e}},rejectionMapper:{get:function(){return Pe},set:function(e){Pe=e}},follow:function(e,t){return new Se(function(n,r){return Je(function(t,n){var r=je;r.unhandleds=[],r.onunhandled=n,r.finalize=ee(function(){var e=this;!function(e){Ae.push(function t(){e(),Ae.splice(Ae.indexOf(t),1)}),++Ce,be(function(){0==--Ce&&Ve()},[])}(function(){0===e.unhandleds.length?t():n(e.unhandleds[0])})},r.finalize),e()},t,n,r)})}});var Le={awaits:0,echoes:0,id:0},Ye=0,Ge=[],He=0,Qe=0,Xe=0;function Je(e,t,n,r){var i=je,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++Xe;var u=Ee.env;o.env=ve?{Promise:Se,PromiseProp:{value:Se,configurable:!0,writable:!0},all:Se.all,race:Se.race,resolve:Se.resolve,reject:Se.reject,nthen:ut(u.nthen,o),gthen:ut(u.gthen,o)}:{},t&&a(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=it(o,e,n,r);return 0===o.ref&&o.finalize(),s}function $e(){return Le.id||(Le.id=++Ye),++Le.awaits,Le.echoes+=se,Le.id}function Ze(e){!Le.awaits||e&&e!==Le.id||(0==--Le.awaits&&(Le.id=0),Le.echoes=Le.awaits*se)}function et(e){return Le.echoes&&e&&e.constructor===de?($e(),e.then(function(e){return Ze(),e},function(e){return Ze(),ct(e)})):e}function tt(){var e=Ge[Ge.length-1];Ge.pop(),nt(e,!1)}function nt(e,t){var n,r=je;if((t?!Le.echoes||He++&&e===je:!He||--He&&e===je)||(n=t?function(e){++Qe,Le.echoes&&0!=--Le.echoes||(Le.echoes=Le.id=0),Ge.push(je),nt(e,!0)}.bind(null,e):tt,pe.call(le,n)),e!==je&&(je=e,r===Ee&&(Ee.env=rt()),ve)){var i=Ee.env.Promise,o=e.env;fe.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(u,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject)}}function rt(){var e=u.Promise;return ve?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(u,"Promise"),all:e.all,race:e.race,resolve:e.resolve,reject:e.reject,nthen:fe.then,gthen:e.prototype.then}:{}}function it(e,t,n,r,i){var o=je;try{return nt(e,!0),t(n,r,i)}finally{nt(o,!1)}}function ot(e,t,n){return"function"!=typeof e?e:function(){var r=je;n&&$e(),nt(t,!0);try{return e.apply(this,arguments)}finally{nt(r,!1)}}}function ut(e,t){return function(n,r){return e.call(this,ot(n,t,!1),ot(r,t,!1))}}var at="unhandledrejection";function st(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(u.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(at,!0,!0),a(r,i)):u.CustomEvent&&a(r=new CustomEvent(at,{detail:i}),i),r&&u.dispatchEvent&&(dispatchEvent(r),!u.PromiseRejectionEvent&&u.onunhandledrejection))try{u.onunhandledrejection(r)}catch(e){}T&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var ct=Se.reject;var lt=String.fromCharCode(65535),ft="Invalid key provided. Keys must be of type string, number, Date or Array.",ht="String expected.",pt=[],dt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),yt=dt,vt=dt,mt=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},gt="__dbnames";function bt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var _t={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},wt=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||je.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new H.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}var u=Ne();try{return r&&r.db===this.db?r===je.trans?r._promise(e,o,n):Je(function(){return r._promise(e,o,n)},{trans:r,transless:je.transless||je}):function e(t,n,r,i){if(t._state.openComplete||je.letThrough){var o=t._createTransaction(n,r,t._dbSchema);try{o.create()}catch(e){return ct(e)}return o._promise(n,function(e,t){return Je(function(){return je.trans=o,i(e,t,o)})}).then(function(e){return o._completion.then(function(){return e})})}if(!t._state.isBeingOpened){if(!t._options.autoOpen)return ct(new H.DatabaseClosed);t.open().catch(J)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],o)}finally{u&&Ue()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(o(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=i(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){return e.compound&&t.every(function(t){return e.keyPath.indexOf(t)>=0})&&e.keyPath.every(function(e){return t.indexOf(e)>=0})})[0];if(n&&this.db._maxKey!==lt)return this.where(n.name).equals(n.keyPath.map(function(t){return e[t]}));!n&&T&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,u=this.db._deps.indexedDB;function a(e,t){try{return 0===u.cmp(e,t)}catch(e){return!1}}var s=t.reduce(function(t,n){var i=t[0],u=t[1],s=r[n],c=e[n];return[i||s,i||!s?bt(u,s&&s.multi?function(e){var t=w(e,n);return o(t)&&t.some(function(e){return a(c,e)})}:function(e){return a(c,w(e,n))}):u]},[null,null]),c=s[0],l=s[1];return c?this.where(c.name).equals(e[c.keyPath]).filter(l):n?this.filter(l):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,o(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(l(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass(function(e){a(this,e)})},e.prototype.add=function(e,t){var n=this;return this._trans("readwrite",function(r){return n.core.mutate({trans:r,type:"add",keys:null!=t?[t]:null,values:[e]})}).then(function(e){return e.numFailures?Se.reject(e.failures[0]):e.lastResult}).then(function(t){if(!n.core.schema.primaryKey.outbound)try{k(e,n.core.schema.primaryKey.keyPath,t)}catch(e){}return t})},e.prototype.update=function(e,t){if("object"!=typeof t||o(t))throw new H.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||o(e))return this.where(":id").equals(e).modify(t);i(t).forEach(function(n){k(e,n,t[n])});var n=w(e,this.schema.primKey.keyPath);return void 0===n?ct(new H.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)},e.prototype.put=function(e,t){var n=this;return this._trans("readwrite",function(r){return n.core.mutate({trans:r,type:"put",values:[e],keys:null!=t?[t]:null})}).then(function(e){return e.numFailures?Se.reject(e.failures[0]):e.lastResult}).then(function(t){if(!n.core.schema.primaryKey.outbound)try{k(e,n.core.schema.primaryKey.keyPath,t)}catch(e){}return t})},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})}).then(function(e){return e.numFailures?Se.reject(e.failures[0]):void 0})},e.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:_t})}).then(function(e){return e.numFailures?Se.reject(e.failures[0]):void 0})},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n})})},e.prototype.bulkAdd=function(e,t){var n=this;return this._trans("readwrite",function(r){if(!n.core.schema.primaryKey.outbound&&t)throw new H.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");return n.core.mutate({trans:r,type:"add",keys:t,values:e}).then(function(t){var r=t.numFailures,i=t.lastResult,o=t.failures;if(0===r)return i;throw new L(n.name+".bulkAdd(): "+r+" of "+e.length+" operations failed",Object.keys(o).map(function(e){return o[e]}))})})},e.prototype.bulkPut=function(e,t){var n=this;return this._trans("readwrite",function(r){if(!n.core.schema.primaryKey.outbound&&t)throw new H.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new H.InvalidArgument("Arguments objects and keys must have the same length");return n.core.mutate({trans:r,type:"put",keys:t,values:e}).then(function(t){var r=t.numFailures,i=t.lastResult,o=t.failures;if(0===r)return i;throw new L(n.name+".bulkPut(): "+r+" of "+e.length+" operations failed",Object.keys(o).map(function(e){return o[e]}))})})},e.prototype.bulkDelete=function(e){var t=this;return this._trans("readwrite",function(n){return t.core.mutate({trans:n,type:"delete",keys:e})}).then(function(n){var r=n.numFailures,i=n.lastResult,o=n.failures;if(0===r)return i;throw new L(t.name+".bulkDelete(): "+r+" of "+e.length+" operations failed",o)})},e}();function kt(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=a;for(var r=1,u=arguments.length;rr?u:0}return this.toArray(function(e){return e.sort(a)}).then(t)},e.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if("next"===n.dir&&Ot(n,!0)&&n.limit>0){var r=n.valueMapper,i=jt(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:i,range:n.range}}).then(function(e){var t=e.result;return r?t.map(r):t})}var o=[];return Ct(n,function(e){return o.push(e)},e,n.table.core).then(function(){return o})},e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0?this:(t.offset+=e,Ot(t)?Et(t,function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n(function(){e.advance(t),t=0}),!1))}}):Et(t,function(){var t=e;return function(){return--t<0}}),this)},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Et(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this},e.prototype.until=function(e,t){return Pt(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},e.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t,n;return Pt(this._ctx,function(t){return e(t.value)}),t=this._ctx,n=e,t.isMatch=bt(t.isMatch,n),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&Ot(t,!0)&&t.limit>0)return this._read(function(e){var n=jt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Pt(this._ctx,function(e){var t=e.primaryKey.toString(),r=l(n,t);return n[t]=!0,!r}),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var o;if("function"==typeof e)o=e;else{var u=i(e),a=u.length;o=function(t){for(var n=!1,r=0;r0&&s.mutate({trans:r,type:"add",values:a}).then(function(e){for(var t in e.failures)y.splice(parseInt(t),1);m(a.length,e)})).then(function(e){return c.length>0&&s.mutate({trans:r,type:"put",keys:d,values:c}).then(function(e){return m(c.length,e)})}).then(function(){return y.length>0&&s.mutate({trans:r,type:"delete",keys:y}).then(function(e){return m(y.length,e)})}).then(function(){return e.length>n+i&&t(n+h)})})};return t(0).then(function(){if(d.length>0)throw new z("Error modifying one or more objects",d,y,v);return e.length})})})},e.prototype.delete=function(){var e=this._ctx,t=e.range;return Ot(e)&&(e.isPrimKey&&!vt||3===t.type)?this._write(function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then(function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then(function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new z("Could not delete some values",Object.keys(n).map(function(e){return n[e]}),t-r);return t-r})})}):this.modify(function(e,t){return t.value=null})},e}();function It(e,t){return et?-1:e===t?0:1}function Dt(e,t,n){var r=e instanceof Nt?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Bt(e){return new e.Collection(e,function(){return Mt("")}).limit(0)}function Rt(e,t,n,r,i,o){for(var u=Math.min(e.length,r.length),a=-1,s=0;s=0?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[s],c)<0&&(a=s)}return u0)&&(p=v)}return n(null!==p?function(){e.continue(p+l)}:r),!1}),p}function qt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Mt(e){return{type:1,lower:e,upper:e}}var Nt=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Bt(this):new this.Collection(this,function(){return qt(e,t,!n,!r)})}catch(e){return Dt(this,ft)}},e.prototype.equals=function(e){return new this.Collection(this,function(){return Mt(e)})},e.prototype.above=function(e){return null==e?Dt(this,ft):new this.Collection(this,function(){return qt(e,void 0,!0)})},e.prototype.aboveOrEqual=function(e){return null==e?Dt(this,ft):new this.Collection(this,function(){return qt(e,void 0,!1)})},e.prototype.below=function(e){return null==e?Dt(this,ft):new this.Collection(this,function(){return qt(void 0,e,!1,!0)})},e.prototype.belowOrEqual=function(e){return null==e?Dt(this,ft):new this.Collection(this,function(){return qt(void 0,e)})},e.prototype.startsWith=function(e){return"string"!=typeof e?Dt(this,ht):this.between(e,e+lt,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Ft(this,function(e,t){return 0===e.indexOf(t[0])},[e],lt)},e.prototype.equalsIgnoreCase=function(e){return Ft(this,function(e,t){return e===t[0]},[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=I.apply(S,arguments);return 0===e.length?Bt(this):Ft(this,function(e,t){return-1!==t.indexOf(e)},e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=I.apply(S,arguments);return 0===e.length?Bt(this):Ft(this,function(e,t){return t.some(function(t){return 0===e.indexOf(t)})},e,lt)},e.prototype.anyOf=function(){var e=this,t=I.apply(S,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Dt(this,ft)}if(0===t.length)return Bt(this);var r=new this.Collection(this,function(){return qt(t[0],t[t.length-1])});r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,o){for(var u=e.key;n(u,t[i])>0;)if(++i===t.length)return r(o),!1;return 0===n(u,t[i])||(r(function(){e.continue(t[i])}),!1)}),r},e.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=I.apply(S,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Dt(this,ft)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,o=this._descending,u=this._min,a=this._max;if(0===e.length)return Bt(this);if(!e.every(function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0}))return Dt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",H.InvalidArgument);var s=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers;var l,f=i;function h(e,t){return f(e[0],t[0])}try{(l=e.reduce(function(e,t){for(var n=0,i=e.length;n0){o[0]=u(o[0],t[0]),o[1]=a(o[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(h)}catch(e){return Dt(this,ft)}var p=0,d=c?function(e){return i(e,l[p][1])>0}:function(e){return i(e,l[p][1])>=0},y=s?function(e){return o(e,l[p][0])>0}:function(e){return o(e,l[p][0])>=0};var v=d,m=new this.Collection(this,function(){return qt(l[0][0],l[l.length-1][1],!s,!c)});return m._ondirectionchange=function(e){"next"===e?(v=d,f=i):(v=y,f=o),l.sort(h)},m._addAlgorithm(function(e,t,r){for(var o=e.key;v(o);)if(++p===l.length)return t(r),!1;return!!function(e){return!d(e)&&!y(e)}(o)||0!==n._cmp(o,l[p][1])&&0!==n._cmp(o,l[p][0])&&(t(function(){f===i?e.continue(l[p][0]):e.continue(l[p][1])}),!1)}),m},e.prototype.startsWithAnyOf=function(){var e=I.apply(S,arguments);return e.every(function(e){return"string"==typeof e})?0===e.length?Bt(this):this.inAnyRange(e.map(function(e){return[e,e+lt]})):Dt(this,"startsWithAnyOf() only works with strings")},e}();function Ut(e){return 1===e.length?e[0]:e}function Vt(e){try{return e.only([[]]),[[]]}catch(e){return lt}}function Wt(e){return ze(function(t){return zt(t),e(t.target.error),!1})}function zt(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Lt=function(){function e(){}return e.prototype._lock=function(){return b(!je.global),++this._reculock,1!==this._reculock||je.global||(je.lockOwnerFor=this),this},e.prototype._unlock=function(){if(b(!je.global),0==--this._reculock)for(je.global||(je.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{it(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&je.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new H.DatabaseClosed(r);case"MissingAPIError":throw new H.MissingAPI(r.message,r);default:throw new H.OpenFailed(r)}if(!this.active)throw new H.TransactionInactive;return b(null===this._completion._state),(e=this.idbtrans=e||n.transaction(Ut(this.storeNames),this.mode)).onerror=ze(function(n){zt(n),t._reject(e.error)}),e.onabort=ze(function(n){zt(n),t.active&&t._reject(new H.Abort(e.error)),t.active=!1,t.on("abort").fire(n)}),e.oncomplete=ze(function(){t.active=!1,t._resolve()}),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return ct(new H.ReadOnly("Transaction is readonly"));if(!this.active)return ct(new H.TransactionInactive);if(this._locked())return new Se(function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},je])});if(n)return Je(function(){var e=new Se(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new Se(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=Se.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new Se(function(e,r){n.then(function(n){return t._waitingQueue.push(ze(e.bind(null,n)))},function(e){return t._waitingQueue.push(ze(r.bind(null,e)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},e.prototype.abort=function(){this.active&&this._reject(new H.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(l(t,e))return t[e];var n=this.schema[e];if(!n)throw new H.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function Yt(e,t,n,r,i,o){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n?"&":"")+(r?"*":"")+(i?"++":"")+Gt(t)}}function Gt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ht(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=n,i=function(e){return[e.name,e]},r.reduce(function(e,t,n){var r=i(t,n);return r&&(e[r[0]]=r[1]),e},{}))};var r,i}function Qt(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return w(t,e)}}(e):function(t){return w(t,e)}}function Xt(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function Jt(e){return[].slice.call(e)}var $t=0;function Zt(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function en(e,t,n,r){var i=t.cmp.bind(t);function u(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,r=e.upper,i=e.lowerOpen,o=e.upperOpen;return void 0===t?void 0===r?null:n.upperBound(r,!!o):void 0===r?n.lowerBound(t,!!i):n.bound(t,r,!!i,!!o)}var a=function(e,t){var n=Jt(e.objectStoreNames);return{schema:{name:e.name,tables:n.map(function(e){return t.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=o(t),i=null==t,u={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Qt(t)},indexes:Jt(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,i=e.keyPath,a={name:t,compound:o(i),keyPath:i,unique:n,multiEntry:r,extractKey:Qt(i)};return u[Zt(i)]=a,a}),getIndexByKeyPath:function(e){return u[Zt(e)]}};return u[":id"]=a.primaryKey,null!=t&&(u[Zt(t)]=a.primaryKey),a})},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),s=a.schema,c=a.hasGetAll,l=s.tables.map(function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(n){var r=n.trans,i=n.type,o=n.keys,a=n.values,s=n.range,c=n.wantResults;return new Promise(function(n,l){n=ze(n);var f=r.objectStore(t),h=null==f.keyPath,p="put"===i||"add"===i;if(!p&&"delete"!==i&&"deleteRange"!==i)throw new Error("Invalid operation type: "+i);var d=(o||a||{length:1}).length;if(o&&a&&o.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var y,v=c&&(o||Xt(e.primaryKey,{type:i,keys:o,values:a})).slice(),m=[],g=0,b=function(e){++g,zt(e),v&&(v[e.target._reqno]=void 0),m[e.target._reqno]=e.target.error},_=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===i){if(4===s.type)return n({numFailures:g,failures:m,results:v,lastResult:void 0});y=3===s.type?f.clear():f.delete(u(s))}else{var w=p?h?[a,o]:[a,null]:[o,null],k=w[0],x=w[1];if(p)for(var O=0;Ot}).forEach(function(t){o.push(function(){var o=s,u=t._cfg.dbschema;ln(e,o,r),ln(e,u,r),s=e._dbSchema=u;var a=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var u={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src!==o.primKey.src)u.recreate=!0,r.change.push(u);else{var a=i.idxByName,s=o.idxByName,c=void 0;for(c in a)s[c]||u.del.push(c);for(c in s){var l=a[c],f=s[c];l?l.src!==f.src&&u.change.push(f):u.add.push(f)}(u.del.length>0||u.add.length>0||u.change.length>0)&&r.change.push(u)}}else r.add.push([n,o])}return r}(o,u);a.add.forEach(function(e){sn(r,e[0],e[1].primKey,e[1].indexes)}),a.change.forEach(function(e){if(e.recreate)throw new H.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach(function(e){return cn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),cn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var l=t._cfg.contentUpgrade;if(l){nn(e,r),c=!0;var f,h=x(u);a.del.forEach(function(e){h[e]=o[e]}),on(e,[e.Transaction.prototype]),rn(e,[e.Transaction.prototype],i(h),h),n.schema=h,l.constructor===ye&&$e();var p=Se.follow(function(){if((f=l(n))&&f.constructor===de){var e=Ze.bind(null,null);f.then(e,e)}});return f&&"function"==typeof f.then?Se.resolve(f):p.then(function(){return f})}}),o.push(function(r){c&&yt||function(e,t){for(var n=0;nMath.pow(2,62)?0:r.oldVersion;an(e,c/10,o,u)}},u),s.onsuccess=ze(function(){o=null;var n=e.idbdb=s.result,u=m(n.objectStoreNames);if(u.length>0)try{var c=n.transaction(Ut(u),"readonly");t.autoSchema?function(e,t,n){e.verno=t.version/10;var r=e._dbSchema={},o=e._storeNames=m(t.objectStoreNames,0);0!==o.length&&(o.forEach(function(e){for(var t=n.objectStore(e),i=t.keyPath,o=Yt(Gt(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i),u=[],a=0;a0){var n=t.onReadyBeingFired.reduce(oe,J);return t.onReadyBeingFired=[],Se.resolve(pn(n)).then(e)}})}).finally(function(){t.onReadyBeingFired=null}).then(function(){return t.isBeingOpened=!1,e}).catch(function(n){try{o&&o.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=n,ct(t.dbOpenError)}).finally(function(){t.openComplete=!0,r()})}function yn(e){var t=function(t){return e.next(t)},n=i(t),r=i(function(t){return e.throw(t)});function i(e){return function(t){var i=e(t),u=i.value;return i.done?u:u&&"function"==typeof u.then?u.then(n,r):o(u)?Promise.all(u).then(n,r):n(u)}}return i(t)()}function vn(e,t,n){var r=arguments.length;if(r<2)throw new H.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,P(i),n]}function mn(e,t,n){o(e)||(e=[e]);for(var r=e.length,i=new Array(r+n),u=e.length+n-1;u>=r;--u)i[u]=t;return i}var gn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return r({},e,{table:function(t){var n=e.table(t),i=n.schema,o={},u=[];function a(e,t,n){var i=Zt(e),s=o[i]=o[i]||[],c=null==e?0:"string"==typeof e?1:e.length,l=t>0,f=r({},n,{isVirtual:l,isPrimaryKey:!l&&n.isPrimaryKey,keyTail:t,keyLength:c,extractKey:Qt(e),unique:!l&&n.unique});(s.push(f),f.isPrimaryKey||u.push(f),c>1)&&a(2===c?e[0]:e.slice(0,c-1),t+1,n);return s.sort(function(e,t){return e.keyTail-t.keyTail}),f}var s=a(i.primaryKey.keyPath,0,i.primaryKey);o[":id"]=[s];for(var c=0,l=i.indexes;c0?Promise.reject(n.failures[0]):i.length0?e:t},this._min=function(e,t){return i.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange})}(this),this.on("versionchange",function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+i.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+i.name+"'. Closing db now to resume the delete request."),i.close()}),this.on("blocked",function(e){!e.newVersion||e.newVersion=0&&pt.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new H.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new Se(function(e){t.dbReadyResolve=e}),t.openCanceller=new Se(function(e,n){t.cancelOpen=n})},e.prototype.delete=function(){var e=this,t=arguments.length>0,n=this._state;return new Se(function(r,i){var o=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=ze(function(){fn.remove(e.name),r()}),t.onerror=Wt(i),t.onblocked=e._fireOnBlocked};if(t)throw new H.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(o):o()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return i(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=vn.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,i=je.trans;i&&i.db===this&&-1===e.indexOf("!")||(i=null);var o,u,a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(u=t.map(function(e){var t=e instanceof r.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new H.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(i){if("readonly"===i.mode&&"readwrite"===o){if(!a)throw new H.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");i=null}i&&u.forEach(function(e){if(i&&-1===i.storeNames.indexOf(e)){if(!a)throw new H.SubTransaction("Table "+e+" not included in parent transaction.");i=null}}),a&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,function(t,n){n(e)}):ct(e)}var s=function(e,t,n,r,i){return Se.resolve().then(function(){var o,u=je.transless||je,a=e._createTransaction(t,n,e._dbSchema,r),s={trans:a,transless:u};r?a.idbtrans=r.idbtrans:a.create(),i.constructor===ye&&$e();var c=Se.follow(function(){if(o=i.call(a,a))if(o.constructor===de){var e=Ze.bind(null,null);o.then(e,e)}else"function"==typeof o.next&&"function"==typeof o.throw&&(o=yn(o))},s);return(o&&"function"==typeof o.then?Se.resolve(o).then(function(e){return a.active?e:ct(new H.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):c.then(function(){return o})).then(function(e){return r&&a._resolve(),a._completion.then(function(){return e})}).catch(function(e){return a._reject(e),ct(e)})})}.bind(null,this,o,u,i,n);return i?i._promise(o,s,"lock"):je.trans?it(je.transless,function(){return r._whenReady(s)}):this._whenReady(s)},e.prototype.table=function(e){if(!l(this._allTables,e))throw new H.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),wn=_n;f(wn,r({},X,{delete:function(e){return new wn(e).delete()},exists:function(e){return new wn(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){return fn?fn.getDatabaseNames().then(e):Se.resolve([])},defineClass:function(){return function(e){a(this,e)}},ignoreTransaction:function(e){return je.trans?it(je.transless,e):e()},vip:pn,async:function(e){return function(){try{var t=yn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Se.resolve(t)}catch(e){return ct(e)}}},spawn:function(e,t,n){try{var r=yn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Se.resolve(r)}catch(e){return ct(e)}},currentTransaction:{get:function(){return je.trans||null}},waitFor:function(e,t){var n=Se.resolve("function"==typeof e?wn.ignoreTransaction(e):e).timeout(t||6e4);return je.trans?je.trans.waitFor(n):n},Promise:Se,debug:{get:function(){return T},set:function(e){D(e,"dexie"===e?function(){return!0}:mt)}},derive:d,extend:a,props:f,override:g,Events:kt,getByKeyPath:w,setByKeyPath:k,delByKeyPath:function(e,t){"string"==typeof t?k(e,t,void 0):"length"in t&&[].map.call(t,function(t){k(e,t,void 0)})},shallowClone:x,deepClone:j,getObjectDiff:K,asap:_,minKey:-1/0,addons:[],connections:pt,errnames:Y,dependencies:function(){try{return{indexedDB:u.indexedDB||u.mozIndexedDB||u.webkitIndexedDB||u.msIndexedDB,IDBKeyRange:u.IDBKeyRange||u.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:"3.0.0-alpha.8",version:"3.0.0-alpha.8".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)}),default:wn,Dexie:wn})),wn.maxKey=Vt(wn.dependencies.IDBKeyRange),function(e){try{fn=function(e){var t,n=e&&(e.getDatabaseNames||e.webkitGetDatabaseNames);if(!n){var r=new _n(gt,{addons:[]});r.version(1).stores({dbnames:"name"}),t=r.table("dbnames")}return{getDatabaseNames:function(){return n?new Se(function(t,r){var i=n.call(e);i.onsuccess=function(e){return t(m(e.target.result,0))},i.onerror=Wt(r)}):t.toCollection().primaryKeys()},add:function(e){return!n&&e!==gt&&t.put({name:e}).catch(J)},remove:function(e){return!n&&e!==gt&&t.delete(e).catch(J)}}}(e)}catch(e){}}(_n.dependencies.indexedDB),Se.rejectionMapper=function(e,t){if(!e||e instanceof V||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Q[e.name])return e;var n=new Q[e.name](t||e.message,e);return"stack"in e&&p(n,"stack",{get:function(){return this.inner.stack}}),n},D(T,mt),t.default=_n}}); //# sourceMappingURL=3.2860b24d78cee11b8d5e.worker.js.map