!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=72)}([function(e,t,n){e.exports=n(43)},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){t=t;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},f=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,s=i/(4*o),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,u=e.min(4*c,i);if(c){for(var l=0;l>>2];e.sigBytes-=t}},v=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:h}),reset:function(){l.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=o.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(c)},parse:function(e){var t=c.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=o.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return v.create({ciphertext:t,salt:r})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=o.random(8));var i=u.create({keySize:t+n}).compute(e,r),a=o.create(i.words.slice(t),4*n);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:r})}},b=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=y.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()},"object"===c(t)?e.exports=t=s(n(0),n(2)):(i=[n(0),n(2)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r,i,o,a,s;return r=(n=(t=e).lib).Base,i=n.WordArray,a=(o=t.algo).MD5,s=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),o=i.create(),a=o.words,s=n.keySize,c=n.iterations;a.length>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-a%4*2;i[o>>>2]|=(s|c)<<24-o%4*8,o++}return n.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],v=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],b=e[t+8],w=e[t+9],k=e[t+10],x=e[t+11],_=e[t+12],$=e[t+13],S=e[t+14],M=e[t+15],C=o[0],A=o[1],I=o[2],O=o[3];C=u(C,A,I,O,a,7,s[0]),O=u(O,C,A,I,c,12,s[1]),I=u(I,O,C,A,p,17,s[2]),A=u(A,I,O,C,h,22,s[3]),C=u(C,A,I,O,v,7,s[4]),O=u(O,C,A,I,m,12,s[5]),I=u(I,O,C,A,y,17,s[6]),A=u(A,I,O,C,g,22,s[7]),C=u(C,A,I,O,b,7,s[8]),O=u(O,C,A,I,w,12,s[9]),I=u(I,O,C,A,k,17,s[10]),A=u(A,I,O,C,x,22,s[11]),C=u(C,A,I,O,_,7,s[12]),O=u(O,C,A,I,$,12,s[13]),I=u(I,O,C,A,S,17,s[14]),C=l(C,A=u(A,I,O,C,M,22,s[15]),I,O,c,5,s[16]),O=l(O,C,A,I,y,9,s[17]),I=l(I,O,C,A,x,14,s[18]),A=l(A,I,O,C,a,20,s[19]),C=l(C,A,I,O,m,5,s[20]),O=l(O,C,A,I,k,9,s[21]),I=l(I,O,C,A,M,14,s[22]),A=l(A,I,O,C,v,20,s[23]),C=l(C,A,I,O,w,5,s[24]),O=l(O,C,A,I,S,9,s[25]),I=l(I,O,C,A,h,14,s[26]),A=l(A,I,O,C,b,20,s[27]),C=l(C,A,I,O,$,5,s[28]),O=l(O,C,A,I,p,9,s[29]),I=l(I,O,C,A,g,14,s[30]),C=f(C,A=l(A,I,O,C,_,20,s[31]),I,O,m,4,s[32]),O=f(O,C,A,I,b,11,s[33]),I=f(I,O,C,A,x,16,s[34]),A=f(A,I,O,C,S,23,s[35]),C=f(C,A,I,O,c,4,s[36]),O=f(O,C,A,I,v,11,s[37]),I=f(I,O,C,A,g,16,s[38]),A=f(A,I,O,C,k,23,s[39]),C=f(C,A,I,O,$,4,s[40]),O=f(O,C,A,I,a,11,s[41]),I=f(I,O,C,A,h,16,s[42]),A=f(A,I,O,C,y,23,s[43]),C=f(C,A,I,O,w,4,s[44]),O=f(O,C,A,I,_,11,s[45]),I=f(I,O,C,A,M,16,s[46]),C=d(C,A=f(A,I,O,C,p,23,s[47]),I,O,a,6,s[48]),O=d(O,C,A,I,g,10,s[49]),I=d(I,O,C,A,S,15,s[50]),A=d(A,I,O,C,m,21,s[51]),C=d(C,A,I,O,_,6,s[52]),O=d(O,C,A,I,h,10,s[53]),I=d(I,O,C,A,k,15,s[54]),A=d(A,I,O,C,c,21,s[55]),C=d(C,A,I,O,b,6,s[56]),O=d(O,C,A,I,M,10,s[57]),I=d(I,O,C,A,y,15,s[58]),A=d(A,I,O,C,$,21,s[59]),C=d(C,A,I,O,v,6,s[60]),O=d(O,C,A,I,x,10,s[61]),I=d(I,O,C,A,p,15,s[62]),A=d(A,I,O,C,w,21,s[63]),o[0]=o[0]+C|0,o[1]=o[1]+A|0,o[2]=o[2]+I|0,o[3]=o[3]+O|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<>>32-o)+t}function l(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<>>32-o)+t}function f(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<>>32-o)+t}function d(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<>>32-o)+t}n.MD5=o._createHelper(c),n.HmacMD5=o._createHmacHelper(c)}(Math),e.MD5},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){"use strict";(function(e){function r(){return"undefined"!=typeof window?window:void 0!==e?e:null}function i(){return!("undefined"!=typeof document&&document.documentMode||/Edge/.test(navigator.userAgent))&&r().crypto&&r().crypto.subtle}function o(){return r().crypto?r().crypto.subtle:null}function a(){var e=r(),t=e.crypto||e.msCrypto;if(t){var n=new Uint32Array(4);t.getRandomValues(n);var i=-1;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){i++;var t=n[i>>3]>>i%8*4&15;return("x"==e?t:3&t|8).toString(16)}))}var o=(new Date).getTime();return e.performance&&"function"==typeof e.performance.now&&(o+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(o+16*Math.random())%16|0;return o=Math.floor(o/16),("x"==e?t:3&t|8).toString(16)}))}n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}))}).call(this,n(35))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r,i,o;return n=(t=e).lib,r=n.Base,i=n.WordArray,(o=t.x64={}).Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r>>31}var f=(r<<5|r>>>27)+c+a[u];f+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,c=s,s=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s),e.SHA1},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r;n=(t=e).lib.Base,r=t.enc.Utf8,t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,u=0;u>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=v+u[p-7]+y+u[p-16]}var g=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+c[p]+u[p];d=f,f=l,l=s,s=a+w|0,a=o,o=i,i=r,r=w+(b+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=o._createHelper(l),n.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,o=r.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=n.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],f=n[6],d=n[7],p=r.high,h=r.low,v=i.high,m=i.low,y=o.high,g=o.low,b=a.high,w=a.low,k=s.high,x=s.low,_=l.high,$=l.low,S=f.high,M=f.low,C=d.high,A=d.low,I=p,O=h,E=v,D=m,R=y,P=g,T=b,j=w,N=k,F=x,L=_,U=$,B=S,H=M,z=C,V=A,W=0;W<80;W++){var K=u[W];if(W<16)var q=K.high=0|e[t+2*W],J=K.low=0|e[t+2*W+1];else{var G=u[W-15],Y=G.high,Z=G.low,X=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,Q=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),ee=u[W-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=u[W-7],ae=oe.high,se=oe.low,ce=u[W-16],ue=ce.high,le=ce.low;q=(q=(q=X+ae+((J=Q+se)>>>0>>0?1:0))+re+((J+=ie)>>>0>>0?1:0))+ue+((J+=le)>>>0>>0?1:0),K.high=q,K.low=J}var fe,de=N&L^~N&B,pe=F&U^~F&H,he=I&E^I&R^E&R,ve=O&D^O&P^D&P,me=(I>>>28|O<<4)^(I<<30|O>>>2)^(I<<25|O>>>7),ye=(O>>>28|I<<4)^(O<<30|I>>>2)^(O<<25|I>>>7),ge=(N>>>14|F<<18)^(N>>>18|F<<14)^(N<<23|F>>>9),be=(F>>>14|N<<18)^(F>>>18|N<<14)^(F<<23|N>>>9),we=c[W],ke=we.high,xe=we.low,_e=z+ge+((fe=V+be)>>>0>>0?1:0),$e=ye+ve;z=B,V=H,B=L,H=U,L=N,U=F,N=T+(_e=(_e=(_e=_e+de+((fe+=pe)>>>0>>0?1:0))+ke+((fe+=xe)>>>0>>0?1:0))+q+((fe+=J)>>>0>>0?1:0))+((F=j+fe|0)>>>0>>0?1:0)|0,T=R,j=P,R=E,P=D,E=I,D=O,I=_e+(me+he+($e>>>0>>0?1:0))+((O=fe+$e|0)>>>0>>0?1:0)|0}h=r.low=h+O,r.high=p+I+(h>>>0>>0?1:0),m=i.low=m+D,i.high=v+E+(m>>>0>>0?1:0),g=o.low=g+P,o.high=y+R+(g>>>0

>>0?1:0),w=a.low=w+j,a.high=b+T+(w>>>0>>0?1:0),x=s.low=x+F,s.high=k+N+(x>>>0>>0?1:0),$=l.low=$+U,l.high=_+L+($>>>0>>0?1:0),M=f.low=M+H,f.high=S+B+(M>>>0>>0?1:0),A=d.low=A+V,d.high=C+z+(A>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=n._createHelper(l),t.HmacSHA512=n._createHmacHelper(l)}(),e.SHA512},"object"===c(t)?e.exports=t=s(n(0),n(6)):(i=[n(0),n(6)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return e},"object"===c(t)?e.exports=t=s(n(0),n(6),n(12),n(13),n(3),n(4),n(7),n(9),n(14),n(10),n(15),n(16),n(17),n(8),n(18),n(2),n(1),n(19),n(20),n(21),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29),n(30),n(31),n(32),n(33),n(34)):(i=[n(0),n(6),n(12),n(13),n(3),n(4),n(7),n(9),n(14),n(10),n(15),n(16),n(17),n(8),n(18),n(2),n(1),n(19),n(20),n(21),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29),n(30),n(31),n(32),n(33),n(34)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,n=t.init;(t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=t}}(),e.lib.WordArray},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){var t=e,n=t.lib.WordArray,r=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return n.create(r,2*t)}}}(),e.enc.Utf16},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r,i,o;return n=(t=e).lib.WordArray,r=t.algo,i=r.SHA256,o=r.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=i._createHelper(o),t.HmacSHA224=i._createHmacHelper(o),e.SHA224},"object"===c(t)?e.exports=t=s(n(0),n(9)):(i=[n(0),n(9)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r,i,o,a,s;return n=(t=e).x64,r=n.Word,i=n.WordArray,o=t.algo,a=o.SHA512,s=o.SHA384=a.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=a._createHelper(s),t.HmacSHA384=a._createHmacHelper(s),e.SHA384},"object"===c(t)?e.exports=t=s(n(0),n(6),n(10)):(i=[n(0),n(6),n(10)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.x64.Word,s=n.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,d=0;d<7;d++){if(1&i){var p=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(A=n[i]).high^=a,A.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var p=0,h=0,v=0;v<5;v++)p^=(A=n[d+5*v]).high,h^=A.low;var m=f[d];m.high=p,m.low=h}for(d=0;d<5;d++){var y=f[(d+4)%5],g=f[(d+1)%5],b=g.high,w=g.low;for(p=y.high^(b<<1|w>>>31),h=y.low^(w<<1|b>>>31),v=0;v<5;v++)(A=n[d+5*v]).high^=p,A.low^=h}for(var k=1;k<25;k++){var x=(A=n[k]).high,_=A.low,$=c[k];$<32?(p=x<<$|_>>>32-$,h=_<<$|x>>>32-$):(p=_<<$-32|x>>>64-$,h=x<<$-32|_>>>64-$);var S=f[u[k]];S.high=p,S.low=h}var M=f[0],C=n[0];for(M.high=C.high,M.low=C.low,d=0;d<5;d++)for(v=0;v<5;v++){var A=n[k=d+5*v],I=f[k],O=f[(d+1)%5+5*v],E=f[(d+2)%5+5*v];A.high=I.high^~O.high&E.high,A.low=I.low^~O.low&E.low}A=n[0];var D=l[s];A.high^=D.high,A.low^=D.low}},_doFinalize:function(){var e=this._data,n=e.words,r=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l>>24)|4278255360&(d<<24|d>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(d)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=o._createHelper(d),n.HmacSHA3=o._createHmacHelper(d)}(Math),e.SHA3},"object"===c(t)?e.exports=t=s(n(0),n(6)):(i=[n(0),n(6)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){ /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ return function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,p,w,k,x,_,$,S,M,C,A=this._hash.words,I=f.words,O=d.words,E=s.words,D=c.words,R=u.words,P=l.words;for(x=o=A[0],_=a=A[1],$=p=A[2],S=w=A[3],M=k=A[4],n=0;n<80;n+=1)C=o+e[t+E[n]]|0,C+=n<16?h(a,p,w)+I[0]:n<32?v(a,p,w)+I[1]:n<48?m(a,p,w)+I[2]:n<64?y(a,p,w)+I[3]:g(a,p,w)+I[4],C=(C=b(C|=0,R[n]))+k|0,o=k,k=w,w=b(p,10),p=a,a=C,C=x+e[t+D[n]]|0,C+=n<16?g(_,$,S)+O[0]:n<32?y(_,$,S)+O[1]:n<48?m(_,$,S)+O[2]:n<64?v(_,$,S)+O[3]:h(_,$,S)+O[4],C=(C=b(C|=0,P[n]))+M|0,x=M,M=S,S=b($,10),$=_,_=C;C=A[1]+p+S|0,A[1]=A[2]+w+M|0,A[2]=A[3]+k+x|0,A[3]=A[4]+o+_|0,A[4]=A[0]+a+$|0,A[0]=C},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function m(e,t,n){return(e|~t)^n}function y(e,t,n){return e&n|t&~n}function g(e,t,n){return e^(t|~n)}function b(e,t){return e<>>32-t}n.RIPEMD160=o._createHelper(p),n.HmacRIPEMD160=o._createHmacHelper(p)}(Math),e.RIPEMD160},"object"===c(t)?e.exports=t=s(n(0)):(i=[n(0)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r,i,o,a,s,c;return r=(n=(t=e).lib).Base,i=n.WordArray,a=(o=t.algo).SHA1,s=o.HMAC,c=o.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=s.create(n.hasher,e),o=i.create(),a=i.create([1]),c=o.words,u=a.words,l=n.keySize,f=n.iterations;c.length>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var r=t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=n(e[0]))&&(e[1]=n(e[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===c(t)?e.exports=t=s(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return e.pad.Iso10126={pad:function(t,n){var r=4*n,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126},"object"===c(t)?e.exports=t=s(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971},"object"===c(t)?e.exports=t=s(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return e.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var t=e.words,n=e.sigBytes-1;!(t[n>>>2]>>>24-n%4*8&255);)n--;e.sigBytes=n+1}},e.pad.ZeroPadding},"object"===c(t)?e.exports=t=s(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===c(t)?e.exports=t=s(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){var t,n,r;return n=(t=e).lib.CipherParams,r=t.enc.Hex,t.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){var t=r.parse(e);return n.create({ciphertext:t})}},e.format.Hex},"object"===c(t)?e.exports=t=s(n(0),n(1)):(i=[n(0),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],o=[],a=[],s=[],c=[],u=[],l=[],f=[],d=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var h=r^r<<1^r<<2^r<<3^r<<4;h=h>>>8^255&h^99,i[n]=h,o[h]=n;var v=e[n],m=e[v],y=e[m],g=257*e[h]^16843008*h;a[n]=g<<24|g>>>8,s[n]=g<<16|g>>>16,c[n]=g<<8|g>>>24,u[n]=g,g=16843009*y^65537*m^257*v^16843008*n,l[h]=g<<24|g>>>8,f[h]=g<<16|g>>>16,d[h]=g<<8|g>>>24,p[h]=g,n?(n=v^e[e[e[y^v]]],r^=e[e[r]]):n=r=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a6&&a%n==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=h[a/n|0]<<24),o[a]=o[a-n]^s}for(var c=this._invKeySchedule=[],u=0;u>>24]]^f[i[s>>>16&255]]^d[i[s>>>8&255]]^p[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,d,p,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],d=e[t+3]^n[3],p=4,h=1;h>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&d]^n[p++],m=r[l>>>24]^i[f>>>16&255]^o[d>>>8&255]^a[255&u]^n[p++],y=r[f>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&l]^n[p++],g=r[d>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^n[p++];u=v,l=m,f=y,d=g}v=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&d])^n[p++],m=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^n[p++],y=(s[f>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^n[p++],g=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^n[p++],e[t]=v,e[t+1]=m,e[t+2]=y,e[t+3]=g},keySize:8});t.AES=n._createHelper(v)}(),e.AES},"object"===c(t)?e.exports=t=s(n(0),n(3),n(4),n(2),n(1)):(i=[n(0),n(3),n(4),n(2),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],l=c[o];for(n=0;n<24;n++)u[n/6|0]|=t[(s[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(s[n+24]-1+l)%28]<<31-n%6;for(u[0]=u[0]<<1|u[0]>>>31,n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),d.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^i[c])&l[c])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,d.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}t.RC4=n._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});t.RC4Drop=n._createHelper(a)}(),e.RC4},"object"===c(t)?e.exports=t=s(n(0),n(3),n(4),n(2),n(1)):(i=[n(0),n(3),n(4),n(2),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],a=[],s=r.Rabbit=n.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=f,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=f,i[6]^=l,i[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=n._createHelper(s)}(),e.Rabbit},"object"===c(t)?e.exports=t=s(n(0),n(3),n(4),n(2),n(1)):(i=[n(0),n(3),n(4),n(2),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){var r,i,o,s;function c(e){return(c="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}s=function(e){return function(){var t=e,n=t.lib.StreamCipher,r=t.algo,i=[],o=[],a=[],s=r.RabbitLegacy=n.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=u>>>16|4294901760&l,d=l<<16|65535&u;for(r[0]^=u,r[1]^=f,r[2]^=l,r[3]^=d,r[4]^=u,r[5]^=f,r[6]^=l,r[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=n._createHelper(s)}(),e.RabbitLegacy},"object"===c(t)?e.exports=t=s(n(0),n(3),n(4),n(2),n(1)):(i=[n(0),n(3),n(4),n(2),n(1)],void 0===(o="function"==typeof(r=s)?r.apply(t,i):r)||(e.exports=o))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":a(e)})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";n.r(t);var r=n(5),i=n(11),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DefaultPBKDF2Length=768}var t;return(t=[{key:"generateUUIDSync",value:function(){return Object(r.a)()}},{key:"generateUUID",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object(r.a)());case 1:case"end":return e.stop()}}))}},{key:"timingSafeEqual",value:function(e,t){var n=String(e),r=String(t),i=n.length,o=0;i!==r.length&&(r=n,o=1);for(var a=0;a0&&void 0!==l[0]?l[0]:{},t=e.password,n=e.pw_salt,r=e.pw_cost,f.next=3,regeneratorRuntime.awrap(this.pbkdf2(t,n,r,this.DefaultPBKDF2Length));case 3:return i=f.sent,o=i.length,a=o/3,s=i.slice(0,a),c=i.slice(a,2*a),u=i.slice(2*a,3*a),f.abrupt("return",[s,c,u]);case 10:case"end":return f.stop()}}),null,this)}}])&&function(e,t){for(var n=0;n-1&&e%1==0&&e1),t})),s(e,l(e),n),u&&(n=i(n,7,c));for(var f=t.length;f--;)o(n,t[f]);return n}));e.exports=f},function(e,t,n){var r=n(11)(n(5),"Map");e.exports=r},function(e,t,n){var r=n(12),i=n(4);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(114),i=n(121),o=n(123),a=n(124),s=n(125);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(57),o="object"==r(t)&&t&&!t.nodeType&&t,a=o&&"object"==r(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o&&i.process,c=function(){try{return a&&a.require&&a.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=c}).call(this,n(22)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(3),o=n(34),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(i(e))return!1;var n=r(e);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||s.test(e)||!a.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(78);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(63);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n-1:!!l&&r(e,t,n)>-1}},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r="object"==(void 0===t?"undefined":n(t))&&t&&t.Object===Object&&t;e.exports=r}).call(this,n(56))},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(126),i=n(6);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t,n){var r=n(61),i=n(129),o=n(62);e.exports=function(e,t,n,a,s,c){var u=1&n,l=e.length,f=t.length;if(l!=f&&!(u&&f>l))return!1;var d=c.get(e);if(d&&c.get(t))return d==t;var p=-1,h=!0,v=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r-1?s[c?t[u]:u]:void 0}}},function(e,t,n){var r=n(97),i=n(143),o=n(71);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(24),i=n(59);e.exports=function(e,t,n,o){var a=n.length,s=a,c=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a-1}},function(e,t,n){var r=n(26);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(25);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(25),i=n(37),o=n(39);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(38),i=n(111),o=n(4),a=n(58),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,f=u.hasOwnProperty,d=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:s).test(a(e))}},function(e,t,n){var r=n(14),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,i=n(112),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(5)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(115),i=n(25),o=n(37);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(116),i=n(117),o=n(118),a=n(119),s=n(120);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ti?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(18),o=n(10),a=n(19),s=n(4);e.exports=function(e,t,n){if(!s(n))return!1;var c=r(t);return!!("number"==c?o(n)&&a(t,n.length):"string"==c&&t in n)&&i(n[t],e)}},function(e,t,n){var r=n(24),i=n(176),o=n(53),a=n(177),s=n(178),c=n(80),u=n(51),l=n(179),f=n(180),d=n(64),p=n(90),h=n(32),v=n(181),m=n(182),y=n(82),g=n(3),b=n(30),w=n(186),k=n(4),x=n(188),_=n(13),$="[object Arguments]",S="[object Function]",M="[object Object]",C={};C[$]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[M]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[S]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,A,I,O,E){var D,R=1&n,P=2&n,T=4&n;if(A&&(D=O?A(t,I,O,E):A(t)),void 0!==D)return D;if(!k(t))return t;var j=g(t);if(j){if(D=v(t),!R)return u(t,D)}else{var N=h(t),F=N==S||"[object GeneratorFunction]"==N;if(b(t))return c(t,R);if(N==M||N==$||F&&!O){if(D=P||F?{}:y(t),!R)return P?f(t,s(D,t)):l(t,a(D,t))}else{if(!C[N])return O?t:{};D=m(t,N,R)}}E||(E=new r);var L=E.get(t);if(L)return L;E.set(t,D),x(t)?t.forEach((function(r){D.add(e(r,n,A,r,t,E))})):w(t)&&t.forEach((function(r,i){D.set(i,e(r,n,A,i,t,E))}));var U=T?P?p:d:P?keysIn:_,B=j?void 0:U(t);return i(B||t,(function(r,i){B&&(r=t[i=r]),o(D,i,e(r,n,A,i,t,E))})),D}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){var r=n(14),i=n(29),o=n(3),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(195),i=n(72);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},function(e,t,n){var r=n(33),i=n(196),o=n(15);e.exports=function(e,t,n){for(var a=-1,s=t.length,c={};++a-1;)p!==e&&c.call(p,h,1),c.call(e,h,1);return e}},function(e,t){e.exports=function(e){return e!=e}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r=200){var v=t?null:s(e);if(v)return c(v);d=!1,l=a,h=new r}else h=t?[]:p;e:for(;++u-1}},function(e,t){e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r0&&void 0!==l[0]?l[0]:{},t=e.ciphertextToAuth,n=e.contentCiphertext,r=e.encryptionKey,i=e.iv,o=e.authHash,a=e.authKey,!(l.length>1?l[1]:void 0)||o){f.next=5;break}return console.error("Auth hash is required."),f.abrupt("return");case 5:if(!o){f.next=12;break}return f.next=8,regeneratorRuntime.awrap(this.crypto.hmac256(t,a));case 8:if(s=f.sent,!1!==this.crypto.timingSafeEqual(o,s)){f.next=12;break}return console.error("Auth hash does not match, returning null."),f.abrupt("return",null);case 12:return f.next=14,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(r));case 14:return c=f.sent,f.next=17,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(i||""));case 17:return u=f.sent,f.abrupt("return",this.crypto.aes256CbcDecrypt(n,c,u));case 19:case"end":return f.stop()}}),null,this)}},{key:"encryptText",value:function(e,t,n){var r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(t));case 2:return r=o.sent,o.next=5,regeneratorRuntime.awrap(this.crypto.hexStringToArrayBuffer(n||""));case 5:return i=o.sent,o.abrupt("return",this.crypto.aes256CbcEncrypt(e,r,i));case 7:case"end":return o.stop()}}),null,this)}}])&&i(t.prototype,n),e}();function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n5e3)||this.crypto instanceof r.SNWebCrypto}},{key:"supportedVersions",value:function(){return["001","002","003"]}},{key:"isVersionNewerThanLibraryVersion",value:function(e){var t=this.version();return parseInt(e)>parseInt(t)}},{key:"isProtocolVersionOutdated",value:function(e){var t={"001":Date.parse("2018-01-01"),"002":Date.parse("2020-01-01")}[e];return!!t&&new Date>t}},{key:"costMinimumForVersion",value:function(e){return{"001":l.pwCost(),"002":v.pwCost(),"003":w.pwCost()}[e]}},{key:"defaultPasswordGenerationCost",value:function(){return this.costMinimumForVersion(this.version())}},{key:"versionForItem",value:function(e){return e.content.substring(0,3)}},{key:"createOperatorForLatestVersion",value:function(){return this.createOperatorForVersion(this.version())}},{key:"createOperatorForVersion",value:function(e){if("001"===e)return new l(this.crypto);if("002"===e)return new v(this.crypto);if("003"===e)return new w(this.crypto);if("000"===e)return this.createOperatorForLatestVersion();throw"Unable to find operator for version ".concat(e)}},{key:"operatorForVersion",value:function(e){var t=e,n=this.operators[t];return n||(n=this.createOperatorForVersion(e),this.operators[t]=n),n}},{key:"defaultOperator",value:function(){return this.operatorForVersion(this.version())}},{key:"computeEncryptionKeysForUser",value:function(e,t){var n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return n=t.version,r=this.operatorForVersion(n),i.abrupt("return",r.computeEncryptionKeysForUser(e,t));case 3:case"end":return i.stop()}}),null,this)}},{key:"generateInitialKeysAndAuthParamsForUser",value:function(e,t){var n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=this.defaultOperator(),r.abrupt("return",n.generateInitialKeysAndAuthParamsForUser(e,t));case 2:case"end":return r.stop()}}),null,this)}},{key:"decryptItem",value:function(e,t){var n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return n=this.versionForItem(e),r=this.operatorForVersion(n),i.abrupt("return",r.decryptItem(e,t));case 3:case"end":return i.stop()}}),null,this)}},{key:"encryptItem",value:function(e,t,n){var r,i;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.version,i=this.operatorForVersion(r),o.abrupt("return",i.encryptItem(e,t,n));case 3:case"end":return o.stop()}}),null,this)}},{key:"decryptMultipleItems",value:function(e,t,n){var r,i=this;return regeneratorRuntime.async((function(o){for(;;)switch(o.prev=o.next){case 0:return r=function(e){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}return r.abrupt("return");case 2:if(!0!==e.deleted||null!==e.content){r.next=4;break}return r.abrupt("return");case 4:if(!("string"==typeof e.content||e.content instanceof String)){r.next=19;break}return r.prev=6,r.next=9,regeneratorRuntime.awrap(i.decryptItem(e,t));case 9:r.next=19;break;case 11:if(r.prev=11,r.t0=r.catch(6),e.errorDecrypting||(e.errorDecryptingValueChanged=!0),e.errorDecrypting=!0,!n){r.next=17;break}throw r.t0;case 17:return console.error("Error decrypting item",e,r.t0),r.abrupt("return");case 19:case"end":return r.stop()}}),null,null,[[6,11]])},o.abrupt("return",Promise.all(e.map((function(e){return r(e)}))));case 2:case"end":return o.stop()}}))}}])&&x(t.prototype,n),e}(),$=new _,S=n(2),M=n.n(S),C=n(0),A=n.n(C),I=n(3),O=n.n(I),E=n(92),D=n.n(E);function R(e,t){for(var n=0;n"==n.operator?v>h:"<="==n.operator?v<=h:">="==n.operator?v>=h:"startsWith"==n.operator?v.startsWith(h):"in"==n.operator?-1!=h.indexOf(v):"includes"==n.operator?this.resolveIncludesPredicate(v,h):"matches"==n.operator&&new RegExp(h).test(v)}},{key:"resolveIncludesPredicate",value:function(t,n){if("string"==typeof n)return t.includes(n);var r;r=Array.isArray(n)?e.fromArray(n):n;var i=!0,o=!1,a=void 0;try{for(var s,c=t[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;if(this.ObjectSatisfiesPredicate(u,r))return!0}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return!1}},{key:"ItemSatisfiesPredicate",value:function(t,n){return Array.isArray(n)&&(n=e.fromArray(n)),this.ObjectSatisfiesPredicate(t,n)}},{key:"ItemSatisfiesPredicates",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(!this.ItemSatisfiesPredicate(e,s))return!1}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}},{key:"DateFromString",value:function(e){var t=e.split("."),n=t[1],r=new Date,i=parseInt(t[0]);return"days"==n?r.setDate(r.getDate()-i):"hours"==n&&r.setHours(r.getHours()-i),r}},{key:"IsRecursiveOperator",value:function(e){return["and","or"].includes(e)}}])&&R(t,n),e}();function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.content={},this.referencingObjects=[],this.updateFromJSON(t),this.uuid||Object(k.c)()&&(this.uuid=$.crypto.generateUUIDSync()),"object"!==j(this.content)||this.content.references||(this.content.references=[])}var t,n,r;return t=e,r=[{key:"deepMerge",value:function(e,t){return D()(e,t,(function(e,t){if(O()(e))return t})),e}},{key:"AreItemContentsEqual",value:function(t){var n=t.leftContent,r=t.rightContent,i=t.keysToIgnore,o=t.appDataKeysToIgnore,a=function(e,t){if(!e)return e;var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)delete e[o.value]}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e};return(n=JSON.parse(JSON.stringify(n))).appData&&a(n.appData[e.AppDomain],o),n=a(n,i),(r=JSON.parse(JSON.stringify(r))).appData&&a(r.appData[e.AppDomain],o),r=a(r,i),JSON.stringify(n)===JSON.stringify(r)}}],(n=[{key:"initUUID",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.uuid){e.next=4;break}return e.next=3,regeneratorRuntime.awrap($.crypto.generateUUID());case 3:this.uuid=e.sent;case 4:case"end":return e.stop()}}),null,this)}},{key:"updateFromJSON",value:function(t){if(t){this.deleted=t.deleted,this.uuid=t.uuid,this.enc_item_key=t.enc_item_key,this.auth_hash=t.auth_hash,this.auth_params=t.auth_params;for(var n=0,r=["errorDecrypting","dirty","dirtyCount","dirtiedDate","dummy"];nt.title})).map((function(e,t){return"#"+e.title})).join(" ")}}],(r=[{key:"mapContentToLocalProperties",value:function(e){G(Y(t.prototype),"mapContentToLocalProperties",this).call(this,e),this.title=e.title}},{key:"structureParams",value:function(){var e={title:this.title},n=G(Y(t.prototype),"structureParams",this).call(this);return Object.assign(n,e),n}},{key:"addItemAsRelationship",value:function(e){"Note"==e.content_type&&(Object(k.a)(this.notes,"uuid",e.uuid)||(this.notes.push(e),e.tags.push(this))),G(Y(t.prototype),"addItemAsRelationship",this).call(this,e)}},{key:"removeItemAsRelationship",value:function(e){"Note"==e.content_type&&(A()(this.notes,{uuid:e.uuid}),A()(e.tags,{uuid:this.uuid})),G(Y(t.prototype),"removeItemAsRelationship",this).call(this,e)}},{key:"updateLocalRelationships",value:function(){var e=this.content.references.map((function(e){return e.uuid}));this.notes.slice().forEach(function(t){e.includes(t.uuid)||(A()(t.tags,{uuid:this.uuid}),A()(this.notes,{uuid:t.uuid}),t.setIsNoLongerBeingReferencedBy(this))}.bind(this))}},{key:"isBeingRemovedLocally",value:function(){var e=this;this.notes.forEach((function(t){A()(t.tags,{uuid:e.uuid}),t.setIsNoLongerBeingReferencedBy(e)})),this.notes.length=0,G(Y(t.prototype),"isBeingRemovedLocally",this).call(this)}},{key:"informReferencesOfUUIDChange",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.notes[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;A()(s.tags,{uuid:e}),s.tags.push(this)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"didFinishSyncing",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.notes[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.tagDidFinishSyncing(this)}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"isSmartTag",value:function(){return"SN|SmartTag"==this.content_type}},{key:"displayName",get:function(){return"Tag"}}])&&J(n.prototype,r),i&&J(n,i),t}(F);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ee(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];if(!e.errorDecrypting){var n=e.contentObject;if(e.updateLocalRelationships(),n.references){var r=n.references.slice(),i=r.map((function(e){return e.uuid})),o=!0,a=this.findItems(i,o),s=!0,c=!1,u=void 0;try{for(var l,f=a.entries()[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var d=dt(l.value,2),p=d[0],h=d[1];if(h)e.addItemAsRelationship(h),t&&this.setItemDirty(h,!0);else{var v=i[p],m=this.missedReferenceBuildKey(v,e.uuid);if(!this.missedReferences[m]){var y={reference_uuid:v,for_item:e};this.missedReferences[m]=y}}}}catch(e){c=!0,u=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw u}}}}}},{key:"notifySyncObserversOfModels",value:function(e,t,n){var r,i,o,a,s,c,u,l=this;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:r=this.itemSyncObservers.sort((function(e,t){return e.priority0)){v.next=25;break}return v.next=25,regeneratorRuntime.awrap(l._callSyncObserverCallbackWithTimeout(r,i,o,a,t,n));case 25:case"end":return v.stop()}}),null,null,[[6,10,14,22],[15,,17,21]])},c=r[Symbol.iterator]();case 7:if(i=(u=c.next()).done){f.next=13;break}return f.next=10,regeneratorRuntime.awrap(s());case 10:i=!0,f.next=7;break;case 13:f.next=19;break;case 15:f.prev=15,f.t0=f.catch(4),o=!0,a=f.t0;case 19:f.prev=19,f.prev=20,i||null==c.return||c.return();case 22:if(f.prev=22,!o){f.next=25;break}throw a;case 25:return f.finish(22);case 26:return f.finish(19);case 27:case"end":return f.stop()}}),null,this,[[4,15,19,27],[20,,22,26]])}},{key:"_callSyncObserverCallbackWithTimeout",value:function(e,t,n,r,i,o){var a=this;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",new Promise((function(s,c){a.$timeout((function(){try{e.callback(t,n,r,i,o)}catch(e){console.error("Sync observer exception",e)}finally{s()}}))})));case 1:case"end":return s.stop()}}))}},{key:"setItemDirty",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;this.setItemsDirty([e],t,n,r,i)}},{key:"setItemsDirty",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=!0,s=!1,c=void 0;try{for(var u,l=t[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=u.value;f.setDirty(n,r)}}catch(e){s=!0,c=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}this.notifySyncObserversOfModels(t,i||e.MappingSourceLocalDirtied,o)}},{key:"createItem",value:function(t){var n=e.ContentTypeClassMapping&&e.ContentTypeClassMapping[t.content_type];return n||(n=F),new n(t)}},{key:"createDuplicateItemFromResponseItem",value:function(e){var t,n;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if("function"!=typeof e.setDirty){r.next=3;break}return console.error("Attempting to create conflicted copy of non-response item."),r.abrupt("return",null);case 3:return t=JSON.parse(JSON.stringify(e)),r.next=6,regeneratorRuntime.awrap($.crypto.generateUUID());case 6:return t.uuid=r.sent,n=this.createItem(t),r.abrupt("return",n);case 9:case"end":return r.stop()}}),null,this)}},{key:"duplicateItemAndAddAsConflict",value:function(e){return this.duplicateItemWithCustomContentAndAddAsConflict({content:e.content,duplicateOf:e})}},{key:"duplicateItemWithCustomContentAndAddAsConflict",value:function(e){var t=e.content,n=e.duplicateOf,r=this.duplicateItemWithCustomContent({content:t,duplicateOf:n});return this.addDuplicatedItemAsConflict({duplicate:r,duplicateOf:n}),r}},{key:"addDuplicatedItemAsConflict",value:function(e){var t=e.duplicate,n=e.duplicateOf;this.addDuplicatedItem(t,n),t.content.conflict_of=n.uuid}},{key:"duplicateItemWithCustomContent",value:function(e){var t=e.content,n=e.duplicateOf,r=new n.constructor({content:t});return r.created_at=n.created_at,r.content_type||(r.content_type=n.content_type),r}},{key:"duplicateItemAndAdd",value:function(e){var t=this.duplicateItemWithoutAdding(e);return this.addDuplicatedItem(t,e),t}},{key:"duplicateItemWithoutAdding",value:function(e){var t=new e.constructor({content:e.content});return t.created_at=e.created_at,t.content_type||(t.content_type=e.content_type),t}},{key:"addDuplicatedItem",value:function(e,t){this.addItem(e);var n=!0,r=!1,i=void 0;try{for(var o,a=t.referencingObjects[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s.addItemAsRelationship(e),this.setItemDirty(s,!0)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.resolveReferencesForItem(e),this.setItemDirty(e,!0)}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.addItems([e],t)}},{key:"addItems",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1],e.forEach((function(e){t.itemsHash[e.uuid]||(t.itemsHash[e.uuid]=e,t.items.push(e))}))}},{key:"addItemSyncObserver",value:function(e,t,n){this.addItemSyncObserverWithPriority({id:e,types:t,callback:n,priority:1})}},{key:"addItemSyncObserverWithPriority",value:function(e){var t=e.id,n=e.priority,r=e.types,i=e.callback;Array.isArray(r)||(r=[r]),this.itemSyncObservers.push({id:t,types:r,priority:n,callback:i})}},{key:"removeItemSyncObserver",value:function(e){A()(this.itemSyncObservers,M()(this.itemSyncObservers,{id:e}))}},{key:"getDirtyItems",value:function(){return this.items.filter((function(e){return 1==e.dirty&&!e.dummy&&(!e.errorDecrypting||e.deleted)}))}},{key:"clearDirtyItems",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.setDirty(!1)}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"removeAndDirtyAllRelationshipsForItem",value:function(e){if(!e.errorDecrypting){var t=!0,n=!1,r=void 0;try{for(var i,o=e.content.references[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=this.findItem(a.uuid);s&&(e.removeItemAsRelationship(s),s.hasRelationshipWithItem(e)&&(s.removeItemAsRelationship(e),this.setItemDirty(s,!0)))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}var c=!0,u=!1,l=void 0;try{for(var f,d=e.referencingObjects[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;p.removeItemAsRelationship(e),this.setItemDirty(p,!0)}}catch(e){u=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(u)throw l}}e.referencingObjects=[]}},{key:"setAllItemsDirty",value:function(){var e=this.allItems;this.setItemsDirty(e,!0)}},{key:"setItemToBeDeleted",value:function(e){e.deleted=!0,e.dummy||this.setItemDirty(e,!0),this.removeAndDirtyAllRelationshipsForItem(e)}},{key:"removeItemLocally",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:A()(this.items,{uuid:e.uuid}),delete this.itemsHash[e.uuid],e.isBeingRemovedLocally();case 3:case"end":return t.stop()}}),null,this)}},{key:"allItemsMatchingTypes",value:function(e){return this.allItems.filter((function(t){return(ot()(e,t.content_type)||ot()(e,"*"))&&!t.dummy}))}},{key:"invalidItems",value:function(){return this.allItems.filter((function(e){return e.errorDecrypting}))}},{key:"validItemsForContentType",value:function(e){return this.allItems.filter((function(t){return t.content_type==e&&!t.errorDecrypting}))}},{key:"findItem",value:function(e){return this.itemsHash[e]}},{key:"findItems",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value,u=this.itemsHash[c];(u||t)&&n.push(u)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"itemsMatchingPredicate",value:function(e){return this.itemsMatchingPredicates([e])}},{key:"itemsMatchingPredicates",value:function(e){return this.filterItemsWithPredicates(this.allItems,e)}},{key:"filterItemsWithPredicates",value:function(e,t){return e.filter((function(e){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(!e.satisfiesPredicate(s))return!1}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}))}},{key:"importItems",value:function(t){var n,r,i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,_,$,S,M,C,A;return regeneratorRuntime.async((function(I){for(;;)switch(I.prev=I.next){case 0:n=[],r={},i=!0,o=!1,a=void 0,I.prev=5,s=t[Symbol.iterator]();case 7:if(i=(c=s.next()).done){I.next=18;break}if(u=c.value,l=this.findItem(u.uuid)){I.next=13;break}return r[u.uuid]={},I.abrupt("continue",15);case 13:f=this.duplicateItemWithoutAdding(l),r[u.uuid]={frozenValue:f,itemRef:l};case 15:i=!0,I.next=7;break;case 18:I.next=24;break;case 20:I.prev=20,I.t0=I.catch(5),o=!0,a=I.t0;case 24:I.prev=24,I.prev=25,i||null==s.return||s.return();case 27:if(I.prev=27,!o){I.next=30;break}throw a;case 30:return I.finish(27);case 31:return I.finish(24);case 32:d=!0,p=!1,h=void 0,I.prev=35,v=t[Symbol.iterator]();case 37:if(d=(m=v.next()).done){I.next=52;break}if(y=m.value,g=r[y.uuid],b=g.frozenValue,w=g.itemRef,!b||w.errorDecrypting){I.next=47;break}return I.next=43,regeneratorRuntime.awrap(this.createDuplicateItemFromResponseItem(y));case 43:k=I.sent,y.deleted||b.isItemContentEqualWith(k)||(this.addDuplicatedItemAsConflict({duplicate:k,duplicateOf:w}),n.push(k)),I.next=49;break;case 47:n.push(y),w&&w.errorDecrypting&&(w.errorDecrypting=!1);case 49:d=!0,I.next=37;break;case 52:I.next=58;break;case 54:I.prev=54,I.t1=I.catch(35),p=!0,h=I.t1;case 58:I.prev=58,I.prev=59,d||null==v.return||v.return();case 61:if(I.prev=61,!p){I.next=64;break}throw h;case 64:return I.finish(61);case 65:return I.finish(58);case 66:return I.next=68,regeneratorRuntime.awrap(this.mapResponseItemsToLocalModels(n,e.MappingSourceFileImport));case 68:for(x=I.sent,_=!0,$=!1,S=void 0,I.prev=72,M=x[Symbol.iterator]();!(_=(C=M.next()).done);_=!0)A=C.value,this.setItemDirty(A,!0,!1),A.deleted=!1;I.next=80;break;case 76:I.prev=76,I.t2=I.catch(72),$=!0,S=I.t2;case 80:I.prev=80,I.prev=81,_||null==M.return||M.return();case 83:if(I.prev=83,!$){I.next=86;break}throw S;case 86:return I.finish(83);case 87:return I.finish(80);case 88:return I.abrupt("return",x);case 89:case"end":return I.stop()}}),null,this,[[5,20,24,32],[25,,27,31],[35,54,58,66],[59,,61,65],[72,76,80,88],[81,,83,87]])}},{key:"getAllItemsJSONData",value:function(e,t,n){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.getJSONDataForItems(this.allItems,e,t,n));case 1:case"end":return r.stop()}}),null,this)}},{key:"getJSONDataForItems",value:function(e,t,n,r){return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.all(e.map((function(e){return new K(e,t,n).paramsForExportFile()}))).then((function(e){if(r&&0==e.length)return null;var i={items:e};return t&&(i.auth_params=n),JSON.stringify(i,null,2)})));case 1:case"end":return i.stop()}}))}},{key:"computeDataIntegrityHash",value:function(){var e,t,n,r;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,e=this.allNondummyItems.sort((function(e,t){return t.updated_at-e.updated_at})),t=e.map((function(e){return e.updatedAtTimestamp()})),n=t.join(","),i.next=6,regeneratorRuntime.awrap($.crypto.sha256(n));case 6:return r=i.sent,i.abrupt("return",r);case 10:return i.prev=10,i.t0=i.catch(0),console.error("Error computing data integrity hash",i.t0),i.abrupt("return",null);case 14:case"end":return i.stop()}}),null,this,[[0,10]])}},{key:"allItems",get:function(){return this.items.slice()}},{key:"allNondummyItems",get:function(){return this.items.filter((function(e){return!e.dummy}))}}])&&pt(t.prototype,n),e}();function vt(e,t){for(var n=0;n0&&i!=ht.MappingSourceRemoteSaved&&e.isDesktop&&e.desktopManager.syncComponentsInstallation(a);var s=!0,c=!1,u=void 0;try{for(var l,f=a[Symbol.iterator]();!(s=(l=f.next()).done);s=!0){var d=l.value,p=M()(e.activeComponents,{uuid:d.uuid});!d.active||d.deleted||p?!d.active&&p&&e.deactivateComponent(d):e.activateComponent(d)}}catch(e){c=!0,u=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw u}}var h=!0,v=!1,m=void 0;try{for(var y,g=function(){var n=y.value;if(o&&o==n.component.uuid)return"continue";var r=t.filter((function(e){return-1!==n.contentTypes.indexOf(e.content_type)}));if(0==r.length)return"continue";var i=[{name:"stream-items",content_types:n.contentTypes.sort()}];e.runWithPermissions(n.component,i,(function(){e.sendItemsInReply(n.component,r,n.originalMessage)}))},b=e.streamObservers[Symbol.iterator]();!(h=(y=b.next()).done);h=!0)g()}catch(e){v=!0,m=e}finally{try{h||null==b.return||b.return()}finally{if(v)throw m}}var w=[{name:"stream-context-item"}],k=!0,x=!1,_=void 0;try{for(var $,S=function(){var n=$.value;if(o&&o==n.component.uuid)return"continue";var r=!0,a=!1,s=void 0;try{for(var c,u=e.handlers[Symbol.iterator]();!(r=(c=u.next()).done);r=!0){var l=c.value;(l.areas.includes(n.component.area)||l.areas.includes("*"))&&l.contextRequestHandler&&(A=l.contextRequestHandler(n.component))&&(I=M()(t,{uuid:A.uuid}))&&e.runWithPermissions(n.component,w,(function(){e.sendContextItemInReply(n.component,I,n.originalMessage,i)}))}}catch(e){a=!0,s=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw s}}},C=e.contextStreamObservers[Symbol.iterator]();!(k=($=C.next()).done);k=!0){var A,I;S()}}catch(e){x=!0,_=e}finally{try{k||null==C.return||C.return()}finally{if(x)throw _}}}))}},{key:"configureForNonMobileUsage",value:function(){var e=this,t=function(t){var n=!0,r=!1,i=void 0;try{for(var o,a=e.activeComponents[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(document.activeElement==e.iframeForComponent(s)){e.$timeout((function(){e.focusChangedForComponent(s)}));break}}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}};window.addEventListener?window.addEventListener("focus",t,!0):window.attachEvent("onfocusout",t),window.addEventListener?window.addEventListener("blur",t,!0):window.attachEvent("onblur",t),this.desktopManager.registerUpdateObserver((function(t){t.active&&t.isTheme()&&e.postActiveThemesToAllComponents()})),window.addEventListener("message",(function(t){e.loggingEnabled&&console.log("Web app: received message",t),t.data.sessionKey&&e.handleMessage(e.componentForSessionKey(t.data.sessionKey),t.data)}),!1)}},{key:"postActiveThemesToAllComponents",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.components[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;!o.isTheme()&&o.active&&o.window&&this.postActiveThemesToComponent(o)}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"getActiveThemes",value:function(){return this.componentsForArea("themes").filter((function(e){return e.active}))}},{key:"urlsForActiveThemes",value:function(){var e=this;return this.getActiveThemes().map((function(t){return e.urlForComponent(t)}))}},{key:"postActiveThemesToComponent",value:function(e){var t={themes:this.urlsForActiveThemes()};this.sendMessageToComponent(e,{action:"themes",data:t})}},{key:"contextItemDidChangeInArea",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.handlers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(!1!==a.areas.includes(e)||a.areas.includes("*")){var s=this.contextStreamObservers.filter((function(t){return t.component.area===e})),c=!0,u=!1,l=void 0;try{for(var f,d=s[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;if(a.contextRequestHandler){var h=a.contextRequestHandler(p.component);h&&this.sendContextItemInReply(p.component,h,p.originalMessage)}}}catch(e){u=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(u)throw l}}}}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"setComponentHidden",value:function(e,t){if(t)e.hidden=!0;else if(e.hidden){e.hidden=!1;var n=M()(this.contextStreamObservers,{identifier:e.uuid});n&&this.handleStreamContextItemMessage(e,n.originalMessage);var r=M()(this.streamObservers,{identifier:e.uuid});r&&this.handleStreamItemsMessage(e,r.originalMessage)}}},{key:"jsonForItem",value:function(t,n,r){var i={uuid:t.uuid,content_type:t.content_type,created_at:t.created_at,updated_at:t.updated_at,deleted:t.deleted};return i.content=t.createContentJSONFromProperties(),i.clientData=t.getDomainDataItem(n.getClientDataKey(),e.ClientDataDomain)||{},!r||r!=ht.MappingSourceRemoteSaved&&r!=ht.MappingSourceLocalSaved||(i.isMetadataUpdate=!0),this.removePrivatePropertiesFromResponseItems([i],n,{type:"outgoing"}),i}},{key:"sendItemsInReply",value:function(e,t,n,r){var i=this;this.loggingEnabled&&console.log("Web|componentManager|sendItemsInReply",e,t,n);var o={items:{}},a=t.map((function(t){return i.jsonForItem(t,e,r)}));o.items=a,this.replyToMessage(e,n,o)}},{key:"sendContextItemInReply",value:function(e,t,n,r){this.loggingEnabled&&console.log("Web|componentManager|sendContextItemInReply",e,t,n);var i={item:this.jsonForItem(t,e,r)};this.replyToMessage(e,n,i)}},{key:"replyToMessage",value:function(e,t,n){var r={action:"reply",original:t,data:n};this.sendMessageToComponent(e,r)}},{key:"sendMessageToComponent",value:function(e,t){if(!e.hidden||["component-registered","themes"].includes(t.action)){this.loggingEnabled&&console.log("Web|sendMessageToComponent",e,t);var n=this.urlForComponent(e);n.startsWith("http")||n.startsWith("file")||(n=window.location.href+n),e.window||this.alertManager.alert({text:"Standard Notes is trying to communicate with ".concat(e.name,", but an error is occurring. Please restart this extension and try again.")}),this.isMobile&&(t=JSON.stringify(t)),e.window.postMessage(t,n)}else this.loggingEnabled&&console.log("Component disabled for current item, not sending any messages.",e.name)}},{key:"componentsForArea",value:function(e){return this.components.filter((function(t){return t.area===e}))}},{key:"urlForComponent",value:function(e){if(e.offlineOnly&&!this.isDesktop)return null;if(e.offlineOnly||this.isDesktop&&e.local_url)return e.local_url&&e.local_url.replace("sn://",this.desktopManager.getExtServerHost());var t=e.hosted_url||e.legacy_url;if(this.isMobile){var n="ios"==this.platform?"localhost":"10.0.2.2";t=t.replace("localhost",n).replace("sn.local",n)}return t}},{key:"componentForUrl",value:function(e){return this.components.filter((function(t){return t.hosted_url===e||t.legacy_url===e}))[0]}},{key:"componentForSessionKey",value:function(e){var t=M()(this.components,{sessionKey:e});if(!t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.handlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.componentForSessionKeyHandler&&(t=s.componentForSessionKeyHandler(e)))break}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}return t}},{key:"handleMessage",value:function(e,t){var n=this;if(!e)return console.log("Component not defined for message, returning",t),void this.alertManager.alert({text:"An extension is trying to communicate with Standard Notes, but there is an error establishing a bridge. Please restart the app and try again."});if(e.readonly&&["save-items","associate-item","deassociate-item","create-item","create-items","delete-items","set-component-data"].includes(t.action))this.alertManager.alert({text:"The extension ".concat(e.name," is trying to save, but it is in a locked state and cannot accept changes.")});else{if("stream-items"===t.action)this.handleStreamItemsMessage(e,t);else if("stream-context-item"===t.action)this.handleStreamContextItemMessage(e,t);else if("set-component-data"===t.action)this.handleSetComponentDataMessage(e,t);else if("delete-items"===t.action)this.handleDeleteItemsMessage(e,t);else if("create-items"===t.action||"create-item"===t.action)this.handleCreateItemsMessage(e,t);else if("save-items"===t.action)this.handleSaveItemsMessage(e,t);else if("toggle-activate-component"===t.action){var r=this.modelManager.findItem(t.data.uuid);this.handleToggleComponentMessage(e,r,t)}else"request-permissions"===t.action?this.handleRequestPermissionsMessage(e,t):"install-local-component"===t.action?this.handleInstallLocalComponentMessage(e,t):"duplicate-item"===t.action&&this.handleDuplicateItemMessage(e,t);var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var r=s.value;r.actionHandler&&(r.areas.includes(e.area)||r.areas.includes("*"))&&n.$timeout((function(){r.actionHandler(e,t.action,t.data)}))},u=this.handlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}}}},{key:"removePrivatePropertiesFromResponseItems",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("incoming"==n.type){var r=["updated_at"],i=!0,o=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;if("function"!=typeof u.setDirty){var l=!0,f=!1,d=void 0;try{for(var p,h=r[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var v=p.value;delete u[v]}}catch(e){f=!0,d=e}finally{try{l||null==h.return||h.return()}finally{if(f)throw d}}}else console.error("Attempting to pass object. Use JSON.")}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}}if(!(t&&this.nativeExtManager&&this.nativeExtManager.isSystemExtension(t))){var m=["autoupdateDisabled","permissions","active"];n&&n.includeUrls&&(m=m.concat(["url","hosted_url","local_url"]));var y=!0,g=!1,b=void 0;try{for(var w,k=e[Symbol.iterator]();!(y=(w=k.next()).done);y=!0){var x=w.value;if("function"!=typeof x.setDirty){var _=!0,$=!1,S=void 0;try{for(var M,C=m[Symbol.iterator]();!(_=(M=C.next()).done);_=!0){var A=M.value;delete x.content[A]}}catch(e){$=!0,S=e}finally{try{_||null==C.return||C.return()}finally{if($)throw S}}}else console.error("Attempting to pass object. Use JSON.")}}catch(e){g=!0,b=e}finally{try{y||null==k.return||k.return()}finally{if(g)throw b}}}}},{key:"handleStreamItemsMessage",value:function(e,t){var n=this,r=[{name:"stream-items",content_types:t.data.content_types.sort()}];this.runWithPermissions(e,r,(function(){M()(n.streamObservers,{identifier:e.uuid})||n.streamObservers.push({identifier:e.uuid,component:e,originalMessage:t,contentTypes:t.data.content_types});var r=[],i=!0,o=!1,a=void 0;try{for(var s,c=t.data.content_types[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;r=r.concat(n.modelManager.validItemsForContentType(u))}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}n.sendItemsInReply(e,r,t)}))}},{key:"handleStreamContextItemMessage",value:function(e,t){var n=this;this.runWithPermissions(e,[{name:"stream-context-item"}],(function(){M()(n.contextStreamObservers,{identifier:e.uuid})||n.contextStreamObservers.push({identifier:e.uuid,component:e,originalMessage:t});var r=!0,i=!1,o=void 0;try{for(var a,s=n.handlersForArea(e.area)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;if(c.contextRequestHandler){var u=c.contextRequestHandler(e);u&&n.sendContextItemInReply(e,u,t)}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}))}},{key:"isItemIdWithinComponentContextJurisdiction",value:function(e,t){return this.itemIdsInContextJurisdictionForComponent(t).includes(e)}},{key:"itemIdsInContextJurisdictionForComponent",value:function(e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=this.handlersForArea(e.area)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.contextRequestHandler){var c=s.contextRequestHandler(e);c&&t.push(c.uuid)}}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}},{key:"handlersForArea",value:function(e){return this.handlers.filter((function(t){return t.areas.includes(e)}))}},{key:"handleSaveItemsMessage",value:function(t,n){var r,i,o,a,s,c,u,l,f,d,p,h=this;return regeneratorRuntime.async((function(v){for(;;)switch(v.prev=v.next){case 0:r=n.data.items,i=[],o=this.itemIdsInContextJurisdictionForComponent(t),a=r.slice(),s=!0,c=!1,u=void 0,v.prev=7,l=r.slice()[Symbol.iterator]();case 9:if(s=(f=l.next()).done){v.next=18;break}if(d=f.value,!o.includes(d.uuid)){v.next=15;break}return i.push({name:"stream-context-item"}),Oe()(a,d),v.abrupt("break",18);case 15:s=!0,v.next=9;break;case 18:v.next=24;break;case 20:v.prev=20,v.t0=v.catch(7),c=!0,u=v.t0;case 24:v.prev=24,v.prev=25,s||null==l.return||l.return();case 27:if(v.prev=27,!c){v.next=30;break}throw u;case 30:return v.finish(27);case 31:return v.finish(24);case 32:a.length>0&&(p=rt()(a.map((function(e){return e.content_type}))).sort(),i.push({name:"stream-items",content_types:p})),this.runWithPermissions(t,i,(function(){var i,o,a,s,c,u,l,f,d,p,v,m,y,g,b,w,k,x,_;return regeneratorRuntime.async((function($){for(;;)switch($.prev=$.next){case 0:for(h.removePrivatePropertiesFromResponseItems(r,t,{includeUrls:!0,type:"incoming"}),i=r.map((function(e){return e.uuid})),o=h.modelManager.findItems(i),a=0,s=!0,c=!1,u=void 0,$.prev=7,l=o[Symbol.iterator]();!(s=(f=l.next()).done);s=!0)(d=f.value).locked&&(A()(r,{uuid:d.uuid}),a++);$.next=15;break;case 11:$.prev=11,$.t0=$.catch(7),c=!0,u=$.t0;case 15:$.prev=15,$.prev=16,s||null==l.return||l.return();case 18:if($.prev=18,!c){$.next=21;break}throw u;case 21:return $.finish(18);case 22:return $.finish(15);case 23:return a>0&&(p=1==a?"item":"items",v=1==a?"is":"are",h.alertManager.alert({title:"Items Locked",text:"".concat(a," ").concat(p," you are attempting to save ").concat(v," locked and cannot be edited.")})),$.next=26,regeneratorRuntime.awrap(h.modelManager.mapResponseItemsToLocalModels(r,ht.MappingSourceComponentRetrieved,t.uuid));case 26:m=$.sent,y=!0,g=!1,b=void 0,$.prev=30,w=r[Symbol.iterator]();case 32:if(y=(k=w.next()).done){$.next=42;break}if(x=k.value,_=M()(m,{uuid:x.uuid})){$.next=38;break}return h.alertManager.alert({text:"The extension ".concat(t.name," is trying to save an item with type ").concat(x.content_type,", but that item does not exist. Please restart this extension and try again.")}),$.abrupt("continue",39);case 38:_.locked||(x.clientData&&_.setDomainDataItem(t.getClientDataKey(),x.clientData,e.ClientDataDomain),h.modelManager.setItemDirty(_,!0,!0,ht.MappingSourceComponentRetrieved,t.uuid));case 39:y=!0,$.next=32;break;case 42:$.next=48;break;case 44:$.prev=44,$.t1=$.catch(30),g=!0,b=$.t1;case 48:$.prev=48,$.prev=49,y||null==w.return||w.return();case 51:if($.prev=51,!g){$.next=54;break}throw b;case 54:return $.finish(51);case 55:return $.finish(48);case 56:h.syncManager.sync().then((function(e){var r=Object.assign({},n);r.action=e&&e.error?"save-error":"save-success",h.replyToMessage(t,n,{error:e&&e.error}),h.handleMessage(t,r)}));case 57:case"end":return $.stop()}}),null,null,[[7,11,15,23],[16,,18,22],[30,44,48,56],[49,,51,55]])}));case 34:case"end":return v.stop()}}),null,this,[[7,20,24,32],[25,,27,31]])}},{key:"handleDuplicateItemMessage",value:function(e,t){var n=this,r=t.data.item,i=this.modelManager.findItem(r.uuid),o=[{name:"stream-items",content_types:[i.content_type]}];this.runWithPermissions(e,o,(function(){var r=n.modelManager.duplicateItemAndAdd(i);n.syncManager.sync(),n.replyToMessage(e,t,{item:n.jsonForItem(r,e)})}))}},{key:"handleCreateItemsMessage",value:function(t,n){var r=this,i=n.data.item?[n.data.item]:n.data.items,o=[{name:"stream-items",content_types:rt()(i.map((function(e){return e.content_type})))}];this.runWithPermissions(t,o,(function(){r.removePrivatePropertiesFromResponseItems(i,t,{type:"incoming"});var o=[],a=!0,s=!1,c=void 0;try{for(var u,l=i[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=u.value,d=r.modelManager.createItem(f);f.clientData&&d.setDomainDataItem(t.getClientDataKey(),f.clientData,e.ClientDataDomain),r.modelManager.addItem(d),r.modelManager.resolveReferencesForItem(d,!0),r.modelManager.setItemDirty(d,!0),o.push(d)}}catch(e){s=!0,c=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}r.syncManager.sync();var p="create-item"==n.action?{item:r.jsonForItem(o[0],t)}:{items:o.map((function(e){return r.jsonForItem(e,t)}))};r.replyToMessage(t,n,p)}))}},{key:"handleDeleteItemsMessage",value:function(e,t){var n=this,r=[{name:"stream-items",content_types:rt()(t.data.items.map((function(e){return e.content_type}))).sort()}];this.runWithPermissions(e,r,(function(){var r,i,o,a,s,c,u,l,f,d,p;return regeneratorRuntime.async((function(h){for(;;)switch(h.prev=h.next){case 0:return r=t.data.items,i=1==r.length?"item":"items",o=null,a=!0,h.next=6,regeneratorRuntime.awrap(n.alertManager.confirm({text:"Are you sure you want to delete ".concat(r.length," ").concat(i,"?")}).catch((function(){a=!1})));case 6:if(!a){h.next=42;break}s=!0,c=!1,u=void 0,h.prev=10,l=r[Symbol.iterator]();case 12:if(s=(f=l.next()).done){h.next=24;break}if(d=f.value,p=n.modelManager.findItem(d.uuid)){h.next=18;break}return n.alertManager.alert({text:"The item you are trying to delete cannot be found."}),h.abrupt("continue",21);case 18:["SN|Component","SN|Theme"].includes(p.content_type)&&n.deactivateComponent(p,!0),n.modelManager.setItemToBeDeleted(p),n.modelManager.notifySyncObserversOfModels([p],ht.MappingSourceRemoteSaved);case 21:s=!0,h.next=12;break;case 24:h.next=30;break;case 26:h.prev=26,h.t0=h.catch(10),c=!0,u=h.t0;case 30:h.prev=30,h.prev=31,s||null==l.return||l.return();case 33:if(h.prev=33,!c){h.next=36;break}throw u;case 36:return h.finish(33);case 37:return h.finish(30);case 38:n.syncManager.sync(),o={deleted:!0},h.next=43;break;case 42:o={deleted:!1};case 43:n.replyToMessage(e,t,o);case 44:case"end":return h.stop()}}),null,null,[[10,26,30,38],[31,,33,37]])}))}},{key:"handleRequestPermissionsMessage",value:function(e,t){var n=this;this.runWithPermissions(e,t.data.permissions,(function(){n.replyToMessage(e,t,{approved:!0})}))}},{key:"handleSetComponentDataMessage",value:function(e,t){var n=this;this.runWithPermissions(e,[],(function(){e.componentData=t.data.componentData,n.modelManager.setItemDirty(e,!0),n.syncManager.sync()}))}},{key:"handleToggleComponentMessage",value:function(e,t,n){this.toggleComponent(t)}},{key:"toggleComponent",value:function(e){var t=this;if("modal"==e.area)this.openModalComponent(e);else if(e.active)this.deactivateComponent(e);else if("SN|Theme"==e.content_type){var n=this.getActiveThemes();this.activateComponent(e),e.isLayerable()||setTimeout((function(){var e=!0,r=!1,i=void 0;try{for(var o,a=n[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var s=o.value;s&&!s.isLayerable()&&t.deactivateComponent(s)}}catch(e){r=!0,i=e}finally{try{e||null==a.return||a.return()}finally{if(r)throw i}}}),10)}else this.activateComponent(e)}},{key:"handleInstallLocalComponentMessage",value:function(e,t){if(!this.nativeExtManager||this.nativeExtManager.isSystemExtension(e)){var n=this.modelManager.findItem(t.data.uuid);this.desktopManager.installComponent(n)}}},{key:"runWithPermissions",value:function(e,t,n){e.permissions||(e.permissions=[]),t=JSON.parse(JSON.stringify(t));var r=e.permissions,i=!0,o=!1,a=void 0;try{for(var s,c=function(){var e=s.value,n=r.find((function(t){return t.name==e.name}));if(!n)return"continue";var i=e.content_types;if(!i)return Oe()(t,e),"continue";var o=!0,a=!1,c=void 0;try{for(var u,l=n.content_types[Symbol.iterator]();!(o=(u=l.next()).done);o=!0){var f=u.value;Oe()(i,f)}}catch(e){a=!0,c=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw c}}0==i.length&&Oe()(t,e)},u=t.slice()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}t.length>0?this.promptForPermissions(e,t,(function(e){e&&n()})):n()}},{key:"promptForPermissions",value:function(e,t,n){var r=this,i={};i.component=e,i.permissions=t,i.permissionsString=this.permissionsStringForPermissions(t,e),i.actionBlock=n,i.callback=function(n){if(n){var o=!0,a=!1,s=void 0;try{for(var c,u=function(){var t=c.value,n=e.permissions.find((function(e){return e.name==t.name}));if(n){var r=n.content_types||[];n.content_types=rt()(r.concat(t.content_types))}else e.permissions.push(t)},l=t[Symbol.iterator]();!(o=(c=l.next()).done);o=!0)u()}catch(e){a=!0,s=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw s}}r.modelManager.setItemDirty(e,!0),r.syncManager.sync()}r.permissionDialogs=r.permissionDialogs.filter((function(r){return r==i?(r.actionBlock&&r.actionBlock(n),!1):!!(r.component!=e||r.permissions!=t&&(o=t,r.permissions.some((function(e){return!o.find((function(t){return JSON.stringify(t)===JSON.stringify(e)}))}))))||(n&&r.actionBlock&&r.actionBlock(n),!1);var o})),r.permissionDialogs.length>0&&r.presentPermissionsDialog(r.permissionDialogs[0])};var o=M()(this.permissionDialogs,{component:e});this.permissionDialogs.push(i),o?console.log("Existing dialog, not presenting."):this.presentPermissionsDialog(i)}},{key:"presentPermissionsDialog",value:function(e){console.error("Must override")}},{key:"openModalComponent",value:function(e){console.error("Must override")}},{key:"registerHandler",value:function(e){this.handlers.push(e)}},{key:"deregisterHandler",value:function(e){var t=M()(this.handlers,{identifier:e});t?this.handlers.splice(this.handlers.indexOf(t),1):console.log("Attempting to deregister non-existing handler")}},{key:"registerComponentWindow",value:function(e,t){return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e.window===t&&this.loggingEnabled&&console.log("Web|componentManager","attempting to re-register same component window."),this.loggingEnabled&&console.log("Web|componentManager|registerComponentWindow",e),e.window=t,n.next=5,regeneratorRuntime.awrap($.crypto.generateUUID());case 5:e.sessionKey=n.sent,this.sendMessageToComponent(e,{action:"component-registered",sessionKey:e.sessionKey,componentData:e.componentData,data:{uuid:e.uuid,environment:this.environment,platform:this.platform,activeThemeUrls:this.urlsForActiveThemes()}}),this.postActiveThemesToComponent(e),this.desktopManager&&this.desktopManager.notifyComponentActivation(e);case 9:case"end":return n.stop()}}),null,this)}},{key:"activateComponent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=1!=e.active;e.active=!0;var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var n=s.value;(n.areas.includes(e.area)||n.areas.includes("*"))&&t.$uiRunner((function(){n.activationHandler&&n.activationHandler(e)}))},u=this.handlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}r&&!n&&(this.modelManager.setItemDirty(e,!0),this.syncManager.sync()),this.activeComponents.includes(e)||this.activeComponents.push(e),"themes"==e.area&&this.postActiveThemesToAllComponents()}},{key:"deactivateComponent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0!=e.active;e.active=!1,e.sessionKey=null;var i=!0,o=!1,a=void 0;try{for(var s,c=function(){var n=s.value;(n.areas.includes(e.area)||n.areas.includes("*"))&&t.$uiRunner((function(){n.activationHandler&&n.activationHandler(e)}))},u=this.handlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0)c()}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}r&&!n&&(this.modelManager.setItemDirty(e,!0),this.syncManager.sync()),Oe()(this.activeComponents,e),this.streamObservers=this.streamObservers.filter((function(t){return t.component!==e})),this.contextStreamObservers=this.contextStreamObservers.filter((function(t){return t.component!==e})),"themes"==e.area&&this.postActiveThemesToAllComponents()}},{key:"reloadComponent",value:function(e){var t,n,r,i,o,a,s=this;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:for(e.active=!1,t=!0,n=!1,r=void 0,c.prev=4,i=function(){var t=a.value;(t.areas.includes(e.area)||t.areas.includes("*"))&&s.$uiRunner((function(){t.activationHandler&&t.activationHandler(e)}))},o=this.handlers[Symbol.iterator]();!(t=(a=o.next()).done);t=!0)i();c.next=13;break;case 9:c.prev=9,c.t0=c.catch(4),n=!0,r=c.t0;case 13:c.prev=13,c.prev=14,t||null==o.return||o.return();case 16:if(c.prev=16,!n){c.next=19;break}throw r;case 19:return c.finish(16);case 20:return c.finish(13);case 21:return this.streamObservers=this.streamObservers.filter((function(t){return t.component!==e})),this.contextStreamObservers=this.contextStreamObservers.filter((function(t){return t.component!==e})),"themes"==e.area&&this.postActiveThemesToAllComponents(),c.abrupt("return",new Promise((function(t,n){s.$timeout((function(){e.active=!0;var n=!0,r=!1,i=void 0;try{for(var o,a=s.handlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var c=o.value;(c.areas.includes(e.area)||c.areas.includes("*"))&&s.$uiRunner((function(){c.activationHandler&&c.activationHandler(e),t()}))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}s.activeComponents.includes(e)||s.activeComponents.push(e),"themes"==e.area&&s.postActiveThemesToAllComponents(),t()}))})));case 25:case"end":return c.stop()}}),null,this,[[4,9,13,21],[14,,16,20]])}},{key:"deleteComponent",value:function(e){this.modelManager.setItemToBeDeleted(e),this.syncManager.sync()}},{key:"isComponentActive",value:function(e){return e.active}},{key:"iframeForComponent",value:function(e){for(var t=0,n=Array.from(document.getElementsByTagName("iframe"));t0?e==t-1?2==t?" and ":", and ":", ":""};return e.forEach((function(e,a){if("stream-items"===e.name){for(var s=e.content_types.map((function(e){var t=n.modelManager.humanReadableDisplayForContentType(e);return t?t+"s":"items of type "+e})),c="",u=0;u=2&&a0&&void 0!==arguments[0]?arguments[0]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.entries||(this.entries=[]),t.entries){var n=!0,r=!1,i=void 0;try{for(var o,a=t.entries[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,c=this.createEntryForItem(s.item);c.setPreviousEntry(this.getLastEntry()),this.entries.push(c)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}var t,n;return t=e,(n=[{key:"createEntryForItem",value:function(t){var n=e.HistoryEntryClassMapping&&e.HistoryEntryClassMapping[t.content_type];return n||(n=gt),new n(t)}},{key:"getLastEntry",value:function(){return this.entries[this.entries.length-1]}},{key:"addHistoryEntryForItem",value:function(e){var t=this.createEntryForItem(e),n=this.getLastEntry();if(t.setPreviousEntry(n),!t.isSameAsEntry(n))return this.entries.push(t),t}},{key:"clear",value:function(){this.entries.length=0}},{key:"optimize",value:function(){var t=this,n=[],r=function(t){return t.deltaSize()>e.LargeEntryDeltaThreshold},i=function(e,i,o){if(o?n.push(e):-1!==(i=n.indexOf(e))&&n.splice(i,1),o&&r(e)&&-1==e.operationVector()){var a=t.entries[i-1];a&&n.push(a)}};this.entries.forEach((function(e,n){if(0==n||n==t.entries.length-1)i(e,n,!0);else{var o=r(e);i(e,n,o)}})),this.entries=this.entries.filter((function(e,t){return-1!==n.indexOf(e)}))}}])&&bt(t.prototype,n),e}();function kt(e){return(kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t){for(var n=0;nt.LargeItemEntryAmountThreshold&&n.optimize()}}])&&xt(n.prototype,r),t}(F);function Mt(e,t){for(var n=0;n5&&void 0!==s[5]&&s[5],c.abrupt("return",new Promise((function(s,c){var u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:if((u=new XMLHttpRequest).onreadystatechange=function(){if(4==u.readyState){var e=u.responseText;if(e)try{e=JSON.parse(e)}catch(e){}u.status>=200&&u.status<=299?a.$timeout((function(){r(e),s(e)})):(console.error("Request error:",e),a.$timeout((function(){i(e,u.status),c(e)})))}},"get"==e&&Object.keys(n).length>0&&(t=a.urlForUrlAndParams(t,n)),u.open(e,t,!0),u.setRequestHeader("Content-type","application/json"),!o){l.next=8;break}return l.next=8,regeneratorRuntime.awrap(a.setAuthHeadersForRequest(u));case 8:"post"==e||"patch"==e?u.send(JSON.stringify(n)):u.send();case 9:case"end":return l.stop()}}))})));case 2:case"end":return c.stop()}}))}},{key:"urlForUrlAndParams",value:function(e,t){var n=Object.keys(t).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&");return e.includes("?")?e+"&"+n:e+"?"+n}}]),e}();function It(e,t){for(var n=0;n=this.MaxDiscordanceBeforeOutOfSync&&(this.outOfSync||(this.outOfSync=!0,this.notifyEvent("enter-out-of-sync"))),n.abrupt("return",!1);case 13:return this.outOfSync&&(this.outOfSync=!1,this.notifyEvent("exit-out-of-sync")),this.syncDiscordance=0,n.abrupt("return",!0);case 16:case"end":return n.stop()}}),null,this)}},{key:"isOutOfSync",value:function(){return this.outOfSync}},{key:"getServerURL",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,regeneratorRuntime.awrap(this.storageManager.getItem("server"));case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0=window._default_sf_server;case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),null,this)}},{key:"getSyncURL",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,regeneratorRuntime.awrap(this.getServerURL());case 2:return e.t0=e.sent,e.abrupt("return",e.t0+"/items/sync");case 4:case"end":return e.stop()}}),null,this)}},{key:"registerSyncStatusObserver",value:function(e){var t={key:new Date,callback:e};return this.syncStatusObservers.push(t),t}},{key:"removeSyncStatusObserver",value:function(e){Oe()(this.syncStatusObservers,e)}},{key:"syncStatusDidChange",value:function(){var e=this;this.syncStatusObservers.forEach((function(t){t.callback(e.syncStatus)}))}},{key:"addEventHandler",value:function(e){return this.eventHandlers.push(e),e}},{key:"removeEventHandler",value:function(e){Oe()(this.eventHandlers,e)}},{key:"notifyEvent",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.eventHandlers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)(0,o.value)(e,t||{})}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"setKeyRequestHandler",value:function(e){this.keyRequestHandler=e}},{key:"getActiveKeyInfo",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.keyRequestHandler(e));case 1:case"end":return t.stop()}}),null,this)}},{key:"initialDataLoaded",value:function(){return!0===this._initialDataLoaded}},{key:"_sortLocalItems",value:function(e){var t=this;return e.sort((function(e,n){var r=new Date(n.updated_at)-new Date(e.updated_at),i=t.contentTypeLoadPriority,o=0,a=0;return i&&(o=i.indexOf(e.content_type),a=i.indexOf(n.content_type),-1==o&&(o=i.length),-1==a&&(a=i.length)),o==a?r:o0&&void 0!==s[0]?s[0]:{},n=t.incrementalCallback,r=t.batchSize,!(i=t.options)||!i.simulateHighLatency){c.next=5;break}return o=i.simulatedLatency||1e3,c.next=5,regeneratorRuntime.awrap(this._awaitSleep(o));case 5:if(!this.loadLocalDataPromise){c.next=7;break}return c.abrupt("return",this.loadLocalDataPromise);case 7:return r||(r=100),this.loadLocalDataPromise=this.storageManager.getAllModels().then((function(t){var i=(t=(t=a._sortLocalItems(t)).filter((function(e){var t=a.modelManager.findItem(e.uuid);return!t||new Date(e.dirtiedDate)>t.dirtiedDate}))).length,o=0,s=[];return function c(){var u,l;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return u=t.slice(o,o+r),f.next=3,regeneratorRuntime.awrap(a.handleItemsResponse(u,null,ht.MappingSourceLocalRetrieved,e.KeyRequestLoadLocal));case 3:if(l=f.sent,s.push(l),!((o+=u.length)0)){m.next=23;break}return m.next=23,regeneratorRuntime.awrap(Promise.all(s.map((function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.storageManager.deleteModel(e));case 1:case"end":return t.stop()}}))}))));case 23:return m.next=25,regeneratorRuntime.awrap(r.getActiveKeyInfo(e.KeyRequestSaveLocal));case 25:if(h=m.sent,!(a.length>0)){m.next=33;break}return m.next=29,regeneratorRuntime.awrap(Promise.all(a.map((function(e){var t;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=new K(e,h.keys,h.auth_params),r.next=3,regeneratorRuntime.awrap(t.paramsForLocalStorage());case 3:return t=r.sent,n&&delete t.dirty,r.abrupt("return",t);case 6:case"end":return r.stop()}}))}))).catch((function(e){return o(e)})));case 29:return v=m.sent,m.next=32,regeneratorRuntime.awrap(r.storageManager.saveModels(v).catch((function(e){console.error("Error writing items",e),r.syncStatus.localError=e,r.syncStatusDidChange(),o()})));case 32:r.syncStatus.localError&&(r.syncStatus.localError=null,r.syncStatusDidChange());case 33:i();case 34:case"end":return m.stop()}}),null,null,[[4,8,12,20],[13,,15,19]])})));case 3:case"end":return i.stop()}}))}},{key:"syncOffline",value:function(e){var t,n,r,i,o,a=this;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:for(t=!0,n=!1,r=void 0,s.prev=3,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.updated_at=new Date;s.next=11;break;case 7:s.prev=7,s.t0=s.catch(3),n=!0,r=s.t0;case 11:s.prev=11,s.prev=12,t||null==i.return||i.return();case 14:if(s.prev=14,!n){s.next=17;break}throw r;case 17:return s.finish(14);case 18:return s.finish(11);case 19:return s.abrupt("return",this.writeItemsToLocalStorage(e,!0).then((function(t){var n=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var c=o.value;c.deleted&&a.modelManager.removeItemLocally(c)}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return a.modelManager.clearDirtyItems(e),a.modelManager.didSyncModelsOffline(e),a.notifyEvent("sync:completed",{savedItems:e}),{saved_items:e}})));case 20:case"end":return s.stop()}}),null,this,[[3,7,11,19],[12,,14,18]])}},{key:"markAllItemsDirtyAndSaveOffline",value:function(e){var t,n,r,i,o,a,s,c,u,l,f,d,p;return regeneratorRuntime.async((function(h){for(;;)switch(h.prev=h.next){case 0:if(!e){h.next=28;break}t=this.modelManager.allNondummyItems.filter((function(e){return!e.errorDecrypting})).slice(),n=!0,r=!1,i=void 0,h.prev=5,o=t[Symbol.iterator]();case 7:if(n=(a=o.next()).done){h.next=14;break}return s=a.value,h.next=11,regeneratorRuntime.awrap(this.modelManager.alternateUUIDForItem(s));case 11:n=!0,h.next=7;break;case 14:h.next=20;break;case 16:h.prev=16,h.t0=h.catch(5),r=!0,i=h.t0;case 20:h.prev=20,h.prev=21,n||null==o.return||o.return();case 23:if(h.prev=23,!r){h.next=26;break}throw i;case 26:return h.finish(23);case 27:return h.finish(20);case 28:for(c=this.modelManager.allNondummyItems,u=!0,l=!1,f=void 0,h.prev=32,d=c[Symbol.iterator]();!(u=(p=d.next()).done);u=!0)p.value.setDirty(!0);h.next=40;break;case 36:h.prev=36,h.t1=h.catch(32),l=!0,f=h.t1;case 40:h.prev=40,h.prev=41,u||null==d.return||d.return();case 43:if(h.prev=43,!l){h.next=46;break}throw f;case 46:return h.finish(43);case 47:return h.finish(40);case 48:return h.abrupt("return",this.writeItemsToLocalStorage(c,!1));case 49:case"end":return h.stop()}}),null,this,[[5,16,20,28],[21,,23,27],[32,36,40,48],[41,,43,47]])}},{key:"setSyncToken",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this._syncToken=e,t.next=3,regeneratorRuntime.awrap(this.storageManager.setItem("syncToken",e));case 3:case"end":return t.stop()}}),null,this)}},{key:"getSyncToken",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._syncToken){e.next=4;break}return e.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("syncToken"));case 3:this._syncToken=e.sent;case 4:return e.abrupt("return",this._syncToken);case 5:case"end":return e.stop()}}),null,this)}},{key:"setCursorToken",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._cursorToken=e,!e){t.next=6;break}return t.next=4,regeneratorRuntime.awrap(this.storageManager.setItem("cursorToken",e));case 4:t.next=8;break;case 6:return t.next=8,regeneratorRuntime.awrap(this.storageManager.removeItem("cursorToken"));case 8:case"end":return t.stop()}}),null,this)}},{key:"getCursorToken",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._cursorToken){e.next=4;break}return e.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("cursorToken"));case 3:this._cursorToken=e.sent;case 4:return e.abrupt("return",this._cursorToken);case 5:case"end":return e.stop()}}),null,this)}},{key:"clearQueuedCallbacks",value:function(){this._queuedCallbacks=[]}},{key:"callQueuedCallbacks",value:function(e){var t=this.queuedCallbacks;if(t.length){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)(0,o.value)(e)}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.clearQueuedCallbacks()}}},{key:"beginCheckingIfSyncIsTakingTooLong",value:function(){this.syncStatus.checker&&this.stopCheckingIfSyncIsTakingTooLong(),this.syncStatus.checker=this.$interval(function(){(new Date-this.syncStatus.syncStart)/1e3>5&&(this.notifyEvent("sync:taking-too-long"),this.stopCheckingIfSyncIsTakingTooLong())}.bind(this),500)}},{key:"stopCheckingIfSyncIsTakingTooLong",value:function(){this.$interval.hasOwnProperty("cancel")?this.$interval.cancel(this.syncStatus.checker):clearInterval(this.syncStatus.checker),this.syncStatus.checker=null}},{key:"lockSyncing",value:function(){this.syncLocked=!0}},{key:"unlockSyncing",value:function(){this.syncLocked=!1}},{key:"sync",value:function(){var t,n=this,r=arguments;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:{},!this.syncLocked){i.next=4;break}return console.log("Sync Locked, Returning;"),i.abrupt("return");case 4:return i.abrupt("return",new Promise((function(r,i){var o,a,s,c,u,l,f,d,p,h,v,m,y,g;return regeneratorRuntime.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t||(t={}),o=n.modelManager.getDirtyItems(),a=o.filter((function(e){return!n.lastDirtyItemsSave||e.dirtiedDate>n.lastDirtyItemsSave})),i.next=5,regeneratorRuntime.awrap(n.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 5:if(s=i.sent,c=n.syncStatus.syncOpInProgress,u=n.initialDataLoaded(),!c&&u){i.next=16;break}return n.performSyncAgainOnCompletion=!0,n.lastDirtyItemsSave=new Date,i.next=13,regeneratorRuntime.awrap(n.writeItemsToLocalStorage(a,!1));case 13:return c&&(n.queuedCallbacks.push(r),n.loggingEnabled&&console.warn("Attempting to sync while existing sync is in progress.")),u||(n.loggingEnabled&&console.warn("(1) Attempting to perform online sync before local data has loaded"),r()),i.abrupt("return");case 16:if(n.syncStatus.syncOpInProgress=!0,!s.offline){i.next=19;break}return i.abrupt("return",n.syncOffline(o).then((function(e){n.syncStatus.syncOpInProgress=!1,r(e)})).catch((function(e){n.notifyEvent("sync-exception",e)})));case 19:if(n.initialDataLoaded()){i.next=22;break}return console.error("Attempting to perform online sync before local data has loaded"),i.abrupt("return");case 22:return n.loggingEnabled&&console.log("Syncing online user."),l=n.syncStatus.needsMoreSync,n.syncStatus.syncStart=new Date,n.beginCheckingIfSyncIsTakingTooLong(),f=n.PerSyncItemUploadLimit,(d=o.slice(0,f)).lengthn.syncStatus.total&&(n.syncStatus.total=n.syncStatus.current),n.syncStatusDidChange(),i.next=34,regeneratorRuntime.awrap(n.writeItemsToLocalStorage(a,!1));case 34:return n.lastDirtyItemsSave=new Date,t.onPreSyncSave&&t.onPreSyncSave(),n.allRetreivedItems||(n.allRetreivedItems=[]),n.allSavedItems||(n.allSavedItems=[]),(p={}).limit=n.ServerItemDownloadLimit,t.performIntegrityCheck&&(p.compute_integrity=!0),i.prev=41,i.next=44,regeneratorRuntime.awrap(Promise.all(d.map((function(e){var n=new K(e,s.keys,s.auth_params);return n.additionalFields=t.additionalFields,n.paramsForSync()}))).then((function(e){p.items=e})));case 44:i.next=49;break;case 46:i.prev=46,i.t0=i.catch(41),n.notifyEvent("sync-exception",i.t0);case 49:for(h=!0,v=!1,m=void 0,i.prev=52,y=d[Symbol.iterator]();!(h=(g=y.next()).done);h=!0)g.value.dirtyCount=0;i.next=60;break;case 56:i.prev=56,i.t1=i.catch(52),v=!0,m=i.t1;case 60:i.prev=60,i.prev=61,h||null==y.return||y.return();case 63:if(i.prev=63,!v){i.next=66;break}throw m;case 66:return i.finish(63);case 67:return i.finish(60);case 68:return i.next=70,regeneratorRuntime.awrap(n.getSyncToken());case 70:return p.sync_token=i.sent,i.next=73,regeneratorRuntime.awrap(n.getCursorToken());case 73:return p.cursor_token=i.sent,p.api=At.getApiVersion(),n.loggingEnabled&&console.log("Syncing with params",p),i.prev=76,i.t2=n.httpManager,i.next=80,regeneratorRuntime.awrap(n.getSyncURL());case 80:i.t3=i.sent,i.t4=p,i.t5=function(e){n.handleSyncSuccess(d,e,t).then((function(){r(e)})).catch((function(e){console.log("Caught sync success exception:",e),n.handleSyncError(e,null,o).then((function(t){n.notifyEvent("sync-exception",e),r(t)}))}))},i.t6=function(e,t){n.handleSyncError(e,t,o).then((function(e){r(e)}))},i.t2.postAuthenticatedAbsolute.call(i.t2,i.t3,i.t4,i.t5,i.t6),i.next=90;break;case 87:i.prev=87,i.t7=i.catch(76),console.log("Sync exception caught:",i.t7);case 90:case"end":return i.stop()}}),null,null,[[41,46],[52,56,60,68],[61,,63,67],[76,87]])})));case 5:case"end":return i.stop()}}),null,this)}},{key:"_awaitSleep",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return console.warn("Simulating high latency sync request",e),t.abrupt("return",new Promise((function(t,n){setTimeout((function(){t()}),e)})));case 2:case"end":return t.stop()}}))}},{key:"handleSyncSuccess",value:function(t,n,r){var i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,_,S,M,C,A,I,O,E,D=this;return regeneratorRuntime.async((function(R){for(;;)switch(R.prev=R.next){case 0:if(!r.simulateHighLatency){R.next=4;break}return i=r.simulatedLatency||1e3,R.next=4,regeneratorRuntime.awrap(this._awaitSleep(i));case 4:for(this.syncStatus.error=null,this.loggingEnabled&&console.log("Sync response",n),o=this.allSavedItems.map((function(e){return e.uuid})),a=n.saved_items.map((function(e){return e.uuid})),s=[],n.retrieved_items=n.retrieved_items.filter((function(e){var t=o.includes(e.uuid),n=a.includes(e.uuid);if(t||n)return s.push(e),!1;var r=D.modelManager.findItem(e.uuid);return!r||!r.dirty||(s.push(e),!1)})),c=[],u=!0,l=!1,f=void 0,R.prev=14,d=t[Symbol.iterator]();!(u=(p=d.next()).done);u=!0)0==(h=p.value).dirtyCount&&c.push(h);R.next=22;break;case 18:R.prev=18,R.t0=R.catch(14),l=!0,f=R.t0;case 22:R.prev=22,R.prev=23,u||null==d.return||d.return();case 25:if(R.prev=25,!l){R.next=28;break}throw f;case 28:return R.finish(25);case 29:return R.finish(22);case 30:if(this.modelManager.clearDirtyItems(c),v=[],!(s.length>0)){R.next=72;break}return R.next=35,regeneratorRuntime.awrap(this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 35:return m=R.sent.keys,R.next=38,regeneratorRuntime.awrap($.decryptMultipleItems(s,m));case 38:y=!0,g=!1,b=void 0,R.prev=41,w=s[Symbol.iterator]();case 43:if(y=(k=w.next()).done){R.next=58;break}if(x=k.value,_=this.modelManager.findItem(x.uuid),S=JSON.parse(x.content),_&&S){R.next=49;break}return R.abrupt("continue",55);case 49:if(!_||_.isContentEqualWithNonItemContent(S)){R.next=55;break}return R.next=52,regeneratorRuntime.awrap(this.modelManager.createDuplicateItemFromResponseItem(x));case 52:M=R.sent,this.modelManager.addDuplicatedItemAsConflict({duplicate:M,duplicateOf:_}),v.push(M);case 55:y=!0,R.next=43;break;case 58:R.next=64;break;case 60:R.prev=60,R.t1=R.catch(41),g=!0,b=R.t1;case 64:R.prev=64,R.prev=65,y||null==w.return||w.return();case 67:if(R.prev=67,!g){R.next=70;break}throw b;case 70:return R.finish(67);case 71:return R.finish(64);case 72:return R.next=74,regeneratorRuntime.awrap(this.handleItemsResponse(n.retrieved_items,null,ht.MappingSourceRemoteRetrieved,e.KeyRequestLoadSaveAccount));case 74:return C=R.sent,this.allRetreivedItems=this.allRetreivedItems.concat(C),this.syncStatus.retrievedCount=this.allRetreivedItems.length,A=["content","auth_hash"],R.next=80,regeneratorRuntime.awrap(this.handleItemsResponse(n.saved_items,A,ht.MappingSourceRemoteSaved,e.KeyRequestLoadSaveAccount));case 80:return I=R.sent,this.allSavedItems=this.allSavedItems.concat(I),O=n.unsaved,R.next=85,regeneratorRuntime.awrap(this.deprecated_handleUnsavedItemsResponse(O));case 85:return R.next=87,regeneratorRuntime.awrap(this.handleConflictsResponse(n.conflicts));case 87:if(R.t2=R.sent,R.t2){R.next=90;break}R.t2=[];case 90:if(E=R.t2,!((v=v.concat(E)).length>0)){R.next=95;break}return R.next=95,regeneratorRuntime.awrap(this.writeItemsToLocalStorage(v,!1));case 95:return R.next=97,regeneratorRuntime.awrap(this.writeItemsToLocalStorage(I,!1));case 97:return R.next=99,regeneratorRuntime.awrap(this.writeItemsToLocalStorage(C,!1));case 99:if(!n.integrity_hash||n.cursor_token){R.next=104;break}return R.next=102,regeneratorRuntime.awrap(this.handleServerIntegrityHash(n.integrity_hash));case 102:R.sent||this.syncDiscordance0)){R.next=122;break}return this.performSyncAgainOnCompletion=!1,R.abrupt("return",new Promise((function(e,t){setTimeout((function(){D.sync(r).then(e)}),10)})));case 122:return this.syncStatus.retrievedCount=0,this.syncStatus.current=0,this.syncStatus.total=0,this.syncStatusDidChange(),(this.allRetreivedItems.length>=this.majorDataChangeThreshold||I.length>=this.majorDataChangeThreshold||O&&O.length>=this.majorDataChangeThreshold||v&&v.length>=this.majorDataChangeThreshold)&&this.notifyEvent("major-data-change"),this.callQueuedCallbacks(n),this.notifyEvent("sync:completed",{retrievedItems:this.allRetreivedItems,savedItems:this.allSavedItems}),this.allRetreivedItems=[],this.allSavedItems=[],this.performSyncAgainOnCompletion&&(this.performSyncAgainOnCompletion=!1,setTimeout((function(){D.sync(r)}),10)),R.abrupt("return",n);case 133:case"end":return R.stop()}}),null,this,[[14,18,22,30],[23,,25,29],[41,60,64,72],[65,,67,71]])}},{key:"handleSyncError",value:function(e,t,n){return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:return console.log("Sync error: ",e),401==t&&this.notifyEvent("sync-session-invalid"),e?"string"==typeof e&&(e={error:{message:e}}):e={error:{message:"Could not connect to server."}},this.syncStatus.syncOpInProgress=!1,this.syncStatus.error=e.error,this.syncStatusDidChange(),this.writeItemsToLocalStorage(n,!1),this.modelManager.didSyncModelsOffline(n),this.stopCheckingIfSyncIsTakingTooLong(),this.notifyEvent("sync:error",e.error),this.callQueuedCallbacks({error:"Sync error"}),r.abrupt("return",e);case 12:case"end":return r.stop()}}),null,this)}},{key:"handleItemsResponse",value:function(e,t,n,r){var i,o,a;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,regeneratorRuntime.awrap(this.getActiveKeyInfo(r));case 2:return i=s.sent.keys,s.next=5,regeneratorRuntime.awrap($.decryptMultipleItems(e,i));case 5:return s.next=7,regeneratorRuntime.awrap(this.modelManager.mapResponseItemsToLocalModelsOmittingFields(e,t,n));case 7:return o=s.sent,(a=o.filter((function(e){var t=e.errorDecryptingValueChanged;return e.errorDecryptingValueChanged=!1,t}))).length>0&&this.writeItemsToLocalStorage(a,!1),s.abrupt("return",o);case 11:case"end":return s.stop()}}),null,this)}},{key:"refreshErroredItems",value:function(){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(!((t=this.modelManager.allNondummyItems.filter((function(e){return 1==e.errorDecrypting}))).length>0)){n.next=3;break}return n.abrupt("return",this.handleItemsResponse(t,null,ht.MappingSourceLocalRetrieved,e.KeyRequestLoadSaveAccount));case 3:case"end":return n.stop()}}),null,this)}},{key:"handleConflictsResponse",value:function(t){var n,r,i,o,a,s,c,u,l,f,d,p,h,v,m,y,g,b,w,k,x,_,S,M,C,A,I,O,E,D,R;return regeneratorRuntime.async((function(P){for(;;)switch(P.prev=P.next){case 0:if(t&&0!=t.length){P.next=2;break}return P.abrupt("return");case 2:this.loggingEnabled&&console.log("Handle Conflicted Items:",t),n={},r=!0,i=!1,o=void 0,P.prev=7,a=t[Symbol.iterator]();case 9:if(r=(s=a.next()).done){P.next=21;break}if(c=s.value,u=c.server_item||c.unsaved_item,l=this.modelManager.findItem(u.uuid)){P.next=16;break}return n[u.uuid]={},P.abrupt("continue",18);case 16:f=l.getContentCopy(),n[u.uuid]={frozenCurrentContent:f,itemRef:l};case 18:r=!0,P.next=9;break;case 21:P.next=27;break;case 23:P.prev=23,P.t0=P.catch(7),i=!0,o=P.t0;case 27:P.prev=27,P.prev=28,r||null==a.return||a.return();case 30:if(P.prev=30,!i){P.next=33;break}throw o;case 33:return P.finish(30);case 34:return P.finish(27);case 35:d=[],p=!0,h=!1,v=void 0,P.prev=39,m=t[Symbol.iterator]();case 41:if(p=(y=m.next()).done){P.next=93;break}return g=y.value,b=g.server_item||g.unsaved_item,P.t1=regeneratorRuntime,P.t2=$,P.t3=[b],P.next=49,regeneratorRuntime.awrap(this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 49:return P.t4=P.sent.keys,P.t5=P.t2.decryptMultipleItems.call(P.t2,P.t3,P.t4),P.next=53,P.t1.awrap.call(P.t1,P.t5);case 53:if(w=n[b.uuid],k=w.frozenCurrentContent,x=w.itemRef){P.next=56;break}return P.abrupt("continue",90);case 56:if(d.push(x),"uuid_conflict"!==g.type){P.next=64;break}return P.next=60,regeneratorRuntime.awrap(this.modelManager.alternateUUIDForItem(x));case 60:_=P.sent,d.push(_),P.next=90;break;case 64:if("sync_conflict"!==g.type){P.next=88;break}return P.next=67,regeneratorRuntime.awrap(this.modelManager.createDuplicateItemFromResponseItem(b));case 67:if(S=P.sent,M=this.modelManager.duplicateItemWithCustomContent({content:k,duplicateOf:x}),C=!M.isItemContentEqualWith(S),A=!x.isItemContentEqualWith(S),I=!1,O=!1,E=!1,D=!1,b.deleted||x.deleted?D=!0:C?(new Date-x.client_updated_at)/1e3<20?(E=!0,O=!0):(I=!0,D=!0):A?SFItem.AreItemContentsEqual({leftContent:x.content,rightContent:S.content,keysToIgnore:x.keysToIgnoreWhenCheckingContentEquality().concat(["references"]),appDataKeysToIgnore:x.appDataKeysToIgnoreWhenCheckingContentEquality()})?E=!0:(I=!0,D=!0):D=!0,!I){P.next=81;break}return P.next=79,regeneratorRuntime.awrap(this.modelManager.duplicateItemWithCustomContentAndAddAsConflict({content:k,duplicateOf:x}));case 79:R=P.sent,d.push(R);case 81:if(O&&(this.modelManager.addDuplicatedItemAsConflict({duplicate:S,duplicateOf:x}),d.push(S)),!D){P.next=85;break}return P.next=85,regeneratorRuntime.awrap(this.modelManager.mapResponseItemsToLocalModelsOmittingFields([b],null,ht.MappingSourceRemoteRetrieved));case 85:E&&(x.updated_at=S.updated_at,x.setDirty(!0)),P.next=90;break;case 88:return console.error("Unsupported conflict type",g.type),P.abrupt("continue",90);case 90:p=!0,P.next=41;break;case 93:P.next=99;break;case 95:P.prev=95,P.t6=P.catch(39),h=!0,v=P.t6;case 99:P.prev=99,P.prev=100,p||null==m.return||m.return();case 102:if(P.prev=102,!h){P.next=105;break}throw v;case 105:return P.finish(102);case 106:return P.finish(99);case 107:return P.abrupt("return",d);case 108:case"end":return P.stop()}}),null,this,[[7,23,27,35],[28,,30,34],[39,95,99,107],[100,,102,106]])}},{key:"deprecated_handleUnsavedItemsResponse",value:function(t){var n,r,i,o,a,s,c,u,l,f;return regeneratorRuntime.async((function(d){for(;;)switch(d.prev=d.next){case 0:if(t&&0!=t.length){d.next=2;break}return d.abrupt("return");case 2:this.loggingEnabled&&console.log("Handle Unsaved Items:",t),n=!0,r=!1,i=void 0,d.prev=6,o=t[Symbol.iterator]();case 8:if(n=(a=o.next()).done){d.next=37;break}return s=a.value,c=s.item,d.t0=regeneratorRuntime,d.t1=$,d.t2=[c],d.next=16,regeneratorRuntime.awrap(this.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 16:return d.t3=d.sent.keys,d.t4=d.t1.decryptMultipleItems.call(d.t1,d.t2,d.t3),d.next=20,d.t0.awrap.call(d.t0,d.t4);case 20:if(u=this.modelManager.findItem(c.uuid)){d.next=23;break}return d.abrupt("continue",34);case 23:if("uuid_conflict"!==(l=s.error).tag){d.next=29;break}return d.next=27,regeneratorRuntime.awrap(this.modelManager.alternateUUIDForItem(u));case 27:d.next=34;break;case 29:if("sync_conflict"!==l.tag){d.next=34;break}return d.next=32,regeneratorRuntime.awrap(this.modelManager.createDuplicateItemFromResponseItem(c));case 32:f=d.sent,c.deleted||u.isItemContentEqualWith(f)||this.modelManager.addDuplicatedItemAsConflict({duplicate:f,duplicateOf:u});case 34:n=!0,d.next=8;break;case 37:d.next=43;break;case 39:d.prev=39,d.t5=d.catch(6),r=!0,i=d.t5;case 43:d.prev=43,d.prev=44,n||null==o.return||o.return();case 46:if(d.prev=46,!r){d.next=49;break}throw i;case 49:return d.finish(46);case 50:return d.finish(43);case 51:case"end":return d.stop()}}),null,this,[[6,39,43,51],[44,,46,50]])}},{key:"stateless_downloadAllItems",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(r,i){var o;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o={limit:n.limit||500,sync_token:n.syncToken,cursor_token:n.cursorToken,content_type:n.contentType,event:n.event,api:At.getApiVersion()},a.prev=1,a.t0=t.httpManager,a.next=5,regeneratorRuntime.awrap(t.getSyncURL());case 5:a.t1=a.sent,a.t2=o,a.t3=function(i){var o,a;return regeneratorRuntime.async((function(s){for(;;)switch(s.prev=s.next){case 0:return n.retrievedItems||(n.retrievedItems=[]),o=i.retrieved_items,s.next=4,regeneratorRuntime.awrap(t.getActiveKeyInfo(e.KeyRequestLoadSaveAccount));case 4:return a=s.sent.keys,s.next=7,regeneratorRuntime.awrap($.decryptMultipleItems(o,a));case 7:n.retrievedItems=n.retrievedItems.concat(o.map((function(e){return t.modelManager.createItem(e)}))),n.syncToken=i.sync_token,n.cursorToken=i.cursor_token,n.cursorToken?t.stateless_downloadAllItems(n).then(r):r(n.retrievedItems);case 11:case"end":return s.stop()}}))},a.t4=function(e,t){i(e)},a.t0.postAuthenticatedAbsolute.call(a.t0,a.t1,a.t2,a.t3,a.t4),a.next=16;break;case 12:a.prev=12,a.t5=a.catch(1),console.log("Download all items exception caught:",a.t5),i(a.t5);case 16:case"end":return a.stop()}}),null,null,[[1,12]])}))}},{key:"resolveOutOfSync",value:function(){var e=this;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.stateless_downloadAllItems({event:"resolve-out-of-sync"}).then((function(t){var n,r,i,o,a,s,c,u;return regeneratorRuntime.async((function(l){for(;;)switch(l.prev=l.next){case 0:n=[],r=!0,i=!1,o=void 0,l.prev=4,a=t[Symbol.iterator]();case 6:if(r=(s=a.next()).done){l.next=18;break}if(c=s.value,!(u=e.modelManager.findItem(c.uuid))){l.next=14;break}if(c.isItemContentEqualWith(u)){l.next=14;break}return l.next=14,regeneratorRuntime.awrap(e.modelManager.duplicateItemAndAddAsConflict(u));case 14:n.push(c);case 15:r=!0,l.next=6;break;case 18:l.next=24;break;case 20:l.prev=20,l.t0=l.catch(4),i=!0,o=l.t0;case 24:l.prev=24,l.prev=25,r||null==a.return||a.return();case 27:if(l.prev=27,!i){l.next=30;break}throw o;case 30:return l.finish(27);case 31:return l.finish(24);case 32:return l.next=34,regeneratorRuntime.awrap(e.modelManager.mapResponseItemsToLocalModelsWithOptions({items:n,source:ht.MappingSourceRemoteRetrieved}));case 34:return l.next=36,regeneratorRuntime.awrap(e.writeItemsToLocalStorage(e.modelManager.allNondummyItems));case 36:return l.abrupt("return",e.sync({performIntegrityCheck:!0}));case 37:case"end":return l.stop()}}),null,null,[[4,20,24,32],[25,,27,31]])})));case 1:case"end":return t.stop()}}),null,this)}},{key:"handleSignout",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this.outOfSync=!1,this.loadLocalDataPromise=null,this.performSyncAgainOnCompletion=!1,this.syncStatus.syncOpInProgress=!1,this._queuedCallbacks=[],this.syncStatus={},e.abrupt("return",this.clearSyncToken());case 7:case"end":return e.stop()}}),null,this)}},{key:"clearSyncToken",value:function(){return regeneratorRuntime.async((function(e){for(;;)switch(e.prev=e.next){case 0:return this._syncToken=null,this._cursorToken=null,e.abrupt("return",this.storageManager.removeItem("syncToken"));case 3:case"end":return e.stop()}}),null,this)}},{key:"__setLocalDataNotLoaded",value:function(){this.loadLocalDataPromise=null,this._initialDataLoaded=!1}},{key:"queuedCallbacks",get:function(){return this._queuedCallbacks||(this._queuedCallbacks=[]),this._queuedCallbacks}}])&&Et(t.prototype,n),e}();function Rt(e,t){for(var n=0;n0||a.customHandler)){A.next=77;break}return A.next=75,regeneratorRuntime.awrap(this.runMigration(a,a.items));case 75:A.next=78;break;case 77:this.markMigrationCompleted(a);case 78:g=!0,A.next=70;break;case 81:A.next=87;break;case 83:A.prev=83,A.t3=A.catch(68),b=!0,w=A.t3;case 87:A.prev=87,A.prev=88,g||null==k.return||k.return();case 90:if(A.prev=90,!b){A.next=93;break}throw w;case 93:return A.finish(90);case 94:return A.finish(87);case 95:for(_=!0,$=!1,S=void 0,A.prev=98,M=this.completionHandlers[Symbol.iterator]();!(_=(C=M.next()).done);_=!0)(0,C.value)();A.next=106;break;case 102:A.prev=102,A.t4=A.catch(98),$=!0,S=A.t4;case 106:A.prev=106,A.prev=107,_||null==M.return||M.return();case 109:if(A.prev=109,!$){A.next=112;break}throw S;case 112:return A.finish(109);case 113:return A.finish(106);case 114:case"end":return A.stop()}}),null,this,[[6,10,14,22],[15,,17,21],[25,53,57,65],[32,36,40,48],[41,,43,47],[58,,60,64],[68,83,87,95],[88,,90,94],[98,102,106,114],[107,,109,113]])}},{key:"encode",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",window.btoa(e));case 1:case"end":return t.stop()}}))}},{key:"decode",value:function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",window.atob(e));case 1:case"end":return t.stop()}}))}},{key:"getCompletedMigrations",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._completed){t.next=5;break}return t.next=3,regeneratorRuntime.awrap(this.storageManager.getItem("migrations"));case 3:e=t.sent,this._completed=e?JSON.parse(e):[];case 5:return t.abrupt("return",this._completed);case 6:case"end":return t.stop()}}),null,this)}},{key:"getPendingMigrations",value:function(){var e,t,n,r,i,o,a,s;return regeneratorRuntime.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,regeneratorRuntime.awrap(this.getCompletedMigrations());case 2:e=c.sent,t=[],n=!0,r=!1,i=void 0,c.prev=7,o=this.migrations[Symbol.iterator]();case 9:if(n=(a=o.next()).done){c.next=22;break}return s=a.value,c.t0=e,c.next=14,regeneratorRuntime.awrap(this.encode(s.name));case 14:if(c.t1=c.sent,c.t2=c.t0.indexOf.call(c.t0,c.t1),c.t3=-1,c.t2!=c.t3){c.next=19;break}t.push(s);case 19:n=!0,c.next=9;break;case 22:c.next=28;break;case 24:c.prev=24,c.t4=c.catch(7),r=!0,i=c.t4;case 28:c.prev=28,c.prev=29,n||null==o.return||o.return();case 31:if(c.prev=31,!r){c.next=34;break}throw i;case 34:return c.finish(31);case 35:return c.finish(28);case 36:return c.abrupt("return",t);case 37:case"end":return c.stop()}}),null,this,[[7,24,28,36],[29,,31,35]])}},{key:"markMigrationCompleted",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.getCompletedMigrations());case 2:return t=n.sent,n.t0=t,n.next=6,regeneratorRuntime.awrap(this.encode(e.name));case 6:n.t1=n.sent,n.t0.push.call(n.t0,n.t1),this.storageManager.setItem("migrations",JSON.stringify(t)),e.running=!1;case 10:case"end":return n.stop()}}),null,this)}},{key:"runMigration",value:function(e,t){var n=this;return regeneratorRuntime.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.running){r.next=2;break}return r.abrupt("return");case 2:if(console.log("Running migration:",e.name),e.running=!0,!e.customHandler){r.next=8;break}return r.abrupt("return",e.customHandler().then((function(){n.markMigrationCompleted(e)})));case 8:return r.abrupt("return",e.handler(t).then((function(){n.markMigrationCompleted(e)})));case 9:case"end":return r.stop()}}))}}])&&Ft(t.prototype,n),e}();function Ut(e,t){for(var n=0;n0);case 4:case"end":return t.stop()}}),null,this)}},{key:"actionRequiresPrivilege",value:function(e){var t;return regeneratorRuntime.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,regeneratorRuntime.awrap(this.getSessionExpirey());case 2:if(!(n.sent>new Date)){n.next=5;break}return n.abrupt("return",!1);case 5:return n.next=7,regeneratorRuntime.awrap(this.netCredentialsForAction(e));case 7:return t=n.sent,n.abrupt("return",t.length>0);case 9:case"end":return n.stop()}}),null,this)}},{key:"savePrivileges",value:function(){var e;return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,regeneratorRuntime.awrap(this.getPrivileges());case 2:e=t.sent,this.modelManager.setItemDirty(e,!0),this.syncManager.sync();case 5:case"end":return t.stop()}}),null,this)}},{key:"authenticateAction",value:function(e,t){var n,r,i,o,a,s,c,u,l;return regeneratorRuntime.async((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,regeneratorRuntime.awrap(this.netCredentialsForAction(e));case 2:n=f.sent,r=[],i=[],o=!0,a=!1,s=void 0,f.prev=7,c=n[Symbol.iterator]();case 9:if(o=(u=c.next()).done){f.next=18;break}return l=u.value,f.next=13,regeneratorRuntime.awrap(this._verifyAuthenticationParameters(l,t[l]));case 13:f.sent?r.push(l):i.push(l);case 15:o=!0,f.next=9;break;case 18:f.next=24;break;case 20:f.prev=20,f.t0=f.catch(7),a=!0,s=f.t0;case 24:f.prev=24,f.prev=25,o||null==c.return||c.return();case 27:if(f.prev=27,!a){f.next=30;break}throw s;case 30:return f.finish(27);case 31:return f.finish(24);case 32:return f.abrupt("return",{success:0==i.length,successfulCredentials:r,failedCredentials:i});case 33:case"end":return f.stop()}}),null,this,[[7,20,24,32],[25,,27,31]])}},{key:"_verifyAuthenticationParameters",value:function(t,n){var r,i,o=this;return regeneratorRuntime.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(r=function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.delegate.verifyAccountPassword(e));case 1:case"end":return t.stop()}}))},i=function(e){return regeneratorRuntime.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.delegate.verifyLocalPasscode(e));case 1:case"end":return t.stop()}}))},t!=e.CredentialAccountPassword){a.next=6;break}return a.abrupt("return",r(n));case 6:if(t!=e.CredentialLocalPasscode){a.next=8;break}return a.abrupt("return",i(n));case 8:case"end":return a.stop()}}))}}])&&Ht(t.prototype,n),e}();function Vt(e,t){for(var n=0;n0){var s=n.modelManager.itemsMatchingPredicates(i);if(s.length>=2){var c=s.sort((function(e,t){return e.errorDecrypting?1:t.errorDecrypting?-1:e.created_at * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",d=1,p=2,h=4,v=1,m=2,y=1,g=2,b=4,w=8,k=16,x=32,_=64,$=128,S=256,M=512,C=30,A="...",I=800,O=16,E=1,D=2,R=1/0,P=9007199254740991,T=17976931348623157e292,j=NaN,N=4294967295,F=N-1,L=N>>>1,U=[["ary",$],["bind",y],["bindKey",g],["curry",w],["curryRight",k],["flip",M],["partial",x],["partialRight",_],["rearg",S]],B="[object Arguments]",H="[object Array]",z="[object AsyncFunction]",V="[object Boolean]",W="[object Date]",K="[object DOMException]",q="[object Error]",J="[object Function]",G="[object GeneratorFunction]",Y="[object Map]",Z="[object Number]",X="[object Null]",Q="[object Object]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",ae="[object WeakMap]",se="[object WeakSet]",ce="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",de="[object Int8Array]",pe="[object Int16Array]",he="[object Int32Array]",ve="[object Uint8Array]",me="[object Uint8ClampedArray]",ye="[object Uint16Array]",ge="[object Uint32Array]",be=/\b__p \+= '';/g,we=/\b(__p \+=) '' \+/g,ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,_e=/[&<>"']/g,$e=RegExp(xe.source),Se=RegExp(_e.source),Me=/<%-([\s\S]+?)%>/g,Ce=/<%([\s\S]+?)%>/g,Ae=/<%=([\s\S]+?)%>/g,Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Oe=/^\w*$/,Ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,De=/[\\^$.*+?()[\]{}|]/g,Re=RegExp(De.source),Pe=/^\s+|\s+$/g,Te=/^\s+/,je=/\s+$/,Ne=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fe=/\{\n\/\* \[wrapped with (.+)\] \*/,Le=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ze=/\w*$/,Ve=/^[-+]0x[0-9a-f]+$/i,We=/^0b[01]+$/i,Ke=/^\[object .+?Constructor\]$/,qe=/^0o[0-7]+$/i,Je=/^(?:0|[1-9]\d*)$/,Ge=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ye=/($^)/,Ze=/['\n\r\u2028\u2029\\]/g,Xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Qe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",et="[\\ud800-\\udfff]",tt="["+Qe+"]",nt="["+Xe+"]",rt="\\d+",it="[\\u2700-\\u27bf]",ot="[a-z\\xdf-\\xf6\\xf8-\\xff]",at="[^\\ud800-\\udfff"+Qe+rt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",st="\\ud83c[\\udffb-\\udfff]",ct="[^\\ud800-\\udfff]",ut="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="[A-Z\\xc0-\\xd6\\xd8-\\xde]",dt="(?:"+ot+"|"+at+")",pt="(?:"+ft+"|"+at+")",ht="(?:"+nt+"|"+st+")"+"?",vt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[ct,ut,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),mt="(?:"+[it,ut,lt].join("|")+")"+vt,yt="(?:"+[ct+nt+"?",nt,ut,lt,et].join("|")+")",gt=RegExp("['’]","g"),bt=RegExp(nt,"g"),wt=RegExp(st+"(?="+st+")|"+yt+vt,"g"),kt=RegExp([ft+"?"+ot+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[tt,ft,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[tt,ft+dt,"$"].join("|")+")",ft+"?"+dt+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ft+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt,mt].join("|"),"g"),xt=RegExp("[\\u200d\\ud800-\\udfff"+Xe+"\\ufe0e\\ufe0f]"),_t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],St=-1,Mt={};Mt[le]=Mt[fe]=Mt[de]=Mt[pe]=Mt[he]=Mt[ve]=Mt[me]=Mt[ye]=Mt[ge]=!0,Mt[B]=Mt[H]=Mt[ce]=Mt[V]=Mt[ue]=Mt[W]=Mt[q]=Mt[J]=Mt[Y]=Mt[Z]=Mt[Q]=Mt[te]=Mt[ne]=Mt[re]=Mt[ae]=!1;var Ct={};Ct[B]=Ct[H]=Ct[ce]=Ct[ue]=Ct[V]=Ct[W]=Ct[le]=Ct[fe]=Ct[de]=Ct[pe]=Ct[he]=Ct[Y]=Ct[Z]=Ct[Q]=Ct[te]=Ct[ne]=Ct[re]=Ct[ie]=Ct[ve]=Ct[me]=Ct[ye]=Ct[ge]=!0,Ct[q]=Ct[J]=Ct[ae]=!1;var At={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},It=parseFloat,Ot=parseInt,Et="object"==typeof e&&e&&e.Object===Object&&e,Dt="object"==typeof self&&self&&self.Object===Object&&self,Rt=Et||Dt||Function("return this")(),Pt=t&&!t.nodeType&&t,Tt=Pt&&"object"==typeof r&&r&&!r.nodeType&&r,jt=Tt&&Tt.exports===Pt,Nt=jt&&Et.process,Ft=function(){try{var e=Tt&&Tt.require&&Tt.require("util").types;return e||Nt&&Nt.binding&&Nt.binding("util")}catch(e){}}(),Lt=Ft&&Ft.isArrayBuffer,Ut=Ft&&Ft.isDate,Bt=Ft&&Ft.isMap,Ht=Ft&&Ft.isRegExp,zt=Ft&&Ft.isSet,Vt=Ft&&Ft.isTypedArray;function Wt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Kt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Xt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function kn(e,t){for(var n=e.length;n--&&cn(t,e[n],0)>-1;);return n}var xn=pn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),_n=pn({"&":"&","<":"<",">":">",'"':""","'":"'"});function $n(e){return"\\"+At[e]}function Sn(e){return xt.test(e)}function Mn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Cn(e,t){return function(n){return e(t(n))}}function An(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var Pn=function e(t){var n,r=(t=null==t?Rt:Pn.defaults(Rt.Object(),t,Pn.pick(Rt,$t))).Array,i=t.Date,Xe=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,nt=t.RegExp,rt=t.String,it=t.TypeError,ot=r.prototype,at=Qe.prototype,st=tt.prototype,ct=t["__core-js_shared__"],ut=at.toString,lt=st.hasOwnProperty,ft=0,dt=(n=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",pt=st.toString,ht=ut.call(tt),vt=Rt._,mt=nt("^"+ut.call(lt).replace(De,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yt=jt?t.Buffer:o,wt=t.Symbol,xt=t.Uint8Array,At=yt?yt.allocUnsafe:o,Et=Cn(tt.getPrototypeOf,tt),Dt=tt.create,Pt=st.propertyIsEnumerable,Tt=ot.splice,Nt=wt?wt.isConcatSpreadable:o,Ft=wt?wt.iterator:o,on=wt?wt.toStringTag:o,pn=function(){try{var e=Lo(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),Tn=t.clearTimeout!==Rt.clearTimeout&&t.clearTimeout,jn=i&&i.now!==Rt.Date.now&&i.now,Nn=t.setTimeout!==Rt.setTimeout&&t.setTimeout,Fn=et.ceil,Ln=et.floor,Un=tt.getOwnPropertySymbols,Bn=yt?yt.isBuffer:o,Hn=t.isFinite,zn=ot.join,Vn=Cn(tt.keys,tt),Wn=et.max,Kn=et.min,qn=i.now,Jn=t.parseInt,Gn=et.random,Yn=ot.reverse,Zn=Lo(t,"DataView"),Xn=Lo(t,"Map"),Qn=Lo(t,"Promise"),er=Lo(t,"Set"),tr=Lo(t,"WeakMap"),nr=Lo(tt,"create"),rr=tr&&new tr,ir={},or=fa(Zn),ar=fa(Xn),sr=fa(Qn),cr=fa(er),ur=fa(tr),lr=wt?wt.prototype:o,fr=lr?lr.valueOf:o,dr=lr?lr.toString:o;function pr(e){if(As(e)&&!ys(e)&&!(e instanceof yr)){if(e instanceof mr)return e;if(lt.call(e,"__wrapped__"))return da(e)}return new mr(e)}var hr=function(){function e(){}return function(t){if(!Cs(t))return{};if(Dt)return Dt(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function vr(){}function mr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function yr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=N,this.__views__=[]}function gr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Tr(e,t,n,r,i,a){var s,c=t&d,u=t&p,l=t&h;if(n&&(s=i?n(e,r,i,a):n(e)),s!==o)return s;if(!Cs(e))return e;var f=ys(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&<.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return no(e,s)}else{var v=Ho(e),m=v==J||v==G;if(ks(e))return Yi(e,c);if(v==Q||v==B||m&&!i){if(s=u||m?{}:Vo(e),!c)return u?function(e,t){return ro(e,Bo(e),t)}(e,function(e,t){return e&&ro(t,oc(t),e)}(s,e)):function(e,t){return ro(e,Uo(e),t)}(e,Er(s,e))}else{if(!Ct[v])return i?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case ce:return Zi(e);case V:case W:return new r(+e);case ue:return function(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case le:case fe:case de:case pe:case he:case ve:case me:case ye:case ge:return Xi(e,n);case Y:return new r;case Z:case re:return new r(e);case te:return function(e){var t=new e.constructor(e.source,ze.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ne:return new r;case ie:return i=e,fr?tt(fr.call(i)):{}}var i}(e,v,c)}}a||(a=new xr);var y=a.get(e);if(y)return y;a.set(e,s),Rs(e)?e.forEach((function(r){s.add(Tr(r,t,n,r,e,a))})):Is(e)&&e.forEach((function(r,i){s.set(i,Tr(r,t,n,i,e,a))}));var g=f?o:(l?u?Do:Eo:u?oc:ic)(e);return qt(g||e,(function(r,i){g&&(r=e[i=r]),Ar(s,i,Tr(r,t,n,i,e,a))})),s}function jr(e,t,n){var r=n.length;if(null==e)return!r;for(e=tt(e);r--;){var i=n[r],a=t[i],s=e[i];if(s===o&&!(i in e)||!a(s))return!1}return!0}function Nr(e,t,n){if("function"!=typeof e)throw new it(c);return ia((function(){e.apply(o,n)}),t)}function Fr(e,t,n,r){var i=-1,o=Zt,s=!0,c=e.length,u=[],l=t.length;if(!c)return u;n&&(t=Qt(t,yn(n))),r?(o=Xt,s=!1):t.length>=a&&(o=bn,s=!1,t=new kr(t));e:for(;++i-1},br.prototype.set=function(e,t){var n=this.__data__,r=Ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},wr.prototype.clear=function(){this.size=0,this.__data__={hash:new gr,map:new(Xn||br),string:new gr}},wr.prototype.delete=function(e){var t=No(this,e).delete(e);return this.size-=t?1:0,t},wr.prototype.get=function(e){return No(this,e).get(e)},wr.prototype.has=function(e){return No(this,e).has(e)},wr.prototype.set=function(e,t){var n=No(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},kr.prototype.add=kr.prototype.push=function(e){return this.__data__.set(e,u),this},kr.prototype.has=function(e){return this.__data__.has(e)},xr.prototype.clear=function(){this.__data__=new br,this.size=0},xr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xr.prototype.get=function(e){return this.__data__.get(e)},xr.prototype.has=function(e){return this.__data__.has(e)},xr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof br){var r=n.__data__;if(!Xn||r.length0&&n(s)?t>1?Vr(s,t-1,n,r,i):en(i,s):r||(i[i.length]=s)}return i}var Wr=so(),Kr=so(!0);function qr(e,t){return e&&Wr(e,t,ic)}function Jr(e,t){return e&&Kr(e,t,ic)}function Gr(e,t){return Yt(t,(function(t){return $s(e[t])}))}function Yr(e,t){for(var n=0,r=(t=Ki(t,e)).length;null!=e&&nt}function ei(e,t){return null!=e&<.call(e,t)}function ti(e,t){return null!=e&&t in tt(e)}function ni(e,t,n){for(var i=n?Xt:Zt,a=e[0].length,s=e.length,c=s,u=r(s),l=1/0,f=[];c--;){var d=e[c];c&&t&&(d=Qt(d,yn(t))),l=Kn(d.length,l),u[c]=!n&&(t||a>=120&&d.length>=120)?new kr(c&&d):o}d=e[0];var p=-1,h=u[0];e:for(;++p=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return e.index-t.index}(e,t,n)}))}function gi(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Tt.call(s,c,1),Tt.call(e,c,1);return e}function wi(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Ko(i)?Tt.call(e,i,1):Fi(e,i)}}return e}function ki(e,t){return e+Ln(Gn()*(t-e+1))}function xi(e,t){var n="";if(!e||t<1||t>P)return n;do{t%2&&(n+=e),(t=Ln(t/2))&&(e+=e)}while(t);return n}function _i(e,t){return oa(ea(e,t,Oc),e+"")}function $i(e){return $r(pc(e))}function Si(e,t){var n=pc(e);return ca(n,Pr(t,0,n.length))}function Mi(e,t,n,r){if(!Cs(e))return e;for(var i=-1,a=(t=Ki(t,e)).length,s=a-1,c=e;null!=c&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i>>1,a=e[o];null!==a&&!Ts(a)&&(n?a<=t:a=a){var l=t?null:_o(e);if(l)return In(l);s=!1,i=bn,u=new kr}else u=t?[]:c;e:for(;++r=r?e:Oi(e,t,n)}var Gi=Tn||function(e){return Rt.clearTimeout(e)};function Yi(e,t){if(t)return e.slice();var n=e.length,r=At?At(n):new e.constructor(n);return e.copy(r),r}function Zi(e){var t=new e.constructor(e.byteLength);return new xt(t).set(new xt(e)),t}function Xi(e,t){var n=t?Zi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Qi(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=Ts(e),s=t!==o,c=null===t,u=t==t,l=Ts(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&e1?n[i-1]:o,s=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,s&&qo(n[0],n[1],s)&&(a=i<3?o:a,i=1),t=tt(t);++r-1?i[a?t[s]:s]:o}}function po(e){return Oo((function(t){var n=t.length,r=n,i=mr.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new it(c);if(i&&!s&&"wrapper"==Po(a))var s=new mr([],!0)}for(r=s?r:n;++r1&&w.reverse(),d&&lc))return!1;var l=a.get(e);if(l&&a.get(t))return l==t;var f=-1,d=!0,p=n&m?new kr:o;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ne,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return qt(U,(function(n){var r="_."+n[0];t&n[1]&&!Zt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Fe);return t?t[1].split(Le):[]}(r),n)))}function sa(e){var t=0,n=0;return function(){var r=qn(),i=O-(r-n);if(n=r,i>0){if(++t>=I)return arguments[0]}else t=0;return e.apply(o,arguments)}}function ca(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,Da(e,n)}));function La(e){var t=pr(e);return t.__chain__=!0,t}function Ua(e,t){return t(e)}var Ba=Oo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Rr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof yr&&Ko(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:Ua,args:[i],thisArg:o}),new mr(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));var Ha=io((function(e,t,n){lt.call(e,n)?++e[n]:Dr(e,n,1)}));var za=fo(ma),Va=fo(ya);function Wa(e,t){return(ys(e)?qt:Lr)(e,jo(t,3))}function Ka(e,t){return(ys(e)?Jt:Ur)(e,jo(t,3))}var qa=io((function(e,t,n){lt.call(e,n)?e[n].push(t):Dr(e,n,[t])}));var Ja=_i((function(e,t,n){var i=-1,o="function"==typeof t,a=bs(e)?r(e.length):[];return Lr(e,(function(e){a[++i]=o?Wt(t,e,n):ri(e,t,n)})),a})),Ga=io((function(e,t,n){Dr(e,n,t)}));function Ya(e,t){return(ys(e)?Qt:di)(e,jo(t,3))}var Za=io((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Xa=_i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&qo(e,t[0],t[1])?t=[]:n>2&&qo(t[0],t[1],t[2])&&(t=[t[0]]),yi(e,Vr(t,1),[])})),Qa=jn||function(){return Rt.Date.now()};function es(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,So(e,$,o,o,o,o,t)}function ts(e,t){var n;if("function"!=typeof t)throw new it(c);return e=Bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var ns=_i((function(e,t,n){var r=y;if(n.length){var i=An(n,To(ns));r|=x}return So(e,r,t,n,i)})),rs=_i((function(e,t,n){var r=y|g;if(n.length){var i=An(n,To(rs));r|=x}return So(t,r,e,n,i)}));function is(e,t,n){var r,i,a,s,u,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new it(c);function v(t){var n=r,a=i;return r=i=o,f=t,s=e.apply(a,n)}function m(e){var n=e-l;return l===o||n>=t||n<0||p&&e-f>=a}function y(){var e=Qa();if(m(e))return g(e);u=ia(y,function(e){var n=t-(e-l);return p?Kn(n,a-(e-f)):n}(e))}function g(e){return u=o,h&&r?v(e):(r=i=o,s)}function b(){var e=Qa(),n=m(e);if(r=arguments,i=this,l=e,n){if(u===o)return function(e){return f=e,u=ia(y,t),d?v(e):s}(l);if(p)return Gi(u),u=ia(y,t),v(l)}return u===o&&(u=ia(y,t)),s}return t=zs(t)||0,Cs(n)&&(d=!!n.leading,a=(p="maxWait"in n)?Wn(zs(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),b.cancel=function(){u!==o&&Gi(u),f=0,r=l=i=u=o},b.flush=function(){return u===o?s:g(Qa())},b}var os=_i((function(e,t){return Nr(e,1,t)})),as=_i((function(e,t,n){return Nr(e,zs(t)||0,n)}));function ss(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(c);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ss.Cache||wr),n}function cs(e){if("function"!=typeof e)throw new it(c);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ss.Cache=wr;var us=qi((function(e,t){var n=(t=1==t.length&&ys(t[0])?Qt(t[0],yn(jo())):Qt(Vr(t,1),yn(jo()))).length;return _i((function(r){for(var i=-1,o=Kn(r.length,n);++i=t})),ms=ii(function(){return arguments}())?ii:function(e){return As(e)&<.call(e,"callee")&&!Pt.call(e,"callee")},ys=r.isArray,gs=Lt?yn(Lt):function(e){return As(e)&&Xr(e)==ce};function bs(e){return null!=e&&Ms(e.length)&&!$s(e)}function ws(e){return As(e)&&bs(e)}var ks=Bn||zc,xs=Ut?yn(Ut):function(e){return As(e)&&Xr(e)==W};function _s(e){if(!As(e))return!1;var t=Xr(e);return t==q||t==K||"string"==typeof e.message&&"string"==typeof e.name&&!Es(e)}function $s(e){if(!Cs(e))return!1;var t=Xr(e);return t==J||t==G||t==z||t==ee}function Ss(e){return"number"==typeof e&&e==Bs(e)}function Ms(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=P}function Cs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function As(e){return null!=e&&"object"==typeof e}var Is=Bt?yn(Bt):function(e){return As(e)&&Ho(e)==Y};function Os(e){return"number"==typeof e||As(e)&&Xr(e)==Z}function Es(e){if(!As(e)||Xr(e)!=Q)return!1;var t=Et(e);if(null===t)return!0;var n=lt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==ht}var Ds=Ht?yn(Ht):function(e){return As(e)&&Xr(e)==te};var Rs=zt?yn(zt):function(e){return As(e)&&Ho(e)==ne};function Ps(e){return"string"==typeof e||!ys(e)&&As(e)&&Xr(e)==re}function Ts(e){return"symbol"==typeof e||As(e)&&Xr(e)==ie}var js=Vt?yn(Vt):function(e){return As(e)&&Ms(e.length)&&!!Mt[Xr(e)]};var Ns=wo(fi),Fs=wo((function(e,t){return e<=t}));function Ls(e){if(!e)return[];if(bs(e))return Ps(e)?Dn(e):no(e);if(Ft&&e[Ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ft]());var t=Ho(e);return(t==Y?Mn:t==ne?In:pc)(e)}function Us(e){return e?(e=zs(e))===R||e===-R?(e<0?-1:1)*T:e==e?e:0:0===e?e:0}function Bs(e){var t=Us(e),n=t%1;return t==t?n?t-n:t:0}function Hs(e){return e?Pr(Bs(e),0,N):0}function zs(e){if("number"==typeof e)return e;if(Ts(e))return j;if(Cs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Cs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Pe,"");var n=We.test(e);return n||qe.test(e)?Ot(e.slice(2),n?2:8):Ve.test(e)?j:+e}function Vs(e){return ro(e,oc(e))}function Ws(e){return null==e?"":ji(e)}var Ks=oo((function(e,t){if(Zo(t)||bs(t))ro(t,ic(t),e);else for(var n in t)lt.call(t,n)&&Ar(e,n,t[n])})),qs=oo((function(e,t){ro(t,oc(t),e)})),Js=oo((function(e,t,n,r){ro(t,oc(t),e,r)})),Gs=oo((function(e,t,n,r){ro(t,ic(t),e,r)})),Ys=Oo(Rr);var Zs=_i((function(e,t){e=tt(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&qo(t[0],t[1],i)&&(r=1);++n1),t})),ro(e,Do(e),n),r&&(n=Tr(n,d|p|h,Ao));for(var i=t.length;i--;)Fi(n,t[i]);return n}));var uc=Oo((function(e,t){return null==e?{}:function(e,t){return gi(e,t,(function(t,n){return ec(e,n)}))}(e,t)}));function lc(e,t){if(null==e)return{};var n=Qt(Do(e),(function(e){return[e]}));return t=jo(t),gi(e,n,(function(e,n){return t(e,n[0])}))}var fc=$o(ic),dc=$o(oc);function pc(e){return null==e?[]:gn(e,ic(e))}var hc=uo((function(e,t,n){return t=t.toLowerCase(),e+(n?vc(t):t)}));function vc(e){return _c(Ws(e).toLowerCase())}function mc(e){return(e=Ws(e))&&e.replace(Ge,xn).replace(bt,"")}var yc=uo((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),gc=uo((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),bc=co("toLowerCase");var wc=uo((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var kc=uo((function(e,t,n){return e+(n?" ":"")+_c(t)}));var xc=uo((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),_c=co("toUpperCase");function $c(e,t,n){return e=Ws(e),(t=n?o:t)===o?function(e){return _t.test(e)}(e)?function(e){return e.match(kt)||[]}(e):function(e){return e.match(Ue)||[]}(e):e.match(t)||[]}var Sc=_i((function(e,t){try{return Wt(e,o,t)}catch(e){return _s(e)?e:new Xe(e)}})),Mc=Oo((function(e,t){return qt(t,(function(t){t=la(t),Dr(e,t,ns(e[t],e))})),e}));function Cc(e){return function(){return e}}var Ac=po(),Ic=po(!0);function Oc(e){return e}function Ec(e){return ci("function"==typeof e?e:Tr(e,d))}var Dc=_i((function(e,t){return function(n){return ri(n,e,t)}})),Rc=_i((function(e,t){return function(n){return ri(e,n,t)}}));function Pc(e,t,n){var r=ic(t),i=Gr(t,r);null!=n||Cs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Gr(t,ic(t)));var o=!(Cs(n)&&"chain"in n&&!n.chain),a=$s(e);return qt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=no(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,en([this.value()],arguments))})})),e}function Tc(){}var jc=yo(Qt),Nc=yo(Gt),Fc=yo(rn);function Lc(e){return Jo(e)?dn(la(e)):function(e){return function(t){return Yr(t,e)}}(e)}var Uc=bo(),Bc=bo(!0);function Hc(){return[]}function zc(){return!1}var Vc=mo((function(e,t){return e+t}),0),Wc=xo("ceil"),Kc=mo((function(e,t){return e/t}),1),qc=xo("floor");var Jc,Gc=mo((function(e,t){return e*t}),1),Yc=xo("round"),Zc=mo((function(e,t){return e-t}),0);return pr.after=function(e,t){if("function"!=typeof t)throw new it(c);return e=Bs(e),function(){if(--e<1)return t.apply(this,arguments)}},pr.ary=es,pr.assign=Ks,pr.assignIn=qs,pr.assignInWith=Js,pr.assignWith=Gs,pr.at=Ys,pr.before=ts,pr.bind=ns,pr.bindAll=Mc,pr.bindKey=rs,pr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ys(e)?e:[e]},pr.chain=La,pr.chunk=function(e,t,n){t=(n?qo(e,t,n):t===o)?1:Wn(Bs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,c=r(Fn(i/t));ai?0:i+n),(r=r===o||r>i?i:Bs(r))<0&&(r+=i),r=n>r?0:Hs(r);n>>0)?(e=Ws(e))&&("string"==typeof t||null!=t&&!Ds(t))&&!(t=ji(t))&&Sn(e)?Ji(Dn(e),0,n):e.split(t,n):[]},pr.spread=function(e,t){if("function"!=typeof e)throw new it(c);return t=null==t?0:Wn(Bs(t),0),_i((function(n){var r=n[t],i=Ji(n,0,t);return r&&en(i,r),Wt(e,this,i)}))},pr.tail=function(e){var t=null==e?0:e.length;return t?Oi(e,1,t):[]},pr.take=function(e,t,n){return e&&e.length?Oi(e,0,(t=n||t===o?1:Bs(t))<0?0:t):[]},pr.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Oi(e,(t=r-(t=n||t===o?1:Bs(t)))<0?0:t,r):[]},pr.takeRightWhile=function(e,t){return e&&e.length?Ui(e,jo(t,3),!1,!0):[]},pr.takeWhile=function(e,t){return e&&e.length?Ui(e,jo(t,3)):[]},pr.tap=function(e,t){return t(e),e},pr.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new it(c);return Cs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(e,t,{leading:r,maxWait:t,trailing:i})},pr.thru=Ua,pr.toArray=Ls,pr.toPairs=fc,pr.toPairsIn=dc,pr.toPath=function(e){return ys(e)?Qt(e,la):Ts(e)?[e]:no(ua(Ws(e)))},pr.toPlainObject=Vs,pr.transform=function(e,t,n){var r=ys(e),i=r||ks(e)||js(e);if(t=jo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Cs(e)&&$s(o)?hr(Et(e)):{}}return(i?qt:qr)(e,(function(e,r,i){return t(n,e,r,i)})),n},pr.unary=function(e){return es(e,1)},pr.union=Aa,pr.unionBy=Ia,pr.unionWith=Oa,pr.uniq=function(e){return e&&e.length?Ni(e):[]},pr.uniqBy=function(e,t){return e&&e.length?Ni(e,jo(t,2)):[]},pr.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?Ni(e,o,t):[]},pr.unset=function(e,t){return null==e||Fi(e,t)},pr.unzip=Ea,pr.unzipWith=Da,pr.update=function(e,t,n){return null==e?e:Li(e,t,Wi(n))},pr.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:Li(e,t,Wi(n),r)},pr.values=pc,pr.valuesIn=function(e){return null==e?[]:gn(e,oc(e))},pr.without=Ra,pr.words=$c,pr.wrap=function(e,t){return ls(Wi(t),e)},pr.xor=Pa,pr.xorBy=Ta,pr.xorWith=ja,pr.zip=Na,pr.zipObject=function(e,t){return zi(e||[],t||[],Ar)},pr.zipObjectDeep=function(e,t){return zi(e||[],t||[],Mi)},pr.zipWith=Fa,pr.entries=fc,pr.entriesIn=dc,pr.extend=qs,pr.extendWith=Js,Pc(pr,pr),pr.add=Vc,pr.attempt=Sc,pr.camelCase=hc,pr.capitalize=vc,pr.ceil=Wc,pr.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=zs(n))==n?n:0),t!==o&&(t=(t=zs(t))==t?t:0),Pr(zs(e),t,n)},pr.clone=function(e){return Tr(e,h)},pr.cloneDeep=function(e){return Tr(e,d|h)},pr.cloneDeepWith=function(e,t){return Tr(e,d|h,t="function"==typeof t?t:o)},pr.cloneWith=function(e,t){return Tr(e,h,t="function"==typeof t?t:o)},pr.conformsTo=function(e,t){return null==t||jr(e,t,ic(t))},pr.deburr=mc,pr.defaultTo=function(e,t){return null==e||e!=e?t:e},pr.divide=Kc,pr.endsWith=function(e,t,n){e=Ws(e),t=ji(t);var r=e.length,i=n=n===o?r:Pr(Bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},pr.eq=ps,pr.escape=function(e){return(e=Ws(e))&&Se.test(e)?e.replace(_e,_n):e},pr.escapeRegExp=function(e){return(e=Ws(e))&&Re.test(e)?e.replace(De,"\\$&"):e},pr.every=function(e,t,n){var r=ys(e)?Gt:Br;return n&&qo(e,t,n)&&(t=o),r(e,jo(t,3))},pr.find=za,pr.findIndex=ma,pr.findKey=function(e,t){return an(e,jo(t,3),qr)},pr.findLast=Va,pr.findLastIndex=ya,pr.findLastKey=function(e,t){return an(e,jo(t,3),Jr)},pr.floor=qc,pr.forEach=Wa,pr.forEachRight=Ka,pr.forIn=function(e,t){return null==e?e:Wr(e,jo(t,3),oc)},pr.forInRight=function(e,t){return null==e?e:Kr(e,jo(t,3),oc)},pr.forOwn=function(e,t){return e&&qr(e,jo(t,3))},pr.forOwnRight=function(e,t){return e&&Jr(e,jo(t,3))},pr.get=Qs,pr.gt=hs,pr.gte=vs,pr.has=function(e,t){return null!=e&&zo(e,t,ei)},pr.hasIn=ec,pr.head=ba,pr.identity=Oc,pr.includes=function(e,t,n,r){e=bs(e)?e:pc(e),n=n&&!r?Bs(n):0;var i=e.length;return n<0&&(n=Wn(i+n,0)),Ps(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&cn(e,t,n)>-1},pr.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Wn(r+i,0)),cn(e,t,i)},pr.inRange=function(e,t,n){return t=Us(t),n===o?(n=t,t=0):n=Us(n),function(e,t,n){return e>=Kn(t,n)&&e=-P&&e<=P},pr.isSet=Rs,pr.isString=Ps,pr.isSymbol=Ts,pr.isTypedArray=js,pr.isUndefined=function(e){return e===o},pr.isWeakMap=function(e){return As(e)&&Ho(e)==ae},pr.isWeakSet=function(e){return As(e)&&Xr(e)==se},pr.join=function(e,t){return null==e?"":zn.call(e,t)},pr.kebabCase=yc,pr.last=_a,pr.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Bs(n))<0?Wn(r+i,0):Kn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):sn(e,ln,i,!0)},pr.lowerCase=gc,pr.lowerFirst=bc,pr.lt=Ns,pr.lte=Fs,pr.max=function(e){return e&&e.length?Hr(e,Oc,Qr):o},pr.maxBy=function(e,t){return e&&e.length?Hr(e,jo(t,2),Qr):o},pr.mean=function(e){return fn(e,Oc)},pr.meanBy=function(e,t){return fn(e,jo(t,2))},pr.min=function(e){return e&&e.length?Hr(e,Oc,fi):o},pr.minBy=function(e,t){return e&&e.length?Hr(e,jo(t,2),fi):o},pr.stubArray=Hc,pr.stubFalse=zc,pr.stubObject=function(){return{}},pr.stubString=function(){return""},pr.stubTrue=function(){return!0},pr.multiply=Gc,pr.nth=function(e,t){return e&&e.length?mi(e,Bs(t)):o},pr.noConflict=function(){return Rt._===this&&(Rt._=vt),this},pr.noop=Tc,pr.now=Qa,pr.pad=function(e,t,n){e=Ws(e);var r=(t=Bs(t))?En(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return go(Ln(i),n)+e+go(Fn(i),n)},pr.padEnd=function(e,t,n){e=Ws(e);var r=(t=Bs(t))?En(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Gn();return Kn(e+i*(t-e+It("1e-"+((i+"").length-1))),t)}return ki(e,t)},pr.reduce=function(e,t,n){var r=ys(e)?tn:hn,i=arguments.length<3;return r(e,jo(t,4),n,i,Lr)},pr.reduceRight=function(e,t,n){var r=ys(e)?nn:hn,i=arguments.length<3;return r(e,jo(t,4),n,i,Ur)},pr.repeat=function(e,t,n){return t=(n?qo(e,t,n):t===o)?1:Bs(t),xi(Ws(e),t)},pr.replace=function(){var e=arguments,t=Ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},pr.result=function(e,t,n){var r=-1,i=(t=Ki(t,e)).length;for(i||(i=1,e=o);++rP)return[];var n=N,r=Kn(e,N);t=jo(t),e-=N;for(var i=mn(r,t);++n=a)return e;var c=n-En(r);if(c<1)return r;var u=s?Ji(s,0,c).join(""):e.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),Ds(i)){if(e.slice(c).search(i)){var l,f=u;for(i.global||(i=nt(i.source,Ws(ze.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var d=l.index;u=u.slice(0,d===o?c:d)}}else if(e.indexOf(ji(i),c)!=c){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+r},pr.unescape=function(e){return(e=Ws(e))&&$e.test(e)?e.replace(xe,Rn):e},pr.uniqueId=function(e){var t=++ft;return Ws(e)+t},pr.upperCase=xc,pr.upperFirst=_c,pr.each=Wa,pr.eachRight=Ka,pr.first=ba,Pc(pr,(Jc={},qr(pr,(function(e,t){lt.call(pr.prototype,t)||(Jc[t]=e)})),Jc),{chain:!1}),pr.VERSION="4.17.15",qt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){pr[e].placeholder=pr})),qt(["drop","take"],(function(e,t){yr.prototype[e]=function(n){n=n===o?1:Wn(Bs(n),0);var r=this.__filtered__&&!t?new yr(this):this.clone();return r.__filtered__?r.__takeCount__=Kn(n,r.__takeCount__):r.__views__.push({size:Kn(n,N),type:e+(r.__dir__<0?"Right":"")}),r},yr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),qt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=n==E||3==n;yr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:jo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),qt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");yr.prototype[e]=function(){return this[n](1).value()[0]}})),qt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");yr.prototype[e]=function(){return this.__filtered__?new yr(this):this[n](1)}})),yr.prototype.compact=function(){return this.filter(Oc)},yr.prototype.find=function(e){return this.filter(e).head()},yr.prototype.findLast=function(e){return this.reverse().find(e)},yr.prototype.invokeMap=_i((function(e,t){return"function"==typeof e?new yr(this):this.map((function(n){return ri(n,e,t)}))})),yr.prototype.reject=function(e){return this.filter(cs(jo(e)))},yr.prototype.slice=function(e,t){e=Bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new yr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=Bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},yr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},yr.prototype.toArray=function(){return this.take(N)},qr(yr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=pr[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(pr.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,c=t instanceof yr,u=s[0],l=c||ys(t),f=function(e){var t=i.apply(pr,en([e],s));return r&&d?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=a&&!d,v=c&&!p;if(!a&&l){t=v?t:new yr(this);var m=e.apply(t,s);return m.__actions__.push({func:Ua,args:[f],thisArg:o}),new mr(m,d)}return h&&v?e.apply(this,s):(m=this.thru(f),h?r?m.value()[0]:m.value():m)})})),qt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ot[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);pr.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ys(i)?i:[],e)}return this[n]((function(n){return t.apply(ys(n)?n:[],e)}))}})),qr(yr.prototype,(function(e,t){var n=pr[t];if(n){var r=n.name+"";lt.call(ir,r)||(ir[r]=[]),ir[r].push({name:t,func:n})}})),ir[ho(o,g).name]=[{name:"wrapper",func:o}],yr.prototype.clone=function(){var e=new yr(this.__wrapped__);return e.__actions__=no(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=no(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=no(this.__views__),e},yr.prototype.reverse=function(){if(this.__filtered__){var e=new yr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},yr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ys(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},pr.prototype.plant=function(e){for(var t,n=this;n instanceof vr;){var r=da(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},pr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof yr){var t=e;return this.__actions__.length&&(t=new yr(this)),(t=t.reverse()).__actions__.push({func:Ua,args:[Ca],thisArg:o}),new mr(t,this.__chain__)}return this.thru(Ca)},pr.prototype.toJSON=pr.prototype.valueOf=pr.prototype.value=function(){return Bi(this.__wrapped__,this.__actions__)},pr.prototype.first=pr.prototype.head,Ft&&(pr.prototype[Ft]=function(){return this}),pr}();Rt._=Pn,(i=function(){return Pn}.call(t,n,t,r))===o||(r.exports=i)}).call(this)}).call(this,n(49),n(50)(e))},function(e,t,n){var r=n(11),i=n(44);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},function(e,t,n){var r=n(45);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return Array.isArray(e)?function(e,t){for(var n,r="",o="",a=Array.isArray(t),s=0;s]/;function c(e){var t=""+e,n=s.exec(t);if(!n)return e;var r,i,o,a="";for(r=n.index,i=0;r ":" ")+n+"| "+e})).join("\n");throw t.path=r,t.message=(r||"Pug")+":"+i+"\n"+a+"\n\n"+t.message,t}},function(e,t,n){var r=n(71);function i(t,n,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(t,n,o||t)}e.exports=i},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r;window,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t){for(var n=0;n\n

").concat(e.text,"
\n \n ")}(e,t)})).join("");return"\n
\n ".concat(e,"\n
\n ")}},{key:"templateString",value:function(){var e=this.buttonsString(),t=this.title?"
".concat(this.title,"
"):"",n=this.text?"

".concat(this.text,"

"):"";return'\n
\n
\n
\n
\n
\n
\n
\n '.concat(t,'\n\n
\n ').concat(n,"\n
\n\n
\n ").concat(e,"\n
\n
\n
\n
\n
\n
\n
\n ")}},{key:"dismiss",value:function(){this.onElement.removeChild(this.element),document.removeEventListener("keyup",this.keyupListener)}},{key:"primaryButton",value:function(){var e=this.buttons.find((function(e){return!0===e.primary}));return e||(e=this.buttons[this.buttons.length-1]),e}},{key:"present",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.onElement;n||(n=document.body),this.onElement=n,this.element=document.createElement("div"),this.element.className="sn-component",this.element.innerHTML=this.templateString().trim(),document.addEventListener("keyup",this.keyupListener),this.buttons.forEach((function(t,n){e.element.querySelector("#button-".concat(n)).onclick=function(){t.action&&t.action(),e.dismiss()}})),n.appendChild(this.element)}}])&&r(t.prototype,n),i&&r(t,i),e}();n.d(t,"SKAlert",(function(){return i}))}])},e.exports=r()},function(e,t,n){var r=n(46);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(48);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(51);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(52);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(53);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(54);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(55);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(56);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(57);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(58);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(59);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(60);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(61);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(62);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(63);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(64);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(65);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(66);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(67);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(68);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(69);e.exports=(r.default||r).apply(r,[])},function(e,t,n){var r=n(70);e.exports=(r.default||r).apply(r,[])},function(e,t,n){},function(e,t,n){},function(e,t){ /** * @license AngularJS v1.7.9 * (c) 2010-2018 Google, Inc. http://angularjs.org * License: MIT */ !function(e){"use strict";var t={objectMaxDepth:5,urlErrorParamsEnabled:!0};function n(e){if(!U(e))return t;L(e.objectMaxDepth)&&(t.objectMaxDepth=r(e.objectMaxDepth)?e.objectMaxDepth:NaN),L(e.urlErrorParamsEnabled)&&Z(e.urlErrorParamsEnabled)&&(t.urlErrorParamsEnabled=e.urlErrorParamsEnabled)}function r(e){return z(e)&&e>0}function i(e,n){n=n||Error;var r="https://errors.angularjs.org/1.7.9/",i=r.replace(".","\\.")+"[\\s\\S]*",o=new RegExp(i,"g");return function(){var i,a,s=arguments[0],c=arguments[1],u="["+(e?e+":":"")+s+"] ",l=de(arguments,2).map((function(e){return qe(e,t.objectMaxDepth)}));if(u+=c.replace(/\{\d+\}/g,(function(e){var t=+e.slice(1,-1);return t=0&&t-1 in e||"function"==typeof e.item)}function _(e,t,n){var r,i;if(e)if(q(e))for(r in e)"prototype"!==r&&"length"!==r&&"name"!==r&&e.hasOwnProperty(r)&&t.call(n,e[r],r,e);else if(W(e)||x(e)){var o="object"!=typeof e;for(r=0,i=e.length;r=0&&e.splice(n,1),n}function ae(e,t,n){var i,o,a=[],s=[];if(n=r(n)?n:NaN,t){if((o=t)&&z(o.length)&&Q.test(y.call(o))||(i=t,"[object ArrayBuffer]"===y.call(i)))throw b("cpta","Can't copy! TypedArray destination cannot be mutated.");if(e===t)throw b("cpi","Can't copy! Source and destination are identical.");return W(t)?t.length=0:_(t,(function(e,n){"$$hashKey"!==n&&delete t[n]})),a.push(e),s.push(t),c(e,t,n)}return u(e,n);function c(e,t,n){if(--n<0)return"...";var r,i=t.$$hashKey;if(W(e))for(var o=0,a=e.length;o2?de(arguments,2):[];return!q(t)||t instanceof RegExp?t:n.length?function(){return arguments.length?t.apply(e,fe(n,arguments,0)):t.apply(e,n)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function he(t,n){var r=n;return"string"==typeof t&&"$"===t.charAt(0)&&"$"===t.charAt(1)?r=void 0:G(n)?r="$WINDOW":n&&e.document===n?r="$DOCUMENT":Y(n)&&(r="$SCOPE"),r}function ve(e,t){if(!F(e))return z(t)||(t=t?2:null),JSON.stringify(e,he,t)}function me(e){return H(e)?JSON.parse(e):e}var ye=/:/g;function ge(e,t){e=e.replace(ye,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return D(n)?t:n}function be(e,t){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+t),e}function we(e,t,n){n=n?-1:1;var r=e.getTimezoneOffset();return be(e,n*(ge(t,r)-r))}function ke(e){e=a(e).clone().empty();var t=a("
").append(e).html();try{return e[0].nodeType===He?d(t):t.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,(function(e,t){return"<"+d(t)}))}catch(e){return d(t)}}function xe(e){try{return decodeURIComponent(e)}catch(e){}}function _e(e){var t={};return _((e||"").split("&"),(function(e){var n,r,i;e&&(r=e=e.replace(/\+/g,"%20"),-1!==(n=e.indexOf("="))&&(r=e.substring(0,n),i=e.substring(n+1)),L(r=xe(r))&&(i=!L(i)||xe(i),f.call(t,r)?W(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i))})),t}function $e(e){return Se(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Se(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}var Me=["ng-","data-ng-","ng:","x-ng-"];var Ce=function(t){var n=t.currentScript;if(!n)return!0;if(!(n instanceof e.HTMLScriptElement||n instanceof e.SVGScriptElement))return!1;var r=n.attributes;return[r.getNamedItem("src"),r.getNamedItem("href"),r.getNamedItem("xlink:href")].every((function(e){if(!e)return!0;if(!e.value)return!1;var n=t.createElement("a");if(n.href=e.value,t.location.origin===n.origin)return!0;switch(n.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}}))}(e.document);function Ae(t,n){var r,i,o={};if(_(Me,(function(e){var n=e+"app";!r&&t.hasAttribute&&t.hasAttribute(n)&&(r=t,i=t.getAttribute(n))})),_(Me,(function(e){var n,o=e+"app";!r&&(n=t.querySelector("["+o.replace(":","\\:")+"]"))&&(r=n,i=n.getAttribute(o))})),r){if(!Ce)return void e.console.error("AngularJS: disabling automatic bootstrap.