UNPKG

bimwin-api

Version:

BIMWIN核心库, 使用typescript开发, 非LOD版本

2 lines 1.62 MB
/*! For license information please see bimwin.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.bw=e():t.bw=e()}(self,(()=>(()=>{var t={9187:t=>{"use strict";function e(t,e,n){n=n||2;var r,a,o,h,u,d,m,f=e&&e.length,g=f?e[0]*n:t.length,A=i(t,0,g,n,!0),v=[];if(!A||A.next===A.prev)return v;if(f&&(A=function(t,e,n,s){var r,a,o,h=[];for(r=0,a=e.length;r<a;r++)(o=i(t,e[r]*s,r<a-1?e[r+1]*s:t.length,s,!1))===o.next&&(o.steiner=!0),h.push(p(o));for(h.sort(l),r=0;r<h.length;r++)n=c(h[r],n);return n}(t,e,A,n)),t.length>80*n){r=o=t[0],a=h=t[1];for(var y=n;y<g;y+=n)(u=t[y])<r&&(r=u),(d=t[y+1])<a&&(a=d),u>o&&(o=u),d>h&&(h=d);m=0!==(m=Math.max(o-r,h-a))?32767/m:0}return s(A,v,n,r,a,m,0),v}function i(t,e,i,n,s){var r,a;if(s===C(t,e,i,n)>0)for(r=e;r<i;r+=n)a=_(r,t[r],t[r+1],a);else for(r=i-n;r>=e;r-=n)a=_(r,t[r],t[r+1],a);return a&&A(a,a.next)&&(M(a),a=a.next),a}function n(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!A(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function s(t,e,i,l,c,u,p){if(t){!p&&u&&function(t,e,i,n){var s=t;do{0===s.z&&(s.z=d(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,a,o,h,l=1;do{for(i=t,t=null,r=null,a=0;i;){for(a++,n=i,o=0,e=0;e<l&&(o++,n=n.nextZ);e++);for(h=l;o>0||h>0&&n;)0!==o&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,o--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(a>1)}(s)}(t,l,c,u);for(var m,f,g=t;t.prev!==t.next;)if(m=t.prev,f=t.next,u?a(t,l,c,u):r(t))e.push(m.i/i|0),e.push(t.i/i|0),e.push(f.i/i|0),M(t),t=f.next,g=f.next;else if((t=f)===g){p?1===p?s(t=o(n(t),e,i),e,i,l,c,u,2):2===p&&h(t,e,i,l,c,u):s(n(t),e,i,l,c,u,1);break}}}function r(t){var e=t.prev,i=t,n=t.next;if(g(e,i,n)>=0)return!1;for(var s=e.x,r=i.x,a=n.x,o=e.y,h=i.y,l=n.y,c=s<r?s<a?s:a:r<a?r:a,u=o<h?o<l?o:l:h<l?h:l,d=s>r?s>a?s:a:r>a?r:a,p=o>h?o>l?o:l:h>l?h:l,f=n.next;f!==e;){if(f.x>=c&&f.x<=d&&f.y>=u&&f.y<=p&&m(s,o,r,h,a,l,f.x,f.y)&&g(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function a(t,e,i,n){var s=t.prev,r=t,a=t.next;if(g(s,r,a)>=0)return!1;for(var o=s.x,h=r.x,l=a.x,c=s.y,u=r.y,p=a.y,f=o<h?o<l?o:l:h<l?h:l,A=c<u?c<p?c:p:u<p?u:p,v=o>h?o>l?o:l:h>l?h:l,y=c>u?c>p?c:p:u>p?u:p,x=d(f,A,e,i,n),w=d(v,y,e,i,n),b=t.prevZ,_=t.nextZ;b&&b.z>=x&&_&&_.z<=w;){if(b.x>=f&&b.x<=v&&b.y>=A&&b.y<=y&&b!==s&&b!==a&&m(o,c,h,u,l,p,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,_.x>=f&&_.x<=v&&_.y>=A&&_.y<=y&&_!==s&&_!==a&&m(o,c,h,u,l,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;b&&b.z>=x;){if(b.x>=f&&b.x<=v&&b.y>=A&&b.y<=y&&b!==s&&b!==a&&m(o,c,h,u,l,p,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;_&&_.z<=w;){if(_.x>=f&&_.x<=v&&_.y>=A&&_.y<=y&&_!==s&&_!==a&&m(o,c,h,u,l,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function o(t,e,i){var s=t;do{var r=s.prev,a=s.next.next;!A(r,a)&&v(r,s,s.next,a)&&w(r,a)&&w(a,r)&&(e.push(r.i/i|0),e.push(s.i/i|0),e.push(a.i/i|0),M(s),M(s.next),s=t=a),s=s.next}while(s!==t);return n(s)}function h(t,e,i,r,a,o){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&f(h,l)){var c=b(h,l);return h=n(h,h.next),c=n(c,c.next),s(h,e,i,r,a,o,0),void s(c,e,i,r,a,o,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function c(t,e){var i=function(t,e){var i,n=e,s=t.x,r=t.y,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var o=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=s&&o>a&&(a=o,i=n.x<n.next.x?n:n.next,o===s))return i}n=n.next}while(n!==e);if(!i)return null;var h,l=i,c=i.x,d=i.y,p=1/0;n=i;do{s>=n.x&&n.x>=c&&s!==n.x&&m(r<d?s:a,r,c,d,r<d?a:s,r,n.x,n.y)&&(h=Math.abs(r-n.y)/(s-n.x),w(n,t)&&(h<p||h===p&&(n.x>i.x||n.x===i.x&&u(i,n)))&&(i=n,p=h)),n=n.next}while(n!==l);return i}(t,e);if(!i)return e;var s=b(i,t);return n(s,s.next),n(i,i.next)}function u(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function m(t,e,i,n,s,r,a,o){return(s-a)*(e-o)>=(t-a)*(r-o)&&(t-a)*(n-o)>=(i-a)*(e-o)&&(i-a)*(r-o)>=(s-a)*(n-o)}function f(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&v(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||A(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,i,n){var s=x(g(t,e,i)),r=x(g(t,e,n)),a=x(g(i,n,t)),o=x(g(i,n,e));return s!==r&&a!==o||!(0!==s||!y(t,i,e))||!(0!==r||!y(t,n,e))||!(0!==a||!y(i,t,n))||!(0!==o||!y(i,e,n))}function y(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function x(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function b(t,e){var i=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function _(t,e,i,n){var s=new S(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(t,e,i,n){for(var s=0,r=e,a=i-n;r<i;r+=n)s+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return s}t.exports=e,t.exports.default=e,e.deviation=function(t,e,i,n){var s=e&&e.length,r=s?e[0]*i:t.length,a=Math.abs(C(t,0,r,i));if(s)for(var o=0,h=e.length;o<h;o++){var l=e[o]*i,c=o<h-1?e[o+1]*i:t.length;a-=Math.abs(C(t,l,c,i))}var u=0;for(o=0;o<n.length;o+=3){var d=n[o]*i,p=n[o+1]*i,m=n[o+2]*i;u+=Math.abs((t[d]-t[m])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[m+1]-t[d+1]))}return 0===a&&0===u?0:Math.abs((u-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,s=0;s<t.length;s++){for(var r=0;r<t[s].length;r++)for(var a=0;a<e;a++)i.vertices.push(t[s][r][a]);s>0&&(n+=t[s-1].length,i.holes.push(n))}return i}},840:(t,e,i)=>{var n;!function(s,r,a,o){"use strict";var h,l=["","webkit","Moz","MS","ms","o"],c=r.createElement("div"),u="function",d=Math.round,p=Math.abs,m=Date.now;function f(t,e,i){return setTimeout(b(t,i),e)}function g(t,e,i){return!!Array.isArray(t)&&(A(t,i[e],i),!0)}function A(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==o)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function v(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=s.console&&(s.console.warn||s.console.log);return r&&r.call(s.console,n,i),t.apply(this,arguments)}}h="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==o&&null!==n)for(var s in n)n.hasOwnProperty(s)&&(e[s]=n[s])}return e}:Object.assign;var y=v((function(t,e,i){for(var n=Object.keys(e),s=0;s<n.length;)(!i||i&&t[n[s]]===o)&&(t[n[s]]=e[n[s]]),s++;return t}),"extend","Use `assign`."),x=v((function(t,e){return y(t,e,!0)}),"merge","Use `assign`.");function w(t,e,i){var n,s=e.prototype;(n=t.prototype=Object.create(s)).constructor=t,n._super=s,i&&h(n,i)}function b(t,e){return function(){return t.apply(e,arguments)}}function _(t,e){return typeof t==u?t.apply(e&&e[0]||o,e):t}function M(t,e){return t===o?e:t}function S(t,e,i){A(E(e),(function(e){t.addEventListener(e,i,!1)}))}function C(t,e,i){A(E(e),(function(e){t.removeEventListener(e,i,!1)}))}function T(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function P(t,e){return t.indexOf(e)>-1}function E(t){return t.trim().split(/\s+/g)}function L(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function I(t){return Array.prototype.slice.call(t,0)}function D(t,e,i){for(var n=[],s=[],r=0;r<t.length;){var a=e?t[r][e]:t[r];L(s,a)<0&&n.push(t[r]),s[r]=a,r++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}function z(t,e){for(var i,n,s=e[0].toUpperCase()+e.slice(1),r=0;r<l.length;){if((n=(i=l[r])?i+s:e)in t)return n;r++}return o}var R=1;function k(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||s}var O="ontouchstart"in s,B=z(s,"PointerEvent")!==o,N=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F="touch",U="mouse",V=25,G=1,H=2,W=4,j=8,Z=1,q=2,X=4,Y=8,Q=16,K=q|X,J=Y|Q,$=K|J,tt=["x","y"],et=["clientX","clientY"];function it(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){_(t.options.enable,[t])&&i.handler(e)},this.init()}function nt(t,e,i){var n=i.pointers.length,s=i.changedPointers.length,r=e&G&&n-s==0,a=e&(W|j)&&n-s==0;i.isFirst=!!r,i.isFinal=!!a,r&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,s=n.length;i.firstInput||(i.firstInput=st(e)),s>1&&!i.firstMultiple?i.firstMultiple=st(e):1===s&&(i.firstMultiple=!1);var r=i.firstInput,a=i.firstMultiple,h=a?a.center:r.center,l=e.center=rt(n);e.timeStamp=m(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=lt(h,l),e.distance=ht(h,l),function(t,e){var i=e.center,n=t.offsetDelta||{},s=t.prevDelta||{},r=t.prevInput||{};e.eventType!==G&&r.eventType!==W||(s=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=s.x+(i.x-n.x),e.deltaY=s.y+(i.y-n.y)}(i,e),e.offsetDirection=ot(e.deltaX,e.deltaY);var c,u,d=at(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=p(d.x)>p(d.y)?d.x:d.y,e.scale=a?(c=a.pointers,ht((u=n)[0],u[1],et)/ht(c[0],c[1],et)):1,e.rotation=a?function(t,e){return lt(e[1],e[0],et)+lt(t[1],t[0],et)}(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,s,r,a=t.lastInterval||e,h=e.timeStamp-a.timeStamp;if(e.eventType!=j&&(h>V||a.velocity===o)){var l=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,u=at(h,l,c);n=u.x,s=u.y,i=p(u.x)>p(u.y)?u.x:u.y,r=ot(l,c),t.lastInterval=e}else i=a.velocity,n=a.velocityX,s=a.velocityY,r=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=s,e.direction=r}(i,e);var f=t.element;T(e.srcEvent.target,f)&&(f=e.srcEvent.target),e.target=f}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function st(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:d(t.pointers[i].clientX),clientY:d(t.pointers[i].clientY)},i++;return{timeStamp:m(),pointers:e,center:rt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function rt(t){var e=t.length;if(1===e)return{x:d(t[0].clientX),y:d(t[0].clientY)};for(var i=0,n=0,s=0;s<e;)i+=t[s].clientX,n+=t[s].clientY,s++;return{x:d(i/e),y:d(n/e)}}function at(t,e,i){return{x:e/t||0,y:i/t||0}}function ot(t,e){return t===e?Z:p(t)>=p(e)?t<0?q:X:e<0?Y:Q}function ht(t,e,i){i||(i=tt);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return Math.sqrt(n*n+s*s)}function lt(t,e,i){i||(i=tt);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return 180*Math.atan2(s,n)/Math.PI}it.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(k(this.element),this.evWin,this.domHandler)}};var ct={mousedown:G,mousemove:H,mouseup:W},ut="mousedown",dt="mousemove mouseup";function pt(){this.evEl=ut,this.evWin=dt,this.pressed=!1,it.apply(this,arguments)}w(pt,it,{handler:function(t){var e=ct[t.type];e&G&&0===t.button&&(this.pressed=!0),e&H&&1!==t.which&&(e=W),this.pressed&&(e&W&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:U,srcEvent:t}))}});var mt={pointerdown:G,pointermove:H,pointerup:W,pointercancel:j,pointerout:j},ft={2:F,3:"pen",4:U,5:"kinect"},gt="pointerdown",At="pointermove pointerup pointercancel";function vt(){this.evEl=gt,this.evWin=At,it.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}s.MSPointerEvent&&!s.PointerEvent&&(gt="MSPointerDown",At="MSPointerMove MSPointerUp MSPointerCancel"),w(vt,it,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),s=mt[n],r=ft[t.pointerType]||t.pointerType,a=r==F,o=L(e,t.pointerId,"pointerId");s&G&&(0===t.button||a)?o<0&&(e.push(t),o=e.length-1):s&(W|j)&&(i=!0),o<0||(e[o]=t,this.callback(this.manager,s,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(o,1))}});var yt={touchstart:G,touchmove:H,touchend:W,touchcancel:j},xt="touchstart",wt="touchstart touchmove touchend touchcancel";function bt(){this.evTarget=xt,this.evWin=wt,this.started=!1,it.apply(this,arguments)}function _t(t,e){var i=I(t.touches),n=I(t.changedTouches);return e&(W|j)&&(i=D(i.concat(n),"identifier",!0)),[i,n]}w(bt,it,{handler:function(t){var e=yt[t.type];if(e===G&&(this.started=!0),this.started){var i=_t.call(this,t,e);e&(W|j)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:F,srcEvent:t})}}});var Mt={touchstart:G,touchmove:H,touchend:W,touchcancel:j},St="touchstart touchmove touchend touchcancel";function Ct(){this.evTarget=St,this.targetIds={},it.apply(this,arguments)}function Tt(t,e){var i=I(t.touches),n=this.targetIds;if(e&(G|H)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var s,r,a=I(t.changedTouches),o=[],h=this.target;if(r=i.filter((function(t){return T(t.target,h)})),e===G)for(s=0;s<r.length;)n[r[s].identifier]=!0,s++;for(s=0;s<a.length;)n[a[s].identifier]&&o.push(a[s]),e&(W|j)&&delete n[a[s].identifier],s++;return o.length?[D(r.concat(o),"identifier",!0),o]:void 0}w(Ct,it,{handler:function(t){var e=Mt[t.type],i=Tt.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:F,srcEvent:t})}});var Pt=2500,Et=25;function Lt(){it.apply(this,arguments);var t=b(this.handler,this);this.touch=new Ct(this.manager,t),this.mouse=new pt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function It(t,e){t&G?(this.primaryTouch=e.changedPointers[0].identifier,Dt.call(this,e)):t&(W|j)&&Dt.call(this,e)}function Dt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),Pt)}}function zt(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var s=this.lastTouches[n],r=Math.abs(e-s.x),a=Math.abs(i-s.y);if(r<=Et&&a<=Et)return!0}return!1}w(Lt,it,{handler:function(t,e,i){var n=i.pointerType==F,s=i.pointerType==U;if(!(s&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)It.call(this,e,i);else if(s&&zt.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Rt=z(c.style,"touchAction"),kt=Rt!==o,Ot="compute",Bt="auto",Nt="manipulation",Ft="none",Ut="pan-x",Vt="pan-y",Gt=function(){if(!kt)return!1;var t={},e=s.CSS&&s.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){t[i]=!e||s.CSS.supports("touch-action",i)})),t}();function Ht(t,e){this.manager=t,this.set(e)}Ht.prototype={set:function(t){t==Ot&&(t=this.compute()),kt&&this.manager.element.style&&Gt[t]&&(this.manager.element.style[Rt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return A(this.manager.recognizers,(function(e){_(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(P(t,Ft))return Ft;var e=P(t,Ut),i=P(t,Vt);return e&&i?Ft:e||i?e?Ut:Vt:P(t,Nt)?Nt:Bt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,s=P(n,Ft)&&!Gt[Ft],r=P(n,Vt)&&!Gt[Vt],a=P(n,Ut)&&!Gt[Ut];if(s){var o=1===t.pointers.length,h=t.distance<2,l=t.deltaTime<250;if(o&&h&&l)return}if(!a||!r)return s||r&&i&K||a&&i&J?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Wt=1,jt=2,Zt=4,qt=8,Xt=qt,Yt=16,Qt=32;function Kt(t){this.options=h({},this.defaults,t||{}),this.id=R++,this.manager=null,this.options.enable=M(this.options.enable,!0),this.state=Wt,this.simultaneous={},this.requireFail=[]}function Jt(t){return t&Yt?"cancel":t&qt?"end":t&Zt?"move":t&jt?"start":""}function $t(t){return t==Q?"down":t==Y?"up":t==q?"left":t==X?"right":""}function te(t,e){var i=e.manager;return i?i.get(t):t}function ee(){Kt.apply(this,arguments)}function ie(){ee.apply(this,arguments),this.pX=null,this.pY=null}function ne(){ee.apply(this,arguments)}function se(){Kt.apply(this,arguments),this._timer=null,this._input=null}function re(){ee.apply(this,arguments)}function ae(){ee.apply(this,arguments)}function oe(){Kt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function he(t,e){return(e=e||{}).recognizers=M(e.recognizers,he.defaults.preset),new le(t,e)}function le(t,e){this.options=h({},he.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new(this.options.inputClass||(B?vt:N?Ct:O?Lt:pt))(this,nt),this.touchAction=new Ht(this,this.options.touchAction),ce(this,!0),A(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function ce(t,e){var i,n=t.element;n.style&&(A(t.options.cssProps,(function(s,r){i=z(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=s):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}Kt.prototype={defaults:{},set:function(t){return h(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(g(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=te(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return g(t,"dropRecognizeWith",this)||(t=te(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(g(t,"requireFailure",this))return this;var e=this.requireFail;return-1===L(e,t=te(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(g(t,"dropRequireFailure",this))return this;t=te(t,this);var e=L(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<qt&&n(e.options.event+Jt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=qt&&n(e.options.event+Jt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Qt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Qt|Wt)))return!1;t++}return!0},recognize:function(t){var e=h({},t);if(!_(this.options.enable,[this,e]))return this.reset(),void(this.state=Qt);this.state&(Xt|Yt|Qt)&&(this.state=Wt),this.state=this.process(e),this.state&(jt|Zt|qt|Yt)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},w(ee,Kt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=e&(jt|Zt),s=this.attrTest(t);return n&&(i&j||!s)?e|Yt:n||s?i&W?e|qt:e&jt?e|Zt:jt:Qt}}),w(ie,ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:$},getTouchAction:function(){var t=this.options.direction,e=[];return t&K&&e.push(Vt),t&J&&e.push(Ut),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,s=t.direction,r=t.deltaX,a=t.deltaY;return s&e.direction||(e.direction&K?(s=0===r?Z:r<0?q:X,i=r!=this.pX,n=Math.abs(t.deltaX)):(s=0===a?Z:a<0?Y:Q,i=a!=this.pY,n=Math.abs(t.deltaY))),t.direction=s,i&&n>e.threshold&&s&e.direction},attrTest:function(t){return ee.prototype.attrTest.call(this,t)&&(this.state&jt||!(this.state&jt)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=$t(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),w(ne,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ft]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&jt)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),w(se,Kt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Bt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(W|j)&&!s)this.reset();else if(t.eventType&G)this.reset(),this._timer=f((function(){this.state=Xt,this.tryEmit()}),e.time,this);else if(t.eventType&W)return Xt;return Qt},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===Xt&&(t&&t.eventType&W?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=m(),this.manager.emit(this.options.event,this._input)))}}),w(re,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ft]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&jt)}}),w(ae,ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:K|J,pointers:1},getTouchAction:function(){return ie.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(K|J)?e=t.overallVelocity:i&K?e=t.overallVelocityX:i&J&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&t.eventType&W},emit:function(t){var e=$t(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),w(oe,Kt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Nt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime<e.time;if(this.reset(),t.eventType&G&&0===this.count)return this.failTimeout();if(n&&s&&i){if(t.eventType!=W)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||ht(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&r?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=Xt,this.tryEmit()}),e.interval,this),jt):Xt}return Qt},failTimeout:function(){return this._timer=f((function(){this.state=Qt}),this.options.interval,this),Qt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Xt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),he.VERSION="2.0.7",he.defaults={domEvents:!1,touchAction:Ot,enable:!0,inputTarget:null,inputClass:null,preset:[[re,{enable:!1}],[ne,{enable:!1},["rotate"]],[ae,{direction:K}],[ie,{direction:K},["swipe"]],[oe],[oe,{event:"doubletap",taps:2},["tap"]],[se]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},le.prototype={set:function(t){return h(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,s=e.curRecognizer;(!s||s&&s.state&Xt)&&(s=e.curRecognizer=null);for(var r=0;r<n.length;)i=n[r],2===e.stopped||s&&i!=s&&!i.canRecognizeWith(s)?i.reset():i.recognize(t),!s&&i.state&(jt|Zt|qt)&&(s=e.curRecognizer=i),r++}},get:function(t){if(t instanceof Kt)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(g(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(g(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=L(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==o&&e!==o){var i=this.handlers;return A(E(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(t!==o){var i=this.handlers;return A(E(t),(function(t){e?i[t]&&i[t].splice(L(i[t],e),1):delete i[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var i=r.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},destroy:function(){this.element&&ce(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h(he,{INPUT_START:G,INPUT_MOVE:H,INPUT_END:W,INPUT_CANCEL:j,STATE_POSSIBLE:Wt,STATE_BEGAN:jt,STATE_CHANGED:Zt,STATE_ENDED:qt,STATE_RECOGNIZED:Xt,STATE_CANCELLED:Yt,STATE_FAILED:Qt,DIRECTION_NONE:Z,DIRECTION_LEFT:q,DIRECTION_RIGHT:X,DIRECTION_UP:Y,DIRECTION_DOWN:Q,DIRECTION_HORIZONTAL:K,DIRECTION_VERTICAL:J,DIRECTION_ALL:$,Manager:le,Input:it,TouchAction:Ht,TouchInput:Ct,MouseInput:pt,PointerEventInput:vt,TouchMouseInput:Lt,SingleTouchInput:bt,Recognizer:Kt,AttrRecognizer:ee,Tap:oe,Pan:ie,Swipe:ae,Pinch:ne,Rotate:re,Press:se,on:S,off:C,each:A,merge:x,extend:y,assign:h,inherit:w,bindFn:b,prefixed:z}),(void 0!==s?s:"undefined"!=typeof self?self:{}).Hammer=he,(n=function(){return he}.call(e,i,e,t))===o||(t.exports=n)}(window,document)},9483:(t,e,i)=>{t.exports=function t(e,i,n){function s(a,o){if(!i[a]){if(!e[a]){if(r)return r(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var l=i[a]={exports:{}};e[a][0].call(l.exports,(function(t){return s(e[a][1][t]||t)}),l,l.exports,t,e,i,n)}return i[a].exports}for(var r=void 0,a=0;a<n.length;a++)s(n[a]);return s}({1:[function(t,e,n){(function(t){"use strict";var i,n,s=t.MutationObserver||t.WebKitMutationObserver;if(s){var r=0,a=new s(c),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),i=function(){o.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var h=new t.MessageChannel;h.port1.onmessage=c,i=function(){h.port2.postMessage(0)}}var l=[];function c(){var t,e;n=!0;for(var i=l.length;i;){for(e=l,l=[],t=-1;++t<i;)e[t]();i=l.length}n=!1}e.exports=function(t){1!==l.push(t)||n||i()}}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,i){"use strict";var n=t(1);function s(){}var r={},a=["REJECTED"],o=["FULFILLED"],h=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==s&&p(this,t)}function c(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function u(t,e,i){n((function(){var n;try{n=e(i)}catch(e){return r.reject(t,e)}n===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,n)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var i=!1;function n(e){i||(i=!0,r.reject(t,e))}function s(e){i||(i=!0,r.resolve(t,e))}var a=m((function(){e(s,n)}));"error"===a.status&&n(a.value)}function m(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}e.exports=l,l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var i=new this.constructor(s);return this.state!==h?u(i,this.state===o?t:e,this.outcome):this.queue.push(new c(i,t,e)),i},c.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){r.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=m(d,e);if("error"===i.status)return r.reject(t,i.value);var n=i.value;if(n)p(t,n);else{t.state=o,t.outcome=e;for(var s=-1,a=t.queue.length;++s<a;)t.queue[s].callFulfilled(e)}return t},r.reject=function(t,e){t.state=a,t.outcome=e;for(var i=-1,n=t.queue.length;++i<n;)t.queue[i].callRejected(e);return t},l.resolve=function(t){return t instanceof this?t:r.resolve(new this(s),t)},l.reject=function(t){var e=new this(s);return r.reject(e,t)},l.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,n=!1;if(!i)return this.resolve([]);for(var a=new Array(i),o=0,h=-1,l=new this(s);++h<i;)c(t[h],h);return l;function c(t,s){e.resolve(t).then((function(t){a[s]=t,++o!==i||n||(n=!0,r.resolve(l,a))}),(function(t){n||(n=!0,r.reject(l,t))}))}},l.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i,n=t.length,a=!1;if(!n)return this.resolve([]);for(var o=-1,h=new this(s);++o<n;)i=t[o],e.resolve(i).then((function(t){a||(a=!0,r.resolve(h,t))}),(function(t){a||(a=!0,r.reject(h,t))}));return h}},{1:1}],3:[function(t,e,n){(function(e){"use strict";"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==i.g?i.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,i){"use strict";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};var s=function(){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}}();function r(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(s){if("TypeError"!==s.name)throw s;for(var i=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<t.length;n+=1)i.append(t[n]);return i.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var a=Promise;function o(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function h(t,e,i){"function"==typeof e&&t.then(e),"function"==typeof i&&t.catch(i)}function l(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function c(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var u="local-forage-detect-blob-support",d=void 0,p={},m=Object.prototype.toString,f="readonly",g="readwrite";function A(t){for(var e=t.length,i=new ArrayBuffer(e),n=new Uint8Array(i),s=0;s<e;s++)n[s]=t.charCodeAt(s);return i}function v(t){return"boolean"==typeof d?a.resolve(d):function(t){return new a((function(e){var i=t.transaction(u,g),n=r([""]);i.objectStore(u).put(n,"key"),i.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},i.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);e(i||!t||parseInt(t[1],10)>=43)}})).catch((function(){return!1}))}(t).then((function(t){return d=t}))}function y(t){var e=p[t.name],i={};i.promise=new a((function(t,e){i.resolve=t,i.reject=e})),e.deferredOperations.push(i),e.dbReady?e.dbReady=e.dbReady.then((function(){return i.promise})):e.dbReady=i.promise}function x(t){var e=p[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function w(t,e){var i=p[t.name].deferredOperations.pop();if(i)return i.reject(e),i.promise}function b(t,e){return new a((function(i,n){if(p[t.name]=p[t.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},t.db){if(!e)return i(t.db);y(t),t.db.close()}var r=[t.name];e&&r.push(t.version);var a=s.open.apply(s,r);e&&(a.onupgradeneeded=function(e){var i=a.result;try{i.createObjectStore(t.storeName),e.oldVersion<=1&&i.createObjectStore(u)}catch(i){if("ConstraintError"!==i.name)throw i;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),a.onerror=function(t){t.preventDefault(),n(a.error)},a.onsuccess=function(){var e=a.result;e.onversionchange=function(t){t.target.close()},i(e),x(t)}}))}function _(t){return b(t,!1)}function M(t){return b(t,!0)}function S(t,e){if(!t.db)return!0;var i=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,s=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),s||i){if(i){var r=t.db.version+1;r>t.version&&(t.version=r)}return!0}return!1}function C(t){return r([A(atob(t.data))],{type:t.type})}function T(t){return t&&t.__local_forage_encoded_blob}function P(t){var e=this,i=e._initReady().then((function(){var t=p[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return h(i,t,t),i}function E(t,e,i,n){void 0===n&&(n=1);try{var s=t.db.transaction(t.storeName,e);i(null,s)}catch(s){if(n>0&&(!t.db||"InvalidStateError"===s.name||"NotFoundError"===s.name))return a.resolve().then((function(){if(!t.db||"NotFoundError"===s.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),M(t)})).then((function(){return function(t){y(t);for(var e=p[t.name],i=e.forages,n=0;n<i.length;n++){var s=i[n];s._dbInfo.db&&(s._dbInfo.db.close(),s._dbInfo.db=null)}return t.db=null,_(t).then((function(e){return t.db=e,S(t)?M(t):e})).then((function(n){t.db=e.db=n;for(var s=0;s<i.length;s++)i[s]._dbInfo.db=n})).catch((function(e){throw w(t,e),e}))}(t).then((function(){E(t,e,i,n-1)}))})).catch(i);i(s)}}var L={_driver:"asyncStorage",_initStorage:function(t){var e=this,i={db:null};if(t)for(var n in t)i[n]=t[n];var s=p[i.name];s||(s={forages:[],db:null,dbReady:null,deferredOperations:[]},p[i.name]=s),s.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=P);var r=[];function o(){return a.resolve()}for(var h=0;h<s.forages.length;h++){var l=s.forages[h];l!==e&&r.push(l._initReady().catch(o))}var c=s.forages.slice(0);return a.all(r).then((function(){return i.db=s.db,_(i)})).then((function(t){return i.db=t,S(i,e._defaultConfig.version)?M(i):t})).then((function(t){i.db=s.db=t,e._dbInfo=i;for(var n=0;n<c.length;n++){var r=c[n];r!==e&&(r._dbInfo.db=i.db,r._dbInfo.version=i.version)}}))},_support:function(){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}}(),iterate:function(t,e){var i=this,n=new a((function(e,n){i.ready().then((function(){E(i._dbInfo,f,(function(s,r){if(s)return n(s);try{var a=r.objectStore(i._dbInfo.storeName).openCursor(),o=1;a.onsuccess=function(){var i=a.result;if(i){var n=i.value;T(n)&&(n=C(n));var s=t(n,i.key,o++);void 0!==s?e(s):i.continue()}else e()},a.onerror=function(){n(a.error)}}catch(t){n(t)}}))})).catch(n)}));return o(n,e),n},getItem:function(t,e){var i=this;t=l(t);var n=new a((function(e,n){i.ready().then((function(){E(i._dbInfo,f,(function(s,r){if(s)return n(s);try{var a=r.objectStore(i._dbInfo.storeName).get(t);a.onsuccess=function(){var t=a.result;void 0===t&&(t=null),T(t)&&(t=C(t)),e(t)},a.onerror=function(){n(a.error)}}catch(t){n(t)}}))})).catch(n)}));return o(n,e),n},setItem:function(t,e,i){var n=this;t=l(t);var s=new a((function(i,s){var r;n.ready().then((function(){return r=n._dbInfo,"[object Blob]"===m.call(e)?v(r.db).then((function(t){return t?e:(i=e,new a((function(t,e){var n=new FileReader;n.onerror=e,n.onloadend=function(e){var n=btoa(e.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:i.type})},n.readAsBinaryString(i)})));var i})):e})).then((function(e){E(n._dbInfo,g,(function(r,a){if(r)return s(r);try{var o=a.objectStore(n._dbInfo.storeName);null===e&&(e=void 0);var h=o.put(e,t);a.oncomplete=function(){void 0===e&&(e=null),i(e)},a.onabort=a.onerror=function(){var t=h.error?h.error:h.transaction.error;s(t)}}catch(t){s(t)}}))})).catch(s)}));return o(s,i),s},removeItem:function(t,e){var i=this;t=l(t);var n=new a((function(e,n){i.ready().then((function(){E(i._dbInfo,g,(function(s,r){if(s)return n(s);try{var a=r.objectStore(i._dbInfo.storeName).delete(t);r.oncomplete=function(){e()},r.onerror=function(){n(a.error)},r.onabort=function(){var t=a.error?a.error:a.transaction.error;n(t)}}catch(t){n(t)}}))})).catch(n)}));return o(n,e),n},clear:function(t){var e=this,i=new a((function(t,i){e.ready().then((function(){E(e._dbInfo,g,(function(n,s){if(n)return i(n);try{var r=s.objectStore(e._dbInfo.storeName).clear();s.oncomplete=function(){t()},s.onabort=s.onerror=function(){var t=r.error?r.error:r.transaction.error;i(t)}}catch(t){i(t)}}))})).catch(i)}));return o(i,t),i},length:function(t){var e=this,i=new a((function(t,i){e.ready().then((function(){E(e._dbInfo,f,(function(n,s){if(n)return i(n);try{var r=s.objectStore(e._dbInfo.storeName).count();r.onsuccess=function(){t(r.result)},r.onerror=function(){i(r.error)}}catch(t){i(t)}}))})).catch(i)}));return o(i,t),i},key:function(t,e){var i=this,n=new a((function(e,n){t<0?e(null):i.ready().then((function(){E(i._dbInfo,f,(function(s,r){if(s)return n(s);try{var a=r.objectStore(i._dbInfo.storeName),o=!1,h=a.openKeyCursor();h.onsuccess=function(){var i=h.result;i?0===t||o?e(i.key):(o=!0,i.advance(t)):e(null)},h.onerror=function(){n(h.error)}}catch(t){n(t)}}))})).catch(n)}));return o(n,e),n},keys:function(t){var e=this,i=new a((function(t,i){e.ready().then((function(){E(e._dbInfo,f,(function(n,s){if(n)return i(n);try{var r=s.objectStore(e._dbInfo.storeName).openKeyCursor(),a=[];r.onsuccess=function(){var e=r.result;e?(a.push(e.key),e.continue()):t(a)},r.onerror=function(){i(r.error)}}catch(t){i(t)}}))})).catch(i)}));return o(i,t),i},dropInstance:function(t,e){e=c.apply(this,arguments);var i,n=this.config();if((t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName),t.name){var r=t.name===n.name&&this._dbInfo.db?a.resolve(this._dbInfo.db):_(t).then((function(e){var i=p[t.name],n=i.forages;i.db=e;for(var s=0;s<n.length;s++)n[s]._dbInfo.db=e;return e}));i=t.storeName?r.then((function(e){if(e.objectStoreNames.contains(t.storeName)){var i=e.version+1;y(t);var n=p[t.name],r=n.forages;e.close();for(var o=0;o<r.length;o++){var h=r[o];h._dbInfo.db=null,h._dbInfo.version=i}var l=new a((function(e,n){var r=s.open(t.name,i);r.onerror=function(t){r.result.close(),n(t)},r.onupgradeneeded=function(){r.result.deleteObjectStore(t.storeName)},r.onsuccess=function(){var t=r.result;t.close(),e(t)}}));return l.then((function(t){n.db=t;for(var e=0;e<r.length;e++){var i=r[e];i._dbInfo.db=t,x(i._dbInfo)}})).catch((function(e){throw(w(t,e)||a.resolve()).catch((function(){})),e}))}})):r.then((function(e){y(t);var i=p[t.name],n=i.forages;e.close();for(var r=0;r<n.length;r++)n[r]._dbInfo.db=null;var o=new a((function(e,i){var n=s.deleteDatabase(t.name);n.onerror=function(){var t=n.result;t&&t.close(),i(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 o.then((function(t){i.db=t;for(var e=0;e<n.length;e++)x(n[e]._dbInfo)})).catch((function(e){throw(w(t,e)||a.resolve()).catch((function(){})),e}))}))}else i=a.reject("Invalid arguments");return o(i,e),i}};var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D="~~local_forage_type~",z=/^~~local_forage_type~([^~]+)~/,R="__lfsc__:",k=R.length,O="arbf",B="blob",N="si08",F="ui08",U="uic8",V="si16",G="si32",H="ur16",W="ui32",j="fl32",Z="fl64",q=k+O.length,X=Object.prototype.toString;function Y(t){var e,i,n,s,r,a=.75*t.length,o=t.length,h=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var l=new ArrayBuffer(a),c=new Uint8Array(l);for(e=0;e<o;e+=4)i=I.indexOf(t[e]),n=I.indexOf(t[e+1]),s=I.indexOf(t[e+2]),r=I.indexOf(t[e+3]),c[h++]=i<<2|n>>4,c[h++]=(15&n)<<4|s>>2,c[h++]=(3&s)<<6|63&r;return l}function Q(t){var e,i=new Uint8Array(t),n="";for(e=0;e<i.length;e+=3)n+=I[i[e]>>2],n+=I[(3&i[e])<<4|i[e+1]>>4],n+=I[(15&i[e+1])<<2|i[e+2]>>6],n+=I[63&i[e+2]];return i.length%3==2?n=n.substring(0,n.length-1)+"=":i.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var K={serialize:function(t,e){var i="";if(t&&(i=X.call(t)),t&&("[object ArrayBuffer]"===i||t.buffer&&"[object ArrayBuffer]"===X.call(t.buffer))){var n,s=R;t instanceof ArrayBuffer?(n=t,s+=O):(n=t.buffer,"[object Int8Array]"===i?s+=N:"[object Uint8Array]"===i?s+=F:"[object Uint8ClampedArray]"===i?s+=U:"[object Int16Array]"===i?s+=V:"[object Uint16Array]"===i?s+=H:"[object Int32Array]"===i?s+=G:"[object Uint32Array]"===i?s+=W:"[object Float32Array]"===i?s+=j:"[object Float64Array]"===i?s+=Z:e(new Error("Failed to get type for BinaryArray"))),e(s+Q(n))}else if("[object Blob]"===i){var r=new FileReader;r.onload=function(){var i=D+t.type+"~"+Q(this.result);e(R+B+i)},r.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(i){console.error("Couldn't convert value into a JSON string: ",t),e(null,i)}},deserialize:function(t){if(t.substring(0,k)!==R)return JSON.parse(t);var e,i=t.substring(q),n=t.substring(k,q);if(n===B&&z.test(i)){var s=i.match(z);e=s[1],i=i.substring(s[0].length)}var a=Y(i);switch(n){case O:return a;case B:return r([a],{type:e});case N:return new Int8Array(a);case F:return new Uint8Array(a);case U:return new Uint8ClampedArray(a);case V:return new Int16Array(a);case H:return new Uint16Array(a);case G:return new Int32Array(a);case W:return new Uint32Array(a);case j:return new Float32Array(a);case Z:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:Y,bufferToString:Q};function J(t,e,i,n){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,n)}function $(t,e,i,n,s,r){t.executeSql(i,n,s,(function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,o){o.rows.length?r(t,a):J(t,e,(function(){t.executeSql(i,n,s,r)}),r)}),r):r(t,a)}),r)}function tt(t,e,i,n){var s=this;t=l(t);var r=new a((function(r,a){s.ready().then((function(){void 0===e&&(e=null);var o=e,h=s._dbInfo;h.serializer.serialize(e,(function(e,l){l?a(l):h.db.transaction((function(i){$(i,h,"INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[t,e],(function(){r(o)}),(function(t,e){a(e)}))}),(function(e){if(e.code===e.QUOTA_ERR){if(n>0)return void r(tt.apply(s,[t,o,i,n-1]));a(e)}}))}))})).catch(a)}));return o(r,i),r}var et={_driver:"webSQLStorage",_initStorage:function(t){var e=this,i={db:null};if(t)for(var n in t)i[n]="string"!=typeof t[n]?t[n].toString():t[n];var s=new a((function(t,n){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(t){return n(t)}i.db.transaction((function(s){J(s,i,(function(){e._dbInfo=i,t()}),(function(t,e){n(e)}))}),n)}));return i.serializer=K,s},_support:"function"==typeof openDatabase,iterate:function(t,e){var i=this,n=new a((function(e,n){i.ready().then((function(){var s=i._dbInfo;s.db.transaction((function(i){$(i,s,"SELECT * FROM "+s.storeName,[],(function(i,n){for(var r=n.rows,a=r.length,o=0;o<a;o++){var h=r.item(o),l=h.value;if(l&&(l=s.serializer.deserialize(l)),void 0!==(l=t(l,h.key,o+1)))return void e(l)}e()}),(function(t,e){n(e)}))}))})).catch(n)}));return o(n,e),n},getItem:function(t,e){var i=this;t=l(t);var n=new a((function(e,n){i.ready().then((function(){var s=i._dbInfo;s.db.transaction((function(i){$(i,s,"SELECT * FROM "+s.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,i){var n=i.rows.length?i.rows.item(0).value:null;n&&(n=s.serializer.deserialize(n)),e(n)}),(function(t,e){n(e)}))}))})).catch(n)}));return o(n,e),n},setItem:function(t,e,i){return tt.apply(this,[t,e,i,1])},removeItem:function(t,e){var i=this;t=l(t);var n=new a((function(e,n){i.ready().then((function(){var s=i._dbInfo;s.db.transaction((function(i){$(i,s,"DELETE FROM "+s.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){n(e)}))}))})).catch(n)}));return o(n,e),n},clear:function(t){var e=this,i=new a((function(t,i){e.ready().then((function(){var n=e._dbInfo;n.db.transaction((function(e){$(e,n,"DELETE FROM "+n.storeName,[],(function(){t()}),(function(t,e){i(e)}))}))})).catch(i)}));return o(i,t),i},length:function(t){var e=this,i=new a((function(t,i){e.ready().then((function(){var n=e._dbInfo;n.db.transaction((function(e){$(e,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(e,i){var n=i.rows.item(0).c;t(n)}),(function(t,e){i(e)}))}))})).catch(i)}));return o(i,t),i},key:function(t,e){var i=this,n=new a((function(e,n){i.ready().then((function(){var s=i._dbInfo;s.db.transaction((function(i){$(i,s,"SELECT key FROM "+s.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,i){var n=i.rows.length?i.rows.item(0).key:null;e(n)}),(function(t,e){n(e)}))}))})).catch(n)}));return o(n,e),n},keys:function(t){var e=this,i=new a((function(t,i){e.ready().then((function(){var n=e._dbInfo;n.db.transaction((function(e){$(e,n,"SELECT key FROM "+n.storeName,[],(function(e,i){for(var n=[],s=0;s<i.rows.length;s++)n.push(i.rows.item(s).key);t(n)}),(function(t,e){i(e)}))}))})).catch(i)}));return o(i,t),i},dropInstance:function(t,e){e=c.apply(this,arguments);var i=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||i.name,t.storeName=t.storeName||i.storeName);var n,s=this;return o(n=t.name?new a((function(e){var n;n=t.name===i.name?s._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:n,storeNames:[t.storeName]}):e(function(t){return new a((function(e,i){t.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(i,n){for(var s=[],r=0;r<n.rows.length;r++)s.push(n.rows.item(r).name);e({db:t,storeNames:s})}),(function(t,e){i(e)}))}),(function(t){i(t)}))}))}(n))})).then((function(t){return new a((function(e,i){t.db.transaction((function(n){function s(t){return new a((function(e,i){n.executeSql("DROP TABLE IF EXISTS "+t,[],(function(){e()}),(function(t,e){i(e)}))}))}for(var r=[],o=0,h=t.storeNames.length;o<h;o++)r.push(s(t.storeNames[o]));a.all(r).then((function(){e()})).catch((function(t){i(t)}))}),(function(t){i(t)}))}))})):a.reject("Invalid arguments"),e),n}};function it(t,e){var i=t.name+"/";return t.storeName!==e.storeName&&(i+=t.storeName+"/"),i}function nt(){return!function(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}()||localStorage.length>0}var st={_driver:"localStorageWrapper",_initStorage:function(t){var e={};if(t)for(var i in t)e[i]=t[i];return e.keyPrefix=it(t,this._defaultConfig),nt()?(this._dbInfo=e,e.serializer=K,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}(),iterate:function(t,e){var i=this,n=i.ready().then((function(){for(var e=i._dbInfo,n=e.keyPrefix,s=n.length,r=localStorage.length,a=1,o=0;o<r;o++){var h=localStorage.key(o);if(0===h.indexOf(n)){var l=localStorage.getItem(h);if(l&&(l=e.serializer.deserialize(l)),void 0!==(l=t(l,h.substring(s),a++)))return l}}}));return o(n,e),n},getItem:function(t,e){var i=this;t=l(t);var n=i.ready().then((function(){var e=i._dbInfo,n=localStorage.getItem(e.keyPrefix+t);return n&&(n=e.serializer.deserialize(n)),n}));return o(n,e),n},setItem:function(t,e,i){var n=this;t=l(t);var s=n.ready().then((function(){void 0===e&&(e=null)