aboutsummaryrefslogtreecommitdiff
path: root/dist/background.js
blob: 6ea17e1dbbcf8524b84c65514f9bccea96214097 (plain) (blame)
1
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=848)}({109:function(t,e,n){"use strict";const r=n(172),i=Symbol("max"),a=Symbol("length"),o=Symbol("lengthCalculator"),s=Symbol("allowStale"),u=Symbol("maxAge"),l=Symbol("dispose"),h=Symbol("noDisposeOnSet"),c=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),v=()=>1;const p=(t,e,n)=>{const r=t[f].get(e);if(r){const e=r.value;if(g(t,e)){if(m(t,r),!t[s])return}else n&&(t[d]&&(r.value.now=Date.now()),t[c].unshiftNode(r));return e.value}},g=(t,e)=>{if(!e||!e.maxAge&&!t[u])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[u]&&n>t[u]},y=t=>{if(t[a]>t[i])for(let e=t[c].tail;t[a]>t[i]&&null!==e;){const n=e.prev;m(t,e),e=n}},m=(t,e)=>{if(e){const n=e.value;t[l]&&t[l](n.key,n.value),t[a]-=n.length,t[f].delete(n.key),t[c].removeNode(e)}};class w{constructor(t,e,n,r,i){this.key=t,this.value=e,this.length=n,this.now=r,this.maxAge=i||0}}const b=(t,e,n,r)=>{let i=n.value;g(t,i)&&(m(t,n),t[s]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;const e=t.length||v;if(this[o]="function"!=typeof e?v:e,this[s]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[l]=t.dispose,this[h]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||1/0,y(this)}get max(){return this[i]}set allowStale(t){this[s]=!!t}get allowStale(){return this[s]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[u]=t,y(this)}get maxAge(){return this[u]}set lengthCalculator(t){"function"!=typeof t&&(t=v),t!==this[o]&&(this[o]=t,this[a]=0,this[c].forEach(t=>{t.length=this[o](t.value,t.key),this[a]+=t.length})),y(this)}get lengthCalculator(){return this[o]}get length(){return this[a]}get itemCount(){return this[c].length}rforEach(t,e){e=e||this;for(let n=this[c].tail;null!==n;){const r=n.prev;b(this,t,n,e),n=r}}forEach(t,e){e=e||this;for(let n=this[c].head;null!==n;){const r=n.next;b(this,t,n,e),n=r}}keys(){return this[c].toArray().map(t=>t.key)}values(){return this[c].toArray().map(t=>t.value)}reset(){this[l]&&this[c]&&this[c].length&&this[c].forEach(t=>this[l](t.key,t.value)),this[f]=new Map,this[c]=new r,this[a]=0}dump(){return this[c].map(t=>!g(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[c]}set(t,e,n){if((n=n||this[u])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,s=this[o](e,t);if(this[f].has(t)){if(s>this[i])return m(this,this[f].get(t)),!1;const o=this[f].get(t).value;return this[l]&&(this[h]||this[l](t,o.value)),o.now=r,o.maxAge=n,o.value=e,this[a]+=s-o.length,o.length=s,this.get(t),y(this),!0}const d=new w(t,e,s,r,n);return d.length>this[i]?(this[l]&&this[l](t,e),!1):(this[a]+=d.length,this[c].unshift(d),this[f].set(t,this[c].head),y(this),!0)}has(t){if(!this[f].has(t))return!1;const e=this[f].get(t).value;return!g(this,e)}get(t){return p(this,t,!0)}peek(t){return p(this,t,!1)}pop(){const t=this[c].tail;return t?(m(this,t),t.value):null}del(t){m(this,this[f].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const t=i-e;t>0&&this.set(r.k,r.v,t)}}}prune(){this[f].forEach((t,e)=>p(this,e,!1))}}},172:function(t,e,n){"use strict";function r(t){var e=this;if(e instanceof r||(e=new r),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)e.push(arguments[n]);return e}function i(t,e){t.tail=new o(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function a(t,e){t.head=new o(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function o(t,e,n,r){if(!(this instanceof o))return new o(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null